add GfxSheetAssetBrowser to GraphicsEditor

This commit is contained in:
scawful
2024-07-19 20:47:32 -04:00
parent 7a7021cee8
commit c8aa5aeb78
2 changed files with 620 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
#include "app/gfx/scad_format.h"
#include "app/gfx/snes_palette.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"
@@ -53,6 +54,19 @@ 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 :