diff --git a/soh/soh/Enhancements/sfx-editor/SfxEditor.cpp b/soh/soh/Enhancements/sfx-editor/SfxEditor.cpp index 19a862584..80b9c9baa 100644 --- a/soh/soh/Enhancements/sfx-editor/SfxEditor.cpp +++ b/soh/soh/Enhancements/sfx-editor/SfxEditor.cpp @@ -448,6 +448,10 @@ void DrawSfxEditor(bool& open) { "Displays the name of the current sequence in the corner of the screen whenever a new sequence " "is loaded to the main sequence player (does not apply to fanfares or enemy BGM)." ); + ImGui::SameLine(); + UIWidgets::EnhancementSliderInt("Overlay Duration: %d seconds", "##SeqNameOverlayDuration", + "gSeqNameOverlayDuration", 1, 10, "", 5, true); + ImGui::NewLine(); UIWidgets::PaddedSeparator(); UIWidgets::PaddedText("The following options are experimental and may cause music\nto sound odd or have other undesireable effects."); UIWidgets::EnhancementCheckbox("Lower Octaves of Unplayable High Notes", "gExperimentalOctaveDrop"); diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 435cdc6c1..6c7bb459f 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1598,6 +1598,11 @@ extern "C" void Overlay_DisplayText(float duration, const char* text) { SohImGui::GetGameOverlay()->TextDrawNotification(duration, true, text); } +extern "C" void Overlay_DisplayText_Seconds(int seconds, const char* text) { + float duration = seconds * CVarGetInteger("gInterpolationFPS", 20) * 0.05; + SohImGui::GetGameOverlay()->TextDrawNotification(duration, true, text); +} + extern "C" void Entrance_ClearEntranceTrackingData(void) { ClearEntranceTrackingData(); } diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index 6b93bd2c7..6b393f177 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -130,6 +130,7 @@ GetItemEntry Randomizer_GetItemFromKnownCheckWithoutObtainabilityCheck(Randomize ItemObtainability Randomizer_GetItemObtainabilityFromRandomizerCheck(RandomizerCheck randomizerCheck); int CustomMessage_RetrieveIfExists(PlayState* play); void Overlay_DisplayText(float duration, const char* text); +void Overlay_DisplayText_Seconds(int seconds, const char* text); GetItemEntry ItemTable_Retrieve(int16_t getItemID); GetItemEntry ItemTable_RetrieveEntry(s16 modIndex, s16 getItemID); void Entrance_ClearEntranceTrackingData(void); diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index 03542f84f..4b4b027f3 100644 --- a/soh/src/code/audio_load.c +++ b/soh/src/code/audio_load.c @@ -615,7 +615,7 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) { if (CVarGetInteger("gSeqNameOverlay", 0) && playerIdx == SEQ_PLAYER_BGM_MAIN) { const char* sequenceName = SfxEditor_GetSequenceName(seqId); if (sequenceName != NULL) { - Overlay_DisplayText(5.0f, sequenceName); + Overlay_DisplayText_Seconds(CVarGetInteger("gSeqNameOverlayDuration", 5), sequenceName); } } }