1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-28 12:50:16 +00:00

fix OnOff flags, resetting menu

This commit is contained in:
jugeeya 2020-08-20 21:45:03 -07:00
parent 766d6e546c
commit 5f7b30f57d
2 changed files with 14 additions and 4 deletions

View file

@ -9,8 +9,7 @@
const std::vector<std::string> on_off{"Off", "On"};
// clang-format off
#define ENUM_CLASS_OnOffFlag(type,x) \
x(type,On,"On") \
x(type,Off,"Off")
x(type,On,"On")
// clang-format on
DEFINE_ENUM_CLASS(OnOffFlag);

View file

@ -19,7 +19,7 @@ static struct TrainingModpackMenu
DefensiveFlags DEFENSIVE_STATE = DefensiveFlags::All;
DelayFlags OOS_OFFSET = DelayFlags::None;
DelayFlags REACTION_TIME = DelayFlags::None;
OnOffFlags MASH_IN_NEUTRAL = OnOffFlag::Off;
OnOffFlags MASH_IN_NEUTRAL = OnOffFlags::None;
BoolFlags FAST_FALL = BoolFlags::None;
DelayFlags FAST_FALL_DELAY = DelayFlags::None;
BoolFlags FALLING_AERIALS = BoolFlags::None;
@ -470,7 +470,18 @@ tsl::elm::Element* GuiMain::createUI()
std::string extdata,
int index,
std::string title,
std::string help) { menu = defaultMenu; });
std::string help) {
menu = defaultMenu;
/* Open Sd card filesystem. */
FsFileSystem fsSdmc;
if(R_FAILED(fsOpenSdCardFileSystem(&fsSdmc))) return;
tsl::hlp::ScopeGuard fsGuard([&] { fsFsClose(&fsSdmc); });
fsFsDeleteFile(&fsSdmc, TRAINING_MOD_CONF);
tsl::goBack();
});
resetMenuItem->setHelpListener(
[](std::string title, std::string help) { tsl::changeTo<GuiHelp>(title, help); });
list->addItem(resetMenuItem);