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

#include <water_fill_panel.h>

Inheritance diagram for yaze::editor::WaterFillPanel:
Collaboration diagram for yaze::editor::WaterFillPanel:

Public Member Functions

 WaterFillPanel (DungeonCanvasViewer *viewer, DungeonObjectInteraction *interaction)
 
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.
 
void SetCanvasViewer (DungeonCanvasViewer *viewer)
 
void SetInteraction (DungeonObjectInteraction *interaction)
 
void Draw (bool *p_open) override
 Draw the panel content.
 
- 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 int GetPriority () const
 Get display priority for menu ordering.
 
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.
 
void DrawWithLazyInit (bool *p_open)
 Execute lazy initialization if needed, then call Draw()
 

Static Private Member Functions

static std::vector< zelda3::WaterFillZoneEntryCollectZones (const std::array< zelda3::Room, 0x128 > &rooms)
 
static void ApplyZoneToRoom (const zelda3::WaterFillZoneEntry &z, zelda3::Room *room)
 

Private Attributes

std::string last_io_status_
 
std::string last_io_error_
 
DungeonCanvasViewerviewer_ = nullptr
 
DungeonObjectInteractioninteraction_ = nullptr
 

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)
 

Detailed Description

Definition at line 25 of file water_fill_panel.h.

Constructor & Destructor Documentation

◆ WaterFillPanel()

yaze::editor::WaterFillPanel::WaterFillPanel ( DungeonCanvasViewer * viewer,
DungeonObjectInteraction * interaction )
inline

Definition at line 27 of file water_fill_panel.h.

Member Function Documentation

◆ GetId()

std::string yaze::editor::WaterFillPanel::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 31 of file water_fill_panel.h.

◆ GetDisplayName()

std::string yaze::editor::WaterFillPanel::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 32 of file water_fill_panel.h.

◆ GetIcon()

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

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::EditorPanel.

Definition at line 33 of file water_fill_panel.h.

References ICON_MD_WATER_DROP.

◆ GetEditorCategory()

std::string yaze::editor::WaterFillPanel::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 34 of file water_fill_panel.h.

◆ SetCanvasViewer()

void yaze::editor::WaterFillPanel::SetCanvasViewer ( DungeonCanvasViewer * viewer)
inline

Definition at line 36 of file water_fill_panel.h.

References viewer_.

Referenced by yaze::editor::DungeonEditorV2::~DungeonEditorV2().

◆ SetInteraction()

void yaze::editor::WaterFillPanel::SetInteraction ( DungeonObjectInteraction * interaction)
inline

Definition at line 37 of file water_fill_panel.h.

References interaction_.

Referenced by yaze::editor::DungeonEditorV2::~DungeonEditorV2().

◆ Draw()

void yaze::editor::WaterFillPanel::Draw ( bool * p_open)
inlineoverridevirtual

Draw the panel content.

Parameters
p_openPointer 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 41 of file water_fill_panel.h.

References ApplyZoneToRoom(), yaze::editor::DungeonCanvasViewer::CanNavigateRooms(), CollectZones(), yaze::editor::DungeonCanvasViewer::current_room_id(), yaze::zelda3::DumpWaterFillZonesToJsonString(), yaze::util::FileDialogOptions::filters, yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), yaze::editor::AgentUI::GetTheme(), yaze::editor::DungeonCanvasViewer::HasRooms(), yaze::zelda3::HasWaterFillReservedRegion(), ICON_MD_CHECK_CIRCLE, ICON_MD_DOWNLOAD, ICON_MD_ERROR, ICON_MD_INFO, ICON_MD_TUNE, ICON_MD_UPLOAD, ICON_MD_WARNING, interaction_, yaze::Rom::is_loaded(), yaze::zelda3::kWaterFillTableEnd, last_io_error_, last_io_status_, yaze::util::LoadFile(), yaze::zelda3::LoadWaterFillZonesFromJsonString(), yaze::editor::DungeonObjectInteraction::mode_manager(), yaze::editor::DungeonCanvasViewer::NavigateToRoom(), yaze::zelda3::NormalizeWaterFillZoneMasks(), yaze::editor::PaintWaterFill, yaze::editor::DungeonCanvasViewer::rom(), yaze::editor::DungeonCanvasViewer::rooms(), yaze::editor::Select, yaze::editor::DungeonCanvasViewer::set_show_water_fill_overlay(), yaze::editor::InteractionModeManager::SetMode(), yaze::editor::DungeonCanvasViewer::show_water_fill_overlay(), yaze::util::FileDialogWrapper::ShowOpenFileDialog(), yaze::util::FileDialogWrapper::ShowSaveFileDialog(), yaze::Rom::vector(), and viewer_.

◆ CollectZones()

static std::vector< zelda3::WaterFillZoneEntry > yaze::editor::WaterFillPanel::CollectZones ( const std::array< zelda3::Room, 0x128 > & rooms)
inlinestaticprivate

◆ ApplyZoneToRoom()

static void yaze::editor::WaterFillPanel::ApplyZoneToRoom ( const zelda3::WaterFillZoneEntry & z,
zelda3::Room * room )
inlinestaticprivate

Member Data Documentation

◆ last_io_status_

std::string yaze::editor::WaterFillPanel::last_io_status_
private

Definition at line 461 of file water_fill_panel.h.

Referenced by Draw().

◆ last_io_error_

std::string yaze::editor::WaterFillPanel::last_io_error_
private

Definition at line 462 of file water_fill_panel.h.

Referenced by Draw().

◆ viewer_

DungeonCanvasViewer* yaze::editor::WaterFillPanel::viewer_ = nullptr
private

Definition at line 464 of file water_fill_panel.h.

Referenced by Draw(), and SetCanvasViewer().

◆ interaction_

DungeonObjectInteraction* yaze::editor::WaterFillPanel::interaction_ = nullptr
private

Definition at line 465 of file water_fill_panel.h.

Referenced by Draw(), and SetInteraction().


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