add AssetBrowser as tab in GraphicsEditor
This commit is contained in:
@@ -54,6 +54,13 @@ constexpr ImGuiTableFlags kGfxEditFlags = ImGuiTableFlags_Reorderable |
|
|||||||
absl::Status GraphicsEditor::Update() {
|
absl::Status GraphicsEditor::Update() {
|
||||||
TAB_BAR("##TabBar")
|
TAB_BAR("##TabBar")
|
||||||
status_ = UpdateGfxEdit();
|
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_ = UpdateScadView();
|
||||||
status_ = UpdateLinkGfxView();
|
status_ = UpdateLinkGfxView();
|
||||||
END_TAB_BAR()
|
END_TAB_BAR()
|
||||||
@@ -64,19 +71,6 @@ absl::Status GraphicsEditor::Update() {
|
|||||||
absl::Status GraphicsEditor::UpdateGfxEdit() {
|
absl::Status GraphicsEditor::UpdateGfxEdit() {
|
||||||
TAB_ITEM("Sheet Editor")
|
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,
|
if (ImGui::BeginTable("##GfxEditTable", 3, kGfxEditTableFlags,
|
||||||
ImVec2(0, 0))) {
|
ImVec2(0, 0))) {
|
||||||
for (const auto& name :
|
for (const auto& name :
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "app/editor/utils/editor.h"
|
#include "app/editor/utils/editor.h"
|
||||||
#include "app/gfx/bitmap.h"
|
#include "app/gfx/bitmap.h"
|
||||||
#include "app/gfx/snes_tile.h"
|
#include "app/gfx/snes_tile.h"
|
||||||
|
#include "app/gui/asset_browser.h"
|
||||||
#include "app/gui/canvas.h"
|
#include "app/gui/canvas.h"
|
||||||
#include "app/gui/input.h"
|
#include "app/gui/input.h"
|
||||||
#include "app/gui/pipeline.h"
|
#include "app/gui/pipeline.h"
|
||||||
@@ -157,6 +158,8 @@ class GraphicsEditor : public SharedRom, public Editor {
|
|||||||
char tilemap_file_path_[256] = "";
|
char tilemap_file_path_[256] = "";
|
||||||
char tilemap_file_name_[256] = "";
|
char tilemap_file_name_[256] = "";
|
||||||
|
|
||||||
|
gui::GfxSheetAssetBrowser asset_browser_;
|
||||||
|
|
||||||
GfxEditMode gfx_edit_mode_ = GfxEditMode::kSelect;
|
GfxEditMode gfx_edit_mode_ = GfxEditMode::kSelect;
|
||||||
|
|
||||||
Rom temp_rom_;
|
Rom temp_rom_;
|
||||||
|
|||||||
Reference in New Issue
Block a user