diff --git a/LoL Assist/App.xaml b/LoL Assist/App.xaml
index 1d5e358..b81f350 100644
--- a/LoL Assist/App.xaml
+++ b/LoL Assist/App.xaml
@@ -5,658 +5,17 @@
xmlns:converters="clr-namespace:LoL_Assist_WAPP.Converters"
StartupUri="MainWindow.xaml">
-
-
-
-
-
-
- #7160E8
- #403582
- #A093EF
- #303030
- #18191C
- White
- white
-
- Silver
- Gray
- #969284
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/LoL Assist/App.xaml.cs b/LoL Assist/App.xaml.cs
index d1740fb..f9556df 100644
--- a/LoL Assist/App.xaml.cs
+++ b/LoL Assist/App.xaml.cs
@@ -14,9 +14,9 @@ public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
- Global.Config.debug = false;
- Console.Title = "LoL Assist - Debug Console";
- ToolTipService.ShowDurationProperty.OverrideMetadata(typeof(DependencyObject), new FrameworkPropertyMetadata(int.MaxValue));
+ Global.Config.debug = true;
+ //Console.Title = "LoL Assist - Debug Console";
+ ToolTipService.ShowDurationProperty.OverrideMetadata(typeof(DependencyObject), new FrameworkPropertyMetadata(int.MaxValue));
if (!Global.Config.debug)
{
diff --git a/LoL Assist/BuildEditorWindow.xaml b/LoL Assist/BuildEditorWindow.xaml
index 498a039..c665e34 100644
--- a/LoL Assist/BuildEditorWindow.xaml
+++ b/LoL Assist/BuildEditorWindow.xaml
@@ -39,8 +39,8 @@
Margin="7,0,0,0" FontWeight="DemiBold" HorizontalAlignment="Left" VerticalAlignment="Center"/>
-
+
@@ -69,7 +69,7 @@
+ Foreground="{Binding ElementName=saveStatus, Path=Text, Converter={StaticResource TextToForegroundConverter}}" Text="{Binding Path=saveInfo}" FontSize="10" FontWeight="DemiBold"/>
diff --git a/LoL Assist/BuildEditorWindow.xaml.cs b/LoL Assist/BuildEditorWindow.xaml.cs
index 4546e9d..fa131a6 100644
--- a/LoL Assist/BuildEditorWindow.xaml.cs
+++ b/LoL Assist/BuildEditorWindow.xaml.cs
@@ -25,8 +25,6 @@ public BuildEditorWindow()
InitializeComponent();
DataContext = viewModel;
}
-
- private void CloseBtn_Clicked(object sender, MouseButtonEventArgs e) => Close();
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
@@ -119,5 +117,7 @@ private void AnimateClose(FrameworkElement element, double time = 0.13)
Utils.Animation.FadeOut(element, time);
}
#endregion
+
+ private void CloseBtn_Click(object sender, RoutedEventArgs e) => Close();
}
}
diff --git a/LoL Assist/Colours.xaml b/LoL Assist/Colours.xaml
new file mode 100644
index 0000000..1234822
--- /dev/null
+++ b/LoL Assist/Colours.xaml
@@ -0,0 +1,125 @@
+
+
+ #7160E8
+ #403582
+ #A093EF
+
+
+ #303030
+ #18191C
+ #242424
+
+ White
+ white
+ #E74856
+
+ Silver
+ Gray
+ #969284
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LoL Assist/Converters/NullToCollapseConverter.cs b/LoL Assist/Converters/NullToCollapseConverter.cs
new file mode 100644
index 0000000..9038dab
--- /dev/null
+++ b/LoL Assist/Converters/NullToCollapseConverter.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+
+namespace LoL_Assist_WAPP.Converters
+{
+ internal class NullToCollapseConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return string.IsNullOrEmpty(value?.ToString()) ? Visibility.Collapsed : Visibility.Visible;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/LoL Assist/Converters/TextToForegroundConverter.cs b/LoL Assist/Converters/TextToForegroundConverter.cs
new file mode 100644
index 0000000..5e74f7f
--- /dev/null
+++ b/LoL Assist/Converters/TextToForegroundConverter.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Media;
+
+namespace LoL_Assist_WAPP.Converters
+{
+ public class TextToForegroundConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+ {
+ switch(value.ToString())
+ {
+ case "Declined":
+ case "Disconnected":
+ case "Invalid Build Config":
+ return (SolidColorBrush)Application.Current.Resources["RedBrush"]; // Red
+ case "Accepted":
+ return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#29ab87")); // Green
+ case "Auto Accept is disabled":
+ return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ffc40c")); // Yellow
+ default:
+ return (SolidColorBrush)Application.Current.Resources["FontPrimaryBrush"];
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/LoL Assist/DataTemplates.xaml b/LoL Assist/DataTemplates.xaml
new file mode 100644
index 0000000..0513f87
--- /dev/null
+++ b/LoL Assist/DataTemplates.xaml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LoL Assist/Extensions/ProgressBarSmoother.cs b/LoL Assist/Extensions/ProgressBarSmoother.cs
new file mode 100644
index 0000000..f713201
--- /dev/null
+++ b/LoL Assist/Extensions/ProgressBarSmoother.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media.Animation;
+
+namespace LoL_Assist_WAPP.Extensions
+{
+ // Source: https://stackoverflow.com/questions/14485818/how-to-update-a-progress-bar-so-it-increases-smoothly
+ public class ProgressBarSmoother
+ {
+ public static double GetSmoothValue(DependencyObject obj)
+ {
+ return (double)obj.GetValue(SmoothValueProperty);
+ }
+
+ public static void SetSmoothValue(DependencyObject obj, double value)
+ {
+ obj.SetValue(SmoothValueProperty, value);
+ }
+
+ public static readonly DependencyProperty SmoothValueProperty =
+ DependencyProperty.RegisterAttached("SmoothValue", typeof(double), typeof(ProgressBarSmoother), new PropertyMetadata(0.0, changing));
+
+ private static void changing(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var anim = new DoubleAnimation((double)e.OldValue, (double)e.NewValue, TimeSpan.FromSeconds(1));
+ (d as ProgressBar).BeginAnimation(ProgressBar.ValueProperty, anim, HandoffBehavior.Compose);
+ }
+ }
+}
diff --git a/LoL Assist/LoL Assist.csproj b/LoL Assist/LoL Assist.csproj
index f0bb51c..636871f 100644
--- a/LoL Assist/LoL Assist.csproj
+++ b/LoL Assist/LoL Assist.csproj
@@ -5,7 +5,7 @@
Debug
AnyCPU
{0BD0D0DA-C57A-43F1-A986-0B92F2235045}
- Exe
+ WinExe
LoL_Assist_WAPP
LoL Assist
v4.8
@@ -24,6 +24,7 @@
DEBUG;TRACE
prompt
4
+ true
AnyCPU
@@ -74,6 +75,7 @@
+
@@ -97,7 +99,13 @@
BuildEditorWindow.xaml
+
+
+
+
+ MainWnd.xaml
+
@@ -105,22 +113,30 @@
+
+ True
+ True
+ Resources.resx
+
+
+
+
ConfigPanel.xaml
+
+ MessageBox.xaml
+
MsgBox.xaml
-
- IconButton.xaml
-
InfoPanel.xaml
@@ -130,10 +146,21 @@
PatchNotesPanel.xaml
+
+ RoleSelectPanel.xaml
+
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
@@ -146,15 +173,23 @@
MainWindow.xaml
Code
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
-
+
Designer
MSBuild:Compile
-
+
Designer
MSBuild:Compile
@@ -170,16 +205,15 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Code
-
- True
- True
- Resources.resx
-
True
Settings.settings
@@ -211,9 +245,6 @@
-
-
-
@@ -322,15 +353,9 @@
-
-
-
-
-
-
@@ -463,5 +488,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LoL Assist/MainWindow.xaml b/LoL Assist/MainWindow.xaml
index 56afeef..2a17703 100644
--- a/LoL Assist/MainWindow.xaml
+++ b/LoL Assist/MainWindow.xaml
@@ -5,52 +5,93 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:view="clr-namespace:LoL_Assist_WAPP.View" x:Name="Me"
xmlns:viewModel ="clr-namespace:LoL_Assist_WAPP.ViewModel"
- mc:Ignorable="d" WindowStartupLocation="CenterScreen" Background="{DynamicResource bBrushSecondary}" MouseLeftButtonDown="Me_MouseLeftButtonDown" RenderOptions.BitmapScalingMode="HighQuality"
- Title="LoL Assist" Height="330" Width="465" MinHeight="330" MinWidth="465" MaxHeight="330" MaxWidth="465" BorderBrush="{DynamicResource BorderGradientBrush}" BorderThickness="1">
+ mc:Ignorable="d" WindowStartupLocation="CenterScreen" Background="{DynamicResource bBrushSecondary}" RenderOptions.BitmapScalingMode="HighQuality" Topmost="{Binding Path=Topmost, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
+ Title="LoL Assist" Height="350" Width="485" MinHeight="350" MinWidth="485" MaxHeight="350" MaxWidth="485" BorderBrush="{DynamicResource BorderGradientBrush}" BorderThickness="1">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
@@ -67,9 +108,13 @@
-
-
-
+
+
+
+
+
+
+
@@ -102,6 +147,9 @@
-
+
+
+
+
diff --git a/LoL Assist/MainWindow.xaml.cs b/LoL Assist/MainWindow.xaml.cs
index 8050921..3e16112 100644
--- a/LoL Assist/MainWindow.xaml.cs
+++ b/LoL Assist/MainWindow.xaml.cs
@@ -14,85 +14,30 @@ public partial class MainWindow : Window
{
private readonly View.InfoPanel InfoPanel;
private readonly View.ConfigPanel ConfigPanel;
- private readonly View.PatchNotesPanel PatchNotesPanel;
-
- private BuildEditorWindow buildEditorWindow;
public MainWindow()
{
InitializeComponent();
- var MatchFoundPanel = new View.MatchFoundPanel(Me);
ConfigPanel = new View.ConfigPanel(BackDrop);
InfoPanel = new View.InfoPanel(BackDrop);
- PatchNotesPanel = new View.PatchNotesPanel(BackDrop);
ConfigPanel.Margin = ConfigModel.marginClose;
InfoPanel.Margin = ConfigModel.marginClose;
Grid.SetRowSpan(InfoPanel, 2);
Grid.SetRowSpan(ConfigPanel, 2);
- Grid.SetRowSpan(MatchFoundPanel, 2);
- Grid.SetRowSpan(PatchNotesPanel, 2);
MainGrid.Children.Add(InfoPanel);
MainGrid.Children.Add(ConfigPanel);
- MainGrid.Children.Add(MatchFoundPanel);
- MainGrid.Children.Add(PatchNotesPanel);
}
- private void MinimzieBtn_Clicked(object sender, MouseButtonEventArgs e) => WindowState = WindowState.Minimized;
- private void Info_Clicked(object sender, MouseButtonEventArgs e) => Animate(InfoPanel, ConfigModel.marginClose, ConfigModel.marginOpen);
- private void SettingsBtn_Clicked(object sender, MouseButtonEventArgs e) => Animate(ConfigPanel, ConfigModel.marginClose, ConfigModel.marginOpen);
- private void CloseBtn_Clicked(object sender, MouseButtonEventArgs e)
- {
- View.MsgBox exitMsg = new View.MsgBox("Are you sure you want to exit LoL Assist?");
- exitMsg.Margin = new Thickness(0, Height, 0, 0);
- MainGrid.Children.Add(exitMsg);
- Grid.SetRowSpan(exitMsg, 2);
- exitMsg.Decided += delegate (bool result)
- {
- if (result) Environment.Exit(0);
- Utils.Animation.FadeOut(BackDrop, 0.13);
- Utils.Animation.Margin(exitMsg, ConfigModel.marginOpen, new Thickness(0, Height, 0, 0), 0.13);
- };
- Animate(exitMsg, new Thickness(0, Height, 0, 0), ConfigModel.marginOpen, 0.13);
- }
-
private void Animate(FrameworkElement element, Thickness from, Thickness to, double time = 0.2)
{
Utils.Animation.FadeIn(BackDrop, time);
Utils.Animation.Margin(element, from, to, time);
}
- private void Me_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- if (e.ChangedButton == MouseButton.Left)
- DragMove();
- }
-
- private void EditBtn_Clicked(object sender, MouseButtonEventArgs e)
- {
- buildEditorWindow = new BuildEditorWindow();
- buildEditorWindow.Owner = this;
- buildEditorWindow.ShowDialog();
- }
-
- private void ConnectionStatus_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
- {
- if (ConnectionStatus.Text == "Disconnected")
- {
- GMode.Visibility = Visibility.Hidden;
- wStatus.Visibility = Visibility.Visible;
- ChampionContainer.Visibility = Visibility.Hidden;
- ConnectionStatus.Foreground = new SolidColorBrush(Color.FromRgb(231, 72, 86));
- }
- else
- {
- GMode.Visibility = Visibility.Visible;
- wStatus.Visibility = Visibility.Hidden;
- ChampionContainer.Visibility = Visibility.Visible;
- ConnectionStatus.Foreground = (SolidColorBrush)Application.Current.Resources["FontPrimaryBrush"];
- }
- }
+ private void SettingsBtn_Click(object sender, RoutedEventArgs e) => Animate(ConfigPanel, ConfigModel.marginClose, ConfigModel.marginOpen);
+ private void InfoBtn_Click(object sender, RoutedEventArgs e) => Animate(InfoPanel, ConfigModel.marginClose, ConfigModel.marginOpen);
}
}
diff --git a/LoL Assist/MainWnd.xaml b/LoL Assist/MainWnd.xaml
new file mode 100644
index 0000000..c605944
--- /dev/null
+++ b/LoL Assist/MainWnd.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/LoL Assist/MainWnd.xaml.cs b/LoL Assist/MainWnd.xaml.cs
new file mode 100644
index 0000000..a9f62e9
--- /dev/null
+++ b/LoL Assist/MainWnd.xaml.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace LoL_Assist_WAPP
+{
+ ///
+ /// Interaction logic for MainWnd.xaml
+ ///
+ public partial class MainWnd : Window
+ {
+ public MainWnd()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/LoL Assist/Model/ConfigModel.cs b/LoL Assist/Model/ConfigModel.cs
index 081b558..039a79f 100644
--- a/LoL Assist/Model/ConfigModel.cs
+++ b/LoL Assist/Model/ConfigModel.cs
@@ -13,13 +13,13 @@ public static class ConfigModel
public static string PatchNotes { get; set; }
public const string DefaultSource = "Metasrc.com";
public static Thickness marginOpen = new Thickness(0, 0, 0, 0);
- public static Thickness marginClose = new Thickness(465, 0, 0, 0);
+ public static Thickness marginClose = new Thickness(485, 0, 0, 0); // Main window width
public static readonly string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
public class Config
{
#region General
- public int MonitoringDelay { get; set; } = 300;
+ public int MonitoringDelay { get; set; } = 250;
public bool AutoRunes { get; set; } = true;
public bool AutoAccept { get; set; } = true;
public bool AutoSpells { get; set; } = true;
diff --git a/LoL Assist/Properties/AssemblyInfo.cs b/LoL Assist/Properties/AssemblyInfo.cs
index 902b507..4e0763d 100644
--- a/LoL Assist/Properties/AssemblyInfo.cs
+++ b/LoL Assist/Properties/AssemblyInfo.cs
@@ -12,7 +12,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Rokuazery")]
[assembly: AssemblyProduct("LoL Assist by Rokuazery")]
-[assembly: AssemblyCopyright("Copyright © 2021")]
+[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -51,6 +51,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.6.0.0")]
-[assembly: AssemblyFileVersion("1.6.0.0")]
+[assembly: AssemblyVersion("1.8.0.0")]
+[assembly: AssemblyFileVersion("1.8.0.0")]
[assembly: NeutralResourcesLanguage("")]
diff --git a/LoL Assist/Properties/Resources.Designer.cs b/LoL Assist/Properties/Resources.Designer.cs
index 6a3f0b0..ec0b11b 100644
--- a/LoL Assist/Properties/Resources.Designer.cs
+++ b/LoL Assist/Properties/Resources.Designer.cs
@@ -70,6 +70,16 @@ internal static System.Drawing.Bitmap Absolute_Focus {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap ADC {
+ get {
+ object obj = ResourceManager.GetObject("ADC", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -270,6 +280,16 @@ internal static System.Drawing.Bitmap Eyeball_Collection {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Fill {
+ get {
+ object obj = ResourceManager.GetObject("Fill", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -440,16 +460,6 @@ internal static System.Drawing.Bitmap Last_Stand {
}
}
- ///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
- ///
- internal static System.Drawing.Bitmap LeagueBuilder {
- get {
- object obj = ResourceManager.GetObject("LeagueBuilder", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -490,6 +500,16 @@ internal static System.Drawing.Bitmap Lethal_Tempo {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Logo {
+ get {
+ object obj = ResourceManager.GetObject("Logo", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -510,6 +530,16 @@ internal static System.Drawing.Bitmap Manaflow_Band {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Mid {
+ get {
+ object obj = ResourceManager.GetObject("Mid", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -869,6 +899,16 @@ internal static System.Drawing.Bitmap SummonerTeleport {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Support {
+ get {
+ object obj = ResourceManager.GetObject("Support", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -899,6 +939,16 @@ internal static System.Drawing.Bitmap Time_Warp_Tonic {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Top {
+ get {
+ object obj = ResourceManager.GetObject("Top", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -912,9 +962,9 @@ internal static System.Drawing.Bitmap Transcendence {
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
- internal static System.Drawing.Bitmap Triumph {
+ internal static System.Drawing.Bitmap Treasure_Hunter {
get {
- object obj = ResourceManager.GetObject("Triumph", resourceCulture);
+ object obj = ResourceManager.GetObject("Treasure_Hunter", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -922,9 +972,9 @@ internal static System.Drawing.Bitmap Triumph {
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
- internal static System.Drawing.Bitmap Ultimate_Hunter {
+ internal static System.Drawing.Bitmap Triumph {
get {
- object obj = ResourceManager.GetObject("Ultimate_Hunter", resourceCulture);
+ object obj = ResourceManager.GetObject("Triumph", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -932,9 +982,9 @@ internal static System.Drawing.Bitmap Ultimate_Hunter {
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
- internal static System.Drawing.Bitmap Unflinching {
+ internal static System.Drawing.Bitmap Ultimate_Hunter {
get {
- object obj = ResourceManager.GetObject("Unflinching", resourceCulture);
+ object obj = ResourceManager.GetObject("Ultimate_Hunter", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -942,9 +992,9 @@ internal static System.Drawing.Bitmap Unflinching {
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
- internal static System.Drawing.Bitmap Unsealed_Spellbook {
+ internal static System.Drawing.Bitmap Unflinching {
get {
- object obj = ResourceManager.GetObject("Unsealed_Spellbook", resourceCulture);
+ object obj = ResourceManager.GetObject("Unflinching", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -952,9 +1002,9 @@ internal static System.Drawing.Bitmap Unsealed_Spellbook {
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
- internal static System.Drawing.Bitmap Untitled {
+ internal static System.Drawing.Bitmap Unsealed_Spellbook {
get {
- object obj = ResourceManager.GetObject("Untitled", resourceCulture);
+ object obj = ResourceManager.GetObject("Unsealed_Spellbook", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
diff --git a/LoL Assist/Properties/Resources.resx b/LoL Assist/Properties/Resources.resx
index 8c88bfe..639e24e 100644
--- a/LoL Assist/Properties/Resources.resx
+++ b/LoL Assist/Properties/Resources.resx
@@ -121,6 +121,9 @@
..\Resources\Absolute Focus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\ADC.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\Aftershock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -181,6 +184,9 @@
..\Resources\Eyeball Collection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\Fill.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\First Strike.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -232,9 +238,6 @@
..\Resources\Last Stand.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\LeagueBuilder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
..\Resources\Legend Alacrity.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -247,12 +250,18 @@
..\Resources\Lethal Tempo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\Logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\Magical Footwear.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\Manaflow Band.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\Mid.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\Minion Dematerializer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -361,6 +370,9 @@
..\Resources\Summon Aery.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\Support.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\Taste of Blood.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -370,9 +382,15 @@
..\Resources\Time Warp Tonic.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\Top.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\Transcendence.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\Treasure Hunter.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\Triumph.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -385,9 +403,6 @@
..\Resources\Unsealed Spellbook.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\Untitled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
..\Resources\Waterwalking.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
diff --git a/LoL Assist/Resources/ADC.png b/LoL Assist/Resources/ADC.png
new file mode 100644
index 0000000..ddd20c4
Binary files /dev/null and b/LoL Assist/Resources/ADC.png differ
diff --git a/LoL Assist/Resources/Fill.png b/LoL Assist/Resources/Fill.png
new file mode 100644
index 0000000..474e2e0
Binary files /dev/null and b/LoL Assist/Resources/Fill.png differ
diff --git a/LoL Assist/Resources/LeagueBuilder.png b/LoL Assist/Resources/LeagueBuilder.png
deleted file mode 100644
index b5caa93..0000000
Binary files a/LoL Assist/Resources/LeagueBuilder.png and /dev/null differ
diff --git a/LoL Assist/Resources/Logo.png b/LoL Assist/Resources/Logo.png
new file mode 100644
index 0000000..1439d93
Binary files /dev/null and b/LoL Assist/Resources/Logo.png differ
diff --git a/LoL Assist/Resources/Mid.png b/LoL Assist/Resources/Mid.png
new file mode 100644
index 0000000..dc86a69
Binary files /dev/null and b/LoL Assist/Resources/Mid.png differ
diff --git a/LoL Assist/Resources/Support.png b/LoL Assist/Resources/Support.png
new file mode 100644
index 0000000..8435c60
Binary files /dev/null and b/LoL Assist/Resources/Support.png differ
diff --git a/LoL Assist/Resources/Top.png b/LoL Assist/Resources/Top.png
new file mode 100644
index 0000000..c6a7507
Binary files /dev/null and b/LoL Assist/Resources/Top.png differ
diff --git a/LoL Assist/Resources/Treasure Hunter.png b/LoL Assist/Resources/Treasure Hunter.png
new file mode 100644
index 0000000..b05eb78
Binary files /dev/null and b/LoL Assist/Resources/Treasure Hunter.png differ
diff --git a/LoL Assist/Resources/Untitled.png b/LoL Assist/Resources/Untitled.png
deleted file mode 100644
index 3918166..0000000
Binary files a/LoL Assist/Resources/Untitled.png and /dev/null differ
diff --git a/LoL Assist/Styles.xaml b/LoL Assist/Styles.xaml
new file mode 100644
index 0000000..a40a1e6
--- /dev/null
+++ b/LoL Assist/Styles.xaml
@@ -0,0 +1,631 @@
+
+
+
+
+ M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LoL Assist/View/ConfigPanel.xaml b/LoL Assist/View/ConfigPanel.xaml
index 945e2ab..5d4a3fe 100644
--- a/LoL Assist/View/ConfigPanel.xaml
+++ b/LoL Assist/View/ConfigPanel.xaml
@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:LoL_Assist_WAPP.View"
xmlns:viewModel="clr-namespace:LoL_Assist_WAPP.ViewModel" xmlns:sys="http://schemas.microsoft.com/winfx/2009/xaml"
mc:Ignorable="d"
- Width="350" Height="245">
+ Width="350" Height="250">
@@ -19,8 +19,8 @@
-
+
@@ -32,7 +32,8 @@
-
+
+
@@ -88,7 +89,8 @@
-
+
+
diff --git a/LoL Assist/View/ConfigPanel.xaml.cs b/LoL Assist/View/ConfigPanel.xaml.cs
index 9731df8..fb789e7 100644
--- a/LoL Assist/View/ConfigPanel.xaml.cs
+++ b/LoL Assist/View/ConfigPanel.xaml.cs
@@ -34,8 +34,6 @@ void Close()
Utils.Animation.Margin(this, ConfigModel.marginOpen, ConfigModel.marginClose);
}
- private void CloseBtn_Clicked(object sender, MouseButtonEventArgs e) => Close();
-
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
@@ -93,5 +91,7 @@ private void resetConfigBtn_Click(object sender, RoutedEventArgs e)
};
Animate(exitMsg, new Thickness(0, Height, 0, 0), ConfigModel.marginOpen, 0.13);
}
+
+ private void BackBtn_Click(object sender, RoutedEventArgs e) => Close();
}
}
diff --git a/LoL Assist/View/IconButton.xaml b/LoL Assist/View/IconButton.xaml
deleted file mode 100644
index e7bb5d5..0000000
--- a/LoL Assist/View/IconButton.xaml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/LoL Assist/View/IconButton.xaml.cs b/LoL Assist/View/IconButton.xaml.cs
deleted file mode 100644
index 51d7e94..0000000
--- a/LoL Assist/View/IconButton.xaml.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-using System;
-using System.Windows;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.ComponentModel;
-using System.Windows.Controls;
-
-namespace LoL_Assist_WAPP.View
-{
- ///
- /// Interaction logic for IconButton.xaml
- ///
- public partial class IconButton : UserControl
- {
- public delegate void ClickedHendler(object sender, MouseButtonEventArgs e);
- public event ClickedHendler Clicked;
-
- public Geometry IconGeometry
- {
- get
- {
- return (Geometry)GetValue(IconGeometryProperty);
- }
- set
- {
- SetValue(IconGeometryProperty, value);
- }
- }
-
- public Stretch IconStretch
- {
- get
- {
- return (Stretch)GetValue(IconStretchProperty);
- }
- set
- {
- SetValue(IconStretchProperty, value);
- }
- }
-
- public Color OnHoverColor
- {
- get
- {
- return (Color)GetValue(OnHoverColorPropery);
- }
- set
- {
- SetValue(OnHoverColorPropery, value);
- }
- }
-
- public Color StaticColor
- {
- get
- {
- return (Color)GetValue(StaticColorProperty);
- }
- set
- {
- SetValue(StaticColorProperty, value);
- }
- }
-
- public static readonly DependencyProperty OnHoverColorPropery = DependencyProperty.Register("OnHoverColor", typeof(Color), typeof(IconButton), new FrameworkPropertyMetadata(Color.FromRgb(255, 255, 255)));
- public static readonly DependencyProperty StaticColorProperty = DependencyProperty.Register("StaticColor", typeof(Color), typeof(IconButton), new FrameworkPropertyMetadata(null));
-
- readonly DependencyPropertyDescriptor StaticColorPropertyDescriptor = DependencyPropertyDescriptor.FromProperty(StaticColorProperty, typeof(IconButton));
-
- public static readonly DependencyProperty IconStretchProperty = DependencyProperty.Register("IconStretch", typeof(Stretch), typeof(IconButton), new FrameworkPropertyMetadata(null));
- public static readonly DependencyProperty IconGeometryProperty = DependencyProperty.Register("IconGeometry", typeof(Geometry), typeof(IconButton), new FrameworkPropertyMetadata(null));
-
- readonly DependencyPropertyDescriptor IconStretchPrpertyDescriptor = DependencyPropertyDescriptor.FromProperty(IconStretchProperty, typeof(IconButton));
- readonly DependencyPropertyDescriptor IconGeometryPropertyDescriptor = DependencyPropertyDescriptor.FromProperty(IconGeometryProperty, typeof(IconButton));
-
- public IconButton()
- {
- InitializeComponent();
-
- IconGeometryPropertyDescriptor.AddValueChanged(this, IconGeometryChanged);
- IconStretchPrpertyDescriptor.AddValueChanged(this, IconStretchChanged);
- StaticColorPropertyDescriptor.AddValueChanged(this, StaticColorChanged);
-
- StaticColor = Color.FromRgb(114, 117, 122);
-
- DataContext = this;
- }
-
- private void StaticColorChanged(object sender, EventArgs e)
- {
- IconPath.Fill = new SolidColorBrush(StaticColor);
- }
-
- private void IconStretchChanged(object sender, EventArgs e)
- {
- IconPath.Stretch = IconStretch;
- IconPathPressed.Stretch = IconStretch;
- }
-
- private void IconGeometryChanged(object sender, EventArgs e)
- {
- IconPath.Data = IconGeometry;
- IconPathPressed.Data = IconGeometry;
- }
-
- private void ButtonGrid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- ((Grid)sender).CaptureMouse();
- IconPathPressed.Visibility = Visibility.Visible;
- }
-
- private void ButtonGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
- {
- ((Grid)sender).ReleaseMouseCapture();
- IconPathPressed.Visibility = Visibility.Hidden;
-
- if (IsMouseOver) Clicked?.Invoke(this, e);
- }
-
- private void ButtonGrid_MouseEnter(object sender, MouseEventArgs e)
- {
- if (e.LeftButton == MouseButtonState.Released)
- {
- IconPathPressed.Visibility = Visibility.Hidden;
- IconPath.Fill = new SolidColorBrush(StaticColor);
- }
- }
- private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
- {
- ButtonGrid.Width = Width;
- ButtonGrid.Height = Height;
- }
- }
-}
diff --git a/LoL Assist/View/InfoPanel.xaml b/LoL Assist/View/InfoPanel.xaml
index e44aaed..aa79a0a 100644
--- a/LoL Assist/View/InfoPanel.xaml
+++ b/LoL Assist/View/InfoPanel.xaml
@@ -40,7 +40,7 @@
-
+
@@ -64,7 +64,7 @@
-
+
diff --git a/LoL Assist/View/InfoPanel.xaml.cs b/LoL Assist/View/InfoPanel.xaml.cs
index 9056013..db060fc 100644
--- a/LoL Assist/View/InfoPanel.xaml.cs
+++ b/LoL Assist/View/InfoPanel.xaml.cs
@@ -20,14 +20,14 @@ public InfoPanel(Border border)
Version.Text = $"App Verion {ConfigModel.version} | Lib Version {Global.version}";
}
- private void CloseBtn_Clicked(object sender, MouseButtonEventArgs e)
+ private void CreatorLink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) => Process.Start(e.Uri.ToString());
+ private void TesterLink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) => Process.Start(e.Uri.ToString());
+ private void Github_Click(object sender, System.Windows.RoutedEventArgs e) => Process.Start("https://github.com/Rokuazery/LoL-Assist");
+
+ private void BackBtn_Click(object sender, System.Windows.RoutedEventArgs e)
{
Utils.Animation.FadeOut(backDrop);
Utils.Animation.Margin(this, ConfigModel.marginOpen, ConfigModel.marginClose, 0.2);
}
-
- private void CreatorLink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) => Process.Start(e.Uri.ToString());
- private void TesterLink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) => Process.Start(e.Uri.ToString());
- private void Github_Click(object sender, System.Windows.RoutedEventArgs e) => Process.Start("https://github.com/Rokuazery/LoL-Assist");
}
}
diff --git a/LoL Assist/View/MatchFoundPanel.xaml b/LoL Assist/View/MatchFoundPanel.xaml
index 6ff794b..7726c55 100644
--- a/LoL Assist/View/MatchFoundPanel.xaml
+++ b/LoL Assist/View/MatchFoundPanel.xaml
@@ -4,38 +4,58 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:LoL_Assist_WAPP.View"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800" Background="#72000000">
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
+
+
diff --git a/LoL Assist/View/MatchFoundPanel.xaml.cs b/LoL Assist/View/MatchFoundPanel.xaml.cs
index 6f8cb53..64ec61a 100644
--- a/LoL Assist/View/MatchFoundPanel.xaml.cs
+++ b/LoL Assist/View/MatchFoundPanel.xaml.cs
@@ -5,12 +5,10 @@
using System.Threading.Tasks;
using System.Windows.Media;
using System.Threading;
-using LoLA.LCU.Objects;
using LoLA.LCU.Events;
using System.Windows;
using LoLA.LCU;
using System;
-using LoLA;
namespace LoL_Assist_WAPP.View
{
@@ -19,123 +17,6 @@ namespace LoL_Assist_WAPP.View
///
public partial class MatchFoundPanel : UserControl
{
- private readonly Window mainWnd = new Window();
- public MatchFoundPanel(Window mainWindow)
- {
- InitializeComponent();
-
- mainWnd = mainWindow;
-
- Opacity = 0;
- Visibility = Visibility.Hidden;
- phaseMonitor.PhaseChanged += Phase_Changed;
- }
-
- private void Phase_Changed(object sender, PhaseMonitor.PhaseChangedArgs e)
- {
- switch (e.currentPhase)
- {
- case Phase.ReadyCheck:
- MatchFound();
- break;
- case Phase.ChampSelect:
- HideMatchFound(true);
- break;
- default:
- HideMatchFound();
- break;
- }
- }
-
- bool IsFound = false, IsDecided = false;
- private async void MatchFound()
- {
- IsFound = true;
- IsDecided = false;
-
- Dispatcher.Invoke(new Action(() => {
- SetAaStatus(string.Empty, (Color)Application.Current.Resources["FontSecondaryColor"]);
- Utils.Animation.FadeIn(this);
- mainWnd.Topmost = true;
- }));
-
- int autoAcceptTimer = 5;
- while (IsFound)
- {
- var matchInfo = await LCUWrapper.GetMatchmakingInfo();
- var timer = matchInfo?.timer == null ? 0 : (int)matchInfo.timer;
-
- SetAaTime($"{10 - timer}s");
- if (!IsDecided)
- {
- if (Model.ConfigModel.config.AutoAccept)
- {
- if (!(autoAcceptTimer <= timer))
- SetAaStatus($"Auto Accept in {autoAcceptTimer - timer}s");
- else Accept();
- }
- else SetAaStatus("Auto Accept is disabled!", Color.FromRgb(255, 196, 12));
- }
-
- if (matchInfo?.playerResponse == "Accepted")
- {
- IsDecided = true;
- SetAaStatus(matchInfo.playerResponse, Color.FromRgb(41, 171, 135));
- }
- else if (matchInfo?.playerResponse == "Declined")
- {
- IsDecided = true;
- SetAaStatus(matchInfo.playerResponse, Color.FromRgb(231, 72, 86));
- }
-
- if (Model.ConfigModel.config.LowSpecMode)
- SetTimeoutBarValue(10 * timer);
- else
- {
- Dispatcher.Invoke(() => {
- Duration duration = new Duration(TimeSpan.FromSeconds(1));
- DoubleAnimation dbAnimation = new DoubleAnimation(11 * timer, duration);
- dbAnimation.Completed += (s, _) => { dbAnimation = null; };
- pBar.BeginAnimation(RangeBase.ValueProperty, dbAnimation);
- });
- }
-
- if (timer == 10) HideMatchFound();
- Thread.Sleep(1000);
- }
- }
-
- private async void Accept() => await LCUWrapper.AcceptMatchmakingAsync();
- private async void Decline() => await LCUWrapper.DeclineMatchmakingAsync();
- private void AcceptBtn_Click(object sender, RoutedEventArgs e) => Accept();
- private void DeclineBtn_Click(object sender, RoutedEventArgs e) => Decline();
- private void SetAaTime(string text) => Dispatcher.Invoke(() => { aCount.Text = text; });
- private void SetTimeoutBarValue(double value) => Dispatcher.Invoke(() => { pBar.Value = value; });
-
- private void SetAaStatus(string text,Color color = default)
- {
- Dispatcher.Invoke(() => {
- aaStatus.Text = text;
- if (color == default)
- aaStatus.Foreground = new SolidColorBrush(Color.FromRgb(255, 255, 255));
- else
- aaStatus.Foreground = new SolidColorBrush(color);
- });
- }
-
- private void HideMatchFound(bool topmost = false)
- {
- Dispatcher.Invoke(() => {
- pBar.BeginAnimation(RangeBase.ValueProperty, null); // clear the animation
- Utils.Animation.FadeOut(this);
- mainWnd.Topmost = topmost;
-
- if (IsFound) mainWnd.Activate(); // Activate the window to fix topmost
-
- IsDecided = false;
- IsFound = false;
- pBar.Value = 0;
- });
- }
+ public MatchFoundPanel() => InitializeComponent();
}
}
diff --git a/LoL Assist/View/MessageBox.xaml b/LoL Assist/View/MessageBox.xaml
new file mode 100644
index 0000000..b8009f9
--- /dev/null
+++ b/LoL Assist/View/MessageBox.xaml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
diff --git a/LoL Assist/View/MessageBox.xaml.cs b/LoL Assist/View/MessageBox.xaml.cs
new file mode 100644
index 0000000..a27123f
--- /dev/null
+++ b/LoL Assist/View/MessageBox.xaml.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using LoL_Assist_WAPP.ViewModel;
+
+namespace LoL_Assist_WAPP.View
+{
+ ///
+ /// Interaction logic for MessageBox.xaml
+ ///
+ public partial class MessageBox : UserControl
+ {
+ public MessageBox()
+ {
+ InitializeComponent();
+ }
+
+ private async void msgBox_Loaded(object sender, RoutedEventArgs e)
+ {
+ await Task.Delay(2);
+ var data = ((MessageBoxViewModel)DataContext);
+ MsgBox exitMsg = new MsgBox(data.message, data.width, data.height);
+ exitMsg.Opacity = 0;
+ exitMsg.Visibility = Visibility.Collapsed;
+ MsgContainer.Children.Add(exitMsg);
+ exitMsg.Decided += delegate (bool result)
+ {
+ if (result) data.action.Invoke();
+ Utils.Animation.FadeOut(this);
+ };
+ Utils.Animation.FadeIn(exitMsg);
+ }
+ }
+}
diff --git a/LoL Assist/View/MsgBox.xaml b/LoL Assist/View/MsgBox.xaml
index 4949bfa..15f134c 100644
--- a/LoL Assist/View/MsgBox.xaml
+++ b/LoL Assist/View/MsgBox.xaml
@@ -8,16 +8,18 @@
Width="250" Height="160">
-
+
-
+
-
+
+
Decided?.Invoke(false);
private void YesBtn_Click(object sender, RoutedEventArgs e) => Decided?.Invoke(true);
- private void CloseBtn_Clicked(object sender, MouseButtonEventArgs e) => Decided?.Invoke(false);
-
- //private void Close()
- //{
- // Utils.Animation.FadeOut(backDrop, 0.13);
- // Utils.Animation.Margin(this, ConfigModel.marginOpen, new Thickness(0, 330, 0, 0), 0.13);
- //}
+ private void CancelBtn_Click(object sender, RoutedEventArgs e) => Decided?.Invoke(false);
}
}
diff --git a/LoL Assist/View/PatchNotesPanel.xaml b/LoL Assist/View/PatchNotesPanel.xaml
index dcf2631..47e8c3b 100644
--- a/LoL Assist/View/PatchNotesPanel.xaml
+++ b/LoL Assist/View/PatchNotesPanel.xaml
@@ -5,67 +5,80 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:LoL_Assist_WAPP.View"
xmlns:viewModel="clr-namespace:LoL_Assist_WAPP.ViewModel"
- mc:Ignorable="d"
- d:DesignHeight="230" d:DesignWidth="260" MaxHeight="230" MaxWidth="260">
-
-
-
+ mc:Ignorable="d" x:Name="patchNotes">
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
Full Change Log
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
diff --git a/LoL Assist/View/PatchNotesPanel.xaml.cs b/LoL Assist/View/PatchNotesPanel.xaml.cs
index ac5762d..3c9a163 100644
--- a/LoL Assist/View/PatchNotesPanel.xaml.cs
+++ b/LoL Assist/View/PatchNotesPanel.xaml.cs
@@ -22,34 +22,6 @@ namespace LoL_Assist_WAPP.View
///
public partial class PatchNotesPanel : UserControl
{
- private readonly Border backDrop = new Border();
- public PatchNotesPanel(Border border)
- {
- InitializeComponent();
- backDrop = border;
- Visibility = Visibility.Collapsed;
- Opacity = 0;
-
- if (!ConfigModel.config.DoNotShowPatch)
- Open();
- }
-
- private void CloseBtn_Clicked(object sender, MouseButtonEventArgs e) => Close();
- private void CloseButton_Click(object sender, RoutedEventArgs e) => Close();
-
- void Close()
- {
- Utils.Animation.FadeOut(backDrop);
- Utils.Animation.FadeOut(this);
- }
-
- async void Open()
- {
- await Task.Delay(550);
- Utils.Animation.FadeIn(backDrop);
- Utils.Animation.FadeIn(this, 0.5);
- }
-
- private void GithubLink_RequestNavigate(object sender, RequestNavigateEventArgs e) => Process.Start(e.Uri.ToString());
+ public PatchNotesPanel() => InitializeComponent();
}
}
diff --git a/LoL Assist/View/RoleSelectPanel.xaml b/LoL Assist/View/RoleSelectPanel.xaml
new file mode 100644
index 0000000..2c9f4be
--- /dev/null
+++ b/LoL Assist/View/RoleSelectPanel.xaml
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LoL Assist/View/RoleSelectPanel.xaml.cs b/LoL Assist/View/RoleSelectPanel.xaml.cs
new file mode 100644
index 0000000..d980052
--- /dev/null
+++ b/LoL Assist/View/RoleSelectPanel.xaml.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace LoL_Assist_WAPP.View
+{
+ ///
+ /// Interaction logic for RoleSelectPanel.xaml
+ ///
+ public partial class RoleSelectPanel : UserControl
+ {
+ public RoleSelectPanel()
+ {
+ InitializeComponent();
+ }
+
+ private void Role_Click(object sender, RoutedEventArgs e) => Utils.Animation.FadeOut(this);
+ }
+}
diff --git a/LoL Assist/ViewModel/BuildEditorViewModel.cs b/LoL Assist/ViewModel/BuildEditorViewModel.cs
index 71dafef..f11b67b 100644
--- a/LoL Assist/ViewModel/BuildEditorViewModel.cs
+++ b/LoL Assist/ViewModel/BuildEditorViewModel.cs
@@ -36,12 +36,12 @@ private void SetAsDefaultExecute()
{
try
{
- if (!SelectedBuildName.Equals(CreateNewKey))
+ if (!SelectedBuildName.Equals(_CreateNewKey))
{
var gameMode = gm();
- defaultBuildConfig.setDefaultConfig(gameMode, SelectedBuildName);
- writeDefaultBuildConfig(SelectedChampionId, defaultBuildConfig);
- SlDefaultConfig = defaultBuildConfig.getDefaultConfig(gameMode);
+ _DefaultBuildConfig.setDefaultConfig(gameMode, SelectedBuildName);
+ writeDefaultBuildConfig(_SelectedChampionId, _DefaultBuildConfig);
+ SlDefaultConfig = _DefaultBuildConfig.getDefaultConfig(gameMode);
}
}
catch { /*ex*/ }
@@ -49,29 +49,29 @@ private void SetAsDefaultExecute()
public void DeleteConfigExecute()
{
- if(SelectedBuildName != null && !SelectedBuildName.Equals(CreateNewKey))
+ if(SelectedBuildName != null && !SelectedBuildName.Equals(_CreateNewKey))
{
var buildName = SelectedBuildName;
SelectedBuildName = null;
var gameMode = gm();
var _buildsName = new List();
- _buildsName.Add(CreateNewKey);
+ _buildsName.Add(_CreateNewKey);
- Main.localBuild.DeleteData(SelectedChampionId, Path.GetFileNameWithoutExtension(buildName), gameMode);
- foreach (var path in Main.localBuild.GetBuildFiles(SelectedChampionId, gameMode))
+ Main.localBuild.DeleteData(_SelectedChampionId, Path.GetFileNameWithoutExtension(buildName), gameMode);
+ foreach (var path in Main.localBuild.GetBuildFiles(_SelectedChampionId, gameMode))
_buildsName.Add(Path.GetFileName(path));
BuildsName = _buildsName;
- var customBuildPath = Main.localBuild.BuildsFolder(SelectedChampionId, gameMode);
- var fullPath = $"{customBuildPath}\\{defaultBuildConfig.getDefaultConfig(gameMode)}";
+ var customBuildPath = Main.localBuild.BuildsFolder(_SelectedChampionId, gameMode);
+ var fullPath = $"{customBuildPath}\\{_DefaultBuildConfig.getDefaultConfig(gameMode)}";
if (!File.Exists(fullPath))
- defaultBuildConfig.resetDefaultConfig(gameMode);
+ _DefaultBuildConfig.resetDefaultConfig(gameMode);
- writeDefaultBuildConfig(SelectedChampionId, defaultBuildConfig);
- SlDefaultConfig = defaultBuildConfig.getDefaultConfig(gameMode);
+ writeDefaultBuildConfig(_SelectedChampionId, _DefaultBuildConfig);
+ SlDefaultConfig = _DefaultBuildConfig.getDefaultConfig(gameMode);
}
}
@@ -80,9 +80,9 @@ private void ClearDefaultSourceExecute()
if (SelectedChampion != null && SelectedGameMode != null)
{
var gameMode = gm();
- defaultBuildConfig.resetDefaultConfig(gameMode);
- writeDefaultBuildConfig(SelectedChampionId, defaultBuildConfig);
- SlDefaultConfig = defaultBuildConfig.getDefaultConfig(gameMode);
+ _DefaultBuildConfig.resetDefaultConfig(gameMode);
+ writeDefaultBuildConfig(_SelectedChampionId, _DefaultBuildConfig);
+ SlDefaultConfig = _DefaultBuildConfig.getDefaultConfig(gameMode);
}
}
@@ -91,21 +91,21 @@ private async void SaveConfigExecute()
if(!string.IsNullOrEmpty(FileName) && SelectedChampion != null && SelectedGameMode != null)
{
var sGM = gm();
- var filePath = Main.localBuild.DataPath(SelectedChampionId, FileName, sGM);
+ var filePath = Main.localBuild.DataPath(_SelectedChampionId, FileName, sGM);
if (File.Exists(filePath))
File.Create(filePath).Dispose();
using(var streaWriter = new StreamWriter(filePath))
{
- var json = JsonConvert.SerializeObject(SelectedBuild, Formatting.Indented);
+ var json = JsonConvert.SerializeObject(_SelectedBuild, Formatting.Indented);
streaWriter.Write(json);
- ReferenceBuild = json;
+ _ReferenceBuild = json;
}
var _buildsName = new List();
- _buildsName.Add(CreateNewKey);
- foreach (var path in Main.localBuild.GetBuildFiles(SelectedChampionId, sGM))
+ _buildsName.Add(_CreateNewKey);
+ foreach (var path in Main.localBuild.GetBuildFiles(_SelectedChampionId, sGM))
_buildsName.Add(Path.GetFileName(path));
BuildsName = _buildsName;
@@ -259,7 +259,7 @@ public ItemImageModel SelectedSpell1
selectedSpell1 = value;
SelectedSpell2 = RemoveDup(SelectedSpell1, SelectedSpell2);
if(value != null)
- SelectedBuild.spell.Spell0 = Dictionaries.SpellNameToSpellID[value.Text];
+ _SelectedBuild.spell.Spell0 = Dictionaries.SpellNameToSpellID[value.Text];
OnPropertyChanged(nameof(SelectedSpell1));
IsChanged();
@@ -278,7 +278,7 @@ public ItemImageModel SelectedSpell2
selectedSpell2 = value;
SelectedSpell1 = RemoveDup(SelectedSpell2, SelectedSpell1);
if(value != null)
- SelectedBuild.spell.Spell1 = Dictionaries.SpellNameToSpellID[value.Text];
+ _SelectedBuild.spell.Spell1 = Dictionaries.SpellNameToSpellID[value.Text];
OnPropertyChanged(nameof(SelectedSpell2));
IsChanged();
@@ -299,7 +299,7 @@ public string RuneName
runeName = value;
if(value != null)
- SelectedBuild.rune.Name = value;
+ _SelectedBuild.rune.Name = value;
OnPropertyChanged(nameof(RuneName));
IsChanged();
@@ -332,7 +332,7 @@ public ItemImageModel SelectedPath1
selectedPath1 = value;
SelectedPath2 = RemoveDup(SelectedPath1, SelectedPath2);
if(value != null)
- SelectedBuild.rune.Path0 = DataConverter.PathNameToId(value.Text);
+ _SelectedBuild.rune.Path0 = DataConverter.PathNameToId(value.Text);
OnPropertyChanged(nameof(SelectedPath1));
Path1_Changed();
@@ -341,16 +341,16 @@ public ItemImageModel SelectedPath1
}
}
- public ObservableCollection keystoneList = new ObservableCollection();
- public ObservableCollection KeystoneList
+ public ObservableCollection keystones = new ObservableCollection();
+ public ObservableCollection Keystones
{
- get => keystoneList;
+ get => keystones;
set
{
- if (keystoneList != value)
+ if (keystones != value)
{
- keystoneList = value;
- OnPropertyChanged(nameof(KeystoneList));
+ keystones = value;
+ OnPropertyChanged(nameof(Keystones));
}
}
}
@@ -365,7 +365,7 @@ public ItemImageModel SelectedKeystone
{
selectedKeystone = value;
if(value != null)
- SelectedBuild.rune.Keystone = DataConverter.PerkNameToId(value.Text);
+ _SelectedBuild.rune.Keystone = DataConverter.PerkNameToId(value.Text);
OnPropertyChanged(nameof(SelectedKeystone));
IsChanged();
@@ -397,7 +397,7 @@ public ItemImageModel SelectedPerk1
{
selectedPerk1 = value;
if(value!=null)
- SelectedBuild.rune.Slot1 = DataConverter.PerkNameToId(value.Text);
+ _SelectedBuild.rune.Slot1 = DataConverter.PerkNameToId(value.Text);
OnPropertyChanged(nameof(SelectedPerk1));
IsChanged();
@@ -429,7 +429,7 @@ public ItemImageModel SelectedPerk2
{
selectedPerk2 = value;
if(value != null)
- SelectedBuild.rune.Slot2 = DataConverter.PerkNameToId(value.Text);
+ _SelectedBuild.rune.Slot2 = DataConverter.PerkNameToId(value.Text);
OnPropertyChanged(nameof(SelectedPerk2));
IsChanged();
@@ -461,7 +461,7 @@ public ItemImageModel SelectedPerk3
{
selectedPerk3 = value;
if(value!=null)
- SelectedBuild.rune.Slot3 = DataConverter.PerkNameToId(value.Text);
+ _SelectedBuild.rune.Slot3 = DataConverter.PerkNameToId(value.Text);
OnPropertyChanged(nameof(SelectedPerk3));
IsChanged();
@@ -479,7 +479,7 @@ public ItemImageModel SelectedPath2
{
selectedPath2 = value;
if(value != null)
- SelectedBuild.rune.Path1 = DataConverter.PathNameToId(value.Text);
+ _SelectedBuild.rune.Path1 = DataConverter.PathNameToId(value.Text);
SelectedPath1 = RemoveDup(SelectedPath2, SelectedPath1);
OnPropertyChanged(nameof(SelectedPath2));
@@ -513,7 +513,7 @@ public ItemImageModel SelectedPerk4
{
selectedPerk4 = value;
if(value!=null)
- SelectedBuild.rune.Slot4 = DataConverter.PerkNameToId(value.Text);
+ _SelectedBuild.rune.Slot4 = DataConverter.PerkNameToId(value.Text);
SelectedPerk5 = RemoveDup(value, SelectedPerk5);
OnPropertyChanged(nameof(SelectedPerk4));
@@ -547,7 +547,7 @@ public ItemImageModel SelectedPerk5
{
selectedPerk5 = value;
if(value != null)
- SelectedBuild.rune.Slot5 = DataConverter.PerkNameToId(value.Text);
+ _SelectedBuild.rune.Slot5 = DataConverter.PerkNameToId(value.Text);
SelectedPerk4 = RemoveDup(value, SelectedPerk4);
OnPropertyChanged(nameof(SelectedPerk5));
@@ -580,7 +580,7 @@ public ItemImageModel SelectedOffense
{
selectedOffense = value;
if (value != null)
- SelectedBuild.rune.Shard0 = Dictionaries.ShardDescToShardId[value.Text];
+ _SelectedBuild.rune.Shard0 = Dictionaries.ShardDescToShardId[value.Text];
SelectedPerk4 = RemoveDup(SelectedOffense, SelectedPerk4);
OnPropertyChanged(nameof(SelectedOffense));
@@ -613,7 +613,7 @@ public ItemImageModel SelectedFlex
{
selectedFlex = value;
if (value != null)
- SelectedBuild.rune.Shard1 = Dictionaries.ShardDescToShardId[value.Text];
+ _SelectedBuild.rune.Shard1 = Dictionaries.ShardDescToShardId[value.Text];
SelectedPerk4 = RemoveDup(SelectedFlex, SelectedPerk4);
OnPropertyChanged(nameof(SelectedFlex));
@@ -646,7 +646,7 @@ public ItemImageModel SelectedDefense
{
selectedDefense = value;
if (value != null)
- SelectedBuild.rune.Shard2 = Dictionaries.ShardDescToShardId[value.Text];
+ _SelectedBuild.rune.Shard2 = Dictionaries.ShardDescToShardId[value.Text];
SelectedPerk4 = RemoveDup(SelectedDefense, SelectedPerk4);
OnPropertyChanged(nameof(SelectedDefense));
@@ -744,20 +744,20 @@ public string SaveInfo
#endregion
- private string ReferenceBuild;
- private string SelectedChampionId;
- public DefaultBuildConfig defaultBuildConfig;
- private const string CreateNewKey = "Create New*";
- private ChampionBD SelectedBuild = new ChampionBD();
- private Dictionary SecondPath = new Dictionary();
+ private string _ReferenceBuild;
+ private string _SelectedChampionId;
+ public DefaultBuildConfig _DefaultBuildConfig;
+ private const string _CreateNewKey = "Create New*";
+ private ChampionBD _SelectedBuild = new ChampionBD();
+ private Dictionary _SecondPath = new Dictionary();
public BuildEditorViewModel()
{
Init();
PathModel.Init();
- SaveCommand = new Command(action => { SaveConfigExecute(); });
- SetAsDefaultCommand = new Command(action => { SetAsDefaultExecute(); });
- ClearDefaultSourceCommand = new Command(action => { ClearDefaultSourceExecute(); });
+ SaveCommand = new Command(o => { SaveConfigExecute(); });
+ SetAsDefaultCommand = new Command(o => { SetAsDefaultExecute(); });
+ ClearDefaultSourceCommand = new Command(o => { ClearDefaultSourceExecute(); });
}
public async void Init()
@@ -801,24 +801,24 @@ private async void Data_Changed()
saveInfo = null;
var gameMode = gm();
- _buildsName.Add(CreateNewKey);
- SelectedChampionId = DataConverter.ChampionNameToId(SelectedChampion);
+ _buildsName.Add(_CreateNewKey);
+ _SelectedChampionId = DataConverter.ChampionNameToId(SelectedChampion);
// Load in default build config
- defaultBuildConfig = new DefaultBuildConfig();
+ _DefaultBuildConfig = new DefaultBuildConfig();
- if (File.Exists(defConfigPath(SelectedChampionId))) defaultBuildConfig = getDefaultBuildConfig(SelectedChampionId);
+ if (File.Exists(defConfigPath(_SelectedChampionId))) _DefaultBuildConfig = getDefaultBuildConfig(_SelectedChampionId);
- var customBuildPath = Main.localBuild.BuildsFolder(SelectedChampionId, gameMode);
- var fullPath = $"{customBuildPath}\\{defaultBuildConfig.getDefaultConfig(gameMode)}";
+ var customBuildPath = Main.localBuild.BuildsFolder(_SelectedChampionId, gameMode);
+ var fullPath = $"{customBuildPath}\\{_DefaultBuildConfig.getDefaultConfig(gameMode)}";
if(!File.Exists(fullPath))
- defaultBuildConfig.resetDefaultConfig(gameMode);
+ _DefaultBuildConfig.resetDefaultConfig(gameMode);
- SlDefaultConfig = defaultBuildConfig.getDefaultConfig(gameMode);
+ SlDefaultConfig = _DefaultBuildConfig.getDefaultConfig(gameMode);
await Task.Run(() => {
- foreach (var path in Main.localBuild.GetBuildFiles(SelectedChampionId, gameMode))
+ foreach (var path in Main.localBuild.GetBuildFiles(_SelectedChampionId, gameMode))
_buildsName.Add(Path.GetFileName(path));
foreach (var spell in Dictionaries.SpellNameToSpellKey)
@@ -838,7 +838,7 @@ await Task.Run(() => {
else
{
SelectedGameMode = null;
- SelectedBuild = null;
+ _SelectedBuild = null;
BuildsName = null;
saveInfo = null;
ClearSmallInfo();
@@ -848,11 +848,11 @@ await Task.Run(() => {
public async void FetchBuild()
{
if(!string.IsNullOrEmpty(SelectedBuildName)
- && !SelectedBuildName.Equals(CreateNewKey))
+ && !SelectedBuildName.Equals(_CreateNewKey))
{
saveInfo = null;
await Task.Run(() => {
- foreach (var path in Main.localBuild.GetBuildFiles(SelectedChampionId, gm()))
+ foreach (var path in Main.localBuild.GetBuildFiles(_SelectedChampionId, gm()))
{
if (Path.GetFileName(path) == SelectedBuildName)
{
@@ -862,9 +862,9 @@ await Task.Run(() => {
{
var jsonContent = sr.ReadToEnd();
FileName = Path.GetFileNameWithoutExtension(path);
- SelectedBuild = JsonConvert.DeserializeObject(jsonContent);
- ReferenceBuild = jsonContent;
- LoadBuild(SelectedBuild);
+ _SelectedBuild = JsonConvert.DeserializeObject(jsonContent);
+ _ReferenceBuild = jsonContent;
+ LoadBuild(_SelectedBuild);
}
}
catch { }
@@ -874,7 +874,7 @@ await Task.Run(() => {
});
}
else if(!string.IsNullOrEmpty(SelectedBuildName)
- && SelectedBuildName.Equals(CreateNewKey)) {
+ && SelectedBuildName.Equals(_CreateNewKey)) {
ClearProfile();
saveInfo = "New* Unsaved";
}
@@ -886,7 +886,7 @@ private void Path1_Changed()
Perk1List = new ObservableCollection();
Perk2List = new ObservableCollection();
Perk3List = new ObservableCollection();
- KeystoneList = new ObservableCollection();
+ Keystones = new ObservableCollection();
if (SelectedPath1 != null)
{
@@ -908,7 +908,7 @@ private void Path1_Changed()
switch (i)
{
case 0:
- KeystoneList.Add(model);
+ Keystones.Add(model);
break;
case 1:
Perk1List.Add(model);
@@ -932,11 +932,12 @@ private void Path1_Changed()
private void Path2_Changed()
{
Perk5List = new ObservableCollection();
+ Perk4List = new ObservableCollection();
var _perk4list = new ObservableCollection();
if (SelectedPath2 != null)
{
- secondSlot = SecondPath[SelectedPath2.Text];
+ secondSlot = _SecondPath[SelectedPath2.Text];
foreach (var perk in secondSlot)
{
if(!string.IsNullOrEmpty(perk))
@@ -1005,7 +1006,7 @@ private void LoadBuild(ChampionBD championBuild)
{
RuneName = championBuild.rune.Name;
SelectedPath1 = PathList.SingleOrDefault(p => p.Text == DataConverter.PathIdToName(championBuild.rune.Path0));
- SelectedKeystone = KeystoneList.SingleOrDefault(k => k.Text == DataConverter.PerkIdToName(championBuild.rune.Keystone));
+ SelectedKeystone = Keystones.SingleOrDefault(k => k.Text == DataConverter.PerkIdToName(championBuild.rune.Keystone));
SelectedPerk1 = Perk1List.SingleOrDefault(p => p.Text == DataConverter.PerkIdToName(championBuild.rune.Slot1));
SelectedPerk2 = Perk2List.SingleOrDefault(p => p.Text == DataConverter.PerkIdToName(championBuild.rune.Slot2));
SelectedPerk3 = Perk3List.SingleOrDefault(p => p.Text == DataConverter.PerkIdToName(championBuild.rune.Slot3));
@@ -1029,15 +1030,15 @@ private void LoadBuild(ChampionBD championBuild)
private void IsChanged()
{
- var sBuild = JsonConvert.SerializeObject(SelectedBuild, Formatting.Indented);
+ var sBuild = JsonConvert.SerializeObject(_SelectedBuild, Formatting.Indented);
if(SelectedGameMode != null && SelectedBuildName != null)
{
- if ((!sBuild.Equals(ReferenceBuild) ||
+ if ((!sBuild.Equals(_ReferenceBuild) ||
!Path.GetFileNameWithoutExtension(SelectedBuildName).Equals(FileName))
- && !SelectedBuildName.Equals(CreateNewKey))
+ && !SelectedBuildName.Equals(_CreateNewKey))
saveInfo = "*Unsaved";
- else if (SelectedBuildName.Equals(CreateNewKey))
+ else if (SelectedBuildName.Equals(_CreateNewKey))
saveInfo = "New* Unsaved";
else saveInfo = null;
}
@@ -1045,11 +1046,11 @@ private void IsChanged()
private void InitSecondPath()
{
- SecondPath.Add("Domination", PathModel.Domination);
- SecondPath.Add("Sorcery", PathModel.Sorcery);
- SecondPath.Add("Precision", PathModel.Precision);
- SecondPath.Add("Inspiration", PathModel.Inspiration);
- SecondPath.Add("Resolve", PathModel.Resolve);
+ _SecondPath.Add("Domination", PathModel.Domination);
+ _SecondPath.Add("Sorcery", PathModel.Sorcery);
+ _SecondPath.Add("Precision", PathModel.Precision);
+ _SecondPath.Add("Inspiration", PathModel.Inspiration);
+ _SecondPath.Add("Resolve", PathModel.Resolve);
}
private void InitShards()
@@ -1084,7 +1085,7 @@ public string RemoveDup(string s1, string s2)
{
if (s1 == s2)
return null;
- else return s2;
+ return s2;
}
else return s2;
}
@@ -1095,7 +1096,7 @@ public ItemImageModel RemoveDup(ItemImageModel s1, ItemImageModel s2)
{
if (s1.Text == s2.Text)
return null;
- else return s2;
+ return s2;
}
else return s2;
}
@@ -1110,8 +1111,8 @@ public void ClearSmallInfo()
public void ClearProfile()
{
SelectedBuildName = null;
- ReferenceBuild = null;
- SelectedBuild = new ChampionBD();
+ _ReferenceBuild = null;
+ _SelectedBuild = new ChampionBD();
FileName = null;
RuneName = null;
SelectedSpell1 = null;
diff --git a/LoL Assist/ViewModel/ConfigViewModel.cs b/LoL Assist/ViewModel/ConfigViewModel.cs
index 3cbb5f2..ddeb840 100644
--- a/LoL Assist/ViewModel/ConfigViewModel.cs
+++ b/LoL Assist/ViewModel/ConfigViewModel.cs
@@ -116,8 +116,8 @@ public bool LowSpecMode
ConfigModel.config.LowSpecMode = value;
if (ConfigModel.config.LowSpecMode)
- ConfigModel.config.MonitoringDelay = 550;
- else ConfigModel.config.MonitoringDelay = 300;
+ ConfigModel.config.MonitoringDelay = 300;
+ else ConfigModel.config.MonitoringDelay = 250;
OnPropertyChanged(nameof(LowSpecMode));
}
@@ -207,18 +207,14 @@ public bool UpdateOnStartup
public ConfigViewModel()
{
- //themeList.Add("Default");
- //themeList.Add("League of Legends");
Update();
-
ShowFolderInExCommand = new Command(action => ShowFolderExecute());
}
private void ShowFolderExecute()
{
var path = Global.libraryFolder;
- if(Directory.Exists(path))
- Process.Start(path);
+ if(Directory.Exists(path)) Process.Start(path);
}
public void Update()
@@ -237,21 +233,6 @@ public void Update()
BuildCache = ConfigModel.config.BuildCache;
Global.Config.caching = BuildCache;
UpdateOnStartup = ConfigModel.config.UpdateOnStartup;
-
- //bool isThemeFound = false;
- //foreach (var item in themeList)
- //{
- // if (ConfigModel.config.Theme.Equals(item))
- // {
- // isThemeFound = true;
- // break;
- // }
- //}
-
- //if(isThemeFound)
- // SelectedTheme = ConfigModel.config.Theme;
-
- //Utils.SwitchTheme(ConfigModel.config.Theme);
}
#region Space junk
public event PropertyChangedEventHandler PropertyChanged;
diff --git a/LoL Assist/ViewModel/MainViewModel.cs b/LoL Assist/ViewModel/MainViewModel.cs
index 57deca0..c1be6a7 100644
--- a/LoL Assist/ViewModel/MainViewModel.cs
+++ b/LoL Assist/ViewModel/MainViewModel.cs
@@ -26,11 +26,38 @@ namespace LoL_Assist_WAPP.ViewModel
{
public class MainViewModel : INotifyPropertyChanged
{
- private const string disconnected = "Disconnected";
+ private const string _disconnected = "Disconnected";
#region Miscellaneous
+
+ #region Commands
public ICommand DebugCommand { get; }
public ICommand ManualImportCommand { get; }
+ #region Window Commands
+ public ICommand MoveWindowCommand { get; }
+ public ICommand ShutdownAppCommand { get; }
+ public ICommand MinimizeWindowCommand { get; }
+ public ICommand ShowBuildEditorWindowCommand { get; }
+
+ private bool topmost;
+ public bool Topmost
+ {
+ get => topmost;
+ set
+ {
+ if (topmost != value)
+ {
+ topmost = value;
+ OnPropertyChanged(nameof(Topmost));
+ Application.Current.Dispatcher.Invoke(() => {
+ Application.Current.MainWindow.Activate(); // Fix for topmost issue
+ });
+ }
+ }
+ }
+ #endregion
+ #endregion
+
private Visibility manualImportVisibility = Visibility.Collapsed;
public Visibility ManualImportVisibility
{
@@ -45,18 +72,15 @@ public Visibility ManualImportVisibility
}
}
- private SolidColorBrush connectionStatusForeground;
-
- public SolidColorBrush ConnectionStatusForeground
+ private object topMostContent = null;
+ public object TopMostContent
{
- get => connectionStatusForeground;
+ get => topMostContent;
set
{
- if (connectionStatusForeground != value)
- {
- connectionStatusForeground = value;
- OnPropertyChanged(nameof(ConnectionStatusForeground));
- }
+ Console.WriteLine("Content set: " + value);
+ topMostContent = value;
+ OnPropertyChanged(nameof(TopMostContent));
}
}
@@ -90,11 +114,54 @@ public string ChampionName
}
}
}
+
+ private List roles;
+ public List Roles
+ {
+ get => roles;
+ set
+ {
+ if (roles != value)
+ {
+ roles = value;
+ OnPropertyChanged(nameof(Roles));
+ }
+ }
+ }
+
+ private ItemImageModel selectedRole;
+ public ItemImageModel SelectedRole
+ {
+ get => selectedRole;
+ set
+ {
+ if (selectedRole != value)
+ {
+ ReImport();
+ selectedRole = value;
+ OnPropertyChanged(nameof(SelectedRole));
+ }
+ }
+ }
+
+ private Visibility roleSelectVisibility = Visibility.Collapsed;
+ public Visibility RoleSelectVisibility
+ {
+ get => roleSelectVisibility;
+ set
+ {
+ if (roleSelectVisibility != value)
+ {
+ roleSelectVisibility = value;
+ OnPropertyChanged(nameof(RoleSelectVisibility));
+ }
+ }
+ }
#endregion
#region Status
- private string gMode;
- public string GMode
+ private GameMode gMode;
+ public GameMode GMode
{
get => gMode;
set
@@ -121,7 +188,21 @@ public string WorkingStatus
}
}
- private string connectionStatus = disconnected;
+ private Visibility workingStatusVisibility;
+ public Visibility WorkingStatusVisibility
+ {
+ get => workingStatusVisibility;
+ set
+ {
+ if (workingStatusVisibility != value)
+ {
+ workingStatusVisibility = value;
+ OnPropertyChanged(nameof(WorkingStatusVisibility));
+ }
+ }
+ }
+
+ private string connectionStatus = _disconnected;
public string ConnectionStatus
{
get => connectionStatus;
@@ -184,6 +265,19 @@ public Visibility WarningGridVisibility
}
}
+ private Visibility championContainerVisibility = Visibility.Collapsed;
+ public Visibility ChampionContainerVisibility
+ {
+ get => championContainerVisibility;
+ set
+ {
+ if (championContainerVisibility != value)
+ {
+ championContainerVisibility = value;
+ OnPropertyChanged(nameof(ChampionContainerVisibility));
+ }
+ }
+ }
private string warningCount;
public string WarningCount
@@ -203,33 +297,58 @@ public string WarningCount
}
#endregion
- private bool IsBusy = false;
- private bool IsLoLMonitoringPuased = false;
- private const string ProccName = "LeagueClient";
- private GameMode CurrentGameMode = GameMode.NONE;
- private Task CurrentChampionBuild = null;
- private StringBuilder Warnings = new StringBuilder();
- private string CurrentTime
+ private bool _IsBusy = false;
+ private bool _IsLoLMonitoringPuased = false;
+ private const string _ProccName = "LeagueClient";
+ private GameMode _CurrentGameMode = GameMode.NONE;
+ private Task _CurrentChampionBuild = null;
+ private StringBuilder _Warnings = new StringBuilder();
+ private string GetCurrentTime
{
get { return $"[{DateTime.Now:hh:mm:ss}]"; }
}
public MainViewModel()
{
- GMode = $"Game Mode: {CurrentGameMode}";
- DebugCommand = new Command(async action => { await DebugExecute(); });
- ManualImportCommand = new Command(ManualImportExecute);
- InitLoLA();
- }
+ InitTrayIcon();
+ GMode = _CurrentGameMode;
+ ManualImportCommand = new Command(o => { ReImport(); });
+ DebugCommand = new Command(async o => { await DebugExecute(); });
- private async void InitLoLA()
- {
- LogService.Clear();
+ ShutdownAppCommand = new Command(o => { ShutdownAppExecute(); });
+ ShowBuildEditorWindowCommand = new Command(o => { ShowBuildEditorWindow(); });
+ MoveWindowCommand = new Command(o => { Application.Current.MainWindow.DragMove(); });
+ MinimizeWindowCommand = new Command(o => { Application.Current.MainWindow.WindowState = WindowState.Minimized; });
+
+ WorkingStatus = $"Clearing old logs...";
+ LogService.Clear(); // remove old log file(LoLA.log)
WorkingStatus = "Loading in configuration...";
ConfigModel.LoadConfig();
+
+ ShowPatchNotes(ConfigModel.config.DoNotShowPatch);
+
+ Roles = new List() { // Roles XD
+ new ItemImageModel(){Text = "Default", Image="pack://application:,,,/Resources/Fill.png"},
+ new ItemImageModel(){Text = "Top", Image="pack://application:,,,/Resources/Top.png"},
+ new ItemImageModel(){Text = "Jungle", Image="pack://application:,,,/Resources/Jungle.png"},
+ new ItemImageModel(){Text = "Mid", Image="pack://application:,,,/Resources/Mid.png"},
+ new ItemImageModel(){Text = "ADC", Image="pack://application:,,,/Resources/ADC.png"},
+ new ItemImageModel(){Text = "Support", Image="pack://application:,,,/Resources/Support.png"}};
+
+ InitLoLA();
+ }
- if(ConfigModel.config.UpdateOnStartup)
+ private void ShowBuildEditorWindow()
+ {
+ var window = new BuildEditorWindow();
+ window.Owner = Application.Current.MainWindow;
+ window.ShowDialog();
+ }
+
+ private async void InitLoLA()
+ {
+ if (ConfigModel.config.UpdateOnStartup)
{
WorkingStatus = "Checking for updates...";
await Update.Start();
@@ -249,28 +368,135 @@ private async void InitLoLA()
champMonitor.ChampionChanged += Champion_Changed;
champMonitor.MonitorDelay = ConfigModel.config.MonitoringDelay;
- IsLoLMonitoringPuased = true;
+ _IsLoLMonitoringPuased = true;
var lolMonitorThread = new Thread(LoLMonitor);
lolMonitorThread.Start();
phaseMonitor.PhaseChanged += Phase_Changed;
ResetStatus();
- await LCUWrapper.GetRunePagesAsync();
+ // await LCUWrapper.GetRunePagesAsync();
}
+ private async void ImportBuilds(string championName)
+ {
+ if (!string.IsNullOrEmpty(championName))
+ {
+ ClearChamp(false);
+
+ while (_IsBusy)
+ Thread.Sleep(ConfigModel.config.MonitoringDelay);
+
+ _IsBusy = true;
+ bool[] IsErr = { false, false };
+ Stopwatch sw = Stopwatch.StartNew();
+ ChampionName = championName;
+ try
+ {
+ if (ConfigModel.config.AutoRunes || ConfigModel.config.AutoSpells)
+ {
+ List tasks = new List();
+ string CurrentRole = string.Empty;
+
+ var gm = _CurrentGameMode;
+ var cBD = _CurrentChampionBuild;
+
+ if (gm.Equals(GameMode.CLASSIC) || gm.Equals(GameMode.PRACTICETOOL))
+ CurrentRole = SelectedRole.Text.Replace("Default", string.Empty).ToLower();
+
+ var CurrentChampionId = DataConverter.ChampionNameToId(championName);
+ SetImportStatus("Fetching Runes & Spells...");
+ sw.Start();
+
+ if (!ConfigModel.config.CustomRunesSpells)
+ tasks.Add(cBD = Main.RequestBuildsData(CurrentChampionId, gm, BuildsProvider.Metasrc, CurrentRole));
+ else
+ {
+ var buildName = GetLocalBuildName(CurrentChampionId, gm);
+
+ if (buildName == ConfigModel.DefaultSource)
+ tasks.Add(cBD = Main.RequestBuildsData(CurrentChampionId, gm, BuildsProvider.Metasrc, CurrentRole));
+ else
+ tasks.Add(cBD = Main.RequestBuildsData(CurrentChampionId, gm,
+ BuildsProvider.Local, Path.GetFileNameWithoutExtension(buildName)));
+ }
+
+ tasks.Add(Task.Run(() => ChampionImage = DataDragonWrapper.GetChampionImage(CurrentChampionId, Global.Config.dDragonPatch).Result));
+ Parallel.ForEach(tasks, task => { Task.Run(() => task).Wait(); });
+
+ SetImportStatus($"Importing {FixedName(ChampionName)} Runes & Spells...");
+
+ RuneObj RB = (await cBD)?.rune;
+ SpellObj SC = (await cBD)?.spell;
+
+ if (cBD != null)
+ {
+ var currentPerks = await LCUWrapper.GetCurrentRunePageAsync();
+ List ImportTasks = new List();
+ if (ConfigModel.config.AutoRunes)
+ ImportTasks.Add(SetRuneAsync(RB, currentPerks));
+
+ if (ConfigModel.config.AutoSpells)
+ ImportTasks.Add(ImportSpellsAsync(SC, gm));
+
+ int i = 0;
+ Parallel.ForEach(ImportTasks, async task => {
+ try { await task; IsErr[i] = false; }
+ catch { IsErr[i] = true; }
+ i++;
+ });
+ currentPerks = null;
+ }
+ }
+ }
+ catch
+ {
+ WarningStatus = $"{GetCurrentTime} Failed to import Runes & Spells.";
+ _Warnings.AppendLine($"{GetCurrentTime} Failed to import {FixedName(ChampionName)} Runes & Spells.");
+ SetImportStatus("Uh oh, LoL Assist failed to import Runes & Spells", LogType.EROR);
+ }
+ finally
+ {
+ sw.Stop();
+ if (IsErr[0])
+ _Warnings.AppendLine($"{GetCurrentTime} Failed to import {FixedName(ChampionName)} Runes.");
+ else if (IsErr[1])
+ _Warnings.AppendLine($"{GetCurrentTime} Failed to import {FixedName(ChampionName)} Spells.");
+ else if (IsErr[0] && IsErr[1])
+ SetImportStatus($"Uh Oh, something went wrong.\ntry deleting {FixedName(ChampionName)} data might fix the issue", LogType.EROR);
+ else
+ SetImportStatus($"Runes & Spells has been imported successfully! Elapsed [{sw.ElapsedMilliseconds}ms]");
+ WarningStatus = _Warnings.ToString().TrimEnd(Environment.NewLine.ToCharArray());
+ }
+ _IsBusy = false;
+ }
+ }
private async void Phase_Changed(object sender, PhaseMonitor.PhaseChangedArgs e)
{
- CurrentGameMode = await LCUWrapper.GetCurrentGameModeAsync();
+ Topmost = e.currentPhase == Phase.ChampSelect || e.currentPhase == Phase.ReadyCheck;
+ _CurrentGameMode = await LCUWrapper.GetCurrentGameModeAsync();
if (e.currentPhase != Phase.InProgress)
- GMode = $"Game Mode: {CurrentGameMode}";
+ {
+ GMode = _CurrentGameMode;
+ DispatcherInvoke(() => { // Needs to be invoke to fix delay issue
+ if (_CurrentGameMode == GameMode.CLASSIC
+ || _CurrentGameMode == GameMode.PRACTICETOOL)
+ {
+ SelectedRole = Roles[0];
+ RoleSelectVisibility = Visibility.Visible;
+ }
+ else RoleSelectVisibility = Visibility.Collapsed;
+ });
+ }
switch (e.currentPhase)
{
case Phase.ChampSelect:
- ImportStatus = "Selecting a champion...";
- ManualImportVisibility = Visibility.Visible;
+ DispatcherInvoke(() => {
+ ImportStatus = "Selecting a champion...";
+ ManualImportVisibility = Visibility.Visible;
+ });
break;
case Phase.None:
case Phase.Lobby:
@@ -282,12 +508,19 @@ private async void Phase_Changed(object sender, PhaseMonitor.PhaseChangedArgs e)
ConnectionStatus = await GetSummonerInfo();
break;
case Phase.InProgress:
- ImportStatus = "Game in progress...";
- ManualImportVisibility = Visibility.Collapsed;
+ DispatcherInvoke(() => {
+ ImportStatus = "Game in progress...";
+ ManualImportVisibility = Visibility.Collapsed;
+ });
break;
case Phase.Matchmaking:
- ClearChamp();
- ImportStatus = "Queueing...";
+ DispatcherInvoke(() => {
+ ClearChamp();
+ ImportStatus = "Queueing...";
+ });
+ break;
+ case Phase.ReadyCheck:
+ SetTopMostContent(new MatchFoundViewModel());
break;
}
//var page = await LCUWrapper.GetCurrentRunePageAsync();
@@ -296,28 +529,33 @@ private async void Phase_Changed(object sender, PhaseMonitor.PhaseChangedArgs e)
// Console.WriteLine(string.Format("ID: {0}", pIds));
}
- private void Champion_Changed(object sender, ChampionMonitor.ChampionChangedArgs e) => ImportBuilds(e.championName);
- private async void ManualImportExecute(object e) => ImportBuilds(await LCUWrapper.GetCurrentChampionAsyncV2());
+ private void DispatcherInvoke(Action action) => Application.Current.Dispatcher.Invoke(action);
+ #region LoL Checker
+ // Checks for LeagueClient process and get summoner info
public void LoLMonitor()
{
CheckLoL();
while (true)
{
- if (!IsLoLMonitoringPuased)
+ if (!_IsLoLMonitoringPuased)
{
- if (Process.GetProcessesByName(ProccName).Length == 0)
+ if (Process.GetProcessesByName(_ProccName).Length == 0)
{
- ConnectionStatus = disconnected;
- IsLoLMonitoringPuased = true;
+ DispatcherInvoke(() => {
+ WorkingStatusVisibility = Visibility.Visible;
+ ChampionContainerVisibility = Visibility.Collapsed;
+ });
+
+ ConnectionStatus = _disconnected;
+ _IsLoLMonitoringPuased = true;
CheckLoL();
}
}
Thread.Sleep(ConfigModel.config.MonitoringDelay * 2);
}
}
-
public async void CheckLoL()
{
string summonerInfo;
@@ -328,108 +566,123 @@ public async void CheckLoL()
Thread.Sleep(ConfigModel.config.MonitoringDelay * 2);
} while (string.IsNullOrEmpty(summonerInfo));
+ DispatcherInvoke(() => {
+ WorkingStatusVisibility = Visibility.Collapsed;
+ ChampionContainerVisibility = Visibility.Visible;
+ });
+
WorkingStatus = string.Empty;
ConnectionStatus = summonerInfo;
-
- IsLoLMonitoringPuased = false;
+ _IsLoLMonitoringPuased = false;
}
+ #endregion
- private async void ImportBuilds(string championName)
- {
- if (!string.IsNullOrEmpty(championName))
- {
- ClearChamp(false);
-
- while (IsBusy)
- Thread.Sleep(ConfigModel.config.MonitoringDelay);
-
- IsBusy = true;
- bool[] IsErr = { false, false };
- Stopwatch sw = Stopwatch.StartNew();
- try
- {
- if (ConfigModel.config.AutoRunes || ConfigModel.config.AutoSpells)
- {
- List tasks = new List();
-
- ChampionName = championName;
- var CurrentChampionId = DataConverter.ChampionNameToId(ChampionName);
-
- SetImportStatus("Fetching Runes & Spells...");
-
- sw.Start();
+ private void ShutdownAppExecute() => ShowMsgBox(new Action(() => { Application.Current.MainWindow.Close(); }),
+ msg: "Are you sure you want to exit LoL Assist?", width: 230, height: 150);
+ private void ShowPatchNotes(bool doNotShow) { if (!doNotShow) SetTopMostContent(new PatchViewModel()); }
+ private void Champion_Changed(object sender, ChampionMonitor.ChampionChangedArgs e) => ImportBuilds(e.championName);
+ private async void ReImport() => await Task.Run(async () => { ImportBuilds(await LCUWrapper.GetCurrentChampionAsyncV2()); });
- if(!ConfigModel.config.CustomRunesSpells)
- tasks.Add(CurrentChampionBuild = Main.RequestBuildsData(CurrentChampionId, CurrentGameMode, BuildsProvider.Metasrc));
- else
- {
- var buildName = GetLocalBuildName(CurrentChampionId, CurrentGameMode);
+ #region Tray Icon
+ private void InitTrayIcon()
+ {
+ string[] menus = new string[] { "Exit", "Show", "Patch Notes", "Minimize to Tray" };
+ var trayIcon = new System.Windows.Forms.NotifyIcon();
+ var menuList = new List();
+ var menuContainer = new System.Windows.Forms.ContextMenu();
- if (buildName == ConfigModel.DefaultSource)
- tasks.Add(CurrentChampionBuild = Main.RequestBuildsData(CurrentChampionId, CurrentGameMode, BuildsProvider.Metasrc));
- else
- tasks.Add(CurrentChampionBuild = Main.RequestBuildsData(CurrentChampionId, CurrentGameMode,
- BuildsProvider.Local, Path.GetFileNameWithoutExtension(buildName)));
- }
+ for (int i = 0; i < menus.Length; i++)
+ {
+ var item = new System.Windows.Forms.MenuItem() {
+ Index = i,
+ Text = menus[i]
+ };
- tasks.Add(Task.Run(() => ChampionImage = DataDragonWrapper.GetChampionImage(CurrentChampionId, Global.Config.dDragonPatch).Result));
- Parallel.ForEach(tasks, task => { Task.Run(() => task).Wait(); });
+ item.Click += new EventHandler(menuItem_Click);
+ menuList.Add(item);
+ }
- SetImportStatus($"Importing {FixedName(ChampionName)} Runes & Spells...");
+ menuContainer.MenuItems.AddRange(menuList.ToArray());
- RuneObj RB = (await CurrentChampionBuild)?.rune;
- SpellObj SC = (await CurrentChampionBuild)?.spell;
+ using(var stream = Application.GetResourceStream(new Uri("pack://application:,,,/icon.ico")).Stream)
+ {
+ trayIcon.Icon = new System.Drawing.Icon(stream);
+ }
- if (CurrentChampionBuild != null)
- {
- var currentPerks = await LCUWrapper.GetCurrentRunePageAsync();
- List ImportTasks = new List();
- if (ConfigModel.config.AutoRunes)
- ImportTasks.Add(SetRuneAsync(RB, currentPerks));
+ trayIcon.Visible = true;
+ trayIcon.ContextMenu = menuContainer;
+ trayIcon.DoubleClick += (o, args) => ShowMainWindow();
+ trayIcon.Text = $"LoL Assist v{ConfigModel.version}";
+
+ // Dispose tray icon on closed
+ Application.Current.MainWindow.Closed += (o, args) => {
+ trayIcon.Icon = null;
+ trayIcon.Dispose();
+ Environment.Exit(0);
+ };
+ }
- if (ConfigModel.config.AutoSpells)
- ImportTasks.Add(ImportSpellsAsync(SC, CurrentGameMode));
+ private void menuItem_Click(object sender, EventArgs e)
+ {
+ var menuItem = sender as System.Windows.Forms.MenuItem;
+ switch(menuItem.Text)
+ {
+ case "Exit":
+ Application.Current.MainWindow.Close();
+ break;
+ case "Show":
+ ShowMainWindow();
+ break;
+ case "Patch Notes":
+ ShowMainWindow();
+ ShowPatchNotes(false);
+ break;
+ case "Minimize to Tray":
+ Application.Current.MainWindow.ShowInTaskbar = false;
+ Application.Current.MainWindow.WindowState = WindowState.Minimized;
+ break;
+ }
+ }
- int i = 0;
- Parallel.ForEach(ImportTasks, async task => {
- try { await task; IsErr[i] = false; }
- catch { IsErr[i] = true; } i++;
- });
- currentPerks = null;
- }
- }
- }
- catch
- {
- WarningStatus = $"{CurrentTime} Failed to import Runes & Spells.";
- Warnings.AppendLine($"{CurrentTime} Failed to import {FixedName(ChampionName)} Runes & Spells.");
- SetImportStatus("Uh oh, LoL Assist failed to import Runes & Spells", LogType.EROR);
- }
- finally
- {
- sw.Stop();
- if (IsErr[0])
- Warnings.AppendLine($"{CurrentTime} Failed to import {FixedName(ChampionName)} Runes.");
- else if (IsErr[1])
- Warnings.AppendLine($"{CurrentTime} Failed to import {FixedName(ChampionName)} Spells.");
- else if (IsErr[0] && IsErr[1])
- SetImportStatus($"Uh Oh, something went wrong.\ntry deleting {FixedName(ChampionName)} data might fix the issue", LogType.EROR);
- else
- SetImportStatus($"Runes & Spells has been imported successfully! Elapsed [{sw.ElapsedMilliseconds}ms]");
+ private void ShowMainWindow()
+ {
+ Application.Current.MainWindow.Show();
+ Application.Current.MainWindow.ShowInTaskbar = true;
+ Application.Current.MainWindow.WindowState = WindowState.Normal;
- WarningStatus = Warnings.ToString().TrimEnd(Environment.NewLine.ToCharArray());
- }
- IsBusy = false;
- }
+ Application.Current.MainWindow.Activate();
}
+ #endregion
+ #region Debug D:
+ private int _debugI = 0;
public async Task DebugExecute()
{
- LogService.Log(LogService.Model("clicked", "Debug", LogType.DBUG));
- await Main.RequestBuildsData("Aatrox", GameMode.URF, BuildsProvider.Metasrc);
+ LogService.Log(LogService.Model($"--------------attempt-{_debugI}", "Debug", LogType.DBUG));
+ //* Debug Code *//
+ //await Main.RequestBuildsData("Aatrox", GameMode.URF, BuildsProvider.Metasrc);
+ Console.WriteLine(await LCUWrapper.GetCurrentSessionAsync());
+ _debugI++;
}
+ #endregion
#region Space junk
+ private async void SetTopMostContent(object obj)
+ {
+ TopMostContent = null;
+ await Task.Delay(1); // Fix
+ TopMostContent = obj;
+ }
+ private void ShowMsgBox(Action action, string msg, double width = 330, double height = 220)
+ {
+ SetTopMostContent(new MessageBoxViewModel()
+ {
+ message = msg,
+ width = width,
+ height = height,
+ action = () => { action.Invoke(); }
+ });
+ }
private async Task GetSummonerInfo()
{
var summonerInfo = await LCUWrapper.GetCurrentSummonerAsync();
@@ -441,13 +694,11 @@ private async Task GetSummonerInfo()
return $"Name: {summonerInfo?.displayName} | Lvl {summonerInfo?.summonerLevel}";
}
-
private void SetImportStatus(string msg, LogType logType = LogType.INFO)
{
- ImportStatus = msg;
+ DispatcherInvoke(() => { ImportStatus = msg; });
Log(msg, logType);
}
-
private void ClearChamp(bool hideManualImport = true)
{
ChampionImage = null;
@@ -456,7 +707,6 @@ private void ClearChamp(bool hideManualImport = true)
if (hideManualImport)
ManualImportVisibility = Visibility.Hidden;
}
-
private void ResetStatus()
{
ClearChamp();
diff --git a/LoL Assist/ViewModel/MatchFoundViewModel.cs b/LoL Assist/ViewModel/MatchFoundViewModel.cs
new file mode 100644
index 0000000..38afd0e
--- /dev/null
+++ b/LoL Assist/ViewModel/MatchFoundViewModel.cs
@@ -0,0 +1,162 @@
+using System.Windows.Controls;
+using System.Threading.Tasks;
+using LoL_Assist_WAPP.Model;
+using System.ComponentModel;
+using System.Windows.Input;
+using System.Threading;
+using LoLA.LCU.Events;
+using LoLA.LCU;
+using System;
+using System.Windows;
+
+namespace LoL_Assist_WAPP.ViewModel
+{
+ public class MatchFoundViewModel : INotifyPropertyChanged
+ {
+ #region Commands
+ public ICommand AcceptMatchCommand { get; }
+ public ICommand DeclineMatchCommand { get; }
+
+ private ICommand hideUserControlCommand;
+ public ICommand HideUserControlCommand
+ {
+ get
+ {
+ if (hideUserControlCommand == null)
+ {
+ hideUserControlCommand = new Command(p => HideUserControl(p));
+ }
+ return hideUserControlCommand;
+ }
+ }
+ #endregion
+
+ private string timeoutTimer;
+ public string TimeoutTimer
+ {
+ get => timeoutTimer;
+ set
+ {
+ if (timeoutTimer != value)
+ {
+ timeoutTimer = value;
+ OnPropertyChanged(nameof(TimeoutTimer));
+ }
+ }
+ }
+
+ private string acceptStatus = "Auto Accept in 5s";
+ public string AcceptStatus
+ {
+ get => acceptStatus;
+ set
+ {
+ if (acceptStatus != value)
+ {
+ acceptStatus = value;
+ OnPropertyChanged(nameof(AcceptStatus));
+ }
+ }
+ }
+
+ private double? timeoutValue;
+ public double? TimeoutValue
+ {
+ get => timeoutValue;
+ set
+ {
+ if (timeoutValue != value)
+ {
+ timeoutValue = value;
+ OnPropertyChanged(nameof(TimeoutValue));
+ }
+ }
+ }
+
+ private Visibility matchfoundVisibility;
+ public Visibility MatchfoundVisibility
+ {
+ get => matchfoundVisibility;
+ set
+ {
+ if (matchfoundVisibility != value)
+ {
+ matchfoundVisibility = value;
+ OnPropertyChanged(nameof(MatchfoundVisibility));
+ }
+ }
+ }
+
+ private readonly int _autoAcceptTimer = 5;
+ private bool _isMatchFound = false;
+ private bool _isDecided = false;
+ public MatchFoundViewModel()
+ {
+ MatchFound();
+ AcceptMatchCommand = new Command(o => { Accept(); });
+ DeclineMatchCommand = new Command(o => { Decline(); });
+ LoLAWrapper.phaseMonitor.PhaseChanged += Phase_Changed;
+ }
+
+ private void Phase_Changed(object sender, PhaseMonitor.PhaseChangedArgs e)
+ {
+ if (e.currentPhase != Phase.ReadyCheck) HideMatchFound();
+ }
+
+ private void HideMatchFound()
+ {
+ MatchfoundVisibility = Visibility.Collapsed;
+ _isMatchFound = false;
+ _isDecided = false;
+ }
+
+ private async void MatchFound()
+ {
+ await Task.Run(async() => {
+ _isMatchFound = true;
+ _isDecided = false;
+
+ ConsoleBeep();
+
+ while (_isMatchFound)
+ {
+ var matchInfo = await LCUWrapper.GetMatchmakingInfo();
+ var timer = matchInfo?.timer == null ? 0 : (int)matchInfo.timer;
+
+ // update timer UI
+ TimeoutTimer = $"{10 - timer}s";
+ if (!_isDecided)
+ {
+ if (ConfigModel.config.AutoAccept)
+ {
+ if (_autoAcceptTimer <= timer) Accept();
+ else AcceptStatus = $"Auto Accept in {_autoAcceptTimer - timer}s";
+ } else AcceptStatus = "Auto Accept is disabled";
+ }
+
+ if (matchInfo?.playerResponse != "None")
+ AcceptStatus = matchInfo.playerResponse;
+
+ TimeoutValue = timer * 10;
+
+ //if (timer == 10) HideMatchFound();
+ Thread.Sleep(1000);
+ }
+ });
+ }
+
+ private async void Accept() => _isDecided = await LCUWrapper.AcceptMatchmakingAsync();
+ private async void Decline() => _isDecided = await LCUWrapper.DeclineMatchmakingAsync();
+
+ private void ConsoleBeep() // Beep sound
+ {
+ Console.Beep();
+ Console.Beep();
+ }
+
+ private void HideUserControl(object p) => Utils.Animation.FadeOut(p as UserControl);
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+}
diff --git a/LoL Assist/ViewModel/MessageBoxViewModel.cs b/LoL Assist/ViewModel/MessageBoxViewModel.cs
new file mode 100644
index 0000000..0187d52
--- /dev/null
+++ b/LoL Assist/ViewModel/MessageBoxViewModel.cs
@@ -0,0 +1,17 @@
+using System;
+using System.ComponentModel;
+
+namespace LoL_Assist_WAPP.ViewModel
+{
+ internal class MessageBoxViewModel : INotifyPropertyChanged
+ {
+ public Action action { get; set; }
+ public string message { get; set; }
+ public string title { get; set; }
+ public double width { get; set; }
+ public double height { get; set; }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+}
diff --git a/LoL Assist/ViewModel/PatchViewModel.cs b/LoL Assist/ViewModel/PatchViewModel.cs
index 5d0638b..857f814 100644
--- a/LoL Assist/ViewModel/PatchViewModel.cs
+++ b/LoL Assist/ViewModel/PatchViewModel.cs
@@ -1,11 +1,30 @@
using LoL_Assist_WAPP.Model;
using System.ComponentModel;
+using System.Windows.Input;
using System.Text;
+using System;
+using System.Windows.Controls;
+using System.Diagnostics;
namespace LoL_Assist_WAPP.ViewModel
{
internal class PatchViewModel : INotifyPropertyChanged
{
+ public ICommand RunUrlCommand { get; }
+
+ private ICommand hideUserControlCommand;
+ public ICommand HideUserControlCommand
+ {
+ get
+ {
+ if (hideUserControlCommand == null)
+ {
+ hideUserControlCommand = new Command(o => HideUserControl(o));
+ }
+ return hideUserControlCommand;
+ }
+ }
+
private bool doNotShowPatchNote;
public bool DoNotShowPatchNote
{
@@ -54,24 +73,27 @@ public string Title
public PatchViewModel()
{
+ RunUrlCommand = new Command(o => { Process.Start("https://www.youtube.com/watch?v=dQw4w9WgXcQ"); });
DoNotShowPatchNote = ConfigModel.config.DoNotShowPatch;
- SetPatchNotes();
Title = $"What's New in v{ConfigModel.version}";
+ SetPatchNotes();
}
void SetPatchNotes()
{
StringBuilder patchNotes = new StringBuilder();
- patchNotes.AppendLine("• Added a What's New panel");
- patchNotes.AppendLine("• Minor improvement for R&P(Runes & Spells) Editor Window UI");
- patchNotes.AppendLine("• Added a reset config button on the settings");
- patchNotes.AppendLine("• Moved the clear cache button to miscellaneous section");
- patchNotes.AppendLine("• Fixed an issue where LoLA failed to fetch rune data");
- patchNotes.AppendLine("• Fixed an issue where LoL Assist shows an error when Auto Spells/Auto Runes are disabled");
+ patchNotes.AppendLine("• Added an option for role select (available for a certain game mode only)");
+ patchNotes.AppendLine("• Added a system tray menu [Exit, Show, Patch Notes, Minimize to Tray]");
+ patchNotes.AppendLine("• Fixed an issue where LoL Assist UI being unresponsive");
+ patchNotes.AppendLine("• Minor UI improvements");
+ patchNotes.AppendLine("• Better MVVM Bindings");
+ patchNotes.AppendLine("• Code clean up");
PatchNotes = patchNotes.ToString();
}
+ private void HideUserControl(object p) => Utils.Animation.FadeOut(p as UserControl);
+
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string propertyName) =>
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
diff --git a/LoL Assist/ViewModel/RoleSelectViewModel.cs b/LoL Assist/ViewModel/RoleSelectViewModel.cs
new file mode 100644
index 0000000..9199095
--- /dev/null
+++ b/LoL Assist/ViewModel/RoleSelectViewModel.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+
+namespace LoL_Assist_WAPP.ViewModel
+{
+ public class RoleSelectViewModel : INotifyPropertyChanged
+ {
+ private string patchNotes;
+ public string PatchNotes
+ {
+ get => patchNotes;
+ set
+ {
+ if (patchNotes != value)
+ {
+ patchNotes = value;
+ OnPropertyChanged(nameof(PatchNotes));
+ }
+ }
+ }
+
+ private ICommand selectRoleCommand;
+ public ICommand SelectRoleCommand
+ {
+ get
+ {
+ if (selectRoleCommand == null)
+ selectRoleCommand = new Command(o => SelectRole(o.ToString()));
+
+ return selectRoleCommand;
+ }
+ }
+
+ public string Role { get; set; } = string.Empty;
+
+ public string GetRole
+ {
+ get { return Role; }
+ }
+
+ public Action ImportAction { get; set; }
+
+ private async void SelectRole(string role)
+ {
+ Role = role;
+ await Task.Run(() => { ImportAction?.Invoke(); });
+ }
+
+ public RoleSelectViewModel()
+ {
+
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ protected void OnPropertyChanged(string propertyName)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+}
diff --git a/LoLA Config.json b/LoLA Config.json
new file mode 100644
index 0000000..f35972b
--- /dev/null
+++ b/LoLA Config.json
@@ -0,0 +1 @@
+{"MonitoringDelay":300,"AutoRunes":true,"AutoAccept":true,"AutoSpells":true,"UseLatestPatch":false,"CustomRunesSpells":true,"FlashPlacementToRight":false,"Logging":false,"LowSpecMode":false,"BuildCache":true,"UpdateOnStartup":true,"DoNotShowPatch":false}
\ No newline at end of file