Skip to content

Commit

Permalink
Added back auto-update toggle
Browse files Browse the repository at this point in the history
Settings screen will now display checkboxes instead of colored buttons when enabled. Updated text for available options
  • Loading branch information
CriticalFlaw committed Oct 6, 2024
1 parent 74d50be commit 959f5c9
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 83 deletions.
106 changes: 53 additions & 53 deletions src/TF2HUD.Editor/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,61 @@
</configSections>
<userSettings>
<HUDEditor.Properties.Settings>
<setting name="hud_selected" serializeAs="String">
<value />
</setting>
<setting name="hud_directory" serializeAs="String">
<value />
</setting>
<setting name="user_language" serializeAs="String">
<value>en-US</value>
</setting>
<setting name="app_update_auto" serializeAs="String">
<value>True</value>
</setting>
<setting name="app_xhair_persist" serializeAs="String">
<value>False</value>
</setting>
<setting name="app_xhair_enabled" serializeAs="String">
<value>False</value>
</setting>
<setting name="app_xhair_style" serializeAs="String">
<value>$</value>
</setting>
<setting name="app_xhair_color" serializeAs="String">
<value />
</setting>
<setting name="app_xhair_size" serializeAs="String">
<value>0</value>
</setting>
<setting name="app_default_bg" serializeAs="String">
<value>https://user-images.githubusercontent.com/6818236/220803776-12f85855-a409-4555-8f76-e3877d04bab9.png</value>
</setting>
</HUDEditor.Properties.Settings>
<setting name="hud_selected" serializeAs="String">
<value />
</setting>
<setting name="hud_directory" serializeAs="String">
<value />
</setting>
<setting name="user_language" serializeAs="String">
<value>en-US</value>
</setting>
<setting name="app_update_auto" serializeAs="String">
<value>False</value>
</setting>
<setting name="app_xhair_persist" serializeAs="String">
<value>False</value>
</setting>
<setting name="app_xhair_enabled" serializeAs="String">
<value>False</value>
</setting>
<setting name="app_xhair_style" serializeAs="String">
<value>$</value>
</setting>
<setting name="app_xhair_color" serializeAs="String">
<value />
</setting>
<setting name="app_xhair_size" serializeAs="String">
<value>0</value>
</setting>
<setting name="app_default_bg" serializeAs="String">
<value>https://user-images.githubusercontent.com/6818236/220803776-12f85855-a409-4555-8f76-e3877d04bab9.png</value>
</setting>
</HUDEditor.Properties.Settings>
</userSettings>
<applicationSettings>
<HUDEditor.Properties.Settings>
<setting name="app_docs" serializeAs="String">
<value>https://criticalflaw.ca/TF2HUD.Editor/</value>
</setting>
<setting name="json_file" serializeAs="String">
<value>https://raw.githubusercontent.com/CriticalFlaw/TF2HUD.Editor/master/src/TF2HUD.Editor/JSON/{0}</value>
</setting>
<setting name="json_list" serializeAs="String">
<value>https://api.github.com/repos/CriticalFlaw/TF2HUD.Editor/contents/src/TF2HUD.Editor/JSON</value>
</setting>
<setting name="app_tracker" serializeAs="String">
<value>https://github.com/CriticalFlaw/TF2HUD.Editor/issues</value>
</setting>
<setting name="app_update" serializeAs="String">
<value>https://github.com/CriticalFlaw/TF2HUD.Editor/releases/latest</value>
</setting>
<setting name="mastercomfig_vpk" serializeAs="String">
<value>https://github.com/mastercomfig/mastercomfig/releases/download/9.5.2/mastercomfig-transparent-viewmodels-addon.vpk</value>
</setting>
<setting name="tf2_hud_crosshairs_zip" serializeAs="String">
<value>https://github.com/Hypnootize/TF2-HUD-Crosshairs/archive/refs/heads/master.zip</value>
</setting>
</HUDEditor.Properties.Settings>
<setting name="app_docs" serializeAs="String">
<value>https://criticalflaw.ca/TF2HUD.Editor/</value>
</setting>
<setting name="json_file" serializeAs="String">
<value>https://raw.githubusercontent.com/CriticalFlaw/TF2HUD.Editor/master/src/TF2HUD.Editor/JSON/{0}</value>
</setting>
<setting name="json_list" serializeAs="String">
<value>https://api.github.com/repos/CriticalFlaw/TF2HUD.Editor/contents/src/TF2HUD.Editor/JSON</value>
</setting>
<setting name="app_tracker" serializeAs="String">
<value>https://github.com/CriticalFlaw/TF2HUD.Editor/issues</value>
</setting>
<setting name="app_update" serializeAs="String">
<value>https://github.com/CriticalFlaw/TF2HUD.Editor/releases/latest</value>
</setting>
<setting name="mastercomfig_vpk" serializeAs="String">
<value>https://github.com/mastercomfig/mastercomfig/releases/download/9.5.2/mastercomfig-transparent-viewmodels-addon.vpk</value>
</setting>
<setting name="tf2_hud_crosshairs_zip" serializeAs="String">
<value>https://github.com/Hypnootize/TF2-HUD-Crosshairs/archive/refs/heads/master.zip</value>
</setting>
</HUDEditor.Properties.Settings>
</applicationSettings>
</configuration>
23 changes: 6 additions & 17 deletions src/TF2HUD.Editor/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,28 +166,17 @@
</Style>

