From e958fd139e401119f03a18ccb0761002c6071602 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 27 Sep 2025 20:05:10 -0400 Subject: [PATCH] Refactor palette group display in Tile16Editor for improved clarity - Replaced inline array with a static constant for palette group names, enhancing code readability and maintainability. - Updated the display logic for the current palette group to utilize the new constant, ensuring consistent output. --- src/app/editor/overworld/tile16_editor.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/editor/overworld/tile16_editor.cc b/src/app/editor/overworld/tile16_editor.cc index d52cfe8d..4ce2aa83 100644 --- a/src/app/editor/overworld/tile16_editor.cc +++ b/src/app/editor/overworld/tile16_editor.cc @@ -1617,11 +1617,12 @@ void Tile16Editor::DrawPaletteSettings() { Separator(); Text("Current State:"); + static const char* palette_group_names[] = { + "OW Main", "OW Aux", "OW Anim", "Dungeon", "Sprites", "Armor", "Sword" + }; Text("Palette Group: %d (%s)", current_palette_group_, (current_palette_group_ < 7) - ? (const char*[]){"OW Main", "OW Aux", "OW Anim", "Dungeon", - "Sprites", "Armor", - "Sword"}[current_palette_group_] + ? palette_group_names[current_palette_group_] : "Unknown"); Text("Current Palette: %d", current_palette_);