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

#include <minecart_track_editor_panel.h>

Inheritance diagram for yaze::editor::MinecartTrackEditorPanel:
Collaboration diagram for yaze::editor::MinecartTrackEditorPanel:

Public Types

using RoomNavigationCallback = std::function<void(int room_id)>
 

Public Member Functions

 MinecartTrackEditorPanel (const std::string &start_root="")
 
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 Draw (bool *p_open) override
 Draw the panel content.
 
void SetProjectRoot (const std::string &root)
 
void SaveTracks ()
 
void SetPickedCoordinates (int room_id, uint16_t camera_x, uint16_t camera_y)
 
bool IsPickingCoordinates () const
 
int GetPickingTrackIndex () const
 
void SetRoomNavigationCallback (RoomNavigationCallback callback)
 
- 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 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.
 

Private Member Functions

void LoadTracks ()
 
bool ParseSection (const std::string &content, const std::string &label, std::vector< int > &out_values)
 
std::string FormatSection (const std::string &label, const std::vector< int > &values)
 
void StartCoordinatePicking (int track_index)
 
void CancelCoordinatePicking ()
 

Private Attributes

std::vector< MinecartTracktracks_
 
std::string project_root_
 
bool loaded_ = false
 
std::string status_message_
 
bool show_success_ = false
 
float success_timer_ = 0.0f
 
bool picking_mode_ = false
 
int picking_track_index_ = -1
 
uint16_t last_picked_x_ = 0
 
uint16_t last_picked_y_ = 0
 
bool has_picked_coords_ = false
 
RoomNavigationCallback room_navigation_callback_
 

Detailed Description

Definition at line 24 of file minecart_track_editor_panel.h.

Member Typedef Documentation

◆ RoomNavigationCallback

using yaze::editor::MinecartTrackEditorPanel::RoomNavigationCallback = std::function<void(int room_id)>

Definition at line 48 of file minecart_track_editor_panel.h.

Constructor & Destructor Documentation

◆ MinecartTrackEditorPanel()

yaze::editor::MinecartTrackEditorPanel::MinecartTrackEditorPanel ( const std::string & start_root = "")
inlineexplicit

Definition at line 26 of file minecart_track_editor_panel.h.

Member Function Documentation

◆ GetId()

std::string yaze::editor::MinecartTrackEditorPanel::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 29 of file minecart_track_editor_panel.h.

◆ GetDisplayName()

std::string yaze::editor::MinecartTrackEditorPanel::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 30 of file minecart_track_editor_panel.h.

◆ GetIcon()

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

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::EditorPanel.

Definition at line 31 of file minecart_track_editor_panel.h.

◆ GetEditorCategory()

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

◆ Draw()

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

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 59 of file minecart_track_editor_panel.cc.

References CancelCoordinatePicking(), ICON_MD_ARROW_FORWARD, ICON_MD_CANCEL, ICON_MD_MY_LOCATION, ICON_MD_SAVE, yaze::gui::InputHexWordCustom(), loaded_, LoadTracks(), picking_mode_, picking_track_index_, project_root_, room_navigation_callback_, SaveTracks(), show_success_, StartCoordinatePicking(), status_message_, and tracks_.

◆ SetProjectRoot()

void yaze::editor::MinecartTrackEditorPanel::SetProjectRoot ( const std::string & root)

Definition at line 18 of file minecart_track_editor_panel.cc.

References loaded_, and project_root_.

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

◆ SaveTracks()

void yaze::editor::MinecartTrackEditorPanel::SaveTracks ( )

Definition at line 249 of file minecart_track_editor_panel.cc.

References FormatSection(), project_root_, show_success_, status_message_, and tracks_.

Referenced by Draw().

Here is the call graph for this function:

◆ SetPickedCoordinates()

void yaze::editor::MinecartTrackEditorPanel::SetPickedCoordinates ( int room_id,
uint16_t camera_x,
uint16_t camera_y )

◆ IsPickingCoordinates()

bool yaze::editor::MinecartTrackEditorPanel::IsPickingCoordinates ( ) const
inline

Definition at line 44 of file minecart_track_editor_panel.h.

References picking_mode_.

◆ GetPickingTrackIndex()

int yaze::editor::MinecartTrackEditorPanel::GetPickingTrackIndex ( ) const
inline

