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

WindowContent for displaying room graphics blocks. More...

#include <room_graphics_content.h>

Inheritance diagram for yaze::editor::RoomGraphicsContent:

Classes

struct  SheetPreviewMetadata
 

Public Member Functions

 RoomGraphicsContent ()
 
 RoomGraphicsContent (int *current_room_id, DungeonRoomStore *rooms, gfx::IRenderer *renderer=nullptr)
 
void SetCurrentPaletteGroup (const gfx::PaletteGroup &group)
 Set the current palette group for graphics rendering.
 
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.
 
float GetPreferredWidth () const override
 Get preferred width for this panel (optional)
 
void Draw (bool *p_open) override
 Draw the panel content.
 
- Public Member Functions inherited from yaze::editor::WindowContent
virtual ~WindowContent ()=default
 
virtual void OnFirstDraw ()
 Called once before the first Draw() in a session.
 
virtual bool RequiresLazyInit () const
 Whether this panel uses lazy initialization.
 
void InvalidateLazyInit ()
 Reset lazy init state so OnFirstDraw() runs again.
 
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 WindowLifecycle GetWindowLifecycle () const
 Get the lifecycle category for this window.
 
virtual WindowContextScope GetContextScope () const
 Optional context binding for this window (room/selection/etc)
 
virtual WindowScope GetScope () const
 Get the registration scope for this window.
 
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 std::string GetWorkflowGroup () const
 Optional workflow group for hack-centric actions.
 
virtual std::string GetWorkflowLabel () const
 Optional workflow label for menus/command palette.
 
virtual std::string GetWorkflowDescription () const
 Optional workflow description for menus/command palette.
 
virtual int GetWorkflowPriority () const
 Optional workflow ordering priority (lower sorts first).
 
virtual bool PreferAutoHideTabBar () const
 Whether the dock node hosting this panel should auto-hide its tab bar.
 
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.
 
void DrawWithLazyInit (bool *p_open)
 Execute lazy initialization if needed, then call Draw()
 

Private Member Functions

void RefreshSheetPreviews (const zelda3::Room &room)
 

Private Attributes

int * current_room_id_ = nullptr
 
DungeonRoomStorerooms_ = nullptr
 
gfx::IRendererrenderer_ = nullptr
 
gui::Canvas room_gfx_canvas_
 
std::array< gfx::Bitmap, 16 > sheet_previews_
 
std::array< SheetPreviewMetadata, 16 > sheet_preview_metadata_ {}
 
std::array< uint8_t, 16 > preview_block_ids_ {}
 
int preview_room_id_ = -1
 
bool preview_cache_valid_ = false
 
bool show_source_trace_ = false
 
gfx::PaletteGroup current_palette_group_
 
bool palette_dirty_ = true
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::WindowContent
void InvalidateCache ()
 Invalidate all cached computations.
 
template<typename T >
T & GetCached (const std::string &key, std::function< T()> compute)
 Get or compute a cached value.
 
bool IsCacheValid () const
 Check if cache has been invalidated.
 
void ClearCache ()
 Clear all cached values (more aggressive than InvalidateCache)
 

Detailed Description

WindowContent for displaying room graphics blocks.

This panel shows the graphics blocks used by the current room, displaying a 2x8 grid of 128x32 graphics blocks.

See also
WindowContent - Base interface

Definition at line 32 of file room_graphics_content.h.

Constructor & Destructor Documentation

◆ RoomGraphicsContent() [1/2]

yaze::editor::RoomGraphicsContent::RoomGraphicsContent ( )
inline

Definition at line 35 of file room_graphics_content.h.

◆ RoomGraphicsContent() [2/2]

yaze::editor::RoomGraphicsContent::RoomGraphicsContent ( int * current_room_id,
DungeonRoomStore * rooms,
gfx::IRenderer * renderer = nullptr )
inline

Definition at line 39 of file room_graphics_content.h.

Member Function Documentation

◆ SetCurrentPaletteGroup()

void yaze::editor::RoomGraphicsContent::SetCurrentPaletteGroup ( const gfx::PaletteGroup & group)
inline

Set the current palette group for graphics rendering.

Parameters
groupThe palette group from the current room

Definition at line 50 of file room_graphics_content.h.

