mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-02-01 06:57:25 +00:00
add Reset Menu option
This commit is contained in:
parent
bdcef6088c
commit
e10a6c27e9
2 changed files with 28 additions and 2 deletions
|
@ -199,7 +199,7 @@ and specials when hitbox
|
||||||
visualization is active.)"""";
|
visualization is active.)"""";
|
||||||
|
|
||||||
// Save states
|
// Save states
|
||||||
const std::vector<std::string> save_state_items{""};
|
const std::vector<std::string> empty_items{""};
|
||||||
const std::string save_states_help = R""""(
|
const std::string save_states_help = R""""(
|
||||||
Press Grab + Down Taunt at any
|
Press Grab + Down Taunt at any
|
||||||
time to save the state of the
|
time to save the state of the
|
||||||
|
@ -216,6 +216,13 @@ are saved:
|
||||||
- Position
|
- Position
|
||||||
- Facing direction)"""";
|
- 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
|
// OOS
|
||||||
const std::string oos_help = R""""(
|
const std::string oos_help = R""""(
|
||||||
Option to delay oos options
|
Option to delay oos options
|
||||||
|
|
|
@ -26,6 +26,8 @@ static struct TrainingModpackMenu
|
||||||
BoolFlags FULL_HOP = BoolFlags::None;
|
BoolFlags FULL_HOP = BoolFlags::None;
|
||||||
} menu;
|
} menu;
|
||||||
|
|
||||||
|
static struct TrainingModpackMenu defaultMenu = menu;
|
||||||
|
|
||||||
static int FRAME_ADVANTAGE = 0;
|
static int FRAME_ADVANTAGE = 0;
|
||||||
|
|
||||||
u64 pidSmash = 0;
|
u64 pidSmash = 0;
|
||||||
|
@ -430,7 +432,7 @@ tsl::elm::Element* GuiMain::createUI()
|
||||||
valueListItems.push_back(hitboxItem);
|
valueListItems.push_back(hitboxItem);
|
||||||
|
|
||||||
ClickableListItem* saveStateItem = new ClickableListItem(
|
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,
|
saveStateItem->setClickListener([](std::vector<std::string> values,
|
||||||
int* curValue,
|
int* curValue,
|
||||||
std::string extdata,
|
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); });
|
saveStateItem->setHelpListener([](std::string title, std::string help) { tsl::changeTo<GuiHelp>(title, help); });
|
||||||
list->addItem(saveStateItem);
|
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);
|
rootFrame->setContent(list);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue