Skip to content

Commit d2182b1

Browse files
committed
Added full reset debug button
0 on title screen
1 parent 0a18b3b commit d2182b1

4 files changed

Lines changed: 22 additions & 2 deletions

File tree

Globals/SaveSystem.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,12 @@ private static void AddJoypadBinding(string action, string buttonString)
368368
GD.PushWarning($"Could not parse joypad button: {buttonString}");
369369
}
370370
}
371+
372+
public static void ClearConfig()
373+
{
374+
DirAccess.RemoveAbsolute(UserConfigPath);
375+
InitConfig();
376+
}
371377
#endregion
372378

373379
#region Save

Globals/StageProducer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override void _EnterTree()
3737
LiveInstance = this;
3838
}
3939

40-
private void InitFromCfg()
40+
public void InitFromCfg()
4141
{
4242
OptionsMenu.ChangeVolume(
4343
SaveSystem.GetConfigValue(SaveSystem.ConfigSettings.Volume).As<float>()

Globals/SteamWhisperer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static bool IncrementNoteCount()
8585
}
8686

8787
//For Debugging purposes. Resets all stats/ achievements
88-
private static void ResetAll()
88+
public static void ResetAll()
8989
{
9090
if (!Steam.IsSteamRunning())
9191
{

Scenes/UI/TitleScreen/Scripts/TitleScreen.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ public partial class TitleScreen : Control, IFocusableMenu
1414
private Control _focused;
1515
public IFocusableMenu Prev { get; set; }
1616

17+
public override void _UnhandledInput(InputEvent @event)
18+
{
19+
if (@event is InputEventKey eventKey && eventKey.Pressed && !eventKey.Echo)
20+
{
21+
if (eventKey.Keycode == Key.Key0)
22+
{
23+
SteamWhisperer.ResetAll();
24+
SaveSystem.ClearSave();
25+
SaveSystem.ClearConfig();
26+
StageProducer.LiveInstance.InitFromCfg();
27+
}
28+
}
29+
}
30+
1731
public override void _EnterTree()
1832
{
1933
BgAudioPlayer.LiveInstance.PlayLevelMusic();

0 commit comments

Comments
 (0)