Adds an option to the save editor to invert Stone Tower (#812)

* 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-31 00:37:24 -04:00
committed by GitHub
co-authored by Archez
parent 941b48b802
commit 50bc007d46
+18 -1
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() {