diff options
| author | William Casarin <jb55@jb55.com> | 2025-09-18 13:34:41 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-18 13:34:41 -0700 |
| commit | 8e15cefe2b6b3882338d82fd4fa4d29c30bf13fe (patch) | |
| tree | e4eda901766a8752970782d8c59f3d791867fe54 | |
| parent | 577c5639df7d0d92f8fb751f3fefa7e4ed97f264 (diff) | |
dev-tools: add bit label on flags table (#5658)
* build: add -Wformat-security
On some distros format-security is turned on to detect possible issues
with non-string literals as format strings
Let's explicitly turn it on and fix the ImgUi text formatting to avoid
compile issues on those platforms
Signed-off-by: William Casarin <jb55@jb55.com>
* save-editor: add flag table bit index labels
Signed-off-by: William Casarin <jb55@jb55.com>
---------
Signed-off-by: William Casarin <jb55@jb55.com>
| -rw-r--r-- | soh/soh/Enhancements/debugger/debugSaveEditor.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index 7b514a16c..463f900e0 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -572,7 +572,9 @@ void DrawFlagTableArray16(const FlagTable& flagTable, uint16_t row, uint16_t& fl PopStyleCheckbox(); if (ImGui::IsItemHovered() && hasDescription) { ImGui::BeginTooltip(); - ImGui::Text("%s", UIWidgets::WrappedText(flagTable.flagDescriptions.at(row * 16 + flagIndex), 60).c_str()); + uint16_t index = row * 16 + flagIndex; + const char* desc = flagTable.flagDescriptions.at(index); + ImGui::Text("0x%02X: %s", index, UIWidgets::WrappedText(desc, 60).c_str()); ImGui::EndTooltip(); } ImGui::PopID(); @@ -930,7 +932,15 @@ void DrawFlagsTab() { for (int j = 0; j < flagTable.size + 1; j++) { DrawGroupWithBorder( [&]() { - ImGui::Text("%s", fmt::format("{:<2x}", j).c_str()); + if (j == 0) { + for (int k = 0xF; k >= 0; k--) { + ImGui::SameLine(37.5 + ((0xF - k) * 33.8)); + ImGui::Text("%X", k); + } + } + + ImGui::Text("%s", fmt::format("{:<2X}", j).c_str()); + switch (flagTable.flagTableType) { case EVENT_CHECK_INF: DrawFlagTableArray16(flagTable, j, gSaveContext.eventChkInf[j]); |
