From bf3d68c7b44f77d9fa4ae41a2de1a2afd2e466dd Mon Sep 17 00:00:00 2001 From: Rokuazery Date: Wed, 30 Nov 2022 20:50:53 +0700 Subject: [PATCH] U.GG Aram, Fixes & Small Improvements - U.GG Aram - Small visual changes - Fixed some memory leak - Update ReadMe - Update Version.txt - Fixed #19 --- LoL Assist/App.xaml | 11 +- LoL Assist/App.xaml.cs | 33 +- LoL Assist/BuildEditorWindow.xaml | 15 +- LoL Assist/BuildEditorWindow.xaml.cs | 25 +- LoL Assist/{ViewModel => Commands}/Command.cs | 4 +- LoL Assist/Commands/ItemInsertedCommand.cs | 31 ++ LoL Assist/Commands/ItemReceivedCommand.cs | 31 ++ LoL Assist/Commands/ItemRemovedCommand.cs | 31 ++ .../Converters/ChampionToImageConverter.cs | 37 ++ LoL Assist/Converters/ProviderConverter.cs | 2 +- LoL Assist/DataTemplates.xaml | 25 -- LoL Assist/Features/AutoMessage.cs | 31 ++ LoL Assist/LoL Assist.csproj | 121 +++++-- LoL Assist/MainWindow.xaml | 134 +++---- LoL Assist/MainWindow.xaml.cs | 22 +- LoL Assist/{Model => Models}/ConfigModel.cs | 14 +- .../{Model => Models}/ItemImageModel.cs | 2 +- LoL Assist/{Model => Models}/LoLAWrapper.cs | 11 +- LoL Assist/Models/MessageBoxModel.cs | 17 + .../{Model => Models}/ProgressReportModel.cs | 2 +- LoL Assist/{Model => Models}/RuneModel.cs | 2 +- LoL Assist/Properties/AssemblyInfo.cs | 4 +- .../ResourceDictionaries/DataTemplates.xaml | 29 ++ .../{ => ResourceDictionaries}/Styles.xaml | 43 ++- .../Theme.xaml} | 8 +- LoL Assist/Threads/AutoMessageThread.cs | 48 +++ LoL Assist/Utils/Animation.cs | 2 +- LoL Assist/Utils/Helper.cs | 36 +- LoL Assist/Utils/Updater.cs | 13 +- LoL Assist/View/PatchNotesPanel.xaml | 85 ----- LoL Assist/ViewModel/MessageBoxViewModel.cs | 18 - LoL Assist/ViewModel/PatchViewModel.cs | 106 ------ .../BuildEditorViewModel.cs | 169 ++++++--- .../ViewModels/ChampionPickViewModel.cs | 25 ++ .../ChampionPickerViewModel-Rokuazery.cs | 70 ++++ .../ViewModels/ChampionPickerViewModel.cs | 49 +++ .../ConfigViewModel.cs | 86 ++--- .../DownloadViewModel.cs | 72 ++-- LoL Assist/ViewModels/ItemListViewModel.cs | 171 +++++++++ LoL Assist/ViewModels/ItemViewModel.cs | 53 +++ .../MainViewModel.cs | 260 +++++++++---- .../MatchFoundViewModel.cs | 22 +- LoL Assist/ViewModels/MessageViewModel.cs | 82 +++++ .../RuneEditorViewModel.cs | 252 +++---------- LoL Assist/ViewModels/ViewModelBase.cs | 16 + .../{View => Views}/BuildEditorPanel.xaml | 0 .../{View => Views}/BuildEditorPanel.xaml.cs | 0 LoL Assist/Views/ChampionItemListView.xaml | 102 ++++++ LoL Assist/Views/ChampionItemListView.xaml.cs | 159 ++++++++ LoL Assist/Views/ChampionPickerPanel.xaml | 341 ++++++++++++++++++ .../ChampionPickerPanel.xaml.cs} | 14 +- LoL Assist/{View => Views}/ConfigPanel.xaml | 35 +- .../{View => Views}/ConfigPanel.xaml.cs | 24 +- LoL Assist/{View => Views}/DownloadPanel.xaml | 22 +- .../{View => Views}/DownloadPanel.xaml.cs | 2 +- LoL Assist/{View => Views}/InfoPanel.xaml | 4 +- LoL Assist/{View => Views}/InfoPanel.xaml.cs | 5 +- .../{View => Views}/MatchFoundPanel.xaml | 3 +- .../{View => Views}/MatchFoundPanel.xaml.cs | 2 +- LoL Assist/{View => Views}/MessageBox.xaml | 5 +- LoL Assist/{View => Views}/MessageBox.xaml.cs | 12 +- LoL Assist/Views/MessagePanel.xaml | 50 +++ LoL Assist/Views/MessagePanel.xaml.cs | 28 ++ LoL Assist/{View => Views}/MsgBox.xaml | 8 +- LoL Assist/{View => Views}/MsgBox.xaml.cs | 4 +- LoL Assist/{View => Views}/PathSelector.xaml | 0 .../{View => Views}/PathSelector.xaml.cs | 0 .../{View => Views}/RuneEditorPanel.xaml | 11 +- .../{View => Views}/RuneEditorPanel.xaml.cs | 2 +- LoL Assist/Views/Windows/MainWIndow.xaml | 22 ++ LoL Assist/Views/Windows/MainWIndow.xaml.cs | 27 ++ LoL Assist/packages.config | 4 - LoLA/LoLA/Data/ChampionBuild.cs | 8 +- LoLA/LoLA/Data/ItemSet.cs | 28 ++ LoLA/LoLA/DataConverter.cs | 123 +------ LoLA/LoLA/LoLA.csproj | 3 + LoLA/LoLA/Main.cs | 8 +- LoLA/LoLA/Networking/LCU/Data/SessionData.cs | 17 + .../Networking/LCU/Enums/RequestMethod.cs | 10 +- .../Networking/LCU/Events/ChampionMonitor.cs | 1 + .../Networking/LCU/Events/PhaseMonitor.cs | 12 +- LoLA/LoLA/Networking/LCU/LCUWrapper.cs | 85 ++++- LoLA/LoLA/Networking/LCU/LeagueClient.cs | 10 +- .../DataDragon/DataDragonWrapper.cs | 22 +- .../DataProviders/Metasrc/MetasrcClass.cs | 6 +- .../DataProviders/Metasrc/MetasrcWrapper.cs | 132 +++---- .../DataProviders/UGG/UGGWrapper-Rokuazery.cs | 226 ++++++++++++ .../DataProviders/UGG/UGGWrapper.cs | 332 ++++++++++++----- .../WebWrapper/DataProviders/Utils/Helper.cs | 67 ++++ LoLA/LoLA/Properties/AssemblyInfo.cs | 4 +- README.md | 49 +-- Version.txt | 4 +- 92 files changed, 3036 insertions(+), 1317 deletions(-) rename LoL Assist/{ViewModel => Commands}/Command.cs (91%) create mode 100644 LoL Assist/Commands/ItemInsertedCommand.cs create mode 100644 LoL Assist/Commands/ItemReceivedCommand.cs create mode 100644 LoL Assist/Commands/ItemRemovedCommand.cs create mode 100644 LoL Assist/Converters/ChampionToImageConverter.cs delete mode 100644 LoL Assist/DataTemplates.xaml create mode 100644 LoL Assist/Features/AutoMessage.cs rename LoL Assist/{Model => Models}/ConfigModel.cs (85%) rename LoL Assist/{Model => Models}/ItemImageModel.cs (80%) rename LoL Assist/{Model => Models}/LoLAWrapper.cs (91%) create mode 100644 LoL Assist/Models/MessageBoxModel.cs rename LoL Assist/{Model => Models}/ProgressReportModel.cs (90%) rename LoL Assist/{Model => Models}/RuneModel.cs (99%) create mode 100644 LoL Assist/ResourceDictionaries/DataTemplates.xaml rename LoL Assist/{ => ResourceDictionaries}/Styles.xaml (96%) rename LoL Assist/{Colours.xaml => ResourceDictionaries/Theme.xaml} (96%) create mode 100644 LoL Assist/Threads/AutoMessageThread.cs delete mode 100644 LoL Assist/View/PatchNotesPanel.xaml delete mode 100644 LoL Assist/ViewModel/MessageBoxViewModel.cs delete mode 100644 LoL Assist/ViewModel/PatchViewModel.cs rename LoL Assist/{ViewModel => ViewModels}/BuildEditorViewModel.cs (84%) create mode 100644 LoL Assist/ViewModels/ChampionPickViewModel.cs create mode 100644 LoL Assist/ViewModels/ChampionPickerViewModel-Rokuazery.cs create mode 100644 LoL Assist/ViewModels/ChampionPickerViewModel.cs rename LoL Assist/{ViewModel => ViewModels}/ConfigViewModel.cs (77%) rename LoL Assist/{ViewModel => ViewModels}/DownloadViewModel.cs (80%) create mode 100644 LoL Assist/ViewModels/ItemListViewModel.cs create mode 100644 LoL Assist/ViewModels/ItemViewModel.cs rename LoL Assist/{ViewModel => ViewModels}/MainViewModel.cs (74%) rename LoL Assist/{ViewModel => ViewModels}/MatchFoundViewModel.cs (87%) create mode 100644 LoL Assist/ViewModels/MessageViewModel.cs rename LoL Assist/{ViewModel => ViewModels}/RuneEditorViewModel.cs (82%) create mode 100644 LoL Assist/ViewModels/ViewModelBase.cs rename LoL Assist/{View => Views}/BuildEditorPanel.xaml (100%) rename LoL Assist/{View => Views}/BuildEditorPanel.xaml.cs (100%) create mode 100644 LoL Assist/Views/ChampionItemListView.xaml create mode 100644 LoL Assist/Views/ChampionItemListView.xaml.cs create mode 100644 LoL Assist/Views/ChampionPickerPanel.xaml rename LoL Assist/{View/PatchNotesPanel.xaml.cs => Views/ChampionPickerPanel.xaml.cs} (61%) rename LoL Assist/{View => Views}/ConfigPanel.xaml (89%) rename LoL Assist/{View => Views}/ConfigPanel.xaml.cs (81%) rename LoL Assist/{View => Views}/DownloadPanel.xaml (77%) rename LoL Assist/{View => Views}/DownloadPanel.xaml.cs (95%) rename LoL Assist/{View => Views}/InfoPanel.xaml (97%) rename LoL Assist/{View => Views}/InfoPanel.xaml.cs (93%) rename LoL Assist/{View => Views}/MatchFoundPanel.xaml (96%) rename LoL Assist/{View => Views}/MatchFoundPanel.xaml.cs (88%) rename LoL Assist/{View => Views}/MessageBox.xaml (89%) rename LoL Assist/{View => Views}/MessageBox.xaml.cs (77%) create mode 100644 LoL Assist/Views/MessagePanel.xaml create mode 100644 LoL Assist/Views/MessagePanel.xaml.cs rename LoL Assist/{View => Views}/MsgBox.xaml (91%) rename LoL Assist/{View => Views}/MsgBox.xaml.cs (93%) rename LoL Assist/{View => Views}/PathSelector.xaml (100%) rename LoL Assist/{View => Views}/PathSelector.xaml.cs (100%) rename LoL Assist/{View => Views}/RuneEditorPanel.xaml (98%) rename LoL Assist/{View => Views}/RuneEditorPanel.xaml.cs (88%) create mode 100644 LoL Assist/Views/Windows/MainWIndow.xaml create mode 100644 LoL Assist/Views/Windows/MainWIndow.xaml.cs delete mode 100644 LoL Assist/packages.config create mode 100644 LoLA/LoLA/Data/ItemSet.cs create mode 100644 LoLA/LoLA/Networking/LCU/Data/SessionData.cs create mode 100644 LoLA/LoLA/Networking/WebWrapper/DataProviders/UGG/UGGWrapper-Rokuazery.cs create mode 100644 LoLA/LoLA/Networking/WebWrapper/DataProviders/Utils/Helper.cs diff --git a/LoL Assist/App.xaml b/LoL Assist/App.xaml index b81f350..fb940ff 100644 --- a/LoL Assist/App.xaml +++ b/LoL Assist/App.xaml @@ -1,9 +1,6 @@  + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> @@ -12,9 +9,9 @@ --> - - - + + + diff --git a/LoL Assist/App.xaml.cs b/LoL Assist/App.xaml.cs index dfa8b08..14e0c16 100644 --- a/LoL Assist/App.xaml.cs +++ b/LoL Assist/App.xaml.cs @@ -1,10 +1,12 @@ -using System.Windows.Controls; +using LoL_Assist_WAPP.ViewModels; +using System.Windows.Controls; +using LoL_Assist_WAPP.Models; using LoL_Assist_WAPP.Utils; using System.Diagnostics; using System.Windows; using System; using LoLA; -using LoL_Assist_WAPP.Model; +using System.IO; namespace LoL_Assist_WAPP { @@ -13,12 +15,30 @@ namespace LoL_Assist_WAPP /// public partial class App : Application { + public App() + { + Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); + ToolTipService.ShowDurationProperty.OverrideMetadata(typeof(DependencyObject), new FrameworkPropertyMetadata(int.MaxValue)); + ToolTipService.InitialShowDelayProperty.OverrideMetadata(typeof(DependencyObject), new FrameworkPropertyMetadata(350)); + } + + #if DEBUG + private const int MAX_INSTANCES = 2; + #else + private const int MAX_INSTANCES = 1; + #endif + protected override void OnStartup(StartupEventArgs e) { RuneModel.Init(); - GlobalConfig.s_Debug = true; + + #if DEBUG + GlobalConfig.s_Debug = true; + #else + GlobalConfig.s_Debug = false; + #endif + //Console.Title = "LoL Assist - Debug Console"; - ToolTipService.ShowDurationProperty.OverrideMetadata(typeof(DependencyObject), new FrameworkPropertyMetadata(int.MaxValue)); if (!GlobalConfig.s_Debug) { @@ -27,13 +47,16 @@ protected override void OnStartup(StartupEventArgs e) } var proccName = Process.GetCurrentProcess().ProcessName; - if (Process.GetProcessesByName(proccName).Length > 1) + if (Process.GetProcessesByName(proccName).Length > MAX_INSTANCES) { MessageBox.Show("LoL Assist is already running!", "LoL Assist", MessageBoxButton.OK, MessageBoxImage.Warning); Environment.Exit(0); } + MainWindow mainWindow = new MainWindow(); + mainWindow.Show(); + base.OnStartup(e); } } diff --git a/LoL Assist/BuildEditorWindow.xaml b/LoL Assist/BuildEditorWindow.xaml index 3772938..90cf0a8 100644 --- a/LoL Assist/BuildEditorWindow.xaml +++ b/LoL Assist/BuildEditorWindow.xaml @@ -3,10 +3,11 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:local="clr-namespace:LoL_Assist_WAPP" xmlns:view="clr-namespace:LoL_Assist_WAPP.View" - mc:Ignorable="d" MouseLeftButtonDown="Window_MouseLeftButtonDown" SnapsToDevicePixels="True" - MinHeight="463" MinWidth="650" Height="463" Width="650" MaxHeight="463" MaxWidth="650" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" Title="LoL Assist - Advanced Runes & Spells Editor"> - + mc:Ignorable="d" SnapsToDevicePixels="True" x:Name="Wnd" + MinHeight="450" MinWidth="550" Height="450" Width="550" MaxHeight="450" MaxWidth="550" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" Title="LoL Assist - Advanced Runes & Spells Editor"> + + + @@ -23,7 +24,7 @@ Margin="7,0,0,0" FontWeight="DemiBold" HorizontalAlignment="Left" VerticalAlignment="Center"/> -