Panel for editing the tile8 composition of dungeon objects. More...
#include <object_tile_editor_panel.h>

Public Member Functions | |
| ObjectTileEditorPanel (gfx::IRenderer *renderer, Rom *rom) | |
| 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. | |
| void | OpenForObject (int16_t object_id, int room_id, std::array< zelda3::Room, 0x128 > *rooms) |
| void | OpenForNewObject (int width, int height, const std::string &filename, int16_t object_id, int room_id, std::array< zelda3::Room, 0x128 > *rooms) |
| void | Close () |
| bool | IsOpen () const |
| void | SetCurrentPaletteGroup (const gfx::PaletteGroup &group) |
| void | SetObjectCreatedCallback (std::function< void(int, const std::string &)> cb) |
Public Member Functions inherited from yaze::editor::EditorPanel | |
| virtual | ~EditorPanel ()=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 PanelCategory | GetPanelCategory () const |
| Get the lifecycle category for this panel. | |
| virtual PanelContextScope | GetContextScope () const |
| Optional context binding for this panel (room/selection/etc) | |
| virtual PanelScope | GetScope () const |
| Get the registration scope 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 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 | DrawTileGrid () |
| void | DrawSourceSheet () |
| void | DrawTileProperties () |
| void | DrawActionBar () |
| void | HandleKeyboardShortcuts () |
| void | RenderObjectPreview () |
| void | RenderTile8Atlas () |
| void | ApplyChanges (bool confirm_shared=true) |
Private Attributes | |
| std::unique_ptr< zelda3::ObjectTileEditor > | tile_editor_ |
| zelda3::ObjectTileLayout | current_layout_ |
| int | selected_cell_index_ = -1 |
| int | selected_source_tile_ = -1 |
| int | source_palette_ = 2 |
| gui::Canvas | tile_grid_canvas_ {"##ObjTileGrid", ImVec2(256, 256)} |
| gui::Canvas | source_sheet_canvas_ {"##ObjTileSource", ImVec2(256, 512)} |
| gfx::Bitmap | object_preview_bmp_ |
| gfx::Bitmap | tile8_atlas_bmp_ |
| bool | preview_dirty_ = true |
| bool | atlas_dirty_ = true |
| bool | show_shared_confirm_ = false |
| int | shared_object_count_ = 0 |
| bool | is_new_object_ = false |
| std::function< void(int, const std::string &) | on_object_created_ ) |
| gfx::IRenderer * | renderer_ |
| Rom * | rom_ |
| int | current_room_id_ = -1 |
| int16_t | current_object_id_ = -1 |
| std::array< zelda3::Room, 0x128 > * | rooms_ = nullptr |
| gfx::PaletteGroup | current_palette_group_ |
| bool | is_open_ = false |
Additional Inherited Members | |
Protected Member Functions inherited from yaze::editor::EditorPanel | |
| 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) | |
Panel for editing the tile8 composition of dungeon objects.
Shows an interactive grid of an object's constituent 8x8 tiles alongside a tile source sheet from the room's graphics buffer. Users can click a cell in the grid, then pick a replacement tile from the source sheet. Tile properties (palette, flip, priority) can be edited per-cell.
Opened from the Object Editor panel via "Edit Tiles" button.
Definition at line 32 of file object_tile_editor_panel.h.
| yaze::editor::ObjectTileEditorPanel::ObjectTileEditorPanel | ( | gfx::IRenderer * | renderer, |
| Rom * | rom ) |
Definition at line 11 of file object_tile_editor_panel.cc.
References tile_editor_.
|
inlineoverridevirtual |
Unique identifier for this panel.
IDs should be:
Implements yaze::editor::EditorPanel.
Definition at line 36 of file object_tile_editor_panel.h.
|
inlineoverridevirtual |
Human-readable name shown in menus and title bars.
Implements yaze::editor::EditorPanel.
Definition at line 37 of file object_tile_editor_panel.h.
|
inlineoverridevirtual |
Material Design icon for this panel.
Implements yaze::editor::EditorPanel.
Definition at line 38 of file object_tile_editor_panel.h.
References ICON_MD_GRID_ON.
|
inlineoverridevirtual |
Editor category this panel belongs to.
Implements yaze::editor::EditorPanel.
Definition at line 39 of file object_tile_editor_panel.h.
|
inlineoverridevirtual |
Get display priority for menu ordering.
Reimplemented from yaze::editor::EditorPanel.
Definition at line 40 of file object_tile_editor_panel.h.
|
inlineoverridevirtual |
Get preferred width for this panel (optional)
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::EditorPanel.
Definition at line 41 of file object_tile_editor_panel.h.
|
overridevirtual |
Draw the panel content.
| p_open | Pointer to visibility flag (nullptr if not closable) |
Called by PanelManager when the panel is visible. Do NOT call ImGui::Begin/End - the PanelWindow wrapper handles that. Just draw your content directly.
Implements yaze::editor::EditorPanel.
Definition at line 73 of file object_tile_editor_panel.cc.
References ApplyChanges(), yaze::zelda3::ObjectTileLayout::bounds_height, yaze::zelda3::ObjectTileLayout::bounds_width, yaze::zelda3::ObjectTileLayout::cells, Close(), current_layout_, current_object_id_, yaze::zelda3::ObjectTileLayout::custom_filename, DrawActionBar(), DrawSourceSheet(), DrawTileGrid(), DrawTileProperties(), yaze::zelda3::GetObjectName(), HandleKeyboardShortcuts(), ICON_MD_ADD_BOX, ICON_MD_GRID_ON, is_new_object_, is_open_, shared_object_count_, and show_shared_confirm_.
| void yaze::editor::ObjectTileEditorPanel::OpenForObject | ( | int16_t | object_id, |
| int | room_id, | ||
| std::array< zelda3::Room, 0x128 > * | rooms ) |
Definition at line 17 of file object_tile_editor_panel.cc.
References atlas_dirty_, current_layout_, current_object_id_, current_palette_group_, current_room_id_, is_open_, preview_dirty_, rooms_, selected_cell_index_, selected_source_tile_, and tile_editor_.
Referenced by yaze::editor::DungeonEditorV2::Load().
| void yaze::editor::ObjectTileEditorPanel::OpenForNewObject | ( | int | width, |
| int | height, | ||
| const std::string & | filename, | ||
| int16_t | object_id, | ||
| int | room_id, | ||
| std::array< zelda3::Room, 0x128 > * | rooms ) |
Definition at line 42 of file object_tile_editor_panel.cc.
References atlas_dirty_, yaze::zelda3::ObjectTileLayout::CreateEmpty(), current_layout_, current_object_id_, current_room_id_, is_new_object_, is_open_, preview_dirty_, rooms_, selected_cell_index_, and selected_source_tile_.
Referenced by yaze::editor::DungeonObjectSelector::DrawNewCustomObjectDialog().

