yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::SheetBrowserPanel Class Reference

EditorPanel for browsing and selecting graphics sheets. More...

#include <sheet_browser_panel.h>

Inheritance diagram for yaze::editor::SheetBrowserPanel:
Collaboration diagram for yaze::editor::SheetBrowserPanel:

Public Member Functions

 SheetBrowserPanel (GraphicsEditorState *state)
 
std::string GetId () const override
 Unique identifier for this panel.
 
std::string GetDisplayName () const override
 Human-readable name shown in menus and title bars.
 
std::string GetIcon () const override
 Material Design icon for this panel.
 
std::string GetEditorCategory () const override
 Editor category this panel belongs to.
 
int GetPriority () const override
 Get display priority for menu ordering.
 
void Initialize ()
 Initialize the panel.
 
void Draw (bool *p_open) override
 Draw the sheet browser UI.
 
absl::Status Update ()
 Legacy Update method for backward compatibility.
 
- Public Member Functions inherited from yaze::editor::EditorPanel
virtual ~EditorPanel ()=default
 
virtual void OnOpen ()
 Called when panel becomes visible.
 
virtual void OnClose ()
 Called when panel is hidden.
 
virtual void OnFocus ()
 Called when panel receives focus.
 
virtual PanelCategory GetPanelCategory () const
 Get the lifecycle category for this panel.
 
virtual bool IsEnabled () const
 Check if this panel is currently enabled.
 
virtual std::string GetDisabledTooltip () const
 Get tooltip text when panel is disabled.
 
virtual std::string GetShortcutHint () const
 Get keyboard shortcut hint for display.
 
virtual float GetPreferredWidth () const
 Get preferred width for this panel (optional)
 
virtual bool IsVisibleByDefault () const
 Whether this panel should be visible by default.
 
virtual std::string GetParentPanelId () const
 Get parent panel ID for cascade behavior.
 
virtual bool CascadeCloseChildren () const
 Whether closing this panel should close child panels.
 

Private Member Functions

void DrawSearchBar ()
 Draw the search/filter bar.
 
void DrawSheetGrid ()
 Draw the sheet grid view.
 
void DrawSheetThumbnail (int sheet_id, gfx::Bitmap &bitmap)
 Draw a single sheet thumbnail.
 
void DrawBatchOperations ()
 Draw batch operation buttons.
 

Private Attributes

GraphicsEditorStatestate_
 
gui::Canvas thumbnail_canvas_
 
char search_buffer_ [16] = {0}
 
int filter_min_ = 0
 
int filter_max_ = 222
 
bool show_only_modified_ = false
 
float thumbnail_scale_ = 2.0f
 
int columns_ = 2
 

Detailed Description

EditorPanel for browsing and selecting graphics sheets.

Displays a grid view of all 223 graphics sheets from the ROM. Supports single/multi-select, search/filter, and batch operations.

Definition at line 20 of file sheet_browser_panel.h.

Constructor & Destructor Documentation

◆ SheetBrowserPanel()

yaze::editor::SheetBrowserPanel::SheetBrowserPanel ( GraphicsEditorState * state)
inlineexplicit

Definition at line 22 of file sheet_browser_panel.h.

Member Function Documentation

◆ GetId()

std::string yaze::editor::SheetBrowserPanel::GetId ( ) const
inlineoverridevirtual

Unique identifier for this panel.

Returns
Panel ID in format "{category}.{name}" (e.g., "dungeon.room_selector")

IDs should be:

  • Lowercase with underscores
  • Prefixed with editor category
  • Unique across all panels

Implements yaze::editor::EditorPanel.

Definition at line 28 of file sheet_browser_panel.h.

◆ GetDisplayName()

std::string yaze::editor::SheetBrowserPanel::GetDisplayName ( ) const
inlineoverridevirtual

Human-readable name shown in menus and title bars.

Returns
Display name (e.g., "Room Selector")

Implements yaze::editor::EditorPanel.

Definition at line 29 of file sheet_browser_panel.h.

◆ GetIcon()

std::string yaze::editor::SheetBrowserPanel::GetIcon ( ) const
inlineoverridevirtual

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::EditorPanel.

Definition at line 30 of file sheet_browser_panel.h.

References ICON_MD_VIEW_LIST.

◆ GetEditorCategory()

std::string yaze::editor::SheetBrowserPanel::GetEditorCategory ( ) const
inlineoverridevirtual

