Recategorize current enhancements (#257)

This commit is contained in:
aMannus 2024-05-04 15:22:59 +02:00 committed by Garrett Cox
parent 1b6397eca9
commit 655d82462e
13 changed files with 74 additions and 49 deletions

View File

@ -290,6 +290,17 @@ extern std::shared_ptr<HudEditorWindow> mHudEditorWindow;
void DrawEnhancementsMenu() {
if (UIWidgets::BeginMenu("Enhancements")) {
if (UIWidgets::BeginMenu("Graphics")) {
MotionBlur_RenderMenuOptions();
ImGui::SeparatorText("Other");
UIWidgets::CVarCheckbox("Authentic logo", "gEnhancements.Graphics.AuthenticLogo", {
.tooltip = "Hide the game version and build details and display the authentic model and texture on the boot logo start screen"
});
UIWidgets::CVarCheckbox("24 Hours Clock", "gEnhancements.Graphics.24HoursClock");
ImGui::EndMenu();
}
if (UIWidgets::BeginMenu("Cycle")) {
UIWidgets::CVarCheckbox("Do not reset Bottle content", "gEnhancements.Cycle.DoNotResetBottleContent", {
@ -317,16 +328,18 @@ void DrawEnhancementsMenu() {
ImGui::EndMenu();
}
if (UIWidgets::BeginMenu("Restorations")) {
UIWidgets::CVarCheckbox("Side Rolls", "gEnhancements.Restorations.SideRoll", {
.tooltip = "Restores side rolling from OOT."
});
if (UIWidgets::BeginMenu("Cutscenes")) {
UIWidgets::CVarCheckbox("Skip Entrance Cutscenes", "gEnhancements.Cutscenes.SkipEntranceCutscenes");
UIWidgets::CVarCheckbox("Hide Title Cards", "gEnhancements.Cutscenes.HideTitleCards");
ImGui::EndMenu();
}
if (UIWidgets::BeginMenu("Graphics")) {
MotionBlur_RenderMenuOptions();
if (UIWidgets::BeginMenu("Dialogue")) {
UIWidgets::CVarCheckbox("Fast Text", "gEnhancements.Dialogue.FastText", {
.tooltip = "Speeds up text rendering, and enables holding of B progress to next message"
});
ImGui::EndMenu();
}
@ -338,15 +351,13 @@ void DrawEnhancementsMenu() {
ImGui::EndMenu();
}
UIWidgets::CVarCheckbox("Fast Text", "gEnhancements.TimeSavers.FastText", {
.tooltip = "Speeds up text rendering, and enables holding of B progress to next message"
});
UIWidgets::CVarCheckbox("Authentic logo", "gEnhancements.General.AuthenticLogo", {
.tooltip = "Hide the game version and build details and display the authentic model and texture on the boot logo start screen"
});
UIWidgets::CVarCheckbox("Skip Entrance Cutscenes", "gEnhancements.TimeSavers.SkipEntranceCutscenes");
UIWidgets::CVarCheckbox("Hide Title Cards", "gEnhancements.TimeSavers.HideTitleCards");
UIWidgets::CVarCheckbox("24 Hours Clock", "gEnhancements.General.24HoursClock");
if (UIWidgets::BeginMenu("Restorations")) {
UIWidgets::CVarCheckbox("Side Rolls", "gEnhancements.Restorations.SideRoll", {
.tooltip = "Restores side rolling from OOT."
});
ImGui::EndMenu();
}
if (mHudEditorWindow) {
UIWidgets::WindowButton("Hud Editor", "gWindows.HudEditor", mHudEditorWindow, {

View File

@ -0,0 +1,10 @@
#include <libultraship/bridge.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
void RegisterHideTitleCards() {
REGISTER_VB_SHOULD(GI_VB_SHOW_TITLE_CARD, {
if (CVarGetInteger("gEnhancements.Cutscenes.HideTitleCards", 0)) {
*should = false;
}
});
}

View File

@ -0,0 +1,6 @@
#ifndef CUTSCENES_HIDE_TITLE_CARDS_H
#define CUTSCENES_HIDE_TITLE_CARDS_H
void RegisterHideTitleCards();
#endif // CUTSCENES_HIDE_TITLE_CARDS_H

View File

@ -0,0 +1,10 @@
#include <libultraship/bridge.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
void RegisterSkipEntranceCutscenes() {
REGISTER_VB_SHOULD(GI_VB_PLAY_ENTRANCE_CS, {
if (CVarGetInteger("gEnhancements.Cutscenes.SkipEntranceCutscenes", 0)) {
*should = false;
}
});
}

View File

@ -0,0 +1,6 @@
#ifndef CUTSCENES_SKIP_ENTRANCE_CUTSCENES_H
#define CUTSCENES_SKIP_ENTRANCE_CUTSCENES_H
void RegisterSkipEntranceCutscenes();
#endif // CUTSCENES_SKIP_ENTRANCE_CUTSCENES_H

View File

@ -15,6 +15,8 @@ void InitEnhancements() {
// Restorations
RegisterSideRoll();
// Time Savers
RegisterTimeSaversHooks();
// Cutscenes
RegisterSkipEntranceCutscenes();
RegisterHideTitleCards();
}

View File

@ -5,9 +5,10 @@
#include "Cheats/Infinite.h"
#include "Cycle/EndOfCycle.h"
#include "Masks/FierceDeityAnywhere.h"
#include "Restorations/SideRoll.h"
#include "Masks/FastTransformation.h"
#include "TimeSavers/TimeSavers.h"
#include "Cutscenes/SkipEntranceCutscenes.h"
#include "Cutscenes/HideTitleCards.h"
#include "Restorations/SideRoll.h"
#ifdef __cplusplus
extern "C" {

View File

@ -1,15 +0,0 @@
#include <libultraship/bridge.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
void RegisterTimeSaversHooks() {
REGISTER_VB_SHOULD(GI_VB_PLAY_ENTRANCE_CS, {
if (CVarGetInteger("gEnhancements.TimeSavers.SkipEntranceCutscenes", 0)) {
*should = false;
}
});
REGISTER_VB_SHOULD(GI_VB_SHOW_TITLE_CARD, {
if (CVarGetInteger("gEnhancements.TimeSavers.HideTitleCards", 0)) {
*should = false;
}
});
}

View File

@ -1,6 +0,0 @@
#ifndef TIMESAVERS_H
#define TIMESAVERS_H
void RegisterTimeSaversHooks();
#endif // TIMESAVERS_H

View File

@ -319,7 +319,7 @@ s32 Message_ShouldAdvance(PlayState* play) {
}
return CHECK_BTN_ALL(controller->press.button, BTN_A) || CHECK_BTN_ALL(controller->press.button, BTN_B) ||
// 2S2H [Enhancement] When fast text is on, we want to check if B is held instead of only if it was just pressed
(CVarGetInteger("gEnhancements.TimeSavers.FastText", 0) && CHECK_BTN_ALL(controller->cur.button, BTN_B)) ||
(CVarGetInteger("gEnhancements.Dialogue.FastText", 0) && CHECK_BTN_ALL(controller->cur.button, BTN_B)) ||
CHECK_BTN_ALL(controller->press.button, BTN_CUP);
}
}
@ -333,7 +333,7 @@ s32 Message_ShouldAdvanceSilent(PlayState* play) {
} else {
return CHECK_BTN_ALL(controller->press.button, BTN_A) || CHECK_BTN_ALL(controller->press.button, BTN_B) ||
// 2S2H [Enhancement] When fast text is on, we want to check if B is held instead of only if it was just pressed
(CVarGetInteger("gEnhancements.TimeSavers.FastText", 0) && CHECK_BTN_ALL(controller->cur.button, BTN_B)) ||
(CVarGetInteger("gEnhancements.Dialogue.FastText", 0) && CHECK_BTN_ALL(controller->cur.button, BTN_B)) ||
CHECK_BTN_ALL(controller->press.button, BTN_CUP);
}
}
@ -5638,7 +5638,7 @@ void Message_Update(PlayState* play) {
if ((
CHECK_BTN_ALL(input->press.button, BTN_B) ||
// 2S2H [Enhancement] When fast text is on, we want to check if B is held instead of only if it was just pressed
(CVarGetInteger("gEnhancements.TimeSavers.FastText", 0) && CHECK_BTN_ALL(input->cur.button, BTN_B))
(CVarGetInteger("gEnhancements.Dialogue.FastText", 0) && CHECK_BTN_ALL(input->cur.button, BTN_B))
) && !msgCtx->textUnskippable) {
msgCtx->textboxSkipped = true;
msgCtx->textDrawPos = msgCtx->decodedTextLen;

View File

@ -920,14 +920,14 @@ void Message_DrawTextNES(PlayState* play, Gfx** gfxP, u16 textDrawPos) {
}
if (msgCtx->textDelayTimer == 0) {
msgCtx->textDrawPos = i + (CVarGetInteger("gEnhancements.TimeSavers.FastText", 0) ? 10 : 1);
msgCtx->textDrawPos = i + (CVarGetInteger("gEnhancements.Dialogue.FastText", 0) ? 10 : 1);
msgCtx->textDelayTimer = 0;
if (msgCtx->msgMode == MSGMODE_9) {
msgCtx->msgMode = MSGMODE_TEXT_DISPLAYING;
}
} else {
msgCtx->textDelayTimer--;
if (CVarGetInteger("gEnhancements.TimeSavers.FastText", 0)) {
if (CVarGetInteger("gEnhancements.Dialogue.FastText", 0)) {
msgCtx->textDelayTimer = 0;
}
}

View File

@ -5246,7 +5246,7 @@ void Interface_DrawClock(PlayState* play) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha);
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[24], 8, 0);
OVERLAY_DISP = CVarGetInteger("gEnhancements.General.24HoursClock", 0) ?
OVERLAY_DISP = CVarGetInteger("gEnhancements.Graphics.24HoursClock", 0) ?
Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTwentyHourHoursTextures[sp1C6], 4, 16, 11, 0) :
Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0);
@ -5272,7 +5272,7 @@ void Interface_DrawClock(PlayState* play) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha);
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[32], 8, 0);
OVERLAY_DISP = CVarGetInteger("gEnhancements.General.24HoursClock", 0) ?
OVERLAY_DISP = CVarGetInteger("gEnhancements.Graphics.24HoursClock", 0) ?
Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTwentyHourHoursTextures[sp1C6], 4, 16, 11, 0) :
Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0);

View File

@ -115,7 +115,7 @@ void ConsoleLogo_Draw(GameState* thisx) {
char* logoDL = gNintendo64LogoNDL;
char* logoText = gNintendo64LogoTextTex;
if (!CVarGetInteger("gEnhancements.General.AuthenticLogo", 0)) {
if (!CVarGetInteger("gEnhancements.Graphics.AuthenticLogo", 0)) {
logoDL = gShipLogoDL;
logoText = gLUSLogoTextTex;
}
@ -173,7 +173,7 @@ void ConsoleLogo_Draw(GameState* thisx) {
1 << 10, 1 << 10);
}
if (!CVarGetInteger("gEnhancements.General.AuthenticLogo", 0)) {
if (!CVarGetInteger("gEnhancements.Graphics.AuthenticLogo", 0)) {
ConsoleLogo_PrintBuildInfo(this);
}