<Style x:Key="SettingButton" TargetType="Button" BasedOn="{StaticResource HudButton}">
<Setter Property="Width" Value="400" />
<Setter Property="Width" Value="263" />
<Setter Property="Margin" Value="10,10,0,20"/>
</Style>

<Style x:Key="ToggleButton" TargetType="ToggleButton">
<Style x:Key="SettingCheckBox" TargetType="CheckBox">
<Setter Property="FontFamily" Value="../Resources/Fonts/TF2Build.ttf #TF2 Build" />
<Setter Property="FontSize" Value="16px" />
<Setter Property="FontSize" Value="18px" />
<Setter Property="Foreground" Value="#EBE2CA" />
<Setter Property="Background" Value="#776B5F" />
<Setter Property="Margin" Value="5" />
<Setter Property="Width" Value="400" />
<Setter Property="Margin" Value="10,0,0,0"/>
<Setter Property="Width" Value="700" />
<Setter Property="Height" Value="40" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#934739" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="#2B2724" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Foreground" Value="#2B2724" />
</Trigger>
</Style.Triggers>
</Style>

<Style x:Key="LinkButton" TargetType="Button">
Expand Down
2 changes: 1 addition & 1 deletion src/TF2HUD.Editor/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<Image Source="../Resources/Images/favicon.ico" Height="20" HorizontalAlignment="Left" Margin="5"/>
<TextBlock Text="{lex:Loc ui_title}" VerticalAlignment="Center" Margin="30,0,0,0" Foreground="#EBE2CA" FontFamily="../Resources/Fonts/TF2Build.ttf #TF2 Build" FontSize="16px" />
<Button Content="_" HorizontalAlignment="Right" Margin="0,0,60,0" Width="30" Height="30" Click="Minimize_Click" FontFamily="../Resources/Fonts/TF2Build.ttf #TF2 Build" />
<Button Content="[]" HorizontalAlignment="Right" Margin="0,0,30,0" Width="30" Height="30" Click="Maximize_Click" FontFamily="../Resources/Fonts/TF2Build.ttf #TF2 Build" />
<Button Content="&#9744;" HorizontalAlignment="Right" Margin="0,0,30,0" Width="30" Height="30" Click="Maximize_Click" FontFamily="../Resources/Fonts/TF2Build.ttf #TF2 Build" />
<Button Content="X" HorizontalAlignment="Right" Width="30" Height="30" Click="CloseButton_Click" FontFamily="../Resources/Fonts/TF2Build.ttf #TF2 Build" />
</Grid>
</Border>
Expand Down
2 changes: 1 addition & 1 deletion src/TF2HUD.Editor/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public MainWindow()
SetupDirectory();

