Adds an option to the save editor to invert Stone Tower (#812)
Some checks failed
generate-builds / generate-2ship-otr (push) Has been cancelled
generate-builds / build-macos (push) Has been cancelled
generate-builds / build-linux (push) Has been cancelled
generate-builds / build-windows (push) Has been cancelled

* add option to invert st in save editor

* only allow inverting in stone tower scenes

* change tooltip to disabledTooltip

Co-authored-by: Archez <Archez@users.noreply.github.com>

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
This commit is contained in:
balloondude2 2024-10-30 22:37:24 -06:00 committed by GitHub
parent 941b48b802
commit 50bc007d46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -217,6 +217,8 @@ void UpdateGameTime(u16 gameTime) {
void DrawTempleClears() {
bool cleared;
bool open;
bool inverted = false;
bool inStoneTower = false;
// Woodfall
cleared = CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE);
@ -302,7 +304,6 @@ void DrawTempleClears() {
}
// Stone Tower
// Stone Tower Temple is always open so there is no need to have an option to open it.
cleared = CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE);
if (UIWidgets::Checkbox("Stone Tower cleared", &cleared)) {
if (cleared) {
@ -311,6 +312,22 @@ void DrawTempleClears() {
CLEAR_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE);
}
}
if (gPlayState != NULL) {
inStoneTower = Play_GetOriginalSceneId(gPlayState->sceneId) == SCENE_F40;
inverted = Flags_GetSwitch(gPlayState, 20);
}
ImGui::SameLine();
if (UIWidgets::Checkbox("Stone Tower Inverted", &inverted,
{ .disabled = !inStoneTower, .disabledTooltip = "Can only invert while in Stone Tower" })) {
if (inverted) {
Flags_SetSwitch(gPlayState, 20);
} else {
Flags_UnsetSwitch(gPlayState, 20);
}
}
}
void DrawGeneralTab() {