Definition at line 45 of file minecart_track_editor_panel.h.

References picking_track_index_.

◆ SetRoomNavigationCallback()

void yaze::editor::MinecartTrackEditorPanel::SetRoomNavigationCallback ( RoomNavigationCallback callback)
inline

Definition at line 49 of file minecart_track_editor_panel.h.

References room_navigation_callback_.

◆ LoadTracks()

void yaze::editor::MinecartTrackEditorPanel::LoadTracks ( )
private

Definition at line 175 of file minecart_track_editor_panel.cc.

References loaded_, ParseSection(), project_root_, show_success_, status_message_, and tracks_.

Referenced by Draw().

Here is the call graph for this function:

◆ ParseSection()

bool yaze::editor::MinecartTrackEditorPanel::ParseSection ( const std::string & content,
const std::string & label,
std::vector< int > & out_values )
private

Definition at line 212 of file minecart_track_editor_panel.cc.

Referenced by LoadTracks().

◆ FormatSection()

std::string yaze::editor::MinecartTrackEditorPanel::FormatSection ( const std::string & label,
const std::vector< int > & values )
private

Definition at line 283 of file minecart_track_editor_panel.cc.

Referenced by SaveTracks().

◆ StartCoordinatePicking()

void yaze::editor::MinecartTrackEditorPanel::StartCoordinatePicking ( int track_index)
private

Definition at line 46 of file minecart_track_editor_panel.cc.

References picking_mode_, picking_track_index_, show_success_, and status_message_.

Referenced by Draw().

◆ CancelCoordinatePicking()

void yaze::editor::MinecartTrackEditorPanel::CancelCoordinatePicking ( )
private

Definition at line 53 of file minecart_track_editor_panel.cc.

References picking_mode_, picking_track_index_, and status_message_.

Referenced by Draw().

Member Data Documentation

◆ tracks_

std::vector<MinecartTrack> yaze::editor::MinecartTrackEditorPanel::tracks_
private

Definition at line 60 of file minecart_track_editor_panel.h.

Referenced by Draw(), LoadTracks(), SaveTracks(), and SetPickedCoordinates().

◆ project_root_

std::string yaze::editor::MinecartTrackEditorPanel::project_root_
private

Definition at line 61 of file minecart_track_editor_panel.h.

Referenced by Draw(), LoadTracks(), SaveTracks(), and SetProjectRoot().

◆ loaded_

bool yaze::editor::MinecartTrackEditorPanel::loaded_ = false
private

Definition at line 62 of file minecart_track_editor_panel.h.

Referenced by Draw(), LoadTracks(), and SetProjectRoot().

◆ status_message_

std::string yaze::editor::MinecartTrackEditorPanel::status_message_
private

◆ show_success_

bool yaze::editor::MinecartTrackEditorPanel::show_success_ = false
private

◆ success_timer_

float yaze::editor::MinecartTrackEditorPanel::success_timer_ = 0.0f
private

Definition at line 65 of file minecart_track_editor_panel.h.

◆ picking_mode_

bool yaze::editor::MinecartTrackEditorPanel::picking_mode_ = false
private

◆ picking_track_index_

int yaze::editor::MinecartTrackEditorPanel::picking_track_index_ = -1
private

◆ last_picked_x_

uint16_t yaze::editor::MinecartTrackEditorPanel::last_picked_x_ = 0
private

Definition at line 72 of file minecart_track_editor_panel.h.

Referenced by SetPickedCoordinates().

◆ last_picked_y_

uint16_t yaze::editor::MinecartTrackEditorPanel::last_picked_y_ = 0
private

Definition at line 73 of file minecart_track_editor_panel.h.

Referenced by SetPickedCoordinates().

◆ has_picked_coords_

bool yaze::editor::MinecartTrackEditorPanel::has_picked_coords_ = false
private

Definition at line 74 of file minecart_track_editor_panel.h.

Referenced by SetPickedCoordinates().

◆ room_navigation_callback_

RoomNavigationCallback yaze::editor::MinecartTrackEditorPanel::room_navigation_callback_
private

Definition at line 76 of file minecart_track_editor_panel.h.

Referenced by Draw(), and SetRoomNavigationCallback().


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