| void yaze::editor::ObjectTileEditorPanel::Close | ( | ) |
Definition at line 60 of file object_tile_editor_panel.cc.
References current_layout_, is_new_object_, is_open_, selected_cell_index_, and selected_source_tile_.
Referenced by Draw(), DrawActionBar(), and HandleKeyboardShortcuts().
|
inline |
Definition at line 51 of file object_tile_editor_panel.h.
References is_open_.
| void yaze::editor::ObjectTileEditorPanel::SetCurrentPaletteGroup | ( | const gfx::PaletteGroup & | group | ) |
Definition at line 68 of file object_tile_editor_panel.cc.
References current_palette_group_.
|
inline |
Definition at line 56 of file object_tile_editor_panel.h.
References on_object_created_.
|
private |
Definition at line 176 of file object_tile_editor_panel.cc.
References yaze::zelda3::ObjectTileLayout::bounds_height, yaze::zelda3::ObjectTileLayout::bounds_width, yaze::zelda3::ObjectTileLayout::cells, current_layout_, yaze::gfx::Bitmap::is_active(), yaze::gui::kScale, object_preview_bmp_, preview_dirty_, RenderObjectPreview(), selected_cell_index_, and yaze::gfx::Bitmap::texture().
Referenced by Draw().

|
private |
Definition at line 253 of file object_tile_editor_panel.cc.
References atlas_dirty_, yaze::zelda3::ObjectTileLayout::cells, current_layout_, yaze::gfx::Bitmap::is_active(), yaze::zelda3::ObjectTileEditor::kAtlasHeightPx, yaze::zelda3::ObjectTileEditor::kAtlasTileRows, yaze::zelda3::ObjectTileEditor::kAtlasTilesPerRow, yaze::zelda3::ObjectTileEditor::kAtlasWidthPx, preview_dirty_, RenderTile8Atlas(), selected_cell_index_, selected_source_tile_, source_palette_, yaze::gfx::Bitmap::texture(), and tile8_atlas_bmp_.
Referenced by Draw().

|
private |
Definition at line 354 of file object_tile_editor_panel.cc.
References yaze::zelda3::ObjectTileLayout::cells, current_layout_, preview_dirty_, and selected_cell_index_.
Referenced by Draw().
|
private |
Definition at line 441 of file object_tile_editor_panel.cc.
References ApplyChanges(), yaze::zelda3::ObjectTileLayout::cells, Close(), current_layout_, current_object_id_, ICON_MD_CLOSE, ICON_MD_SAVE, ICON_MD_UNDO, ICON_MD_WARNING, yaze::zelda3::ObjectTileLayout::is_custom, preview_dirty_, yaze::zelda3::ObjectTileLayout::RevertAll(), yaze::zelda3::ObjectTileLayout::tile_data_address, and tile_editor_.
Referenced by Draw().

|
private |
Definition at line 489 of file object_tile_editor_panel.cc.
References yaze::zelda3::ObjectTileLayout::cells, Close(), current_layout_, preview_dirty_, and selected_cell_index_.
Referenced by Draw().