// Check for updates
UpdateAppSchema(true);
if (Settings.Default.app_update_auto == true) UpdateAppSchema(true);
}

private void MainWindowViewModelPropertyChanged(object sender, PropertyChangedEventArgs e)
Expand Down
6 changes: 3 additions & 3 deletions src/TF2HUD.Editor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/TF2HUD.Editor/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
<value>Browse</value>
</data>
<data name="ui_check_updates" xml:space="preserve">
<value>Automatically check for updates.</value>
<value>Auto-update files (Disable if doing local edits)</value>
</data>
<data name="ui_clear" xml:space="preserve">
<value>Clear</value>
Expand All @@ -238,7 +238,7 @@
<value>Customize</value>
</data>
<data name="ui_directory" xml:space="preserve">
<value>Set path to tf/custom</value>
<value>Change tf/custom path</value>
</data>
<data name="ui_download" xml:space="preserve">
<value>Download:</value>
Expand Down Expand Up @@ -280,7 +280,7 @@
<value>Options</value>
</data>
<data name="ui_clear_cache" xml:space="preserve">
<value>Clear Cache</value>
<value>Clear Cache Files</value>
</data>
<data name="info_clear_cache" xml:space="preserve">
<value>This option will delete all local schema and editor data files then restart the app. Would you like to continue?</value>
Expand Down
4 changes: 2 additions & 2 deletions src/TF2HUD.Editor/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/TF2HUD.Editor/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<Value Profile="(Default)">https://github.com/mastercomfig/mastercomfig/releases/download/9.5.2/mastercomfig-transparent-viewmodels-addon.vpk</Value>
</Setting>
<Setting Name="app_update_auto" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="app_xhair_persist" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
Expand Down
12 changes: 10 additions & 2 deletions src/TF2HUD.Editor/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,28 @@
<Button
Content="{lex:Loc ui_directory}"
Click="BtnSetDirectory_OnClick"
Width="263"
Style="{StaticResource SettingButton}" />
<Button
Content="{lex:Loc ui_refresh}"
Click="BtnRefresh_OnClick"
Width="263"
Style="{StaticResource SettingButton}" />
<Button
Content="{lex:Loc ui_clear_cache}"
Click="btnClearCache_Click"
Width="263"
Style="{StaticResource SettingButton}" />
<ToggleButton
<CheckBox
x:Name="BtnPersistXhair"
Content="{lex:Loc ui_persist_xhair}"
Click="BtnPersistXhair_Click"
Style="{StaticResource ToggleButton}" />
Style="{StaticResource SettingCheckBox}" />
<CheckBox
x:Name="BtnAutoUpdate"
Content="{lex:Loc ui_check_updates}"
Click="BtnAutoUpdate_OnClick"
Style="{StaticResource SettingCheckBox}" />
</WrapPanel>
</GroupBox>
</StackPanel>
Expand Down
7 changes: 7 additions & 0 deletions src/TF2HUD.Editor/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public SettingsWindow()
InitializeComponent();

// Check for user selected settings.
BtnAutoUpdate.IsChecked = Settings.Default.app_update_auto;
BtnPersistXhair.IsChecked = Settings.Default.app_xhair_persist;
}

Expand Down Expand Up @@ -55,6 +56,12 @@ private void BtnRefresh_OnClick(object sender, RoutedEventArgs e)
MainWindow.UpdateAppSchema(false);
}

private void BtnAutoUpdate_OnClick(object sender, RoutedEventArgs e)
{
Settings.Default.app_update_auto = BtnAutoUpdate.IsChecked ?? true;
Settings.Default.Save();
}

private void BtnPersistXhair_Click(object sender, RoutedEventArgs e)
{
Settings.Default.app_xhair_persist = BtnPersistXhair.IsChecked ?? true;
Expand Down

0 comments on commit 959f5c9

Please sign in to comment.