#include <minecart_track_editor_panel.h>


Classes | |
| struct | RoomTrackAudit |
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 | SetRooms (std::array< zelda3::Room, 0x128 > *rooms) |
| void | SetProject (project::YazeProject *project) |
| void | SetRom (Rom *rom) |
| void | SaveTracks () |
| void | SetPickedCoordinates (int room_id, uint16_t camera_x, uint16_t camera_y) |
| bool | IsPickingCoordinates () const |
| int | GetPickingTrackIndex () const |
| const std::vector< MinecartTrack > & | GetTracks () |
| void | SetRoomNavigationCallback (RoomNavigationCallback callback) |
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() | |
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 () |
| void | RebuildAuditCache () |
| bool | IsDefaultTrack (const MinecartTrack &track) const |
| void | DrawOverlaySettings () |
| void | InitializeOverlayInputs () |
| bool | UpdateOverlayList (const char *label, std::string &input, std::vector< uint16_t > &target) |
Private Attributes | |
| std::vector< MinecartTrack > | tracks_ |
| std::string | project_root_ |
| Rom * | rom_ = nullptr |
| std::array< zelda3::Room, 0x128 > * | rooms_ = nullptr |
| project::YazeProject * | project_ = nullptr |
| std::unordered_map< int, RoomTrackAudit > | room_audit_ |
| std::unordered_map< int, std::vector< int > > | track_usage_rooms_ |
| std::vector< bool > | track_subtype_used_ |
| bool | audit_dirty_ = true |
| 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_ |
| bool | overlay_inputs_initialized_ = false |
| std::string | overlay_track_tiles_input_ |
| std::string | overlay_track_stop_tiles_input_ |
| std::string | overlay_track_switch_tiles_input_ |
| std::string | overlay_track_object_ids_input_ |
| std::string | overlay_minecart_sprite_ids_input_ |
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) | |
Definition at line 31 of file minecart_track_editor_panel.h.
| using yaze::editor::MinecartTrackEditorPanel::RoomNavigationCallback = std::function<void(int room_id)> |
Definition at line 67 of file minecart_track_editor_panel.h.
|
inlineexplicit |
Definition at line 33 of file minecart_track_editor_panel.h.
|
inlineoverridevirtual |
Unique identifier for this panel.
IDs should be:
Implements yaze::editor::EditorPanel.
Definition at line 37 of file minecart_track_editor_panel.h.
|
inlineoverridevirtual |
Human-readable name shown in menus and title bars.
Implements yaze::editor::EditorPanel.
Definition at line 38 of file minecart_track_editor_panel.h.
|
inlineoverridevirtual |
Material Design icon for this panel.
Implements yaze::editor::EditorPanel.
Definition at line 39 of file minecart_track_editor_panel.h.
References ICON_MD_TRAIN.
|
inlineoverridevirtual |
Editor category this panel belongs to.
Implements yaze::editor::EditorPanel.
Definition at line 40 of file minecart_track_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 348 of file minecart_track_editor_panel.cc.
References audit_dirty_, CancelCoordinatePicking(), DrawOverlaySettings(), yaze::zelda3::GenerateTrackCollision(), ICON_MD_ARROW_FORWARD, ICON_MD_AUTO_FIX_HIGH, ICON_MD_CANCEL, ICON_MD_CHECK_CIRCLE, ICON_MD_ERROR, ICON_MD_INFO, ICON_MD_MY_LOCATION, ICON_MD_SAVE, ICON_MD_WARNING_AMBER, yaze::gui::InputHexWordCustom(), IsDefaultTrack(), loaded_, LoadTracks(), picking_mode_, picking_track_index_, project_, yaze::project::YazeProject::project_opened(), project_root_, RebuildAuditCache(), rom_, room_audit_, room_navigation_callback_, rooms_, yaze::project::YazeProject::Save(), SaveTracks(), show_success_, StartCoordinatePicking(), status_message_, track_subtype_used_, track_usage_rooms_, tracks_, and yaze::zelda3::WriteTrackCollision().
| void yaze::editor::MinecartTrackEditorPanel::SetProjectRoot | ( | const std::string & | root | ) |
Definition at line 69 of file minecart_track_editor_panel.cc.
References audit_dirty_, loaded_, and project_root_.
Referenced by yaze::editor::DungeonEditorV2::Load().
|
inline |
Definition at line 46 of file minecart_track_editor_panel.h.
References audit_dirty_, and rooms_.
Referenced by yaze::editor::DungeonEditorV2::Load().
|
inline |
Definition at line 50 of file minecart_track_editor_panel.h.
References audit_dirty_, overlay_inputs_initialized_, and project_.
Referenced by yaze::editor::DungeonEditorV2::Load().
|
inline |
Definition at line 55 of file minecart_track_editor_panel.h.
References rom_.
Referenced by yaze::editor::DungeonEditorV2::Load().
| void yaze::editor::MinecartTrackEditorPanel::SaveTracks | ( | ) |
Definition at line 815 of file minecart_track_editor_panel.cc.
References FormatSection(), project_root_, show_success_, status_message_, and tracks_.
Referenced by Draw().

