mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 09:22:18 -05:00
Adds beta quest Gameshark cheat. (#975)
* Adds beta quest Gameshark cheat. * Fixes issue where lus was including a function from soh. * Limits beta quest to 0-8
This commit is contained in:
parent
d648c7275c
commit
4f29833476
@ -68,6 +68,13 @@ OSContPad* pads;
|
||||
std::map<std::string, GameAsset*> DefaultAssets;
|
||||
std::vector<std::string> emptyArgs;
|
||||
|
||||
bool isBetaQuestEnabled = false;
|
||||
|
||||
extern "C" {
|
||||
void enableBetaQuest() { isBetaQuestEnabled = true; }
|
||||
void disableBetaQuest() { isBetaQuestEnabled = false; }
|
||||
}
|
||||
|
||||
namespace SohImGui {
|
||||
|
||||
WindowImpl impl;
|
||||
@ -1404,6 +1411,78 @@ namespace SohImGui {
|
||||
EnhancementCheckbox("Shield with Two-Handed Weapons", "gShieldTwoHanded");
|
||||
Tooltip("This allows you to put up your shield with any two-handed weapon in hand except for Deku Sticks");
|
||||
|
||||
{
|
||||
static int32_t betaQuestEnabled = CVar_GetS32("gEnableBetaQuest", 0);
|
||||
static int32_t lastBetaQuestEnabled = betaQuestEnabled;
|
||||
static int32_t betaQuestWorld = CVar_GetS32("gBetaQuestWorld", 0xFFEF);
|
||||
static int32_t lastBetaQuestWorld = betaQuestWorld;
|
||||
|
||||
if (!isBetaQuestEnabled) {
|
||||
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
|
||||
}
|
||||
|
||||
EnhancementCheckbox("Enable Beta Quest", "gEnableBetaQuest");
|
||||
Tooltip("Turns on OoT Beta Quest. *WARNING* This will reset your game.");
|
||||
betaQuestEnabled = CVar_GetS32("gEnableBetaQuest", 0);
|
||||
if (betaQuestEnabled) {
|
||||
if (betaQuestEnabled != lastBetaQuestEnabled) {
|
||||
betaQuestWorld = 0;
|
||||
}
|
||||
|
||||
ImGui::Text("Beta Quest World: %d", betaQuestWorld);
|
||||
|
||||
if (ImGui::Button(" - ##BetaQuest")) {
|
||||
betaQuestWorld--;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f);
|
||||
|
||||
ImGui::SliderInt("##BetaQuest", &betaQuestWorld, 0, 8, "", ImGuiSliderFlags_AlwaysClamp);
|
||||
Tooltip("Set the Beta Quest world to explore. *WARNING* Changing this will reset your game.\nCtrl+Click to type in a value.");
|
||||
|
||||
ImGui::Text("After Slider Beta Quest World: %d", betaQuestWorld);
|
||||
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f);
|
||||
if (ImGui::Button(" + ##BetaQuest")) {
|
||||
betaQuestWorld++;
|
||||
}
|
||||
|
||||
if (betaQuestWorld > 8) {
|
||||
betaQuestWorld = 8;
|
||||
}
|
||||
else if (betaQuestWorld < 0) {
|
||||
betaQuestWorld = 0;
|
||||
}
|
||||
|
||||
ImGui::Text("After Clamp Beta Quest World: %d", betaQuestWorld);
|
||||
}
|
||||
else {
|
||||
lastBetaQuestWorld = betaQuestWorld = 0xFFEF;
|
||||
CVar_SetS32("gBetaQuestWorld", betaQuestWorld);
|
||||
needs_save = true;
|
||||
}
|
||||
if (betaQuestEnabled != lastBetaQuestEnabled || betaQuestWorld != lastBetaQuestWorld)
|
||||
{
|
||||
// Reset the game if the beta quest state or world changed because beta quest happens on redirecting the title screen cutscene.
|
||||
lastBetaQuestEnabled = betaQuestEnabled;
|
||||
lastBetaQuestWorld = betaQuestWorld;
|
||||
CVar_SetS32("gEnableBetaQuest", betaQuestEnabled);
|
||||
CVar_SetS32("gBetaQuestWorld", betaQuestWorld);
|
||||
|
||||
console->Commands["reset"].handler(emptyArgs);
|
||||
|
||||
needs_save = true;
|
||||
}
|
||||
|
||||
if (!isBetaQuestEnabled) {
|
||||
ImGui::PopItemFlag();
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void enableBetaQuest();
|
||||
void disableBetaQuest();
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "GameOverlay.h"
|
||||
#include "Lib/ImGui/imgui.h"
|
||||
#include "Console.h"
|
||||
@ -97,3 +107,5 @@ namespace SohImGui {
|
||||
std::string BreakTooltip(const char* text, int lineLength = 60);
|
||||
std::string BreakTooltip(const std::string& text, int lineLength = 60);
|
||||
}
|
||||
|
||||
#endif
|
@ -8,7 +8,7 @@ void SaveContext_Init(void) {
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = NATURE_ID_DISABLED;
|
||||
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFEF;
|
||||
gSaveContext.nextCutsceneIndex = CVar_GetS32("gBetaQuestWorld", 0xFFEF);
|
||||
gSaveContext.cutsceneTrigger = 0;
|
||||
gSaveContext.chamberCutsceneNum = 0;
|
||||
gSaveContext.nextDayTime = 0xFFFF;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "soh/Enhancements/gameconsole.h"
|
||||
|
||||
#include "../libultraship/ImGuiImpl.h"
|
||||
#include "soh/frame_interpolation.h"
|
||||
|
||||
void* D_8012D1F0 = NULL;
|
||||
@ -190,6 +190,7 @@ void Gameplay_Destroy(GameState* thisx) {
|
||||
KaleidoManager_Destroy();
|
||||
ZeldaArena_Cleanup();
|
||||
Fault_RemoveClient(&D_801614B8);
|
||||
disableBetaQuest();
|
||||
gGlobalCtx = NULL;
|
||||
}
|
||||
|
||||
@ -260,6 +261,7 @@ void GivePlayerRandoRewardSariaGift(GlobalContext* globalCtx, RandomizerCheck ch
|
||||
void Gameplay_Init(GameState* thisx) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)thisx;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
enableBetaQuest();
|
||||
gGlobalCtx = globalCtx;
|
||||
//globalCtx->state.gfxCtx = NULL;
|
||||
uintptr_t zAlloc;
|
||||
|
Loading…
Reference in New Issue
Block a user