Skip to content

Commit

Permalink
feat: reset modules button
Browse files Browse the repository at this point in the history
  • Loading branch information
Clazex committed May 5, 2022
1 parent 578e9e7 commit ea2916d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
15 changes: 14 additions & 1 deletion GodSeekerPlus/Menu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ internal static MenuScreen GetSatchelMenuScreen(MenuScreen modListMenu, ModToggl
))
.ForEach(menu.AddElement);

menu.AddElement(new Satchel.BetterMenus.MenuButton(
"ResetModules".Localize(),
"",
btn => {
ModuleManager.Modules.Values.ForEach(
module => module.Active = module.DefaultEnabled
);
GlobalSettings = new();
},
true
));

return menu.GetMenuScreen(modListMenu);
}

Expand All @@ -79,7 +92,7 @@ internal static MenuScreen GetFallbackMenuScreen(MenuScreen modListMenu, ModTogg
Options = StateStrings,
Style = HorizontalOptionStyle.VanillaStyle
},
out UnityEngine.UI.MenuOptionHorizontal toggle
out MenuOptionHorizontal toggle
);
toggle.menuSetting.RefreshValueFromGameSettings();
Expand Down
1 change: 1 addition & 0 deletions GodSeekerPlus/Resources/Lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"Settings": "Options",
"SatchelNotFoundPrompt": "Install Satchel >= v0.7.4 for full menu support",
"ToggleButtonDesc": "Toggle all effects of this mod",
"ResetModules": "Reset all modules to default state",
"ToggleableLevel/AnyTime": "",
"ToggleableLevel/ChangeScene": "Change scene to apply change",
"ToggleableLevel/ReloadSave": "Reload the save to apply change",
Expand Down
1 change: 1 addition & 0 deletions GodSeekerPlus/Resources/Lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"Settings": "选项",
"SatchelNotFoundPrompt": "安装 Satchel >= v0.7.4 以获取完全菜单支持",
"ToggleButtonDesc": "开关本模组的全部效果",
"ResetModules": "将所有模块重置为默认状态",
"ToggleableLevel/AnyTime": "",
"ToggleableLevel/ChangeScene": "切换场景以生效",
"ToggleableLevel/ReloadSave": "重新加载存档以生效",
Expand Down

0 comments on commit ea2916d

Please sign in to comment.