diff --git a/AUCapture-WPF/AUCapture-WPF.csproj b/AUCapture-WPF/AUCapture-WPF.csproj index 42bf1ac3..57feb953 100644 --- a/AUCapture-WPF/AUCapture-WPF.csproj +++ b/AUCapture-WPF/AUCapture-WPF.csproj @@ -45,10 +45,6 @@ - - - - @@ -74,7 +70,6 @@ - @@ -84,7 +79,6 @@ - @@ -201,9 +195,6 @@ - - - diff --git a/AUCapture-WPF/Controls/PlayerControl.xaml b/AUCapture-WPF/Controls/PlayerControl.xaml index 95d7f5dc..893283be 100644 --- a/AUCapture-WPF/Controls/PlayerControl.xaml +++ b/AUCapture-WPF/Controls/PlayerControl.xaml @@ -14,6 +14,7 @@ + diff --git a/AUCapture-WPF/Controls/PlayerControl.xaml.cs b/AUCapture-WPF/Controls/PlayerControl.xaml.cs index c0cc0408..5b6777ba 100644 --- a/AUCapture-WPF/Controls/PlayerControl.xaml.cs +++ b/AUCapture-WPF/Controls/PlayerControl.xaml.cs @@ -2,22 +2,74 @@ using System.Windows; using System.Windows.Controls; using AmongUsCapture; -using Bindables; namespace AUCapture_WPF.Controls { /// /// Interaction logic for PlayerControl.xaml /// - [DependencyProperty] public partial class PlayerControl : UserControl { - public bool AliveStatus { get; set; } - public uint PlayerHatID { get; set; } - public uint PlayerPetID { get; set; } - public uint PlayerPantsID { get; set; } - public string PlayerName { get;set; } - public PlayerColor Color { get; set; } + public static readonly DependencyProperty AliveProperty = + DependencyProperty.Register("AliveStatus", + typeof(bool), typeof(PlayerControl)); + + public static readonly DependencyProperty PlayerNameProperty = + DependencyProperty.Register("PlayerName", + typeof(string), typeof(PlayerControl)); + + public static readonly DependencyProperty PlayerHatDependencyProperty = + DependencyProperty.Register("PlayerHatID", + typeof(uint), typeof(PlayerControl)); + + public static readonly DependencyProperty PlayerPetDependencyProperty = + DependencyProperty.Register("PlayerPetID", + typeof(uint), typeof(PlayerControl)); + + public static readonly DependencyProperty PlayerPantsDependencyProperty = + DependencyProperty.Register("PlayerPantsID", + typeof(uint), typeof(PlayerControl)); + + public static readonly DependencyProperty ColorProperty = + DependencyProperty.Register("Color", + typeof(PlayerColor), typeof(PlayerControl)); + + private static void PropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + Console.WriteLine("Prop changed"); + } + + public bool AliveStatus + { + get => (bool)GetValue(AliveProperty); + set => SetValue(AliveProperty, value); + } + public uint PlayerHatID + { + get => (uint)GetValue(PlayerHatDependencyProperty); + set => SetValue(PlayerHatDependencyProperty, value); + } + + public uint PlayerPetID + { + get => (uint)GetValue(PlayerHatDependencyProperty); + set => SetValue(PlayerHatDependencyProperty, value); + } + public uint PlayerPantsID + { + get => (uint)GetValue(PlayerPantsDependencyProperty); + set => SetValue(PlayerPantsDependencyProperty, value); + } + public string PlayerName + { + get => (string)GetValue(PlayerNameProperty); + set => SetValue(PlayerNameProperty, value); + } + public PlayerColor Color + { + get => (PlayerColor)GetValue(ColorProperty); + set => SetValue(ColorProperty, value); + } public PlayerControl() { InitializeComponent(); diff --git a/AUCapture-WPF/Converters/GameStateToVisability.cs b/AUCapture-WPF/Converters/GameStateToVisability.cs deleted file mode 100644 index 47be8196..00000000 --- a/AUCapture-WPF/Converters/GameStateToVisability.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; -using System.Windows.Media.Imaging; -using AmongUsCapture; -using Discord; - -namespace AUCapture_WPF.Converters -{ - class GameStateToVisability: IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var CurrentGameState = value as GameState? ?? AmongUsCapture.GameState.MENU; - if (CurrentGameState == GameState.MENU) - { - return System.Windows.Visibility.Hidden; - } - else - { - return System.Windows.Visibility.Visible; - } - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/AUCapture-WPF/FodyWeavers.xml b/AUCapture-WPF/FodyWeavers.xml deleted file mode 100644 index e6acda55..00000000 --- a/AUCapture-WPF/FodyWeavers.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/AUCapture-WPF/FodyWeavers.xsd b/AUCapture-WPF/FodyWeavers.xsd deleted file mode 100644 index 5f69a999..00000000 --- a/AUCapture-WPF/FodyWeavers.xsd +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - Used to control if the On_PropertyName_Changed feature is enabled. - - - - - Used to control if the Dependent properties feature is enabled. - - - - - Used to control if the IsChanged property feature is enabled. - - - - - Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form. - - - - - Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project. - - - - - Used to control if equality checks should use the Equals method resolved from the base class. - - - - - Used to control if equality checks should use the static Equals method resolved from the base class. - - - - - Used to turn off build warnings from this weaver. - - - - - Used to turn off build warnings about mismatched On_PropertyName_Changed methods. - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/AUCapture-WPF/MainWindow.xaml.cs b/AUCapture-WPF/MainWindow.xaml.cs index 82577f31..7ee32b18 100644 --- a/AUCapture-WPF/MainWindow.xaml.cs +++ b/AUCapture-WPF/MainWindow.xaml.cs @@ -599,7 +599,6 @@ private void GameStateChangedHandler(object sender, GameStateChangedEventArgs e) Dispatcher.Invoke((Action) (() => { context.GameState = e.NewState; - context.GameMap = null; foreach (var player in context.Players) { player.Alive = true; diff --git a/AUCapture-WPF/Resources/Misc/Stars.png b/AUCapture-WPF/Resources/Misc/Stars.png deleted file mode 100644 index 401f88b0..00000000 Binary files a/AUCapture-WPF/Resources/Misc/Stars.png and /dev/null differ diff --git a/AUCapture-WPF/Resources/Misc/map-1.png b/AUCapture-WPF/Resources/Misc/map-1.png deleted file mode 100644 index 2335eb2b..00000000 Binary files a/AUCapture-WPF/Resources/Misc/map-1.png and /dev/null differ diff --git a/AUCapture-WPF/Resources/Misc/simsong.png b/AUCapture-WPF/Resources/Misc/simsong.png deleted file mode 100644 index fa3a42d4..00000000 Binary files a/AUCapture-WPF/Resources/Misc/simsong.png and /dev/null differ diff --git a/AUCapture-WPF/UserDataContext.cs b/AUCapture-WPF/UserDataContext.cs index 6aa0b6b8..54179c82 100644 --- a/AUCapture-WPF/UserDataContext.cs +++ b/AUCapture-WPF/UserDataContext.cs @@ -35,7 +35,16 @@ public class UserDataContext : INotifyPropertyChanged private ICommand textBoxButtonHelpCmd; private ICommand openAmongUsCMD; public List AccentColors { get; set; } - public bool? Connected { get; set; } = false; + private bool? _connected = false; + public bool? Connected + { + get => _connected; + set + { + _connected = value; + OnPropertyChanged(); + } + } public class AccentColorMenuData { public string Name { get; set; } @@ -140,19 +149,60 @@ protected virtual void DoChangeTheme(object sender) } } }; + private ObservableCollection _players = new ObservableCollection(); + public ObservableCollection Players + { + get => _players; + set + { + _players = value; + OnPropertyChanged(); + } + } - public ObservableCollection Players { get; set; } = new ObservableCollection(); - - public ObservableCollection ConnectionStatuses { get; set; } = new ObservableCollection(); + private ObservableCollection _connectionStatuses = new ObservableCollection(); + public ObservableCollection ConnectionStatuses + { + get => _connectionStatuses; + set + { + _connectionStatuses = value; + OnPropertyChanged(); + } + } - public PlayMap? GameMap { get; set; } + private PlayMap? _gameMap; + public PlayMap? GameMap + { + get => _gameMap; + set + { + _gameMap = value; + OnPropertyChanged(); + } + } - public string GameCode { get; set; } - + private string _gameCode; + public string GameCode + { + get => _gameCode; + set + { + _gameCode = value; + OnPropertyChanged(); + } + } - - public GameState? GameState { get; set; } - + private GameState? _gameState; + public GameState? GameState + { + get => _gameState; + set + { + _gameState = value; + OnPropertyChanged(); + } + } private static void Shuffle(List list) { @@ -212,6 +262,9 @@ public UserDataContext(IDialogCoordinator dialogCoordinator, IAppSettings settin Console.WriteLine(e); LatestVersion = "ERROR"; } + OnPropertyChanged(nameof(LatestVersion)); + OnPropertyChanged(nameof(Version)); + OnPropertyChanged(nameof(AccentColors));