1#ifndef YAZE_APP_EDITOR_GRAPHICS_SHEET_BROWSER_PANEL_H
2#define YAZE_APP_EDITOR_GRAPHICS_SHEET_BROWSER_PANEL_H
10#include "absl/status/status.h"
11#include "absl/status/statusor.h"
48 std::string
GetId()
const override {
return "graphics.sheet_browser_v2"; }
66 void Draw(
bool* p_open)
override;
88 const std::optional<zelda3::GfxSheetInventory>&
inventory()
const {
93 std::function<absl::Status(uint16_t sheet,
const std::string& label)>;
95 std::function<absl::StatusOr<int>(
const std::string& csv_text)>;
113 std::function<absl::StatusOr<std::vector<GraphicsSavePlanEntry>>()>;
186 absl::StatusOr<zelda3::SheetPalette>
PngPalette(
int sheet_id = -1);
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Shared state between GraphicsEditor panel components.
WindowContent for browsing and selecting graphics sheets.
void DrawBatchOperations()
Draw batch operation buttons.
int GetPriority() const override
Get display priority for menu ordering.
absl::StatusOr< zelda3::SheetPalette > PngPalette(int sheet_id=-1)
std::function< const project::YazeProject *()> project_getter_
UndoManager * undo_manager_
bool png_status_is_error_
const Rom * inventory_rom_
std::string GetIcon() const override
Material Design icon for this panel.
std::string label_buffer_
void Draw(bool *p_open) override
Draw the sheet browser UI.
const std::optional< zelda3::GfxSheetInventory > & inventory() const
void DrawPngTransfer(uint16_t sheet_id)
void SetLabelCallbacks(LabelSetter setter, LabelImporter importer)
Project-label writers. Unset callbacks disable label editing.
std::string inventory_error_
std::string GetId() const override
Unique identifier for this panel.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
std::string save_plan_error_
std::optional< zelda3::GfxSheetInventory > inventory_
std::string label_status_
LabelImporter label_importer_
std::string SheetUsageSummary(uint16_t sheet_id) const
SavePlanner save_planner_
void SetUndoManager(UndoManager *undo_manager)
Where PNG imports push their undo steps. Unset means no undo.
std::function< absl::StatusOr< int >(const std::string &csv_text)> LabelImporter
void SetDataSources(Rom *rom, zelda3::GameData *game_data, std::function< const project::YazeProject *()> project_getter)
Where free-block and "used by" data come from. The project getter may return null (no project open).
GraphicsEditorState * state_
void RefreshInventory()
Rebuild the sheet inventory from the ROM buffer. Runs lazily on the first draw and when the ROM chang...
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
void DrawSheetLabelEditor(uint16_t sheet_id)
std::function< absl::StatusOr< std::vector< GraphicsSavePlanEntry > >()> SavePlanner
SheetBrowserPanel(GraphicsEditorState *state)
zelda3::GameData * game_data_
void DrawSelectedSheetInfo()
Storage, reserved state, free 16x16 blocks and "used by" for the current sheet.
void SetPngStatus(std::string message, bool is_error)
void DrawSearchBar()
Draw the search/filter bar.
void Initialize()
Initialize the panel.
LabelSetter label_setter_
void DrawSheetThumbnail(int sheet_id, gfx::Bitmap &bitmap)
Draw a single sheet thumbnail.
gui::Canvas thumbnail_canvas_
std::vector< GraphicsSavePlanEntry > save_plan_
void SetSavePlanner(SavePlanner planner)
Source of the "Pending graphics save" preflight list (GraphicsEditor::PlanGraphicsSave)....
std::vector< SheetPngImportPreview > png_pending_
std::function< absl::Status(uint16_t sheet, const std::string &label)> LabelSetter
std::set< uint16_t > save_plan_sheets_
std::string SheetLabel(uint16_t sheet) const
void DrawSheetGrid()
Draw the sheet grid view.
absl::Status Update()
Legacy Update method for backward compatibility.
Manages undo/redo stacks for a single editor.
Base interface for all logical window content components.
Represents a bitmap image optimized for SNES ROM hacking.
Modern, robust canvas for drawing and manipulating graphics.
Which graphics sheets exist, which tables use them, and which 16x16 blocks are free.
#define ICON_MD_VIEW_LIST
PNG export and import for the Graphics editor.
Modern project structure with comprehensive settings consolidation.