Add QoL sneak option (#2128)

* Added sneak option

* fix french/german choices

* market sneak uses cvar instead of n64dd;
added toggle in gamebar

* whoops

* move enhancement from rando to regular

* address feedback

* accounted for entrance rando

* damn it archez

* added TODO about AI translated messages

* fix variable names
This commit is contained in:
Ralphie Morell 2022-12-10 23:28:22 -05:00 committed by GitHub
parent dc1b8f017e
commit cb232b87c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 47 additions and 2 deletions

View File

@ -24,6 +24,7 @@ typedef enum {
TEXT_MEDIGORON = 0x304C, TEXT_MEDIGORON = 0x304C,
TEXT_CARPET_SALESMAN_1 = 0x6077, TEXT_CARPET_SALESMAN_1 = 0x6077,
TEXT_CARPET_SALESMAN_2 = 0x6078, TEXT_CARPET_SALESMAN_2 = 0x6078,
TEXT_MARKET_GUARD_NIGHT = 0x7003,
TEXT_SCRUB_RANDOM = 0x9000, TEXT_SCRUB_RANDOM = 0x9000,
TEXT_SCRUB_RANDOM_FREE = 0x9001, TEXT_SCRUB_RANDOM_FREE = 0x9001,
TEXT_SHOP_ITEM_RANDOM = 0x9100, TEXT_SHOP_ITEM_RANDOM = 0x9100,

View File

@ -367,6 +367,9 @@ namespace GameMenuBar {
UIWidgets::PaddedEnhancementCheckbox("Skip Magic Arrow Equip Animation", "gSkipArrowAnimation", true, false); UIWidgets::PaddedEnhancementCheckbox("Skip Magic Arrow Equip Animation", "gSkipArrowAnimation", true, false);
UIWidgets::PaddedEnhancementCheckbox("Skip save confirmation", "gSkipSaveConfirmation", true, false); UIWidgets::PaddedEnhancementCheckbox("Skip save confirmation", "gSkipSaveConfirmation", true, false);
UIWidgets::Tooltip("Skip the \"Game saved.\" confirmation screen"); UIWidgets::Tooltip("Skip the \"Game saved.\" confirmation screen");
UIWidgets::PaddedEnhancementCheckbox("Exit Market at Night", "gMarketSneak", true, false);
UIWidgets::Tooltip("Allows exiting Hyrule Castle Market Town to Hyrule Field at night by speaking "
"to the guard next to the gate.");
ImGui::EndMenu(); ImGui::EndMenu();
} }

View File

@ -2045,6 +2045,9 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) {
messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_HEART_PIECE); messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_HEART_PIECE);
CustomMessageManager::ReplaceStringInMessage(messageEntry, "{{heartPieceCount}}", std::to_string(gSaveContext.sohStats.heartPieces + 1)); CustomMessageManager::ReplaceStringInMessage(messageEntry, "{{heartPieceCount}}", std::to_string(gSaveContext.sohStats.heartPieces + 1));
} }
if (textId == TEXT_MARKET_GUARD_NIGHT && CVar_GetS32("gMarketSneak", 0) && play->sceneNum == SCENE_ENTRA_N) {
messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_MARKET_GUARD_NIGHT);
}
if (messageEntry.textBoxType != -1) { if (messageEntry.textBoxType != -1) {
font->charTexBuf[0] = (messageEntry.textBoxType << 4) | messageEntry.textBoxPos; font->charTexBuf[0] = (messageEntry.textBoxType << 4) | messageEntry.textBoxPos;
switch (gSaveContext.language) { switch (gSaveContext.language) {

View File

@ -144,4 +144,13 @@ extern "C" void OTRMessage_Init()
"Vous obtenez un %rQuart de&Coeur%w! Vous en avez collecté&%r{{heartPieceCount}}%w en tout!" "Vous obtenez un %rQuart de&Coeur%w! Vous en avez collecté&%r{{heartPieceCount}}%w en tout!"
} }
); );
CustomMessageManager::Instance->CreateMessage(
customMessageTableID, TEXT_MARKET_GUARD_NIGHT,
{
TEXTBOX_TYPE_BLACK, TEXTBOX_POS_BOTTOM,
"You look bored. Wanna go out for a&walk?\x1B&%gYes&No%w",
"Du siehst gelangweilt aus.&Willst du einen Spaziergang machen?\x1B&%gJa&Nein%w", //TODO: AI translated, replace with actual translation
"Tu as l'air de t'ennuyer. Tu veux&aller faire une promenade?\x1B&%gOui&Non%w", //TODO: AI translated, replace with actual translation
}
);
} }

View File

@ -20,6 +20,7 @@ void func_80A56900(EnHeishi4* this, PlayState* play);
void func_80A56994(EnHeishi4* this, PlayState* play); void func_80A56994(EnHeishi4* this, PlayState* play);
void func_80A56A50(EnHeishi4* this, PlayState* play); void func_80A56A50(EnHeishi4* this, PlayState* play);
void func_80A56ACC(EnHeishi4* this, PlayState* play); void func_80A56ACC(EnHeishi4* this, PlayState* play);
void EnHeishi4_MarketSneak(EnHeishi4* this, PlayState* play);
const ActorInit En_Heishi4_InitVars = { const ActorInit En_Heishi4_InitVars = {
ACTOR_EN_HEISHI4, ACTOR_EN_HEISHI4,
@ -331,13 +332,41 @@ void func_80A56B40(EnHeishi4* this, PlayState* play) {
return; return;
} }
if (this->type == HEISHI4_AT_MARKET_NIGHT) { if (this->type == HEISHI4_AT_MARKET_NIGHT) {
this->actionFunc = func_80A56614; if (CVar_GetS32("gMarketSneak", 0)) {
return; this->actionFunc = EnHeishi4_MarketSneak;
} else {
this->actionFunc = func_80A56614;
return;
}
} }
} }
func_8002F2F4(&this->actor, play); func_8002F2F4(&this->actor, play);
} }
/*Function that allows child Link to exit from Market entrance to Hyrule Field
at night.
*/
void EnHeishi4_MarketSneak(EnHeishi4* this, PlayState* play) {
if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0: //yes
if (gSaveContext.n64ddFlag){
play->nextEntranceIndex = Entrance_OverrideNextIndex(0xCD);
} else {
play->nextEntranceIndex = 0xCD;
}
play->sceneLoadFlag = 0x14;
play->fadeTransition = 0x2E;
gSaveContext.nextTransitionType = 0x2E;
this->actionFunc = func_80A56614;
break;
case 1: //no
this->actionFunc = func_80A56614;
break;
}
}
}
void EnHeishi4_Update(Actor* thisx, PlayState* play) { void EnHeishi4_Update(Actor* thisx, PlayState* play) {
EnHeishi4* this = (EnHeishi4*)thisx; EnHeishi4* this = (EnHeishi4*)thisx;
s32 pad; s32 pad;