Editor category this panel belongs to.

Returns
Category name matching EditorType (e.g., "Dungeon", "Overworld")

Implements yaze::editor::EditorPanel.

Definition at line 31 of file sheet_browser_panel.h.

◆ GetPriority()

int yaze::editor::SheetBrowserPanel::GetPriority ( ) const
inlineoverridevirtual

Get display priority for menu ordering.

Returns
Priority value (lower = higher in list, default 50)

Reimplemented from yaze::editor::EditorPanel.

Definition at line 32 of file sheet_browser_panel.h.

◆ Initialize()

void yaze::editor::SheetBrowserPanel::Initialize ( )

Initialize the panel.

Definition at line 15 of file sheet_browser_panel.cc.

References columns_, and thumbnail_scale_.

◆ Draw()

void yaze::editor::SheetBrowserPanel::Draw ( bool * p_open)
overridevirtual

Draw the sheet browser UI.

Implements yaze::editor::EditorPanel.

Definition at line 21 of file sheet_browser_panel.cc.

References DrawBatchOperations(), DrawSearchBar(), and DrawSheetGrid().

Here is the call graph for this function:

◆ Update()

absl::Status yaze::editor::SheetBrowserPanel::Update ( )

Legacy Update method for backward compatibility.

Returns
Status of the render operation

Definition at line 30 of file sheet_browser_panel.cc.

References DrawBatchOperations(), DrawSearchBar(), and DrawSheetGrid().

Here is the call graph for this function:

◆ DrawSearchBar()

void yaze::editor::SheetBrowserPanel::DrawSearchBar ( )
private

Draw the search/filter bar.

Definition at line 39 of file sheet_browser_panel.cc.

References filter_max_, filter_min_, HOVER_HINT, search_buffer_, yaze::editor::GraphicsEditorState::SelectSheet(), show_only_modified_, and state_.

Referenced by Draw(), and Update().

Here is the call graph for this function:

◆ DrawSheetGrid()

void yaze::editor::SheetBrowserPanel::DrawSheetGrid ( )
private

◆ DrawSheetThumbnail()

void yaze::editor::SheetBrowserPanel::DrawSheetThumbnail ( int sheet_id,
gfx::Bitmap & bitmap )
private

◆ DrawBatchOperations()

void yaze::editor::SheetBrowserPanel::DrawBatchOperations ( )
private

Draw batch operation buttons.

Definition at line 69 of file sheet_browser_panel.cc.

References filter_max_, filter_min_, ICON_MD_DESELECT, ICON_MD_SELECT_ALL, yaze::editor::GraphicsEditorState::selected_sheets, state_, and thumbnail_scale_.

Referenced by Draw(), and Update().

Member Data Documentation

◆ state_

GraphicsEditorState* yaze::editor::SheetBrowserPanel::state_
private

◆ thumbnail_canvas_

gui::Canvas yaze::editor::SheetBrowserPanel::thumbnail_canvas_
private

Definition at line 78 of file sheet_browser_panel.h.

Referenced by DrawSheetThumbnail().

◆ search_buffer_

char yaze::editor::SheetBrowserPanel::search_buffer_[16] = {0}
private

Definition at line 81 of file sheet_browser_panel.h.

Referenced by DrawSearchBar().

◆ filter_min_

int yaze::editor::SheetBrowserPanel::filter_min_ = 0
private

Definition at line 82 of file sheet_browser_panel.h.

Referenced by DrawBatchOperations(), DrawSearchBar(), and DrawSheetGrid().

◆ filter_max_

int yaze::editor::SheetBrowserPanel::filter_max_ = 222
private

Definition at line 83 of file sheet_browser_panel.h.

Referenced by DrawBatchOperations(), DrawSearchBar(), and DrawSheetGrid().

◆ show_only_modified_

bool yaze::editor::SheetBrowserPanel::show_only_modified_ = false
private

Definition at line 84 of file sheet_browser_panel.h.

Referenced by DrawSearchBar(), and DrawSheetGrid().

◆ thumbnail_scale_

float yaze::editor::SheetBrowserPanel::thumbnail_scale_ = 2.0f
private

◆ columns_

int yaze::editor::SheetBrowserPanel::columns_ = 2
private

Definition at line 88 of file sheet_browser_panel.h.

Referenced by DrawSheetGrid(), and Initialize().


The documentation for this class was generated from the following files: