1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2025-01-20 01:10:13 +00:00

add Reset Menu option

This commit is contained in:
jugeeya 2020-08-19 19:59:19 -07:00
parent bdcef6088c
commit e10a6c27e9
2 changed files with 28 additions and 2 deletions

View file

@ -199,7 +199,7 @@ and specials when hitbox
visualization is active.)"""";
// Save states
const std::vector<std::string> save_state_items{""};
const std::vector<std::string> empty_items{""};
const std::string save_states_help = R""""(
Press Grab + Down Taunt at any
time to save the state of the
@ -216,6 +216,13 @@ are saved:
- Position
- Facing direction)"""";
const std::string reset_menu_help = R""""(
Reset menu to default
configuration. Please also
use on the first boot after
upgrading Training Modpack
versions.)"""";
// OOS
const std::string oos_help = R""""(
Option to delay oos options

View file

@ -26,6 +26,8 @@ static struct TrainingModpackMenu
BoolFlags FULL_HOP = BoolFlags::None;
} menu;
static struct TrainingModpackMenu defaultMenu = menu;
static int FRAME_ADVANTAGE = 0;
u64 pidSmash = 0;
@ -430,7 +432,7 @@ tsl::elm::Element* GuiMain::createUI()
valueListItems.push_back(hitboxItem);
ClickableListItem* saveStateItem = new ClickableListItem(
"Save States", save_state_items, nullptr, "saveStates", 0, "Save States", save_states_help);
"Save States", empty_items, nullptr, "saveStates", 0, "Save States", save_states_help);
saveStateItem->setClickListener([](std::vector<std::string> values,
int* curValue,
std::string extdata,
@ -440,6 +442,23 @@ tsl::elm::Element* GuiMain::createUI()
saveStateItem->setHelpListener([](std::string title, std::string help) { tsl::changeTo<GuiHelp>(title, help); });
list->addItem(saveStateItem);
ClickableListItem* resetMenuItem = new ClickableListItem("Reset Menu",
empty_items,
nullptr,
"resetMenu",
0,
"Reset Menu",
reset_menu_help);
resetMenuItem->setClickListener([](std::vector<std::string> values,
int* curValue,
std::string extdata,
int index,
std::string title,
std::string help) { menu = defaultMenu; });
resetMenuItem->setHelpListener(
[](std::string title, std::string help) { tsl::changeTo<GuiHelp>(title, help); });
list->addItem(resetMenuItem);
rootFrame->setContent(list);
}
else