| void yaze::editor::MinecartTrackEditorPanel::SetPickedCoordinates | ( | int | room_id, |
| uint16_t | camera_x, | ||
| uint16_t | camera_y ) |
Definition at line 166 of file minecart_track_editor_panel.cc.
References audit_dirty_, has_picked_coords_, last_picked_x_, last_picked_y_, picking_mode_, picking_track_index_, show_success_, status_message_, and tracks_.
|
inline |
Definition at line 62 of file minecart_track_editor_panel.h.
References picking_mode_.
|
inline |
Definition at line 63 of file minecart_track_editor_panel.h.
References picking_track_index_.
| const std::vector< MinecartTrack > & yaze::editor::MinecartTrackEditorPanel::GetTracks | ( | ) |
Definition at line 159 of file minecart_track_editor_panel.cc.
References loaded_, LoadTracks(), and tracks_.

|
inline |
Definition at line 68 of file minecart_track_editor_panel.h.
References room_navigation_callback_.
Referenced by yaze::editor::DungeonEditorV2::Load().
|
private |
Definition at line 731 of file minecart_track_editor_panel.cc.
References audit_dirty_, loaded_, ParseSection(), project_root_, show_success_, status_message_, and tracks_.
Referenced by Draw(), and GetTracks().

|
private |
Definition at line 774 of file minecart_track_editor_panel.cc.
Referenced by LoadTracks().
|
private |
Definition at line 853 of file minecart_track_editor_panel.cc.
Referenced by SaveTracks().
|
private |
Definition at line 191 of file minecart_track_editor_panel.cc.
References picking_mode_, picking_track_index_, show_success_, and status_message_.
Referenced by Draw().
|
private |
Definition at line 199 of file minecart_track_editor_panel.cc.
References picking_mode_, picking_track_index_, and status_message_.
Referenced by Draw().
|
private |
Definition at line 211 of file minecart_track_editor_panel.cc.
References audit_dirty_, yaze::project::YazeProject::dungeon_overlay, yaze::editor::MinecartTrackEditorPanel::RoomTrackAudit::has_minecart_on_stop, yaze::editor::MinecartTrackEditorPanel::RoomTrackAudit::has_minecart_sprite, yaze::editor::MinecartTrackEditorPanel::RoomTrackAudit::has_stop_tiles, yaze::editor::MinecartTrackEditorPanel::RoomTrackAudit::has_track_collision, yaze::zelda3::LoadCustomCollisionMap(), yaze::project::DungeonOverlaySettings::minecart_sprite_ids, project_, room_audit_, rooms_, yaze::project::DungeonOverlaySettings::track_object_ids, yaze::project::DungeonOverlaySettings::track_stop_tiles, track_subtype_used_, yaze::editor::MinecartTrackEditorPanel::RoomTrackAudit::track_subtypes, yaze::project::DungeonOverlaySettings::track_switch_tiles, yaze::project::DungeonOverlaySettings::track_tiles, and track_usage_rooms_.
Referenced by Draw().

|
private |
Definition at line 205 of file minecart_track_editor_panel.cc.
References yaze::editor::MinecartTrack::room_id, yaze::editor::MinecartTrack::start_x, and yaze::editor::MinecartTrack::start_y.
Referenced by Draw().
|
private |
Definition at line 105 of file minecart_track_editor_panel.cc.
References audit_dirty_, yaze::project::YazeProject::dungeon_overlay, ICON_MD_TUNE, InitializeOverlayInputs(), yaze::project::DungeonOverlaySettings::minecart_sprite_ids, overlay_minecart_sprite_ids_input_, overlay_track_object_ids_input_, overlay_track_stop_tiles_input_, overlay_track_switch_tiles_input_, overlay_track_tiles_input_, project_, yaze::project::DungeonOverlaySettings::track_object_ids, yaze::project::DungeonOverlaySettings::track_stop_tiles, yaze::project::DungeonOverlaySettings::track_switch_tiles, yaze::project::DungeonOverlaySettings::track_tiles, and UpdateOverlayList().
Referenced by Draw().

