diff --git a/src/app/editor/graphics/graphics_editor.cc b/src/app/editor/graphics/graphics_editor.cc index 4faad64a..34667b4f 100644 --- a/src/app/editor/graphics/graphics_editor.cc +++ b/src/app/editor/graphics/graphics_editor.cc @@ -54,6 +54,13 @@ constexpr ImGuiTableFlags kGfxEditFlags = ImGuiTableFlags_Reorderable | absl::Status GraphicsEditor::Update() { TAB_BAR("##TabBar") status_ = UpdateGfxEdit(); + TAB_ITEM("Sheet Browser") + if (asset_browser_.Initialized == false) { + asset_browser_.Initialize(rom()->mutable_bitmap_manager()); + } + asset_browser_.Draw(rom()->mutable_bitmap_manager()); + + END_TAB_ITEM() status_ = UpdateScadView(); status_ = UpdateLinkGfxView(); END_TAB_BAR() @@ -64,19 +71,6 @@ absl::Status GraphicsEditor::Update() { absl::Status GraphicsEditor::UpdateGfxEdit() { TAB_ITEM("Sheet Editor") - static bool show_sheet_browser_ = false; - static gui::GfxSheetAssetBrowser asset_browser; - - if (ImGui::Button("Sheet Browser")) { - show_sheet_browser_ = !show_sheet_browser_; - asset_browser.Initialize(rom()->mutable_bitmap_manager()); - } - - if (show_sheet_browser_) { - asset_browser.Draw("##SheetBrowser", &show_sheet_browser_, - rom()->mutable_bitmap_manager()); - } - if (ImGui::BeginTable("##GfxEditTable", 3, kGfxEditTableFlags, ImVec2(0, 0))) { for (const auto& name : diff --git a/src/app/editor/graphics/graphics_editor.h b/src/app/editor/graphics/graphics_editor.h index a4e60002..d8be0cb7 100644 --- a/src/app/editor/graphics/graphics_editor.h +++ b/src/app/editor/graphics/graphics_editor.h @@ -12,6 +12,7 @@ #include "app/editor/utils/editor.h" #include "app/gfx/bitmap.h" #include "app/gfx/snes_tile.h" +#include "app/gui/asset_browser.h" #include "app/gui/canvas.h" #include "app/gui/input.h" #include "app/gui/pipeline.h" @@ -157,6 +158,8 @@ class GraphicsEditor : public SharedRom, public Editor { char tilemap_file_path_[256] = ""; char tilemap_file_name_[256] = ""; + gui::GfxSheetAssetBrowser asset_browser_; + GfxEditMode gfx_edit_mode_ = GfxEditMode::kSelect; Rom temp_rom_;