Add separate speed option for slower text (#4424)

This commit is contained in:
Jordan Longstaff 2024-10-16 18:32:56 -04:00 committed by GitHub
parent dcd26b2de8
commit b3ce27efed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 4 deletions

View File

@ -302,6 +302,7 @@ const std::vector<const char*> enhancementsCvars = {
CVAR_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"),
CVAR_ENHANCEMENT("TimeSavers.SkipChildStealth"),
CVAR_ENHANCEMENT("TimeSavers.SkipTowerEscape"),
CVAR_ENHANCEMENT("SlowTextSpeed"),
};
const std::vector<const char*> cheatCvars = {
@ -561,6 +562,8 @@ const std::vector<PresetEntry> vanillaPlusPresetEntries = {
// Text Speed (1 to 5)
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5),
// Slow Text Speed (1 to 5)
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5),
// Skip Text
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1),
// King Zora Speed (1 to 5)
@ -634,6 +637,8 @@ const std::vector<PresetEntry> enhancedPresetEntries = {
// Text Speed (1 to 5)
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5),
// Slow Text Speed (1 to 5)
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5),
// Skip Text
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1),
// King Zora Speed (1 to 5)
@ -768,6 +773,8 @@ const std::vector<PresetEntry> randomizerPresetEntries = {
// Text Speed (1 to 5)
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5),
// Slow Text Speed (1 to 5)
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5),
// Skip Text
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1),
// King Zora Speed (1 to 5)
@ -922,6 +929,7 @@ const std::vector<PresetEntry> randomizerPresetEntries = {
const std::vector<PresetEntry> spockRacePresetEntries = {
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LogicRules"), 0),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5),
PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 4),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5),

View File

@ -666,6 +666,10 @@ void DrawEnhancementsMenu() {
UIWidgets::PaddedEnhancementSliderInt("Text Speed: %dx", "##TEXTSPEED", CVAR_ENHANCEMENT("TextSpeed"), 1, 5, "", 1, true, false, true);
UIWidgets::PaddedEnhancementCheckbox("Skip Text", CVAR_ENHANCEMENT("SkipText"), false, true);
UIWidgets::PaddedEnhancementSliderInt("Slow Text Speed: %dx", "##SLOWTEXTSPEED", CVAR_ENHANCEMENT("SlowTextSpeed"), 1, 5, "", 1, true, false, true);
if (ImGui::Button("Match Normal Text")) {
CVarSetInteger(CVAR_ENHANCEMENT("SlowTextSpeed"), CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1));
}
UIWidgets::Tooltip("Holding down B skips text");
UIWidgets::PaddedEnhancementSliderFloat("King Zora Speed: %.2fx", "##MWEEPSPEED", CVAR_ENHANCEMENT("MweepSpeed"), 0.1f, 5.0f, "", 1.0f, false, false, true);
UIWidgets::PaddedEnhancementSliderInt("Vine/Ladder Climb speed +%d", "##CLIMBSPEED", CVAR_ENHANCEMENT("ClimbSpeed"), 0, 12, "", 0, true, false, true);

View File

@ -835,7 +835,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
u16 i;
u16 sfxHi;
u16 charTexIdx;
int gTextSpeed;
int gTextSpeed, gSlowTextSpeed;
Font* font = &play->msgCtx.font;
Gfx* gfx = *gfxP;
@ -857,6 +857,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
charTexIdx = 0;
gTextSpeed = CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1);
gSlowTextSpeed = CVarGetInteger(CVAR_ENHANCEMENT("SlowTextSpeed"), gTextSpeed);
for (i = 0; i < msgCtx->textDrawPos; i++) {
character = msgCtx->msgBufDecoded[i];
@ -1125,10 +1126,10 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
} else if (msgCtx->textDelayTimer == 0) {
msgCtx->textDrawPos = i + 1;
msgCtx->textDelayTimer = msgCtx->textDelay;
} else if (msgCtx->textDelayTimer <= gTextSpeed) {
} else if (msgCtx->textDelayTimer <= gSlowTextSpeed) {
msgCtx->textDelayTimer = 0;
} else {
msgCtx->textDelayTimer -= gTextSpeed;
msgCtx->textDelayTimer -= gSlowTextSpeed;
}
*gfxP = gfx;
}