|
private |
Definition at line 77 of file minecart_track_editor_panel.cc.
References yaze::project::YazeProject::dungeon_overlay, yaze::project::DungeonOverlaySettings::minecart_sprite_ids, overlay_inputs_initialized_, overlay_minecart_sprite_ids_input_, overlay_track_object_ids_input_, overlay_track_stop_tiles_input_, overlay_track_switch_tiles_input_, overlay_track_tiles_input_, project_, yaze::project::DungeonOverlaySettings::track_object_ids, yaze::project::DungeonOverlaySettings::track_stop_tiles, yaze::project::DungeonOverlaySettings::track_switch_tiles, and yaze::project::DungeonOverlaySettings::track_tiles.
Referenced by DrawOverlaySettings().
|
private |
Definition at line 94 of file minecart_track_editor_panel.cc.
References audit_dirty_.
Referenced by DrawOverlaySettings().
|
private |
Definition at line 95 of file minecart_track_editor_panel.h.
Referenced by Draw(), GetTracks(), LoadTracks(), SaveTracks(), and SetPickedCoordinates().
|
private |
Definition at line 96 of file minecart_track_editor_panel.h.
Referenced by Draw(), LoadTracks(), SaveTracks(), and SetProjectRoot().
|
private |
Definition at line 97 of file minecart_track_editor_panel.h.
|
private |
Definition at line 98 of file minecart_track_editor_panel.h.
Referenced by Draw(), RebuildAuditCache(), and SetRooms().
|
private |
Definition at line 99 of file minecart_track_editor_panel.h.
Referenced by Draw(), DrawOverlaySettings(), InitializeOverlayInputs(), RebuildAuditCache(), and SetProject().
|
private |
Definition at line 100 of file minecart_track_editor_panel.h.
Referenced by Draw(), and RebuildAuditCache().
|
private |
Definition at line 101 of file minecart_track_editor_panel.h.
Referenced by Draw(), and RebuildAuditCache().
|
private |
Definition at line 102 of file minecart_track_editor_panel.h.
Referenced by Draw(), and RebuildAuditCache().
|
private |
Definition at line 103 of file minecart_track_editor_panel.h.
Referenced by Draw(), DrawOverlaySettings(), LoadTracks(), RebuildAuditCache(), SetPickedCoordinates(), SetProject(), SetProjectRoot(), SetRooms(), and UpdateOverlayList().
|
private |
Definition at line 104 of file minecart_track_editor_panel.h.
Referenced by Draw(), GetTracks(), LoadTracks(), and SetProjectRoot().
|
private |
Definition at line 105 of file minecart_track_editor_panel.h.
Referenced by CancelCoordinatePicking(), Draw(), LoadTracks(), SaveTracks(), SetPickedCoordinates(), and StartCoordinatePicking().
|
private |
Definition at line 106 of file minecart_track_editor_panel.h.
Referenced by Draw(), LoadTracks(), SaveTracks(), SetPickedCoordinates(), and StartCoordinatePicking().
|
private |
Definition at line 107 of file minecart_track_editor_panel.h.
|
private |
Definition at line 110 of file minecart_track_editor_panel.h.
Referenced by CancelCoordinatePicking(), Draw(), IsPickingCoordinates(), SetPickedCoordinates(), and StartCoordinatePicking().
|
private |
Definition at line 111 of file minecart_track_editor_panel.h.
Referenced by CancelCoordinatePicking(), Draw(), GetPickingTrackIndex(), SetPickedCoordinates(), and StartCoordinatePicking().
|
private |
Definition at line 114 of file minecart_track_editor_panel.h.
Referenced by SetPickedCoordinates().
|
private |
Definition at line 115 of file minecart_track_editor_panel.h.
Referenced by SetPickedCoordinates().
|
private |
Definition at line 116 of file minecart_track_editor_panel.h.
Referenced by SetPickedCoordinates().
|
private |
Definition at line 118 of file minecart_track_editor_panel.h.
Referenced by Draw(), and SetRoomNavigationCallback().
|
private |
Definition at line 121 of file minecart_track_editor_panel.h.
Referenced by InitializeOverlayInputs(), and SetProject().
|
private |
Definition at line 122 of file minecart_track_editor_panel.h.
Referenced by DrawOverlaySettings(), and InitializeOverlayInputs().
|
private |
Definition at line 123 of file minecart_track_editor_panel.h.
Referenced by DrawOverlaySettings(), and InitializeOverlayInputs().
|
private |
Definition at line 124 of file minecart_track_editor_panel.h.
Referenced by DrawOverlaySettings(), and InitializeOverlayInputs().
|
private |
Definition at line 125 of file minecart_track_editor_panel.h.
Referenced by DrawOverlaySettings(), and InitializeOverlayInputs().
|
private |
Definition at line 126 of file minecart_track_editor_panel.h.
Referenced by DrawOverlaySettings(), and InitializeOverlayInputs().