diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index 8bf39d549..7e190a5c7 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -325,6 +325,8 @@ namespace GameMenuBar { UIWidgets::PaddedEnhancementSliderInt("Block pushing speed +%d", "##BLOCKSPEED", "gFasterBlockPush", 0, 5, "", 0, false, false, true); UIWidgets::PaddedEnhancementCheckbox("Faster Heavy Block Lift", "gFasterHeavyBlockLift", true, false); UIWidgets::Tooltip("Speeds up lifting silver rocks and obelisks"); + UIWidgets::PaddedEnhancementCheckbox("Link as default file name", "gLinkDefaultName"); + UIWidgets::Tooltip("Allows you to have \"Link\" as a premade file name"); UIWidgets::PaddedEnhancementCheckbox("No Forced Navi", "gNoForcedNavi", true, false); UIWidgets::Tooltip("Prevent forced Navi conversations"); UIWidgets::PaddedEnhancementCheckbox("No Skulltula Freeze", "gSkulltulaFreeze", true, false); 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 877da8daf..634bb6c7e 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 @@ -473,6 +473,7 @@ void FileChoose_UpdateRandomizer() { */ void FileChoose_UpdateMainMenu(GameState* thisx) { static u8 emptyName[] = { 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E }; + static u8 linkName[] = { 0x15, 0x2C, 0x31, 0x2E, 0x3E, 0x3E, 0x3E, 0x3E }; FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; bool dpad = CVarGetInteger("gDpadText", 0); @@ -497,10 +498,10 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { this->kbdY = 0; this->charIndex = 0; this->charBgAlpha = 0; - this->newFileNameCharCount = 0; + this->newFileNameCharCount = CVarGetInteger("gLinkDefaultName", 0) ? 4 : 0; this->nameEntryBoxPosX = 120; this->nameEntryBoxAlpha = 0; - memcpy(Save_GetSaveMetaInfo(this->buttonIndex)->playerName, &emptyName, 8); + memcpy(Save_GetSaveMetaInfo(this->buttonIndex)->playerName, CVarGetInteger("gLinkDefaultName", 0) ? &linkName : &emptyName, 8); } this->logoAlpha = 0; } else if(!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(this->buttonIndex))) { @@ -654,6 +655,7 @@ void FileChoose_StartQuestMenu(GameState* thisx) { void FileChoose_UpdateQuestMenu(GameState* thisx) { static u8 emptyName[] = { 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E }; + static u8 linkName[] = { 0x15, 0x2C, 0x31, 0x2E, 0x3E, 0x3E, 0x3E, 0x3E }; FileChoose_UpdateStickDirectionPromptAnim(thisx); FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; @@ -707,10 +709,10 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) { this->kbdY = 0; this->charIndex = 0; this->charBgAlpha = 0; - this->newFileNameCharCount = 0; + this->newFileNameCharCount = CVarGetInteger("gLinkDefaultName", 0) ? 4 : 0; this->nameEntryBoxPosX = 120; this->nameEntryBoxAlpha = 0; - memcpy(Save_GetSaveMetaInfo(this->buttonIndex)->playerName, &emptyName, 8); + memcpy(Save_GetSaveMetaInfo(this->buttonIndex)->playerName, CVarGetInteger("gLinkDefaultName", 0) ? &linkName : &emptyName, 8); return; }