From f2fba58b91b9a8caa8e21a4aa8f31b27e99cc9cc Mon Sep 17 00:00:00 2001 From: Maxi Jabase Date: Mon, 14 Feb 2022 13:34:45 -0300 Subject: [PATCH] add buttons to backup and load configs (no logic yet) --- .../CondenserFunctions/SMMethodmapConsumer.cs | 2 +- Spcode.csproj | 1 + .../ColorChangeControl.xaml.cs | 8 ++++--- UI/Windows/ConfigWindow.xaml | 12 ++++++++-- .../ConfigWindowConfigsManager.cs | 22 +++++++++++++++++++ 5 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 UI/Windows/ConfigWindow/ConfigWindowConfigsManager.cs diff --git a/SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMMethodmapConsumer.cs b/SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMMethodmapConsumer.cs index 8f892e13..3d8e48b0 100644 --- a/SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMMethodmapConsumer.cs +++ b/SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMMethodmapConsumer.cs @@ -215,7 +215,7 @@ private int ConsumeSMMethodmap() Parameters = parameters.ToArray(), FullName = TrimFullname(source.Substring(mStartIndex, mEndIndex - mStartIndex + 1)), Length = mEndIndex - mStartIndex + 1, - CommentString = Condenser.TrimComments(functionCommentString), + CommentString = TrimComments(functionCommentString), MethodmapName = methodMapName, File = FileName }); diff --git a/Spcode.csproj b/Spcode.csproj index a9e2b176..d709be72 100644 --- a/Spcode.csproj +++ b/Spcode.csproj @@ -171,6 +171,7 @@ ConfigWindow.xaml + RenameWindow.xaml diff --git a/UI/Components/ColorChangeControl/ColorChangeControl.xaml.cs b/UI/Components/ColorChangeControl/ColorChangeControl.xaml.cs index 49e205cf..f750c68e 100644 --- a/UI/Components/ColorChangeControl/ColorChangeControl.xaml.cs +++ b/UI/Components/ColorChangeControl/ColorChangeControl.xaml.cs @@ -37,7 +37,7 @@ private void SliderValue_Changed(object sender, RoutedEventArgs e) if (!RaiseEventAllowed) { return; } var c = Color.FromArgb(0xFF, (byte)(int)RSlider.Value, (byte)(int)GSlider.Value, (byte)(int)BSlider.Value); UpdateColor(c, true, false); - var raiseEvent = new RoutedEventArgs(ColorChangeControl.ColorChangedEvent); + var raiseEvent = new RoutedEventArgs(ColorChangedEvent); RaiseEvent(raiseEvent); } @@ -57,7 +57,7 @@ private void UpdateColor(Color c, bool UpdateTextBox = true, bool UpdateSlider = GSlider.Value = c.G; BSlider.Value = c.B; } - var raiseEvent = new RoutedEventArgs(ColorChangeControl.ColorChangedEvent); + var raiseEvent = new RoutedEventArgs(ColorChangedEvent); RaiseEvent(raiseEvent); RaiseEventAllowed = true; } @@ -72,7 +72,9 @@ private void BrushRect_TextChanged(object sender, TextChangedEventArgs e) parseString = parseString.Substring(2); } if (int.TryParse(parseString, System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.InvariantCulture, out var result)) - { cVal = result; } + { + cVal = result; + } UpdateColor(Color.FromArgb(0xFF, (byte)((cVal >> 16) & 0xFF), (byte)((cVal >> 8) & 0xFF), (byte)(cVal & 0xFF)), false, true); } } diff --git a/UI/Windows/ConfigWindow.xaml b/UI/Windows/ConfigWindow.xaml index 0980df6a..5aabab47 100644 --- a/UI/Windows/ConfigWindow.xaml +++ b/UI/Windows/ConfigWindow.xaml @@ -9,10 +9,18 @@ IsMaxRestoreButtonEnabled="False" WindowStartupLocation="CenterOwner" GlowBrush="{DynamicResource AccentColorBrush}" - Title="Configurations" - ShowTitleBar="False" + Title="Configurations" + TitleCaps="False" + ShowTitleBar="true" Closing="MetroWindow_Closing"> + + +