-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting's "Other" tab are now functional.
- Loading branch information
1 parent
77d306d
commit 856657b
Showing
8 changed files
with
387 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/HoyoLauncherSettings/Settings.OthersTab/RadioButtons.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using static HoyoLauncher.HoyoLauncherSettings.HoyoSettings; | ||
|
||
namespace HoyoLauncher.HoyoLauncherSettings.Settings.OthersTab; | ||
sealed class HoyoRadioButtons | ||
{ | ||
// kinda messed up but it'll work, just need some better coding; ref wont work on the AppSettings.Settings.Default | ||
public static void SetRadioButtons() | ||
{ | ||
_hoyosettings.RadioButtonTray.IsChecked = AppSettings.Settings.Default.CHECKBOX_MINIMIZE_TRAY; | ||
_hoyosettings.RadioButtonBackground.IsChecked = AppSettings.Settings.Default.CHECKBOX_BACKGROUND; | ||
_hoyosettings.RadioButtonSelectiveStartup.IsChecked = AppSettings.Settings.Default.CHECKBOX_LASTGAME; | ||
|
||
_hoyosettings.RadioButtonTray_Click.MouseDown += (s, e) => | ||
SetSettingsValue(e, () => | ||
{ | ||
AppSettings.Settings.Default.CHECKBOX_MINIMIZE_TRAY = (bool)(_hoyosettings.RadioButtonTray.IsChecked = !_hoyosettings.RadioButtonTray.IsChecked); | ||
}); | ||
_hoyosettings.RadioButtonBackground_Click.MouseDown += (s, e) => | ||
SetSettingsValue(e, () => | ||
{ | ||
AppSettings.Settings.Default.CHECKBOX_BACKGROUND = (bool)(_hoyosettings.RadioButtonBackground.IsChecked = !_hoyosettings.RadioButtonBackground.IsChecked); | ||
}); | ||
_hoyosettings.RadioButtonSelectiveStartup_Click.MouseDown += (s, e) => | ||
SetSettingsValue(e, () => | ||
{ | ||
AppSettings.Settings.Default.CHECKBOX_LASTGAME = (bool)(_hoyosettings.RadioButtonSelectiveStartup.IsChecked = !_hoyosettings.RadioButtonSelectiveStartup.IsChecked); | ||
}); | ||
} | ||
|
||
static void SetSettingsValue(MouseButtonEventArgs e, Action action) | ||
{ | ||
if (e.ChangedButton is MouseButton.Left) | ||
action(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using static HoyoLauncher.HoyoLauncherSettings.HoyoSettings; | ||
|
||
namespace HoyoLauncher.HoyoLauncherSettings.Settings.OthersTab; | ||
sealed class HoyoTooltips | ||
{ | ||
public static void SetToolTips() | ||
{ | ||
_hoyosettings.RadioButtonTray_Click.MouseEnter += ShowTooltip; | ||
_hoyosettings.RadioButtonBackground_Click.MouseEnter += ShowTooltip; | ||
_hoyosettings.RadioButtonSelectiveStartup_Click.MouseEnter += ShowTooltip; | ||
|
||
_hoyosettings.Button_ClearLocationTexts.MouseEnter += ShowTooltip; | ||
_hoyosettings.Button_ResetSettings.MouseEnter += ShowTooltip; | ||
|
||
_hoyosettings.Funni.MouseEnter += ShowTooltip; | ||
|
||
|
||
_hoyosettings.RadioButtonTray_Click.MouseLeave += RemoveTooltip; | ||
_hoyosettings.RadioButtonBackground_Click.MouseLeave += RemoveTooltip; | ||
_hoyosettings.RadioButtonSelectiveStartup_Click.MouseLeave += RemoveTooltip; | ||
|
||
_hoyosettings.Button_ClearLocationTexts.MouseLeave += RemoveTooltip; | ||
_hoyosettings.Button_ResetSettings.MouseLeave += RemoveTooltip; | ||
|
||
_hoyosettings.Funni.MouseLeave += RemoveTooltip; | ||
} | ||
|
||
static void ShowTooltip(object s, MouseEventArgs e) => | ||
_hoyosettings.Tooltip_Text.Text = ((UIElement)s).Uid; | ||
|
||
static void RemoveTooltip(object s, MouseEventArgs e) => | ||
_hoyosettings.Tooltip_Text.Text = ""; | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters