From fd8a2c948331f19d61e9b4392a6f6336f0bdd7a0 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Wed, 2 Nov 2022 11:50:47 -0400 Subject: [PATCH] Adds in-game menu for selecting a dungeon quest/randomizer (#1863) * Adds most visuals and interactions for quest select menu. * "Scrolling" menu, adds remaining sub/title textures, language support * Tweak: ENG, FRA, GER title to match the original style * ADD: Randomizer tex * TWEAK: Randomizer ZAPD extension format * Adds control stick prompts to the "scrolling" menu. * Adds third entry for Randomizer. * Bold text on randomizer subtitle. * Ensures the game won't allow selecting an unsupported quest. * Makes save files be created from the quest menu selection. * Removes the master quest and randomizer checkboxes (no longer needed). * Removes lock on MQ-only rando. * Skips quest select if only one quest is playable. * Adds ability to back out of quest select menu * Show seed icons while Randomizer is selected on Quest Select Menu. * Fixes custom hud colors and d-pad navigation. * Implements backing up from name entry to quest select. Also implements backwards rotations on the file select screen. Co-authored-by: PurpleHato --- .../gTitleRandomizerSubtitleTex.rgba32.png | Bin 0 -> 6971 bytes .../gFileSelPleaseChooseAQuestENGTex.ia8.png | Bin 0 -> 3682 bytes .../gFileSelPleaseChooseAQuestFRATex.ia8.png | Bin 0 -> 3852 bytes .../gFileSelPleaseChooseAQuestGERTex.ia8.png | Bin 0 -> 3666 bytes soh/include/z64.h | 25 + soh/soh/Enhancements/bootcommands.c | 5 - .../Enhancements/randomizer/randomizer.cpp | 36 +- soh/soh/GameMenuBar.cpp | 33 - soh/soh/SaveManager.cpp | 5 - soh/src/code/z_sram.c | 2 +- .../overlays/actors/ovl_En_Ossan/z_en_ossan.h | 17 - .../gamestates/ovl_file_choose/file_choose.h | 7 +- .../ovl_file_choose/z_file_choose.c | 948 ++++++++++++++---- .../ovl_file_choose/z_file_nameset_PAL.c | 9 +- 14 files changed, 787 insertions(+), 300 deletions(-) create mode 100644 OTRExporter/assets/objects/object_mag/gTitleRandomizerSubtitleTex.rgba32.png create mode 100644 OTRExporter/assets/textures/title_static/gFileSelPleaseChooseAQuestENGTex.ia8.png create mode 100644 OTRExporter/assets/textures/title_static/gFileSelPleaseChooseAQuestFRATex.ia8.png create mode 100644 OTRExporter/assets/textures/title_static/gFileSelPleaseChooseAQuestGERTex.ia8.png diff --git a/OTRExporter/assets/objects/object_mag/gTitleRandomizerSubtitleTex.rgba32.png b/OTRExporter/assets/objects/object_mag/gTitleRandomizerSubtitleTex.rgba32.png new file mode 100644 index 0000000000000000000000000000000000000000..a61a058a8ac848b23010366cf497a29fbbc5ec0a GIT binary patch literal 6971 zcmai3XIN9+vfiPC6lsDYy$giidliu0Q2{9d0wDnsLa0UoQIMhnDjjJeV4+v3(mMhI z(gf*Edgn&{&R5Pk_ue0S@638<-kCLPX7=;!JTfx4PC<5s3;+NM9c>L0+!Kqt*hq+Q z_c0DnZU7+kfSOsMtn~Hd91$L1dnbeg1dQ?U#Nhy-pp5afcXWrK*c>1(P`Dz;Ms*zr z8`MdW!%|XTMBh^#;tJLF_lB7I8<;uzyF1D{aVRU1DPZJq1RfBSJsZXY21m+a6ghtJ z%He+hTo&eF`=x?%SLCqLH)2yqcthAE!IEGR4ka=+1#c&3ITH=7Ka6pbB8Mvqc-_@NQ{|v>`#~b!55GO}r2n^x@ zfuoQ(ebImDLom?)h5je!o2dl!fv1nz=z zRpbyC`!~Q6>hyD6R7~bC;3pHz=jYLx!=X6ef3var3sdBf784fz%gXw{LO*jYX9UGS zU{)GX+(996tbe)t3$^|m`bUtzKy?HR;cbd*1PIRRm$N@lLhcu)k8r|4;{OKesH+=! zBb=cy9ELQxuEwULsV*fdDw!+PLm4Q4R$~!63h+-#wuUL;aS1i!kWVMv#Nq z!(9|PFhWicXL}zQibLs_nVp9{5(V+L^YVcpQFcflhhM8;Zx;u9aWMtqpDhK0{=xlA z`WLx^@IO2&;3C)8m(zwKQ3!9pzXf9o@%m>lzdDnR?N`0Y**pF`enk#XZ-kSNBgE-f z5^&r4jUo}wC|`STh^h;&)D$^Xot>e$Lh)n6H9gb?4)JEg^`Zz^@}EY&t`HpI|DI;y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CM}KrI55-*XO&k)quOmwymJqJhsoIg>bO$S|$PnJ?Ssu#V z+4y*@ef1g`xE#Or(CrFgp82;g6f$xSAYTFgzy9RBqQ}}E=HG8 z%6Fx#iqEE&^M~Fpuc)&Nx48toBP4cLK(Aeyni?!lMZ3eWjr>>|f<8JbU*AVF+znnC zu`+;00A_P}qMDc7gzqXj*yj0CJH8052%3q4gFSmwd5Z4R`Im2~Q`YH`5LY00>o_># z)94DI3A#d9UyN00nu=<9txdC(nSlY;BN<{S2Hk2gaklsp$$F~10R1%m+`XkAD65CJ znFIH7a(K7y=R{YJ2;fd;F z3X`~OacyBD4KmL!cM2s#O24T1RWz)}xrR;GAL6|Lah<&w2!8~s+Kl;hk9oWHsC#Ml zVU^7a0VC1-(V3DP(-^W>D)p}B>8q3_^)m!Amzv$e zn?Uc$RgB|g{4V%>Y-Ec%7tOXIIM|)0uoF@Y%O>GQYlzdSaN$MZkvuUZxOkYF!*3+P z7NK!wFk`!@)4)xx!r@xp1oQb;ejcIYgZs#~sP^-Fn;q{N{wp*qFbr7n{rt~MN7F## Jt=gUY{{wF#Q49b8 literal 0 HcmV?d00001 diff --git a/OTRExporter/assets/textures/title_static/gFileSelPleaseChooseAQuestENGTex.ia8.png b/OTRExporter/assets/textures/title_static/gFileSelPleaseChooseAQuestENGTex.ia8.png new file mode 100644 index 0000000000000000000000000000000000000000..02ca600c2d90838979f3b8c34df878e2dae5c0cf GIT binary patch literal 3682 zcmWlc2{=@36vt&(a&V#4sf-RHUYzVE&Fx$iya{Lk;4`@+cJ9>aOA^AHGx0ik`@1f0=ezj%%s9Otb< zo{3^Q!nu?Cp#vRCXD4CUSIVpFLpb4qT$xkkPbs?__3LPZ|vuFKyer88CTx z93m@>{Ya51v}mk38Q+=KIbNYTxx%v;EXb^Tu8=kyE@DI)nOMFb1y`_N^GR#a_Mm@X z*|`ZIxZ%CHof} zoT!OJWj^i_t*vVsYmz2>LlD(!=k>2v}j+j?r~^lY=DfNM9SP6_sfgyPs%-i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pWCYp^YHCqI!S21PdHUHuySpYR)O&#SRXpDP_tYb&mp%_sgfFjjw6%Ba0(jPV zR3s$yFQ}f>z@y})rH#O%>oZN&(g9&kPDLiBrf`ohS4SPX7}Y>Z=olCrY&^4Fu{yodQ#Elq0#9 z^N6311#1>otmjJg0^Tz*{@J0Tr6*TV4nuER3D(Fwo#`>marF1oKjI!_wv@}=gt zR2)){q&^9e2bT5bopoNfkP4_)T1V7L=NK$N50yF`Fb=)u^!Fs-e%tVGk2qgn3xvH^ zBh#4TZ(v3U3;}0#(ovLLj3;fLhjbk#0jCNd|B|9hRmI7d>RRf8eoY;>CV(k)_cLlc jC;A)lv?;kT|CDAOscHLoo!<%kra%yy26wA8oF4xV1CcBk literal 0 HcmV?d00001 diff --git a/OTRExporter/assets/textures/title_static/gFileSelPleaseChooseAQuestFRATex.ia8.png b/OTRExporter/assets/textures/title_static/gFileSelPleaseChooseAQuestFRATex.ia8.png new file mode 100644 index 0000000000000000000000000000000000000000..8bc17292b26f703123ee26b2ade96d2acfacaa13 GIT binary patch literal 3852 zcmWkx2RxMjAHPGc%!DY?FjE<2W^b45pKK>v$;{cDR7VauBzuJW8&TOKM6x@w$2oG{ zS!ZR>|F`G$`aa|JdY-<@IaGtRUh=xF* zFWfaWjQmV=)UUy{G-M>@Wn}K$6_bQOL=ycI@weI^^L8Sp+|uv7iTeFX%7DM_ViROcNUm>xD<-deS)?X-#LCO`B<51-s zWjqD?RG^f!^%~msC)P@Y+Z(ULHNC^d`}{Y}ilmmgYa2V;QanE7cF|YrJ-?CN!vHB^ zYy-_Zp*dr%kvDBgZ9}D6Bcv;HNI`bJvpMHNq;DGS{T!Zm4wsg$)+OeQaBO z&fNLbqT5aWagcnr4N|Lk*s=M0S|9#Z2eNlbU0Cxi#IuOol}RNE)3u6Yy?X4MZ*Zh~ zGyL6)@1kEy%kn-yOlQ(+$}iX5DHu;)fTvlG_MMzkOS3O;rc^4>4(xewuPJRxPpwxv zb0c(KZ}>6Q2-o$Q&o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!~X6(war3*pCJXN5OG>e*lQetW`9q-h+GR0&zjpnQbX4A=TDGThto@8K1cJ5 z@rMet%S=C}e%V$W*6r+QLX-pEa>3k&iu4cW&{r|~AzYojQIiv{v)wGDDq@TGY^1`% nal}znYYwp}&M{ov`4onY<16G9gI)kXR1mn9fo8e7{fqwtC=am* literal 0 HcmV?d00001 diff --git a/OTRExporter/assets/textures/title_static/gFileSelPleaseChooseAQuestGERTex.ia8.png b/OTRExporter/assets/textures/title_static/gFileSelPleaseChooseAQuestGERTex.ia8.png new file mode 100644 index 0000000000000000000000000000000000000000..25f96cc2bd9398e4e5dcbe64e8bf8a7fd46018dd GIT binary patch literal 3666 zcmV-Y4z2NtP)J?hlx=*Y*U8I_T4YF zAK$*;Npe-LiV_#U4*UgNm9tVrN{(_SF6is?-Bw$&=jnMqujl=IKA%3%=K*UZtK{^C z0m$WxS|}KB&qo*B_7@y<;sWe3MOSCS6A|i;&wDJUz3nq|)%W{%G$)d}0+uG>QAO2? z!jr<&t3}o19pQE*6H5r6341juQ25T&<7Iv|IbG&&leI`_46Lof?sN^uYgox>IbnG@ zo?LcCsnlb>#F@;`g~fKu>Ov<(kN|F`7-tMWgN(@Trw*|@|CkY1JL+v81FsuHQVsBWf)&ahVgR@wkNpE zSK|wZF#I9`M8us>~SNvO+egP5cXTMDFWX1ph010qNS#tmY3ljhU3ljkVnw%H_01S3XL_t(& zf$f=ja8=co#(x=rL_m;82!tdIc9_x`NU(iYD7g@eW;6;ygaQfBL=XcQ5y28#ePUxh z>8IU-NXgWwje-*L5JJOcmN5z;^bG`J!WfbZm|2oszW(FfbGW%CwC`En^{Tp8)v0^- zUf*8(+v}{e_d4tPa8CvRi9j`Q2q<;8ySv*bJTR4jA217u2F?P11GE5E0JA-?=2&kr z_1D~(t4(1395L83Gg$5h1(XuFT9#0ZL6xl_b6R;)}X?@uHkg zr!{uYoH?@F?V34rrrFokW4_x12M(0oZr8?*8%_QA->~RY;o;%3+wIEE&Nl7MYX)lr zw0!w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7j{Cgq9S5c~!!I4kH?ii9XYK&N+ZaVA zv+e1R%|LJ51v-zb2zV8viuebh#%pa^?sbpHI5JKB0gONFOzhfbI9t-$ef@WRU>qHu zsr6%CW4vv2@@jk6-~%v9piRxyl=J}N-S@sgu$SHkBMAy?Vyx#JZJOchEy2Lw0T2F4 zetiJfh!G=HQc|MbyLX!pVUAnh$&CScn8yAwB>@O;#(qBxA2cVuJ?=XL4>Sk-fBB!2 kf8m!U+xYvA_+OI$0w6^8zM!=-cmMzZ07*qoM6N<$g3XCdsQ>@~ literal 0 HcmV?d00001 diff --git a/soh/include/z64.h b/soh/include/z64.h index 274a293df..dada44b48 100644 --- a/soh/include/z64.h +++ b/soh/include/z64.h @@ -1322,6 +1322,23 @@ typedef struct { /* 0x00A8 */ View view; } OpeningContext; // size = 0x1D0 +typedef struct { + /* 0x00 */ u32 stickColorR; + /* 0x04 */ u32 stickColorG; + /* 0x08 */ u32 stickColorB; + /* 0x0C */ u32 stickColorA; + /* 0x10 */ f32 stickTexX; + /* 0x14 */ f32 stickTexY; + /* 0x18 */ u32 arrowColorR; + /* 0x1C */ u32 arrowColorG; + /* 0x20 */ u32 arrowColorB; + /* 0x24 */ u32 arrowColorA; + /* 0x28 */ f32 arrowTexX; + /* 0x2C */ f32 arrowTexY; + /* 0x30 */ f32 z; + /* 0x34 */ s32 isEnabled; +} StickDirectionPrompt; + typedef struct { /* 0x00000 */ GameState state; /* 0x000A4 */ Vtx* windowVtx; @@ -1392,6 +1409,14 @@ typedef struct { /* 0x1CAD2 */ s16 kbdY; /* 0x1CAD4 */ s16 newFileNameCharCount; /* 0x1CAD6 */ s16 unk_1CAD6[5]; + s16 logoAlpha; + s8 questType[3]; // 0 for Normal, 1 for MQ + StickDirectionPrompt stickLeftPrompt; + StickDirectionPrompt stickRightPrompt; + f32 arrowAnimTween; + f32 stickAnimTween; + u8 arrowAnimState; + u8 stickAnimState; } FileChooseContext; // size = 0x1CAE0 typedef enum { diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c index ff956105a..ebdda902e 100644 --- a/soh/soh/Enhancements/bootcommands.c +++ b/soh/soh/Enhancements/bootcommands.c @@ -27,11 +27,6 @@ void BootCommands_Init() CVar_RegisterS32("gHudColors", 0); //0 = N64 / 1 = NGC / 2 = Custom CVar_RegisterS32("gInvertYAxis", 1); CVar_RegisterS32("gTrailDuration", 4); // 4 = Default trail duration - if (ResourceMgr_GameHasMasterQuest() && !ResourceMgr_GameHasOriginal()) { - CVar_SetS32("gMasterQuest", 1); - } else if (!ResourceMgr_GameHasMasterQuest()) { - CVar_SetS32("gMasterQuest", 0); - } #if defined(__SWITCH__) || defined(__WIIU__) CVar_RegisterS32("gControlNav", 1); // always enable controller nav on switch/wii u #endif diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index eddd4cfb7..98e87178f 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -2590,42 +2590,30 @@ void DrawRandoEditor(bool& open) { return; } - if (OTRGlobals::Instance->HasMasterQuest() && !OTRGlobals::Instance->HasOriginal()) { - ImGui::Text("Coming Soon! Randomizer is currently not compatible with Master Quest Dungeons.\nFor now, please " - "generate an " - "OTR using a non-Master Quest rom to play the Randomizer"); - ImGui::End(); - return; - } - bool disableEditingRandoSettings = CVar_GetS32("gRandoGenerating", 0) || CVar_GetS32("gOnFileSelectNameEntry", 0); ImGui::PushItemFlag(ImGuiItemFlags_Disabled, disableEditingRandoSettings); ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * (disableEditingRandoSettings ? 0.5f : 1.0f)); - UIWidgets::EnhancementCheckbox("Enable Randomizer", "gRandomizer"); - if (CVar_GetS32("gRandomizer", 0)) { - ImGui::Dummy(ImVec2(0.0f, 0.0f)); - if (ImGui::Button("Generate Seed")) { - if (CVar_GetS32("gRandoGenerating", 0) == 0) { - randoThread = std::thread(&GenerateRandomizerImgui); - } + ImGui::Dummy(ImVec2(0.0f, 0.0f)); + if (ImGui::Button("Generate Seed")) { + if (CVar_GetS32("gRandoGenerating", 0) == 0) { + randoThread = std::thread(&GenerateRandomizerImgui); } - ImGui::Dummy(ImVec2(0.0f, 0.0f)); - std::string spoilerfilepath = CVar_GetString("gSpoilerLog", ""); - ImGui::Text("Spoiler File: %s", spoilerfilepath.c_str()); - - // RANDOTODO settings presets - // std::string presetfilepath = CVar_GetString("gLoadedPreset", ""); - // ImGui::Text("Settings File: %s", presetfilepath.c_str()); } + ImGui::Dummy(ImVec2(0.0f, 0.0f)); + std::string spoilerfilepath = CVar_GetString("gSpoilerLog", ""); + ImGui::Text("Spoiler File: %s", spoilerfilepath.c_str()); + + // RANDOTODO settings presets + // std::string presetfilepath = CVar_GetString("gLoadedPreset", ""); + // ImGui::Text("Settings File: %s", presetfilepath.c_str()); UIWidgets::PaddedSeparator(); ImGuiWindow* window = ImGui::GetCurrentWindow(); static ImVec2 cellPadding(8.0f, 8.0f); - if (CVar_GetS32("gRandomizer", 0) && - ImGui::BeginTabBar("Randomizer Settings", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { + if (ImGui::BeginTabBar("Randomizer Settings", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { if (ImGui::BeginTabItem("World")) { ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding); if (ImGui::BeginTable("tableRandoWorld", 3, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index 1c04ba69c..9e9301df9 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -95,35 +95,6 @@ namespace GameMenuBar { Audio_SetGameVolume(SEQ_SFX, CVar_GetFloat("gFanfareVolume", 1)); } - bool MasterQuestCheckboxDisabled() { - return !(OTRGlobals::Instance->HasMasterQuest() && OTRGlobals::Instance->HasOriginal()) - || CVar_GetS32("gRandomizer", 0); - } - - std::string MasterQuestDisabledTooltip() { - std::string tooltip = ""; - if (CVar_GetS32("gRandomizer", 0)) { - tooltip = "This option is disabled because you have the Randomizer enabled.\nRandomizer has it's own " - "settings surrounding Master Quest dungeons\nthat you can set from the Randomizer Settings Menu."; - } - if (!OTRGlobals::Instance->HasOriginal()) { - tooltip = "This option is force-enabled because you have only loaded the\noot-mq.otr file. If you wish to " - "play the Original Quest,\nplease provide the oot.otr file."; - } - if (!OTRGlobals::Instance->HasMasterQuest()) { - tooltip = "This option is disabled because you have only loaded the\noot.otr file. If you wish to play " - "the Master Quest,\nplease proivde the oot-mq.otr file."; - } - return tooltip; - } - - UIWidgets::CheckboxGraphics MasterQuestDisabledGraphic() { - if (!OTRGlobals::Instance->HasOriginal()) { - return UIWidgets::CheckboxGraphics::Checkmark; - } - return UIWidgets::CheckboxGraphics::Cross; - } - void applyEnhancementPresetDefault(void) { // D-pad Support on Pause CVar_SetS32("gDpadPause", 0); @@ -1313,10 +1284,6 @@ namespace GameMenuBar { UIWidgets::Tooltip("Holding down B skips text"); UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera", true, false); UIWidgets::Tooltip("Enables camera control\nNote: You must remap C buttons off of the right stick in the controller config menu, and map the camera stick to the right stick."); - UIWidgets::PaddedEnhancementCheckbox("Master Quest", "gMasterQuest", true, false, MasterQuestCheckboxDisabled(), MasterQuestDisabledTooltip().c_str(), MasterQuestDisabledGraphic()); - UIWidgets::Tooltip("Enables Master Quest.\n\nWhen checked, any non-rando save files you create will be " - "Master Quest save files. Master Quest save files will still have Master Quest dungeons " - "regardless of this setting and require oot-mq.otr to be present in order to play."); #ifdef __SWITCH__ UIWidgets::Spacer(0); diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index a9a7ba66b..f8ca5bfb4 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -56,8 +56,6 @@ SaveManager::SaveManager() { } void SaveManager::LoadRandomizerVersion1() { - if(!CVar_GetS32("gRandomizer", 0)) return; - for (int i = 0; i < ARRAY_COUNT(gSaveContext.itemLocations); i++) { SaveManager::Instance->LoadStruct("get" + std::to_string(i), [&]() { SaveManager::Instance->LoadData("rgID", gSaveContext.itemLocations[i].get.rgID); @@ -482,9 +480,6 @@ void SaveManager::InitFileNormal() { gSaveContext.magicLevel = 0; gSaveContext.infTable[29] = 1; gSaveContext.sceneFlags[5].swch = 0x40000000; - - gSaveContext.isMasterQuest = CVar_GetS32("gMasterQuest", 0) && !CVar_GetS32("gRandomizer", 0); - //RANDOTODO (ADD ITEMLOCATIONS TO GSAVECONTEXT) } diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index fed23dcf3..61e8fecbb 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -297,7 +297,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { gSaveContext.playerName[offset] = Save_GetSaveMetaInfo(fileChooseCtx->buttonIndex)->playerName[offset]; } - if (CVar_GetS32("gRandomizer", 0) && strnlen(CVar_GetString("gSpoilerLog", ""), 1) != 0 && + if (fileChooseCtx->questType[fileChooseCtx->buttonIndex] == 2 && strnlen(CVar_GetString("gSpoilerLog", ""), 1) != 0 && !((Save_GetSaveMetaInfo(fileChooseCtx->buttonIndex)->requiresMasterQuest && !ResourceMgr_GameHasMasterQuest()) || (Save_GetSaveMetaInfo(fileChooseCtx->buttonIndex)->requiresMasterQuest && !ResourceMgr_GameHasOriginal()))) { // Set N64DD Flags for save file diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index 1dddce504..dfc7ac97f 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -14,23 +14,6 @@ typedef void (*EnOssanInitFunc)(struct EnOssan*, GlobalContext*); typedef s16 (*EnOssanGetGirlAParamsFunc)(s16); typedef void (*EnOssanStateFunc)(struct EnOssan*, GlobalContext*, Player*); -typedef struct { - /* 0x00 */ u32 stickColorR; - /* 0x04 */ u32 stickColorG; - /* 0x08 */ u32 stickColorB; - /* 0x0C */ u32 stickColorA; - /* 0x10 */ f32 stickTexX; - /* 0x14 */ f32 stickTexY; - /* 0x18 */ u32 arrowColorR; - /* 0x1C */ u32 arrowColorG; - /* 0x20 */ u32 arrowColorB; - /* 0x24 */ u32 arrowColorA; - /* 0x28 */ f32 arrowTexX; - /* 0x2C */ f32 arrowTexY; - /* 0x30 */ f32 z; - /* 0x34 */ s32 isEnabled; -} StickDirectionPrompt; // size = 0x38 - #define ColChanMix(c1, c2, m) (c1 - (s32)(c2 * m)) & 0xFF typedef struct EnOssan { diff --git a/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h b/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h index 93f4efb76..0abf7583a 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h +++ b/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h @@ -55,7 +55,12 @@ typedef enum { /* 37 */ CM_OPTIONS_MENU, /* 38 */ CM_START_OPTIONS, /* 39 */ CM_OPTIONS_TO_MAIN, - /* 40 */ CM_UNUSED_DELAY + /* 40 */ CM_UNUSED_DELAY, + CM_ROTATE_TO_QUEST_MENU, + CM_QUEST_MENU, + CM_START_QUEST_MENU, + CM_QUEST_TO_MAIN, + CM_NAME_ENTRY_TO_QUEST_MENU, } ConfigMode; typedef enum { diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index e816670a5..4b1dec055 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -7,6 +7,180 @@ #include #include "soh/frame_interpolation.h" #include +#include "objects/object_mag/object_mag.h" +#include "objects/gameplay_keep/gameplay_keep.h" + +#define NORMAL_QUEST 0 +#define MASTER_QUEST 1 +#define RANDOMIZER_QUEST 2 +#define MIN_QUEST (ResourceMgr_GameHasOriginal() ? NORMAL_QUEST : MASTER_QUEST) +u8 getMaxQuest() { + if ((strnlen(CVar_GetString("gSpoilerLog", ""), 1) != 0)) { + return RANDOMIZER_QUEST; + } + + if (ResourceMgr_GameHasMasterQuest()) { + return MASTER_QUEST; + } + + return NORMAL_QUEST; +} +#define MAX_QUEST getMaxQuest() + +void FileChoose_DrawTextureI8(GraphicsContext* gfxCtx, const void* texture, s16 texWidth, s16 texHeight, s16 rectLeft, s16 rectTop, + s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy) { + OPEN_DISPS(gfxCtx); + gDPLoadTextureBlock(POLY_OPA_DISP++, texture, G_IM_FMT_I, G_IM_SIZ_8b, texWidth, texHeight, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + gSPTextureRectangle(POLY_OPA_DISP++, rectLeft << 2, rectTop << 2, (rectLeft + rectWidth) << 2, (rectTop + rectHeight) << 2, + G_TX_RENDERTILE, 0, 0, dsdx, dtdy); + + CLOSE_DISPS(gfxCtx); +} + +void FileChoose_DrawRawImageRGBA32(GraphicsContext* gfxCtx, s16 centerX, s16 centerY, const char* source, u32 width, u32 height) { + u8* curTexture; + s32 textureCount; + u32 rectLeft; + u32 rectTop; + u32 textureHeight; + s32 remainingSize; + s32 textureSize; + s32 pad; + s32 i; + + OPEN_DISPS(gfxCtx); + + source = ResourceMgr_LoadFileRaw(source); + + curTexture = source; + rectLeft = centerX - (width / 2); + rectTop = centerY - (height / 2); + textureHeight = 4096 / (width << 2); + remainingSize = (width * height) << 2; + textureSize = (width * textureHeight) << 2; + textureCount = remainingSize / textureSize; + if ((remainingSize % textureSize) != 0) { + textureCount += 1; + } + + gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_32b, width, textureHeight, 0, G_TX_NOMIRROR | G_TX_CLAMP, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + remainingSize -= textureSize; + + for (i = 0; i < textureCount; i++) { + gDPSetTextureImage(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_32b, width, curTexture); + + gDPLoadSync(POLY_OPA_DISP++); + gDPLoadTile(POLY_OPA_DISP++, G_TX_LOADTILE, 0, 0, (width - 1) << 2, (textureHeight - 1) << 2); + + gSPTextureRectangle(POLY_OPA_DISP++, rectLeft << 2, rectTop << 2, (rectLeft + (s32)width) << 2, + (rectTop + textureHeight) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + + curTexture += textureSize; + rectTop += textureHeight; + + if ((remainingSize - textureSize) < 0) { + if (remainingSize > 0) { + textureHeight = remainingSize / (s32)(width << 2); + remainingSize -= textureSize; + + gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_32b, width, textureHeight, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + } + } else { + remainingSize -= textureSize; + } + } + CLOSE_DISPS(gfxCtx); +} + +void FileChoose_DrawImageRGBA32(GraphicsContext* gfxCtx, s16 centerX, s16 centerY, const char* source, u32 width, u32 height) { + u8* curTexture; + s32 textureCount; + u32 rectLeft; + u32 rectTop; + u32 textureHeight; + s32 remainingSize; + s32 textureSize; + s32 pad; + s32 i; + + OPEN_DISPS(gfxCtx); + + source = ResourceMgr_LoadTexByName(source); + + curTexture = source; + rectLeft = centerX - (width / 2); + rectTop = centerY - (height / 2); + textureHeight = 4096 / (width << 2); + remainingSize = (width * height) << 2; + textureSize = (width * textureHeight) << 2; + textureCount = remainingSize / textureSize; + if ((remainingSize % textureSize) != 0) { + textureCount += 1; + } + + gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_32b, width, textureHeight, 0, G_TX_NOMIRROR | G_TX_CLAMP, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + remainingSize -= textureSize; + + for (i = 0; i < textureCount; i++) { + gDPSetTextureImage(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_32b, width, curTexture); + + gDPLoadSync(POLY_OPA_DISP++); + gDPLoadTile(POLY_OPA_DISP++, G_TX_LOADTILE, 0, 0, (width - 1) << 2, (textureHeight - 1) << 2); + + gSPTextureRectangle(POLY_OPA_DISP++, rectLeft << 2, rectTop << 2, (rectLeft + (s32)width) << 2, + (rectTop + textureHeight) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + + curTexture += textureSize; + rectTop += textureHeight; + + if ((remainingSize - textureSize) < 0) { + if (remainingSize > 0) { + textureHeight = remainingSize / (s32)(width << 2); + remainingSize -= textureSize; + + gDPSetTileCustom(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_32b, width, textureHeight, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + } + } else { + remainingSize -= textureSize; + } + } + CLOSE_DISPS(gfxCtx); +} + +void FileChoose_DrawTextRec(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a, f32 x, f32 y, f32 z, s32 s, s32 t, + f32 dx, f32 dy) { + f32 unk; + s32 ulx, uly, lrx, lry; + f32 w, h; + s32 dsdx, dtdy; + + OPEN_DISPS(gfxCtx); + gDPPipeSync(POLY_OPA_DISP++); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, r, g, b, a); + + w = 8.0f * z; + h = 12.0f * z; + unk = (1.0f / z) * 1024; + dsdx = unk * dx; + dtdy = dy * unk; + + ulx = (x - w) * 4.0f; + uly = (y - h) * 4.0f; + lrx = (x + w) * 4.0f; + lry = (y + h) * 4.0f; + gSPTextureRectangle(POLY_OPA_DISP++, ulx, uly, lrx, lry, G_TX_RENDERTILE, s, t, dsdx, dtdy); + CLOSE_DISPS(gfxCtx); +} static s16 sUnused = 106; @@ -212,7 +386,7 @@ void DrawSeedHashSprites(FileChooseContext* this) { gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - if (this->windowRot == 0) { + if (this->windowRot == 0 || (this->configMode == CM_QUEST_MENU && this->questType[this->buttonIndex] == RANDOMIZER_QUEST)) { if (this->selectMode == SM_CONFIRM_FILE) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0xFF, 0xFF, 0xFF, this->fileInfoAlpha[this->buttonIndex]); @@ -229,7 +403,7 @@ void DrawSeedHashSprites(FileChooseContext* this) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0xFF, 0xFF, 0xFF, this->fileButtonAlpha[this->buttonIndex]); - if (CVar_GetS32("gRandomizer", 0) && strnlen(CVar_GetString("gSpoilerLog", ""), 1) != 0 && fileSelectSpoilerFileLoaded) { + if (strnlen(CVar_GetString("gSpoilerLog", ""), 1) != 0 && fileSelectSpoilerFileLoaded) { u16 xStart = 64; for (unsigned int i = 0; i < 5; i++) { SpriteLoad(this, GetSeedTexture(gSaveContext.seedIcons[i])); @@ -306,18 +480,25 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { if (this->buttonIndex <= FS_BTN_MAIN_FILE_3) { if (!Save_GetSaveMetaInfo(this->buttonIndex)->valid) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - this->configMode = CM_ROTATE_TO_NAME_ENTRY; - CVar_SetS32("gOnFileSelectNameEntry", 1); - this->kbdButton = FS_KBD_BTN_NONE; - this->charPage = FS_CHAR_PAGE_ENG; - this->kbdX = 0; - this->kbdY = 0; - this->charIndex = 0; - this->charBgAlpha = 0; - this->newFileNameCharCount = 0; - this->nameEntryBoxPosX = 120; - this->nameEntryBoxAlpha = 0; - memcpy(Save_GetSaveMetaInfo(this->buttonIndex)->playerName, &emptyName, 8); + this->prevConfigMode = this->configMode; + if (MIN_QUEST != MAX_QUEST) { + this->configMode = CM_ROTATE_TO_QUEST_MENU; + } else { + this->configMode = CM_ROTATE_TO_NAME_ENTRY; + this->questType[this->buttonIndex] = MIN_QUEST; + CVar_SetS32("gOnFileSelectNameEntry", 1); + this->kbdButton = FS_KBD_BTN_NONE; + this->charPage = FS_CHAR_PAGE_ENG; + this->kbdX = 0; + this->kbdY = 0; + this->charIndex = 0; + this->charBgAlpha = 0; + this->newFileNameCharCount = 0; + this->nameEntryBoxPosX = 120; + this->nameEntryBoxAlpha = 0; + memcpy(Save_GetSaveMetaInfo(this->buttonIndex)->playerName, &emptyName, 8); + } + this->logoAlpha = 0; } else if(!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(this->buttonIndex))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } @@ -399,6 +580,126 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { } } +void FileChoose_UpdateStickDirectionPromptAnim(GameState* thisx) { + FileChooseContext* this = (FileChooseContext*)thisx; + f32 arrowAnimTween; + f32 new_var3; // likely fake temp + s32 new_var2 = 155; // likely fake temp + f32 stickAnimTween; + + arrowAnimTween = this->arrowAnimTween; + stickAnimTween = this->stickAnimTween; + if (this->arrowAnimState == 0) { + arrowAnimTween += 0.027f; + if (arrowAnimTween > 1.0f) { + arrowAnimTween = 1.0f; + this->arrowAnimState = 1; + } + + } else { + arrowAnimTween -= 0.027f; + if (arrowAnimTween < 0.0f) { + arrowAnimTween = 0.0f; + this->arrowAnimState = 0; + } + } + + this->arrowAnimTween = arrowAnimTween; + if (this->stickAnimState == 0) { + stickAnimTween += 0.027f; + if (stickAnimTween > 1.0f) { + stickAnimTween = 1.0f; + this->stickAnimState = 1; + } + + } else { + stickAnimTween = 0.0f; + this->stickAnimState = 0; + } + + this->stickAnimTween = stickAnimTween; + this->stickLeftPrompt.arrowColorR = (u8)(155 - ((s32)(75.0f * arrowAnimTween))); + this->stickLeftPrompt.arrowColorG = (u8)(new_var2 - (s32)(55.0f * arrowAnimTween)); + new_var3 = (75.0f * arrowAnimTween); + this->stickLeftPrompt.arrowColorB = (u8)(255 - ((s32)(75.0f * arrowAnimTween))); + this->stickLeftPrompt.arrowColorA = (u8)(200 - ((s32)(50.0f * arrowAnimTween))); + this->stickRightPrompt.arrowColorR = (u8)(new_var2 - (s32)new_var3); + this->stickRightPrompt.arrowColorG = (u8)(155 - (s32)new_var3); + this->stickRightPrompt.arrowColorB = (u8)(255 - ((s32)(75.0f * arrowAnimTween))); + this->stickRightPrompt.arrowColorA = (u8)(200 - ((s32)(50.0f * arrowAnimTween))); + this->stickRightPrompt.arrowTexX = 260.0f; + this->stickLeftPrompt.arrowTexX = 63.0f; + this->stickRightPrompt.stickTexX = 244.0f; + this->stickLeftPrompt.stickTexX = 79.0f; + this->stickRightPrompt.stickTexX += (8.0f * stickAnimTween); + this->stickLeftPrompt.stickTexX -= (8.0f * stickAnimTween); + this->stickLeftPrompt.arrowTexY = this->stickRightPrompt.arrowTexY = 135.0f; + this->stickLeftPrompt.stickTexY = this->stickRightPrompt.stickTexY = 139.0f; +} + +void FileChoose_StartQuestMenu(GameState* thisx) { + FileChooseContext* this = (FileChooseContext*)thisx; + + this->logoAlpha += 25; + + if (this->logoAlpha >= 255) { + this->logoAlpha = 255; + this->configMode = CM_QUEST_MENU; + } +} + +void FileChoose_UpdateQuestMenu(GameState* thisx) { + static u8 emptyName[] = { 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E }; + FileChoose_UpdateStickDirectionPromptAnim(thisx); + FileChooseContext* this = (FileChooseContext*)thisx; + Input* input = &this->state.input[0]; + s8 i = 0; + bool dpad = CVar_GetS32("gDpadText", 0);(dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)); + + if (ABS(this->stickRelX) > 30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT | BTN_DRIGHT))) { + if (this->stickRelX > 30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DRIGHT))) { + this->questType[this->buttonIndex] += 1; + } else if (this->stickRelX < -30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT))) { + this->questType[this->buttonIndex] -= 1; + } + + if (this->questType[this->buttonIndex] > MAX_QUEST) { + this->questType[this->buttonIndex] = MIN_QUEST; + } else if (this->questType[this->buttonIndex] < MIN_QUEST) { + this->questType[this->buttonIndex] = MAX_QUEST; + } + + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + } + + if (CHECK_BTN_ALL(input->press.button, BTN_A)) { + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + gSaveContext.isMasterQuest = this->questType[this->buttonIndex] == MASTER_QUEST; + gSaveContext.n64ddFlag = this->questType[this->buttonIndex] == RANDOMIZER_QUEST; + osSyncPrintf("Selected Dungeon Quest: %d\n", gSaveContext.isMasterQuest); + this->prevConfigMode = this->configMode; + this->configMode = CM_ROTATE_TO_NAME_ENTRY; + this->logoAlpha = 0; + CVar_SetS32("gOnFileSelectNameEntry", 1); + this->kbdButton = FS_KBD_BTN_NONE; + this->charPage = FS_CHAR_PAGE_ENG; + this->kbdX = 0; + this->kbdY = 0; + this->charIndex = 0; + this->charBgAlpha = 0; + this->newFileNameCharCount = 0; + this->nameEntryBoxPosX = 120; + this->nameEntryBoxAlpha = 0; + memcpy(Save_GetSaveMetaInfo(this->buttonIndex)->playerName, &emptyName, 8); + return; + } + + if (CHECK_BTN_ALL(input->press.button, BTN_B)) { + this->configMode = CM_QUEST_TO_MAIN; + return; + } +} + /** * Update function for `CM_UNUSED_31` */ @@ -431,9 +732,12 @@ void FileChoose_RotateToNameEntry(GameState* thisx) { this->windowRot += VREG(16); - if (this->windowRot >= 314.0f) { + if (MIN_QUEST == MAX_QUEST && this->windowRot >= 314.0f) { this->windowRot = 314.0f; this->configMode = CM_START_NAME_ENTRY; + } else if (this->windowRot >= 628.0f) { + this->windowRot = 628.0f; + this->configMode = CM_START_NAME_ENTRY; } } @@ -458,12 +762,43 @@ void FileChoose_RotateToOptions(GameState* thisx) { */ void FileChoose_RotateToMain(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; + if (this->configMode == CM_QUEST_TO_MAIN || (MIN_QUEST == MAX_QUEST && this->configMode == CM_NAME_ENTRY_TO_MAIN) || + this->configMode == CM_OPTIONS_TO_MAIN) { + this->windowRot -= VREG(16); - this->windowRot += VREG(16); + if (this->windowRot <= 0.0f) { + this->windowRot = 0.0f; + this->configMode = CM_MAIN_MENU; + } + } - if (this->windowRot >= 628.0f) { - this->windowRot = 0.0f; - this->configMode = CM_MAIN_MENU; + if (this->configMode == CM_NAME_ENTRY_TO_MAIN && this->prevConfigMode == CM_MAIN_MENU) { + this->windowRot += VREG(16); + + if (this->windowRot >= 942.0f || (MIN_QUEST == MAX_QUEST && this->windowRot >= 628.0f)) { + this->windowRot = 0.0f; + this->configMode = CM_MAIN_MENU; + } + } +} + +void FileChoose_RotateToQuest(GameState* thisx) { + FileChooseContext* this = (FileChooseContext*)thisx; + + if (this->configMode == CM_NAME_ENTRY_TO_QUEST_MENU) { + this->windowRot -= VREG(16); + + if (this->windowRot <= 314.0f) { + this->windowRot = 314.0f; + this->configMode = CM_START_QUEST_MENU; + } + } else { + this->windowRot += VREG(16); + + if (this->windowRot >= 314.0f) { + this->windowRot = 314.0f; + this->configMode = CM_START_QUEST_MENU; + } } } @@ -488,7 +823,9 @@ static void (*gConfigModeUpdateFuncs[])(GameState*) = { FileChoose_StartNameEntry, FileChoose_RotateToMain, FileChoose_RotateToOptions, FileChoose_UpdateOptionsMenu, FileChoose_StartOptions, FileChoose_RotateToMain, - FileChoose_UnusedCMDelay, + FileChoose_UnusedCMDelay, FileChoose_RotateToQuest, + FileChoose_UpdateQuestMenu, FileChoose_StartQuestMenu, + FileChoose_RotateToMain, FileChoose_RotateToQuest, }; /** @@ -1011,6 +1348,18 @@ static void* sOptionsButtonTextures[] = { gFileSelOptionsButtonENGTex, }; +const char* FileChoose_GetQuestChooseTitleTexName(Language lang) { + switch (lang) { + case LANGUAGE_ENG: + default: + return "assets/textures/title_static/gFileSelPleaseChooseAQuestENGTex"; + case LANGUAGE_FRA: + return "assets/textures/title_static/gFileSelPleaseChooseAQuestFRATex"; + case LANGUAGE_GER: + return "assets/textures/title_static/gFileSelPleaseChooseAQuestGERTex"; + } +} + /** * Draw most window contents including buttons, labels, and icons. * Does not include anything from the keyboard and settings windows. @@ -1023,6 +1372,11 @@ void FileChoose_DrawWindowContents(GameState* thisx) { s16 quadVtxIndex; s16 isActive; s16 pad; + char* tex = (this->configMode == CM_QUEST_MENU || this->configMode == CM_ROTATE_TO_NAME_ENTRY || + this->configMode == CM_START_QUEST_MENU || this->configMode == CM_QUEST_TO_MAIN || + this->configMode == CM_NAME_ENTRY_TO_QUEST_MENU) + ? ResourceMgr_LoadFileRaw(FileChoose_GetQuestChooseTitleTexName(gSaveContext.language)) + : sTitleLabels[gSaveContext.language][this->titleLabel]; Color_RGB8 Background_Color = { this->windowColor[0], this->windowColor[1], this->windowColor[2] }; OPEN_DISPS(this->state.gfxCtx); @@ -1034,235 +1388,317 @@ void FileChoose_DrawWindowContents(GameState* thisx) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->titleAlpha[0]); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); gSPVertex(POLY_OPA_DISP++, this->windowContentVtx, 4, 0); - gDPLoadTextureBlock(POLY_OPA_DISP++, sTitleLabels[gSaveContext.language][this->titleLabel], G_IM_FMT_IA, + gDPLoadTextureBlock(POLY_OPA_DISP++, tex, G_IM_FMT_IA, G_IM_SIZ_8b, 128, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); // draw next title label - gDPPipeSync(POLY_OPA_DISP++); - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->titleAlpha[1]); - gDPLoadTextureBlock(POLY_OPA_DISP++, sTitleLabels[gSaveContext.language][this->nextTitleLabel], G_IM_FMT_IA, - G_IM_SIZ_8b, 128, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, - G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); + if ((this->configMode == CM_QUEST_MENU) || (this->configMode == CM_START_QUEST_MENU) || + this->configMode == CM_NAME_ENTRY_TO_QUEST_MENU) { + // draw control stick prompts. + if (MIN_QUEST != MAX_QUEST) { + func_800944C4(this->state.gfxCtx); + gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + gDPLoadTextureBlock(POLY_OPA_DISP++, gArrowCursorTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 24, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + FileChoose_DrawTextRec(this->state.gfxCtx, this->stickLeftPrompt.arrowColorR, + this->stickLeftPrompt.arrowColorG, this->stickLeftPrompt.arrowColorB, + this->stickLeftPrompt.arrowColorA, this->stickLeftPrompt.arrowTexX, + this->stickLeftPrompt.arrowTexY, this->stickLeftPrompt.z, 0, 0, -1.0f, 1.0f); + FileChoose_DrawTextRec(this->state.gfxCtx, this->stickRightPrompt.arrowColorR, + this->stickRightPrompt.arrowColorG, this->stickRightPrompt.arrowColorB, + this->stickRightPrompt.arrowColorA, this->stickRightPrompt.arrowTexX, + this->stickRightPrompt.arrowTexY, this->stickRightPrompt.z, 0, 0, 1.0f, 1.0f); + gDPLoadTextureBlock(POLY_OPA_DISP++, gControlStickTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + FileChoose_DrawTextRec(this->state.gfxCtx, this->stickLeftPrompt.stickColorR, + this->stickLeftPrompt.stickColorG, this->stickLeftPrompt.stickColorB, + this->stickLeftPrompt.stickColorA, this->stickLeftPrompt.stickTexX, + this->stickLeftPrompt.stickTexY, this->stickLeftPrompt.z, 0, 0, -1.0f, 1.0f); + FileChoose_DrawTextRec(this->state.gfxCtx, this->stickRightPrompt.stickColorR, + this->stickRightPrompt.stickColorG, this->stickRightPrompt.stickColorB, + this->stickRightPrompt.stickColorA, this->stickRightPrompt.stickTexX, + this->stickRightPrompt.stickTexY, this->stickRightPrompt.z, 0, 0, 1.0f, 1.0f); + } + switch (this->questType[this->buttonIndex]) { + case NORMAL_QUEST: + default: + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->logoAlpha); + FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleTheLegendOfTextTex, 72, 8, 156, 108, 72, 8, 1024, 1024); + FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleOcarinaOfTimeTMTextTex, 96, 8, 154, 163, 96, 8, 1024, 1024); + FileChoose_DrawImageRGBA32(this->state.gfxCtx, 160, 135, gTitleZeldaShieldLogoTex, 160, 160); + break; - temp = 4; - - gDPPipeSync(POLY_OPA_DISP++); - - // draw file info box (large box when a file is selected) - for (fileIndex = 0; fileIndex < 3; fileIndex++, temp += 20) { + case MASTER_QUEST: + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->logoAlpha); + FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleTheLegendOfTextTex, 72, 8, 156, 108, 72, 8, 1024, 1024); + FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleOcarinaOfTimeTMTextTex, 96, 8, 154, 163, 96, 8, 1024, 1024); + FileChoose_DrawImageRGBA32(this->state.gfxCtx, 160, 135, gTitleZeldaShieldLogoMQTex, 160, 160); + FileChoose_DrawImageRGBA32(this->state.gfxCtx, 182, 180, "__OTR__objects/object_mag/gTitleMasterQuestSubtitleTex", 128, 32); + break; + + case RANDOMIZER_QUEST: + DrawSeedHashSprites(this); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->logoAlpha); + FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleTheLegendOfTextTex, 72, 8, 156, 108, 72, 8, 1024, 1024); + FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleOcarinaOfTimeTMTextTex, 96, 8, 154, 163, 96, 8, 1024, 1024); + FileChoose_DrawImageRGBA32(this->state.gfxCtx, 160, 135, ResourceMgr_GameHasOriginal() ? gTitleZeldaShieldLogoTex : gTitleZeldaShieldLogoMQTex, 160, 160); + FileChoose_DrawRawImageRGBA32(this->state.gfxCtx, 182, 180, "assets/objects/object_mag/gTitleRandomizerSubtitleTex", 128, 32); + break; + } + } else if (this->configMode != CM_ROTATE_TO_NAME_ENTRY) { gDPPipeSync(POLY_OPA_DISP++); - - if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->fileInfoAlpha[fileIndex]); - } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, Background_Color.r, Background_Color.g, Background_Color.b, this->fileInfoAlpha[fileIndex]); - } - gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[temp], 20, 0); - - for (quadVtxIndex = 0, i = 0; i < 5; i++, quadVtxIndex += 4) { - gDPLoadTextureBlock(POLY_OPA_DISP++, sFileInfoBoxTextures[i], G_IM_FMT_IA, G_IM_SIZ_16b, - sFileInfoBoxPartWidths[i], 56, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSP1Quadrangle(POLY_OPA_DISP++, quadVtxIndex, quadVtxIndex + 2, quadVtxIndex + 3, quadVtxIndex + 1, 0); - } - } - - for (i = 0; i < 3; i++, temp += 20) { - // draw file button - gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[temp], 20, 0); - - isActive = 0; - - if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i)) && Save_GetSaveMetaInfo(i)->valid) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], - sWindowContentColors[1][2], this->fileButtonAlpha[i]); - } else if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, - CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, - CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->fileButtonAlpha[i]); - } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], sWindowContentColors[isActive][1], - sWindowContentColors[isActive][2], this->fileButtonAlpha[i]); - } - - gDPLoadTextureBlock(POLY_OPA_DISP++, sFileButtonTextures[gSaveContext.language][i], G_IM_FMT_IA, G_IM_SIZ_16b, - 64, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->titleAlpha[1]); + gDPLoadTextureBlock(POLY_OPA_DISP++, sTitleLabels[gSaveContext.language][this->nextTitleLabel], G_IM_FMT_IA, + G_IM_SIZ_8b, 128, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); - // draw file name box - if (CVar_GetS32("gHudColors", 1) == 2 && FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->nameBoxAlpha[i]); - } else if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], - sWindowContentColors[1][2], this->nameBoxAlpha[i]); - } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], sWindowContentColors[isActive][1], - sWindowContentColors[isActive][2], this->nameBoxAlpha[i]); + temp = 4; + + gDPPipeSync(POLY_OPA_DISP++); + + // draw file info box (large box when a file is selected) + for (fileIndex = 0; fileIndex < 3; fileIndex++, temp += 20) { + gDPPipeSync(POLY_OPA_DISP++); + + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->fileInfoAlpha[fileIndex]); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, Background_Color.r, Background_Color.g, Background_Color.b, + this->fileInfoAlpha[fileIndex]); + } + gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[temp], 20, 0); + + for (quadVtxIndex = 0, i = 0; i < 5; i++, quadVtxIndex += 4) { + gDPLoadTextureBlock(POLY_OPA_DISP++, sFileInfoBoxTextures[i], G_IM_FMT_IA, G_IM_SIZ_16b, + sFileInfoBoxPartWidths[i], 56, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, quadVtxIndex, quadVtxIndex + 2, quadVtxIndex + 3, quadVtxIndex + 1, 0); + } } - gDPLoadTextureBlock(POLY_OPA_DISP++, gFileSelNameBoxTex, G_IM_FMT_IA, G_IM_SIZ_16b, 108, 16, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOLOD); - gSP1Quadrangle(POLY_OPA_DISP++, 4, 6, 7, 5, 0); + for (i = 0; i < 3; i++, temp += 20) { + // draw file button + gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[temp], 20, 0); - // draw rando label - if (Save_GetSaveMetaInfo(i)->randoSave) { + isActive = 0; + + if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i)) && Save_GetSaveMetaInfo(i)->valid) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], + sWindowContentColors[1][2], this->fileButtonAlpha[i]); + } else if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->fileButtonAlpha[i]); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], + sWindowContentColors[isActive][1], sWindowContentColors[isActive][2], + this->fileButtonAlpha[i]); + } + + gDPLoadTextureBlock(POLY_OPA_DISP++, sFileButtonTextures[gSaveContext.language][i], G_IM_FMT_IA, + G_IM_SIZ_16b, 64, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0); + + // draw file name box if (CVar_GetS32("gHudColors", 1) == 2 && FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->nameAlpha[i]); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->nameBoxAlpha[i]); } else if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], sWindowContentColors[1][2], this->nameBoxAlpha[i]); } else { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], sWindowContentColors[isActive][1], sWindowContentColors[isActive][2], - this->nameAlpha[i]); + this->nameBoxAlpha[i]); } - gDPLoadTextureBlock(POLY_OPA_DISP++, ResourceMgr_LoadFileRaw("assets/textures/title_static/gFileSelRANDButtonTex"), G_IM_FMT_IA, G_IM_SIZ_16b, 44, 16, 0, + + gDPLoadTextureBlock(POLY_OPA_DISP++, gFileSelNameBoxTex, G_IM_FMT_IA, G_IM_SIZ_16b, 108, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); - } - //Draw MQ label - if (Save_GetSaveMetaInfo(i)->requiresMasterQuest && !Save_GetSaveMetaInfo(i)->randoSave && Save_GetSaveMetaInfo(i)->valid) { + gSP1Quadrangle(POLY_OPA_DISP++, 4, 6, 7, 5, 0); + + // draw rando label + if (Save_GetSaveMetaInfo(i)->randoSave) { + if (CVar_GetS32("gHudColors", 1) == 2 && FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->nameAlpha[i]); + } else if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], + sWindowContentColors[1][2], this->nameBoxAlpha[i]); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], + sWindowContentColors[isActive][1], sWindowContentColors[isActive][2], + this->nameAlpha[i]); + } + gDPLoadTextureBlock(POLY_OPA_DISP++, + ResourceMgr_LoadFileRaw("assets/textures/title_static/gFileSelRANDButtonTex"), + G_IM_FMT_IA, G_IM_SIZ_16b, 44, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); + } + // Draw MQ label + if (Save_GetSaveMetaInfo(i)->requiresMasterQuest && !Save_GetSaveMetaInfo(i)->randoSave && + Save_GetSaveMetaInfo(i)->valid) { + if (CVar_GetS32("gHudColors", 1) == 2 && FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->nameAlpha[i]); + } else if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], + sWindowContentColors[1][2], this->nameBoxAlpha[i]); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], + sWindowContentColors[isActive][1], sWindowContentColors[isActive][2], + this->nameAlpha[i]); + } + gDPLoadTextureBlock(POLY_OPA_DISP++, + ResourceMgr_LoadFileRaw("assets/textures/title_static/gFileSelMQButtonTex"), + G_IM_FMT_IA, G_IM_SIZ_16b, 44, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); + } + + // draw connectors if (CVar_GetS32("gHudColors", 1) == 2 && FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->nameAlpha[i]); - } else if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->connectorAlpha[i]); + } else if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i)) && Save_GetSaveMetaInfo(i)->valid) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], - sWindowContentColors[1][2], this->nameBoxAlpha[i]); + sWindowContentColors[1][2], this->fileButtonAlpha[i]); } else { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], sWindowContentColors[isActive][1], sWindowContentColors[isActive][2], - this->nameAlpha[i]); + this->connectorAlpha[i]); } - gDPLoadTextureBlock(POLY_OPA_DISP++, ResourceMgr_LoadFileRaw("assets/textures/title_static/gFileSelMQButtonTex"), G_IM_FMT_IA, G_IM_SIZ_16b, 44, 16, 0, + gDPLoadTextureBlock(POLY_OPA_DISP++, gFileSelConnectorTex, G_IM_FMT_IA, G_IM_SIZ_8b, 24, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); + gSP1Quadrangle(POLY_OPA_DISP++, 12, 14, 15, 13, 0); + + if (Save_GetSaveMetaInfo(i)->randoSave || Save_GetSaveMetaInfo(i)->requiresMasterQuest) { + gSP1Quadrangle(POLY_OPA_DISP++, 16, 18, 19, 17, 0); + } } - // draw connectors - if (CVar_GetS32("gHudColors", 1) == 2 && FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->connectorAlpha[i]); - } else if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i)) && Save_GetSaveMetaInfo(i)->valid) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], - sWindowContentColors[1][2], this->fileButtonAlpha[i]); - } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], sWindowContentColors[isActive][1], - sWindowContentColors[isActive][2], this->connectorAlpha[i]); + // draw file info + for (fileIndex = 0; fileIndex < 3; fileIndex++) { + isActive = 0; + FileChoose_DrawFileInfo(&this->state, fileIndex, isActive); } - gDPLoadTextureBlock(POLY_OPA_DISP++, gFileSelConnectorTex, G_IM_FMT_IA, G_IM_SIZ_8b, 24, 16, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOLOD); - gSP1Quadrangle(POLY_OPA_DISP++, 12, 14, 15, 13, 0); - if (Save_GetSaveMetaInfo(i)->randoSave || Save_GetSaveMetaInfo(i)->requiresMasterQuest) { - gSP1Quadrangle(POLY_OPA_DISP++, 16, 18, 19, 17, 0); - } - } - - // draw file info - for (fileIndex = 0; fileIndex < 3; fileIndex++) { - isActive = 0; - FileChoose_DrawFileInfo(&this->state, fileIndex, isActive); - } - - gDPPipeSync(POLY_OPA_DISP++); - gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, - ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); - gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[0x274], 20, 0); - - // draw primary action buttons (copy/erase) - for (quadVtxIndex = 0, i = 0; i < 2; i++, quadVtxIndex += 4) { - gDPPipeSync(POLY_OPA_DISP++); - - if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->actionButtonAlpha[i]); - } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2], - this->actionButtonAlpha[i]); - } - gDPLoadTextureBlock(POLY_OPA_DISP++, sActionButtonTextures[gSaveContext.language][i], G_IM_FMT_IA, G_IM_SIZ_16b, - 64, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); - gSP1Quadrangle(POLY_OPA_DISP++, quadVtxIndex, quadVtxIndex + 2, quadVtxIndex + 3, quadVtxIndex + 1, 0); - } - - gDPPipeSync(POLY_OPA_DISP++); - - // draw confirm buttons (yes/quit) - for (quadVtxIndex = 0, i = 0; i < 2; i++, quadVtxIndex += 4) { - temp = this->confirmButtonTexIndices[i]; - - if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->confirmButtonAlpha[i]); - } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2], - this->confirmButtonAlpha[i]); - } - gDPLoadTextureBlock(POLY_OPA_DISP++, sActionButtonTextures[gSaveContext.language][temp], G_IM_FMT_IA, - G_IM_SIZ_16b, 64, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, - G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSP1Quadrangle(POLY_OPA_DISP++, quadVtxIndex, quadVtxIndex + 2, quadVtxIndex + 3, quadVtxIndex + 1, 0); - } - - // draw options button - gDPPipeSync(POLY_OPA_DISP++); - - if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->optionButtonAlpha); - } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2], - this->optionButtonAlpha); - } - gDPLoadTextureBlock(POLY_OPA_DISP++, sOptionsButtonTextures[gSaveContext.language], G_IM_FMT_IA, G_IM_SIZ_16b, 64, - 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); - gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); - - // draw highlight over currently selected button - if (((this->menuMode == FS_MENU_MODE_CONFIG) && - ((this->configMode == CM_MAIN_MENU) || (this->configMode == CM_SELECT_COPY_SOURCE) || - (this->configMode == CM_SELECT_COPY_DEST) || (this->configMode == CM_COPY_CONFIRM) || - (this->configMode == CM_ERASE_SELECT) || (this->configMode == CM_ERASE_CONFIRM))) || - ((this->menuMode == FS_MENU_MODE_SELECT) && (this->selectMode == SM_CONFIRM_FILE))) { - gDPPipeSync(POLY_OPA_DISP++); - gDPSetCombineLERP(POLY_OPA_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0, TEXEL0, 0, - PRIMITIVE, 0); - - if (CVar_GetS32("gHudColors", 1) == 2) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->highlightColor[3]); - } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->highlightColor[0], this->highlightColor[1], - this->highlightColor[2], this->highlightColor[3]); - } - gDPLoadTextureBlock(POLY_OPA_DISP++, gFileSelBigButtonHighlightTex, G_IM_FMT_I, G_IM_SIZ_8b, 72, 24, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, - G_TX_NOLOD); - gSP1Quadrangle(POLY_OPA_DISP++, 12, 14, 15, 13, 0); - } - - // draw warning labels - if (this->warningLabel > FS_WARNING_NONE) { gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->emptyFileTextAlpha); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); - gDPLoadTextureBlock(POLY_OPA_DISP++, sWarningLabels[gSaveContext.language][this->warningLabel], G_IM_FMT_IA, - G_IM_SIZ_8b, 128, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, - G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSP1Quadrangle(POLY_OPA_DISP++, 16, 18, 19, 17, 0); + gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[0x274], 20, 0); + + // draw primary action buttons (copy/erase) + for (quadVtxIndex = 0, i = 0; i < 2; i++, quadVtxIndex += 4) { + gDPPipeSync(POLY_OPA_DISP++); + + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->actionButtonAlpha[i]); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2], + this->actionButtonAlpha[i]); + } + gDPLoadTextureBlock(POLY_OPA_DISP++, sActionButtonTextures[gSaveContext.language][i], G_IM_FMT_IA, + G_IM_SIZ_16b, 64, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, quadVtxIndex, quadVtxIndex + 2, quadVtxIndex + 3, quadVtxIndex + 1, 0); + } + + gDPPipeSync(POLY_OPA_DISP++); + + // draw confirm buttons (yes/quit) + for (quadVtxIndex = 0, i = 0; i < 2; i++, quadVtxIndex += 4) { + temp = this->confirmButtonTexIndices[i]; + + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->confirmButtonAlpha[i]); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2], + this->confirmButtonAlpha[i]); + } + gDPLoadTextureBlock(POLY_OPA_DISP++, sActionButtonTextures[gSaveContext.language][temp], G_IM_FMT_IA, + G_IM_SIZ_16b, 64, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, quadVtxIndex, quadVtxIndex + 2, quadVtxIndex + 3, quadVtxIndex + 1, 0); + } + + // draw options button + gDPPipeSync(POLY_OPA_DISP++); + + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->optionButtonAlpha); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2], + this->optionButtonAlpha); + } + gDPLoadTextureBlock(POLY_OPA_DISP++, sOptionsButtonTextures[gSaveContext.language], G_IM_FMT_IA, G_IM_SIZ_16b, + 64, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); + + // draw highlight over currently selected button + if (((this->menuMode == FS_MENU_MODE_CONFIG) && + ((this->configMode == CM_MAIN_MENU) || (this->configMode == CM_SELECT_COPY_SOURCE) || + (this->configMode == CM_SELECT_COPY_DEST) || (this->configMode == CM_COPY_CONFIRM) || + (this->configMode == CM_ERASE_SELECT) || (this->configMode == CM_ERASE_CONFIRM))) || + ((this->menuMode == FS_MENU_MODE_SELECT) && (this->selectMode == SM_CONFIRM_FILE))) { + gDPPipeSync(POLY_OPA_DISP++); + gDPSetCombineLERP(POLY_OPA_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0, TEXEL0, + 0, PRIMITIVE, 0); + + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, + CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->highlightColor[3]); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->highlightColor[0], this->highlightColor[1], + this->highlightColor[2], this->highlightColor[3]); + } + gDPLoadTextureBlock(POLY_OPA_DISP++, gFileSelBigButtonHighlightTex, G_IM_FMT_I, G_IM_SIZ_8b, 72, 24, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, 12, 14, 15, 13, 0); + } + + // draw warning labels + if (this->warningLabel > FS_WARNING_NONE) { + gDPPipeSync(POLY_OPA_DISP++); + gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, + PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->emptyFileTextAlpha); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); + gDPLoadTextureBlock(POLY_OPA_DISP++, sWarningLabels[gSaveContext.language][this->warningLabel], G_IM_FMT_IA, + G_IM_SIZ_8b, 128, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, 16, 18, 19, 17, 0); + } + + gDPPipeSync(POLY_OPA_DISP++); + gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); + + CLOSE_DISPS(this->state.gfxCtx); } - - gDPPipeSync(POLY_OPA_DISP++); - gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); - - CLOSE_DISPS(this->state.gfxCtx); } void FileChoose_ConfigModeDraw(GameState* thisx) { @@ -1292,7 +1728,8 @@ void FileChoose_ConfigModeDraw(GameState* thisx) { FrameInterpolation_RecordOpenChild(this, this->configMode); - if ((this->configMode != CM_NAME_ENTRY) && (this->configMode != CM_START_NAME_ENTRY)) { + if ((this->configMode != CM_NAME_ENTRY) && (this->configMode != CM_START_NAME_ENTRY) && + (this->configMode != CM_QUEST_MENU) && this->configMode != CM_NAME_ENTRY_TO_QUEST_MENU) { gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); @@ -1308,7 +1745,13 @@ void FileChoose_ConfigModeDraw(GameState* thisx) { Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); if (this->windowRot != 0) { - Matrix_RotateX(this->windowRot / 100.0f, MTXMODE_APPLY); + if (this->configMode == CM_ROTATE_TO_QUEST_MENU || + (this->configMode >= CM_MAIN_TO_OPTIONS && this->configMode <= CM_OPTIONS_TO_MAIN) || + MIN_QUEST == MAX_QUEST || this->configMode == CM_QUEST_TO_MAIN) { + Matrix_RotateX(this->windowRot / 100.0f, MTXMODE_APPLY); + } else { + Matrix_RotateX((this->windowRot - 942.0f) / 100.0f, MTXMODE_APPLY); + } } gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(this->state.gfxCtx), @@ -1343,7 +1786,11 @@ void FileChoose_ConfigModeDraw(GameState* thisx) { Matrix_Translate(0.0f, 0.0f, -93.6f, MTXMODE_NEW); Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); - Matrix_RotateX((this->windowRot - 314.0f) / 100.0f, MTXMODE_APPLY); + if (MIN_QUEST == MAX_QUEST) { + Matrix_RotateX((this->windowRot - 314.0f) / 100.0f, MTXMODE_APPLY); + } else { + Matrix_RotateX((this->windowRot - 628.0f) / 100.0f, MTXMODE_APPLY); + } gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(this->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -1395,6 +1842,42 @@ void FileChoose_ConfigModeDraw(GameState* thisx) { FileChoose_DrawOptions(&this->state); } + // draw quest menu + if ((this->configMode == CM_QUEST_MENU) || (this->configMode == CM_ROTATE_TO_QUEST_MENU) || + (this->configMode == CM_ROTATE_TO_NAME_ENTRY) || this->configMode == CM_QUEST_TO_MAIN || + this->configMode == CM_NAME_ENTRY_TO_QUEST_MENU) { + // window + gDPPipeSync(POLY_OPA_DISP++); + gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, CVar_GetRGB("gCCFileChoosePrim", Background_Color).r, CVar_GetRGB("gCCFileChoosePrim", Background_Color).g, CVar_GetRGB("gCCFileChoosePrim", Background_Color).b, this->windowAlpha); + } else { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2], + this->windowAlpha); + } + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); + + Matrix_Translate(0.0f, 0.0f, -93.6f, MTXMODE_NEW); + Matrix_Scale(0.78f, 0.78f, 0.78f, MTXMODE_APPLY); + Matrix_RotateX((this->windowRot - 314.0f) / 100.0f, MTXMODE_APPLY); + + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(this->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPVertex(POLY_OPA_DISP++, &this->windowVtx[0], 32, 0); + gSPDisplayList(POLY_OPA_DISP++, gFileSelWindow1DL); + + gSPVertex(POLY_OPA_DISP++, &this->windowVtx[32], 32, 0); + gSPDisplayList(POLY_OPA_DISP++, gFileSelWindow2DL); + + gSPVertex(POLY_OPA_DISP++, &this->windowVtx[64], 16, 0); + gSPDisplayList(POLY_OPA_DISP++, gFileSelWindow3DL); + + gDPPipeSync(POLY_OPA_DISP++); + + FileChoose_DrawWindowContents(&this->state); + } + gDPPipeSync(POLY_OPA_DISP++); FileChoose_SetView(this, 0.0f, 0.0f, 64.0f); @@ -2080,6 +2563,41 @@ void FileChoose_InitContext(GameState* thisx) { this->unk_1CAD6[3] = 8; this->unk_1CAD6[4] = 10; + this->stickLeftPrompt.stickColorR = 200; + this->stickLeftPrompt.stickColorG = 200; + this->stickLeftPrompt.stickColorB = 200; + this->stickLeftPrompt.stickColorA = 180; + this->stickLeftPrompt.stickTexX = 79; + this->stickLeftPrompt.stickTexY = 139; + this->stickLeftPrompt.arrowColorR = 155; + this->stickLeftPrompt.arrowColorG = 155; + this->stickLeftPrompt.arrowColorB = 255; + this->stickLeftPrompt.arrowColorA = 200; + this->stickLeftPrompt.arrowTexX = 63; + this->stickLeftPrompt.arrowTexY = 135; + this->stickLeftPrompt.z = 1; + this->stickLeftPrompt.isEnabled = false; + + this->stickRightPrompt.stickColorR = 200; + this->stickRightPrompt.stickColorG = 200; + this->stickRightPrompt.stickColorB = 200; + this->stickRightPrompt.stickColorA = 180; + this->stickRightPrompt.stickTexX = 244; + this->stickRightPrompt.stickTexY = 139; + this->stickRightPrompt.arrowColorR = 155; + this->stickRightPrompt.arrowColorG = 155; + this->stickRightPrompt.arrowColorB = 255; + this->stickRightPrompt.arrowColorA = 200; + this->stickRightPrompt.arrowTexX = 260; + this->stickRightPrompt.arrowTexY = 135; + this->stickRightPrompt.z = 1; + this->stickRightPrompt.isEnabled = false; + + this->arrowAnimState = 0; + this->stickAnimState = 0; + this->arrowAnimTween = 0; + this->stickAnimTween = 0; + ShrinkWindow_SetVal(0); gSaveContext.skyboxTime = 0; @@ -2119,6 +2637,10 @@ void FileChoose_Init(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; size_t size = (u32)_title_staticSegmentRomEnd - (u32)_title_staticSegmentRomStart; s32 pad; + this->logoAlpha = 0; + this->questType[0] = MIN_QUEST; + this->questType[1] = MIN_QUEST; + this->questType[2] = MIN_QUEST; fileSelectSpoilerFileLoaded = false; isFastFileIdIncompatible = 0; CVar_SetS32("gOnFileSelectNameEntry", 0); diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c index 358ab35f6..42ced48e1 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c @@ -390,7 +390,12 @@ void FileChoose_DrawNameEntry(GameState* thisx) { if (this->newFileNameCharCount < 0) { this->newFileNameCharCount = 0; - this->configMode = CM_NAME_ENTRY_TO_MAIN; + if (this->prevConfigMode == CM_QUEST_MENU) { + this->configMode = CM_NAME_ENTRY_TO_QUEST_MENU; + } else { + this->configMode = CM_NAME_ENTRY_TO_MAIN; + } + this->prevConfigMode = CM_NAME_ENTRY; CVar_SetS32("gOnFileSelectNameEntry", 0); } else { for (i = this->newFileNameCharCount; i < 7; i++) { @@ -464,6 +469,7 @@ void FileChoose_DrawNameEntry(GameState* thisx) { dayTime = ((void)0, gSaveContext.dayTime); Sram_InitSave(this); gSaveContext.dayTime = dayTime; + this->prevConfigMode = CM_MAIN_MENU; this->configMode = CM_NAME_ENTRY_TO_MAIN; CVar_SetS32("gOnFileSelectNameEntry", 0); CVar_SetS32("gNewFileDropped", 0); @@ -687,6 +693,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { if (CHECK_BTN_ALL(input->press.button, BTN_B)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + this->prevConfigMode = this->configMode; this->configMode = CM_OPTIONS_TO_MAIN; osSyncPrintf("SAVE"); Save_SaveGlobal();