From fb0b71ea54828e224d3141115a05cb5ba99a5921 Mon Sep 17 00:00:00 2001 From: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Date: Wed, 2 Nov 2022 06:39:45 -0700 Subject: [PATCH] Show player state flags on the "Player" tab of Save Editor (#1851) --- .../Enhancements/debugger/debugSaveEditor.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index 6cc493a9b..d4c7fbea9 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -1563,6 +1563,27 @@ void DrawPlayerTab() { } }); + ImGui::Text("Player State"); + uint8_t bit[32] = {}; + uint32_t flags[3] = { player->stateFlags1, player->stateFlags2, player->stateFlags3 }; + + for (int j = 0; j <= 2; j++) { + DrawGroupWithBorder([&]() { + ImGui::Text("State Flags %d", j + 1); + for (int i = 0; i <= 31; i++) { + bit[i] = ((flags[j] >> i) & 1); + if (bit[i] != 0) { + ImGui::Text("Flag %d", i); + } + } + }); + ImGui::SameLine(); + } + DrawGroupWithBorder([&]() { + ImGui::Text("Sword"); + ImGui::Text(" %d", player->swordState); + }); + } else { ImGui::Text("Global Context needed for player info!"); }