Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit f2fba58

Browse files
committed
add buttons to backup and load configs (no logic yet)
1 parent 37d0a8f commit f2fba58

File tree

5 files changed

+39
-6
lines changed

5 files changed

+39
-6
lines changed

SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMMethodmapConsumer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private int ConsumeSMMethodmap()
215215
Parameters = parameters.ToArray(),
216216
FullName = TrimFullname(source.Substring(mStartIndex, mEndIndex - mStartIndex + 1)),
217217
Length = mEndIndex - mStartIndex + 1,
218-
CommentString = Condenser.TrimComments(functionCommentString),
218+
CommentString = TrimComments(functionCommentString),
219219
MethodmapName = methodMapName,
220220
File = FileName
221221
});

Spcode.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
<Compile Include="UI\Windows\ConfigWindow.xaml.cs">
172172
<DependentUpon>ConfigWindow.xaml</DependentUpon>
173173
</Compile>
174+
<Compile Include="UI\Windows\ConfigWindow\ConfigWindowConfigsManager.cs" />
174175
<Compile Include="UI\Windows\RenameWindow.xaml.cs">
175176
<DependentUpon>RenameWindow.xaml</DependentUpon>
176177
</Compile>

UI/Components/ColorChangeControl/ColorChangeControl.xaml.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private void SliderValue_Changed(object sender, RoutedEventArgs e)
3737
if (!RaiseEventAllowed) { return; }
3838
var c = Color.FromArgb(0xFF, (byte)(int)RSlider.Value, (byte)(int)GSlider.Value, (byte)(int)BSlider.Value);
3939
UpdateColor(c, true, false);
40-
var raiseEvent = new RoutedEventArgs(ColorChangeControl.ColorChangedEvent);
40+
var raiseEvent = new RoutedEventArgs(ColorChangedEvent);
4141
RaiseEvent(raiseEvent);
4242
}
4343

@@ -57,7 +57,7 @@ private void UpdateColor(Color c, bool UpdateTextBox = true, bool UpdateSlider =
5757
GSlider.Value = c.G;
5858
BSlider.Value = c.B;
5959
}
60-
var raiseEvent = new RoutedEventArgs(ColorChangeControl.ColorChangedEvent);
60+
var raiseEvent = new RoutedEventArgs(ColorChangedEvent);
6161
RaiseEvent(raiseEvent);
6262
RaiseEventAllowed = true;
6363
}
@@ -72,7 +72,9 @@ private void BrushRect_TextChanged(object sender, TextChangedEventArgs e)
7272
parseString = parseString.Substring(2);
7373
}
7474
if (int.TryParse(parseString, System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.InvariantCulture, out var result))
75-
{ cVal = result; }
75+
{
76+
cVal = result;
77+
}
7678
UpdateColor(Color.FromArgb(0xFF, (byte)((cVal >> 16) & 0xFF), (byte)((cVal >> 8) & 0xFF), (byte)(cVal & 0xFF)), false, true);
7779
}
7880
}

UI/Windows/ConfigWindow.xaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@
99
IsMaxRestoreButtonEnabled="False"
1010
WindowStartupLocation="CenterOwner"
1111
GlowBrush="{DynamicResource AccentColorBrush}"
12-
Title="Configurations"
13-
ShowTitleBar="False"
12+
Title="Configurations"
13+
TitleCaps="False"
14+
ShowTitleBar="true"
1415
Closing="MetroWindow_Closing">
1516

17+
<controls:MetroWindow.RightWindowCommands>
18+
<controls:WindowCommands>
19+
<Button Name="BackupConfigsButton" Content="Backup configs" Click="BackupConfigsButton_Click"/>
20+
<Button Name="LoadConfigsButton" Content="Load configs" Click="LoadConfigsButton_Click"/>
21+
</controls:WindowCommands>
22+
</controls:MetroWindow.RightWindowCommands>
23+
1624
<controls:MetroWindow.Resources>
1725
<ResourceDictionary>
1826

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
8+
namespace SPCode.UI.Windows
9+
{
10+
public partial class ConfigWindow
11+
{
12+
private void BackupConfigsButton_Click(object sender, RoutedEventArgs e)
13+
{
14+
15+
}
16+
17+
private void LoadConfigsButton_Click(object sender, RoutedEventArgs e)
18+
{
19+
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)