References current_palette_group_, and palette_dirty_.

Referenced by yaze::editor::DungeonEditorV2::Load(), and yaze::editor::DungeonEditorV2::OnRoomSelected().

◆ GetId()

std::string yaze::editor::RoomGraphicsContent::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::WindowContent.

Definition at line 59 of file room_graphics_content.h.

◆ GetDisplayName()

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

Human-readable name shown in menus and title bars.

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

Implements yaze::editor::WindowContent.

Definition at line 60 of file room_graphics_content.h.

◆ GetIcon()

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

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::WindowContent.

Definition at line 61 of file room_graphics_content.h.

References ICON_MD_IMAGE.

◆ GetEditorCategory()

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

Editor category this panel belongs to.

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

Implements yaze::editor::WindowContent.

Definition at line 62 of file room_graphics_content.h.

◆ GetPriority()

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

Get display priority for menu ordering.

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

Reimplemented from yaze::editor::WindowContent.

Definition at line 63 of file room_graphics_content.h.

◆ GetPreferredWidth()

float yaze::editor::RoomGraphicsContent::GetPreferredWidth ( ) const
inlineoverridevirtual

Get preferred width for this panel (optional)

Returns
Preferred width in pixels, or 0 to use default (250px)

Override this to specify content-based sizing. For example, a tile selector with 8 tiles at 16px × 2.0 scale would return ~276px.

Reimplemented from yaze::editor::WindowContent.

Definition at line 64 of file room_graphics_content.h.

◆ Draw()

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

◆ RefreshSheetPreviews()

Member Data Documentation

◆ current_room_id_

int* yaze::editor::RoomGraphicsContent::current_room_id_ = nullptr
private

Definition at line 87 of file room_graphics_content.h.

Referenced by Draw().

◆ rooms_

DungeonRoomStore* yaze::editor::RoomGraphicsContent::rooms_ = nullptr
private

Definition at line 88 of file room_graphics_content.h.

Referenced by Draw().

◆ renderer_

gfx::IRenderer* yaze::editor::RoomGraphicsContent::renderer_ = nullptr
private

Definition at line 89 of file room_graphics_content.h.

Referenced by Draw().

◆ room_gfx_canvas_

gui::Canvas yaze::editor::RoomGraphicsContent::room_gfx_canvas_
private

Definition at line 90 of file room_graphics_content.h.

Referenced by Draw().

◆ sheet_previews_

std::array<gfx::Bitmap, 16> yaze::editor::RoomGraphicsContent::sheet_previews_
private

Definition at line 91 of file room_graphics_content.h.

Referenced by Draw(), and RefreshSheetPreviews().

◆ sheet_preview_metadata_

std::array<SheetPreviewMetadata, 16> yaze::editor::RoomGraphicsContent::sheet_preview_metadata_ {}
private

Definition at line 92 of file room_graphics_content.h.

Referenced by Draw(), and RefreshSheetPreviews().

◆ preview_block_ids_

std::array<uint8_t, 16> yaze::editor::RoomGraphicsContent::preview_block_ids_ {}
private

Definition at line 93 of file room_graphics_content.h.

Referenced by RefreshSheetPreviews().

◆ preview_room_id_

int yaze::editor::RoomGraphicsContent::preview_room_id_ = -1
private

Definition at line 94 of file room_graphics_content.h.

Referenced by RefreshSheetPreviews().

◆ preview_cache_valid_

bool yaze::editor::RoomGraphicsContent::preview_cache_valid_ = false
private

Definition at line 95 of file room_graphics_content.h.

Referenced by RefreshSheetPreviews().

◆ show_source_trace_

bool yaze::editor::RoomGraphicsContent::show_source_trace_ = false
private

Definition at line 96 of file room_graphics_content.h.

Referenced by Draw().

◆ current_palette_group_

gfx::PaletteGroup yaze::editor::RoomGraphicsContent::current_palette_group_
private

Definition at line 99 of file room_graphics_content.h.

Referenced by SetCurrentPaletteGroup().

◆ palette_dirty_

bool yaze::editor::RoomGraphicsContent::palette_dirty_ = true
private

Definition at line 100 of file room_graphics_content.h.

Referenced by RefreshSheetPreviews(), and SetCurrentPaletteGroup().


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