From 205e085a414f3679d6b6d2f766a09940c7b31f6d Mon Sep 17 00:00:00 2001 From: scawful Date: Thu, 29 Aug 2024 13:08:45 -0400 Subject: [PATCH] add constant manager --- src/app/editor/editor_manager.h | 2 + src/app/editor/system/constant_manager.h | 89 ++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 src/app/editor/system/constant_manager.h diff --git a/src/app/editor/editor_manager.h b/src/app/editor/editor_manager.h index 9bc50c23..56b2d148 100644 --- a/src/app/editor/editor_manager.h +++ b/src/app/editor/editor_manager.h @@ -19,6 +19,7 @@ #include "app/editor/music/music_editor.h" #include "app/editor/overworld/overworld_editor.h" #include "app/editor/sprite/sprite_editor.h" +#include "app/editor/system/constant_manager.h" #include "app/editor/system/extension_manager.h" #include "app/editor/system/settings_editor.h" #include "app/editor/utils/gfx_context.h" @@ -109,6 +110,7 @@ class EditorManager : public SharedRom, public core::ExperimentFlags { emu::Emulator emulator_; Project current_project_; + ConstantManager constant_manager_; ExtensionManager extension_manager_; yaze_editor_context editor_context_; diff --git a/src/app/editor/system/constant_manager.h b/src/app/editor/system/constant_manager.h new file mode 100644 index 00000000..fd49428f --- /dev/null +++ b/src/app/editor/system/constant_manager.h @@ -0,0 +1,89 @@ +#ifndef YAZE_APP_EDITOR_SYSTEM_CONSTANT_MANAGER_H +#define YAZE_APP_EDITOR_SYSTEM_CONSTANT_MANAGER_H + +#include +#include +#include +#include +#include + +#include "absl/status/status.h" +#include "app/editor/utils/gfx_context.h" +#include "app/gfx/bitmap.h" +#include "app/gfx/snes_palette.h" +#include "app/gfx/snes_tile.h" +#include "app/rom.h" +#include "app/zelda3/common.h" +#include "app/zelda3/overworld/overworld.h" +#include "app/zelda3/overworld/overworld_map.h" +#include "imgui/imgui.h" + +namespace yaze { +namespace app { +namespace editor { + +class ConstantManager { + public: + void ShowConstantManager() { + ImGui::Begin("Constant Manager"); + + // Tab bar for the different types of constants + // Overworld, dungeon, graphics, expanded + ImGui::TextWrapped( + "This is the constant manager. It allows you to view and edit " + "constants in the ROM. You should only edit these if you know what " + "you're doing."); + + if (ImGui::BeginTabBar("Constant Manager Tabs")) { + if (ImGui::BeginTabItem("Overworld")) { + ImGui::Text("Overworld constants"); + ImGui::Separator(); + ImGui::Text("OverworldCustomASMHasBeenApplied: %d", + zelda3::overworld::OverworldCustomASMHasBeenApplied); + ImGui::Text("OverworldCustomAreaSpecificBGPalette: %d", + zelda3::overworld::OverworldCustomAreaSpecificBGPalette); + ImGui::Text("OverworldCustomAreaSpecificBGEnabled: %d", + zelda3::overworld::OverworldCustomAreaSpecificBGEnabled); + ImGui::Text("OverworldCustomMainPaletteArray: %d", + zelda3::overworld::OverworldCustomMainPaletteArray); + ImGui::Text("OverworldCustomMainPaletteEnabled: %d", + zelda3::overworld::OverworldCustomMainPaletteEnabled); + ImGui::Text("OverworldCustomMosaicArray: %d", + zelda3::overworld::OverworldCustomMosaicArray); + ImGui::Text("OverworldCustomMosaicEnabled: %d", + zelda3::overworld::OverworldCustomMosaicEnabled); + ImGui::Text("OverworldCustomAnimatedGFXArray: %d", + zelda3::overworld::OverworldCustomAnimatedGFXArray); + ImGui::Text("OverworldCustomAnimatedGFXEnabled: %d", + zelda3::overworld::OverworldCustomAnimatedGFXEnabled); + + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem("Dungeon")) { + ImGui::Text("Dungeon constants"); + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem("Graphics")) { + ImGui::Text("Graphics constants"); + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem("Expanded")) { + ImGui::Text("Expanded constants"); + ImGui::EndTabItem(); + } + + ImGui::EndTabBar(); + } + + ImGui::End(); + } +}; + +} // namespace editor +} // namespace app +} // namespace yaze + +#endif // YAZE_APP_EDITOR_SYSTEM_CONSTANT_MANAGER_H \ No newline at end of file