Skip to content

Commit

Permalink
Revert "EU and New Menu (Z3DR#77)"
Browse files Browse the repository at this point in the history
This reverts commit 0d1418e.
  • Loading branch information
CharadeNut committed Mar 16, 2024
1 parent 0d1418e commit 48f62dc
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 180 deletions.
4 changes: 2 additions & 2 deletions source/hint_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ void HintTable_Init() {
/*---------------------
| JUNK HINT TEXT |
---------------------*/
hintTable[JUNK01] = HintText::Junk({Text{"That's no moon.", "", ""}});
hintTable[JUNK01] = HintText::Junk({Text{"<Junk hint here>", "", ""}});
hintTable[JUNK02] = HintText::Junk({Text{"The moon is haunted.", "", ""}});
hintTable[JUNK03] = HintText::Junk({Text{"Majora has sick dance moves.", "", ""}});
hintTable[JUNK04] = HintText::Junk({Text{"Making hints is hard.", "", ""}});
Expand Down Expand Up @@ -892,7 +892,7 @@ void HintTable_Init() {
hintTable[JUNK71] = HintText::Junk({Text{"These hints can be quite useful. This is an exception.", "", ""}});
hintTable[JUNK72] = HintText::Junk({Text{"Turns are more effective when you tilt the whole console.", "", ""}});
hintTable[JUNK73] = HintText::Junk({Text{"You ever been in a cockpit before?", "", ""}});
hintTable[JUNK74] = HintText::Junk({Text{"It's a secret to everybody", "", ""}});
hintTable[JUNK74] = HintText::Junk({Text{"Smash 10 pots in 12 seconds.", "", ""}});
hintTable[JUNK75] = HintText::Junk({Text{"You found me!", "", ""}});
hintTable[JUNK76] = HintText::Junk({Text{"I have it on my post-it note somewhere.", "", ""}});
hintTable[JUNK77] = HintText::Junk({Text{"Follow the rainbow.", "", ""}});
Expand Down
2 changes: 2 additions & 0 deletions source/include/menu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ void PrintOptionSubMenu();
void PrintSubMenu();
void PrintPresetsMenu();
void PrintResetToDefaultsMenu();
void PrintGenerateMenu();
void ClearDescription();
void PrintOptionDescription();
void PrintVersionDescription();
void GenerateRandomizer();
std::string GetInput(const char* hintText);

Expand Down
5 changes: 1 addition & 4 deletions source/include/setting_descriptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,4 @@ extern string_view compassShowWotHDesc;
extern string_view skipHMSCutsceneDesc;
extern string_view skipDarmaniCutsceneDesc;
extern string_view skipMikauCutsceneDesc;
extern string_view skipBombersMinigameDesc;
extern string_view NARegionDesc;
extern string_view EURegionDesc;
extern string_view VersionDesc;
extern string_view skipBombersMinigameDesc;
7 changes: 2 additions & 5 deletions source/include/settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ namespace Settings {
extern Option ChestSize;
extern Option ChangeOverworldItems;
extern Option IngameSpoilers;
extern Option RegionSelect;
extern Option MenuOpeningButton;
extern Option RsDurability;
extern Option SkipBombersMinigame;
Expand Down Expand Up @@ -530,10 +529,8 @@ namespace Settings {
extern u32 LinksPocketRewardBitMask;
extern std::array<u32, 9> rDungeonRewardOverrides;

extern Option PlayOption;
extern Option Version;
extern std::vector<Option*> gameOptions;
extern Menu gameSettings;
extern u8 PlayOption;
extern u8 Version;

}

Expand Down
89 changes: 83 additions & 6 deletions source/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ using namespace Settings;

namespace {
bool seedChanged;
bool choosePlayOption;
u16 pastSeedLength;
u16 settingBound = 0;
PrintConsole topScreen, bottomScreen;
Expand Down Expand Up @@ -47,6 +48,7 @@ void MenuInit() {
Settings::InitSettings();

seedChanged = false;
choosePlayOption = false;
pastSeedLength = Settings::seed.length();

settingBound = 0;
Expand Down Expand Up @@ -162,7 +164,7 @@ void MenuUpdate(u32 kDown) {
}
}
//If they pressed B on any menu other than main, go backwards to the previous menu
else if (kDown & KEY_B && currentMenu->mode != MAIN_MENU) {
else if (kDown & KEY_B && currentMenu->mode != MAIN_MENU && !choosePlayOption) {

//Want to reset generate menu when leaving
if (currentMenu->mode == POST_GENERATE) {
Expand Down Expand Up @@ -224,6 +226,9 @@ void MenuUpdate(u32 kDown) {
PrintResetToDefaultsMenu();
} else if (currentMenu->mode == GENERATE_MODE) {
UpdateGenerateMenu(kDown);
if (currentMenu->mode != POST_GENERATE) {
PrintGenerateMenu();
}
} else if (currentMenu->mode == SUB_MENU) {
PrintSubMenu();
}
Expand Down Expand Up @@ -317,12 +322,34 @@ void UpdateResetToDefaultsMenu(u32 kDown) {
}
u16 menuIdx2;
void UpdateGenerateMenu(u32 kDown) {
//consoleSelect(&bottomScreen);
//consoleClear();
if (!choosePlayOption) {
if ((kDown & KEY_A) != 0) {
Settings::PlayOption = currentMenu->menuIdx;
consoleSelect(&bottomScreen);
consoleClear();
choosePlayOption = true;
menuIdx2 = currentMenu->menuIdx;
currentMenu->menuIdx = 0;
}
}
else {
if ((kDown & KEY_B) !=0) {
consoleSelect(&bottomScreen);
consoleClear();
choosePlayOption = false;
currentMenu->menuIdx = menuIdx2;
}
else if ((kDown & KEY_A) !=0) {
Settings::Version = currentMenu->menuIdx;
consoleSelect(&bottomScreen);
consoleClear();
GenerateRandomizer();
//This is just a dummy mode to stop the prompt from appearing again
currentMenu->mode = POST_GENERATE;
}
choosePlayOption = false;
}
}
}

void PrintMainMenu() {
printf("\x1b[0;%dHMain Settings", 1+(BOTTOM_WIDTH-13)/2);
Expand Down Expand Up @@ -461,6 +488,47 @@ void PrintResetToDefaultsMenu() {
printf("\x1b[12;4HPress B to return to the preset menu.");
}

void PrintGenerateMenu() {

consoleSelect(&bottomScreen);

if (!choosePlayOption) {
printf("\x1b[3;%dHHow will you play?", 1+(BOTTOM_WIDTH-18)/2);
std::vector<std::string> playOptions = {"3ds Console", "Citra Emulator"};

for (u8 i = 0; i < playOptions.size(); i++) {

std::string option = playOptions[i];
u8 row = 6 + (i * 2);
//make the current selection green
if (currentMenu->menuIdx == i) {
printf("\x1b[%d;%dH%s>", row, 14, GREEN);
printf("\x1b[%d;%dH%s%s", row, 15, option.c_str(), RESET);
} else {
printf("\x1b[%d;%dH%s", row, 15, option.c_str());
}
}
}
else {
printf("\x1b[3;%dHSelect your game version", 1 + (BOTTOM_WIDTH -18) / 2);
std::vector<std::string> versionOptions = {"1.0", "1.1"};

for (u8 j=0; j < versionOptions.size(); j++) {
std::string option = versionOptions[j];
u8 row = 6 + (j * 2);
//make the current selection green
if (currentMenu->menuIdx == j) {
printf("\x1b[%d;%dH%s>", row, 14, GREEN);
printf("\x1b[%d;%dH%s%s", row, 15, option.c_str(), RESET);
} else {
printf("\x1b[%d;%dH%s", row, 15, option.c_str());
}
}
ClearDescription();
PrintVersionDescription();

}
}

void ClearDescription() {
consoleSelect(&topScreen);
Expand All @@ -478,6 +546,15 @@ void PrintOptionDescription() {
printf("\x1b[22;0H%s", description.data());
}

void PrintVersionDescription() {
ClearDescription(); //"Description must fit in this space ---------------//"
std::string_view description = "Due to patch size when using version 1.1 it can \n"
"take up to 30 seconds to launch the game, this is\n"
"expected and will not effect gameplay";

printf("\x1b[22;0H%s", description.data());
}

void GenerateRandomizer() {

consoleSelect(&topScreen);
Expand Down Expand Up @@ -513,11 +590,11 @@ void GenerateRandomizer() {
printf("\x1b[13;10HWriting Patch...");
if (WriteAllPatches()) {
printf("Done");
if (Settings::PlayOption.Value<u8>() == PATCH_CONSOLE) {
if (Settings::PlayOption == PATCH_CONSOLE) {
printf("\x1b[15;10HQuit out using the home menu. Then\n");
printf("\x1b[16;10Henable game patching and launch MM3D!\n");
}
else if (Settings::PlayOption.Value<u8>() == PATCH_CITRA) {
else if (Settings::PlayOption == PATCH_CITRA) {
printf("\x1b[15;10HCopy code.ips, exheader.bin and romfs to\n");
printf("\x1b[16;10Hthe MM3D mods folder, then launch MM3D!\n");
}
Expand Down
Loading

0 comments on commit 48f62dc

Please sign in to comment.