Add ResourceLabelManager class

This commit is contained in:
scawful
2024-01-22 03:26:37 -05:00
parent a115b7ebe3
commit 5455b2a425
8 changed files with 164 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
#include <imgui/imgui.h>
#include "app/core/common.h"
#include "app/core/labeling.h"
#include "app/gfx/snes_palette.h"
#include "app/gui/canvas.h"
#include "app/gui/icons.h"
@@ -279,8 +280,11 @@ void DungeonEditor::DrawRoomSelector() {
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
int i = 0;
for (const auto each_room_name : zelda3::dungeon::kRoomNames) {
ImGui::Selectable(each_room_name.data(), current_room_id_ == i,
ImGuiSelectableFlags_AllowDoubleClick);
// ImGui::Selectable(each_room_name.data(), current_room_id_ == i,
// ImGuiSelectableFlags_AllowDoubleClick);
rom()->resource_label()->SelectableLabelWithNameEdit(
current_room_id_ == i, "Dungeon Room Names", each_room_name.data(),
zelda3::dungeon::kRoomNames[i].data());
if (ImGui::IsItemClicked()) {
active_rooms_.push_back(i);
}

View File

@@ -5,6 +5,7 @@
#include "app/core/common.h"
#include "app/core/editor.h"
#include "app/core/labeling.h"
#include "app/editor/modules/gfx_group_editor.h"
#include "app/editor/modules/palette_editor.h"
#include "app/gui/canvas.h"
@@ -109,7 +110,6 @@ class DungeonEditor : public Editor,
std::vector<int64_t> room_size_pointers_;
// Add member variables to track the selected set
uint16_t selected_blockset_ = 0xFFFF; // 0xFFFF indicates no selection
uint16_t selected_spriteset_ = 0xFFFF;
uint16_t selected_palette_ = 0xFFFF;