|
private |
Definition at line 150 of file object_tile_editor_panel.cc.
References current_layout_, current_palette_group_, current_room_id_, yaze::gfx::Bitmap::data(), object_preview_bmp_, preview_dirty_, rooms_, tile_editor_, and yaze::gfx::Bitmap::UpdateTexture().
Referenced by DrawTileGrid().

|
private |
Definition at line 163 of file object_tile_editor_panel.cc.
References atlas_dirty_, current_palette_group_, current_room_id_, yaze::gfx::Bitmap::data(), rooms_, source_palette_, tile8_atlas_bmp_, tile_editor_, and yaze::gfx::Bitmap::UpdateTexture().
Referenced by DrawSourceSheet().

|
private |
Definition at line 402 of file object_tile_editor_panel.cc.
References yaze::zelda3::ObjectTileLayout::cells, current_layout_, current_object_id_, current_room_id_, yaze::zelda3::ObjectTileLayout::custom_filename, yaze::zelda3::ObjectTileLayout::is_custom, is_new_object_, yaze::zelda3::ObjectTileLayout::object_id, on_object_created_, rooms_, shared_object_count_, show_shared_confirm_, yaze::zelda3::ObjectTileLayout::tile_data_address, tile_editor_, and yaze::gfx::TileInfoToWord().
Referenced by Draw(), and DrawActionBar().

|
private |
Definition at line 77 of file object_tile_editor_panel.h.
Referenced by ApplyChanges(), DrawActionBar(), ObjectTileEditorPanel(), OpenForObject(), RenderObjectPreview(), and RenderTile8Atlas().
|
private |
Definition at line 78 of file object_tile_editor_panel.h.
Referenced by ApplyChanges(), Close(), Draw(), DrawActionBar(), DrawSourceSheet(), DrawTileGrid(), DrawTileProperties(), HandleKeyboardShortcuts(), OpenForNewObject(), OpenForObject(), and RenderObjectPreview().
|
private |
Definition at line 79 of file object_tile_editor_panel.h.
Referenced by Close(), DrawSourceSheet(), DrawTileGrid(), DrawTileProperties(), HandleKeyboardShortcuts(), OpenForNewObject(), and OpenForObject().
|
private |
Definition at line 80 of file object_tile_editor_panel.h.
Referenced by Close(), DrawSourceSheet(), OpenForNewObject(), and OpenForObject().
|
private |
Definition at line 81 of file object_tile_editor_panel.h.
Referenced by DrawSourceSheet(), and RenderTile8Atlas().
|
private |
Definition at line 84 of file object_tile_editor_panel.h.
|
private |
Definition at line 85 of file object_tile_editor_panel.h.
|
private |
Definition at line 88 of file object_tile_editor_panel.h.
Referenced by DrawTileGrid(), and RenderObjectPreview().
|
private |
Definition at line 89 of file object_tile_editor_panel.h.
Referenced by DrawSourceSheet(), and RenderTile8Atlas().
|
private |
Definition at line 90 of file object_tile_editor_panel.h.
Referenced by DrawActionBar(), DrawSourceSheet(), DrawTileGrid(), DrawTileProperties(), HandleKeyboardShortcuts(), OpenForNewObject(), OpenForObject(), and RenderObjectPreview().
|
private |
Definition at line 91 of file object_tile_editor_panel.h.
Referenced by DrawSourceSheet(), OpenForNewObject(), OpenForObject(), and RenderTile8Atlas().
|
private |
Definition at line 94 of file object_tile_editor_panel.h.
Referenced by ApplyChanges(), and Draw().
|
private |
Definition at line 95 of file object_tile_editor_panel.h.
Referenced by ApplyChanges(), and Draw().
|
private |
Definition at line 98 of file object_tile_editor_panel.h.
Referenced by ApplyChanges(), Close(), Draw(), and OpenForNewObject().
|
private |
Definition at line 99 of file object_tile_editor_panel.h.
Referenced by ApplyChanges(), and SetObjectCreatedCallback().
|
private |
Definition at line 102 of file object_tile_editor_panel.h.
|
private |
Definition at line 103 of file object_tile_editor_panel.h.
|
private |
Definition at line 104 of file object_tile_editor_panel.h.
Referenced by ApplyChanges(), OpenForNewObject(), OpenForObject(), RenderObjectPreview(), and RenderTile8Atlas().
|
private |
Definition at line 105 of file object_tile_editor_panel.h.
Referenced by ApplyChanges(), Draw(), DrawActionBar(), OpenForNewObject(), and OpenForObject().
|
private |
Definition at line 106 of file object_tile_editor_panel.h.
Referenced by ApplyChanges(), OpenForNewObject(), OpenForObject(), RenderObjectPreview(), and RenderTile8Atlas().
|
private |
Definition at line 107 of file object_tile_editor_panel.h.
Referenced by OpenForObject(), RenderObjectPreview(), RenderTile8Atlas(), and SetCurrentPaletteGroup().
|
private |
Definition at line 108 of file object_tile_editor_panel.h.
Referenced by Close(), Draw(), IsOpen(), OpenForNewObject(), and OpenForObject().