#include <canvas_navigation_manager.h>

Public Member Functions | |
| CanvasNavigationManager ()=default | |
| void | Initialize (const CanvasNavigationContext &context, const CanvasNavigationCallbacks &callbacks) |
| Initialize with shared state and callbacks. | |
| absl::Status | CheckForCurrentMap () |
| Detect which map the mouse is over, trigger lazy loading, draw the selection outline, and refresh textures if modified. | |
| void | HandleMapInteraction () |
| Handle tile-mode right-click (eyedropper) and middle-click (lock/properties toggle), plus double-click to open properties. | |
| void | HandleOverworldPan () |
| Pan the overworld canvas via middle-click or left-click drag (in MOUSE mode when not hovering an entity). | |
| void | HandleOverworldZoom () |
| No-op stub preserved for API compatibility. | |
| void | ZoomIn () |
| Increase canvas zoom by one step. | |
| void | ZoomOut () |
| Decrease canvas zoom by one step. | |
| void | ClampOverworldScroll () |
| No-op stub – ImGui handles scroll clamping automatically. | |
| void | ResetOverworldView () |
| Reset scroll to top-left and scale to 1.0. | |
| void | CenterOverworldView () |
| Center the viewport on the current map. | |
| void | CheckForMousePan () |
| Legacy wrapper – delegates to HandleOverworldPan(). | |
| void | ScrollBlocksetCanvasToCurrentTile () |
| Scroll the blockset (tile16 selector) to show the currently selected tile16. | |
| void | UpdateBlocksetSelectorState () |
| Push current tile count and selection into the blockset widget. | |
| void | QueueAdjacentMapsForPreload (int center_map) |
Queue the 4-connected neighbors of center_map for lazy build. | |
| void | ProcessPreloadQueue () |
| Process one map from the preload queue (call once per frame). | |
Private Attributes | |
| CanvasNavigationContext | ctx_ |
| CanvasNavigationCallbacks | callbacks_ |
| int | last_hovered_map_ = -1 |
| float | hover_time_ = 0.0f |
| std::vector< int > | preload_queue_ |
Static Private Attributes | |
| static constexpr float | kHoverBuildDelay = 0.15f |
| static constexpr float | kPreloadStartDelay = 0.3f |
Definition at line 79 of file canvas_navigation_manager.h.
|
default |
| void yaze::editor::CanvasNavigationManager::Initialize | ( | const CanvasNavigationContext & | context, |
| const CanvasNavigationCallbacks & | callbacks ) |
Initialize with shared state and callbacks.
Definition at line 47 of file canvas_navigation_manager.cc.
References callbacks_, and ctx_.
| absl::Status yaze::editor::CanvasNavigationManager::CheckForCurrentMap | ( | ) |
Detect which map the mouse is over, trigger lazy loading, draw the selection outline, and refresh textures if modified.
Definition at line 58 of file canvas_navigation_manager.cc.
References yaze::gfx::Tilemap::atlas, callbacks_, ctx_, yaze::editor::CanvasNavigationContext::current_map, yaze::editor::CanvasNavigationContext::current_map_lock, yaze::editor::CanvasNavigationContext::current_mode, yaze::editor::CanvasNavigationContext::current_parent, yaze::editor::CanvasNavigationContext::current_world, yaze::gui::Canvas::DrawOutline(), yaze::editor::CanvasNavigationCallbacks::ensure_map_texture, yaze::zelda3::Overworld::EnsureMapBuilt(), yaze::gfx::Arena::Get(), yaze::core::FeatureFlags::get(), yaze::zelda3::OverworldVersionHelper::GetVersion(), yaze::gui::Canvas::global_scale(), yaze::gui::Canvas::hover_mouse_pos(), hover_time_, yaze::gfx::Bitmap::is_active(), yaze::core::FeatureFlags::Flags::Overworld::kEnableSpecialWorldExpansion, kHoverBuildDelay, yaze::editor::kOverworldMapSize, kPreloadStartDelay, last_hovered_map_, yaze::editor::CanvasNavigationContext::maps_bmp, yaze::editor::MOUSE, yaze::editor::CanvasNavigationContext::overworld, yaze::core::FeatureFlags::Flags::overworld, yaze::zelda3::Overworld::overworld_map(), yaze::editor::CanvasNavigationContext::ow_map_canvas, preload_queue_, ProcessPreloadQueue(), QueueAdjacentMapsForPreload(), yaze::gfx::Arena::QueueTextureCommand(), yaze::editor::CanvasNavigationCallbacks::refresh_overworld_map, yaze::editor::CanvasNavigationCallbacks::refresh_tile16_blockset, RETURN_IF_ERROR, yaze::editor::CanvasNavigationContext::rom, yaze::zelda3::OverworldVersionHelper::SupportsAreaEnum(), yaze::editor::CanvasNavigationContext::tile16_blockset, and yaze::gfx::Arena::UPDATE.
| void yaze::editor::CanvasNavigationManager::HandleMapInteraction | ( | ) |
Handle tile-mode right-click (eyedropper) and middle-click (lock/properties toggle), plus double-click to open properties.
Definition at line 266 of file canvas_navigation_manager.cc.
References callbacks_, ctx_, yaze::editor::CanvasNavigationContext::current_map, yaze::editor::CanvasNavigationContext::current_map_lock, yaze::editor::CanvasNavigationContext::current_mode, yaze::editor::CanvasNavigationContext::current_world, yaze::editor::DRAW_TILE, yaze::gui::Canvas::drawn_tile_position(), yaze::editor::FILL_TILE, yaze::gui::Canvas::global_scale(), yaze::editor::kOverworldMapSize, yaze::editor::CanvasNavigationContext::ow_map_canvas, yaze::editor::CanvasNavigationCallbacks::pick_tile16_from_hovered_canvas, and yaze::editor::CanvasNavigationContext::show_map_properties_panel.

| void yaze::editor::CanvasNavigationManager::HandleOverworldPan | ( | ) |
Pan the overworld canvas via middle-click or left-click drag (in MOUSE mode when not hovering an entity).
Definition at line 317 of file canvas_navigation_manager.cc.
References callbacks_, ctx_, yaze::editor::CanvasNavigationContext::current_mode, yaze::editor::CanvasNavigationContext::is_dragging_entity, yaze::editor::CanvasNavigationCallbacks::is_entity_hovered, and yaze::editor::MOUSE.
Referenced by CheckForMousePan().
| void yaze::editor::CanvasNavigationManager::HandleOverworldZoom | ( | ) |
No-op stub preserved for API compatibility.
Definition at line 357 of file canvas_navigation_manager.cc.
| void yaze::editor::CanvasNavigationManager::ZoomIn | ( | ) |
Increase canvas zoom by one step.
Definition at line 362 of file canvas_navigation_manager.cc.
References ctx_, yaze::gui::Canvas::global_scale(), yaze::editor::kOverworldMaxZoom, yaze::editor::kOverworldZoomStep, yaze::editor::CanvasNavigationContext::ow_map_canvas, and yaze::gui::Canvas::set_global_scale().

| void yaze::editor::CanvasNavigationManager::ZoomOut | ( | ) |
Decrease canvas zoom by one step.
Definition at line 370 of file canvas_navigation_manager.cc.
References ctx_, yaze::gui::Canvas::global_scale(), yaze::editor::kOverworldMinZoom, yaze::editor::kOverworldZoomStep, yaze::editor::CanvasNavigationContext::ow_map_canvas, and yaze::gui::Canvas::set_global_scale().

| void yaze::editor::CanvasNavigationManager::ClampOverworldScroll | ( | ) |
No-op stub – ImGui handles scroll clamping automatically.
Definition at line 378 of file canvas_navigation_manager.cc.
| void yaze::editor::CanvasNavigationManager::ResetOverworldView | ( | ) |
Reset scroll to top-left and scale to 1.0.
Definition at line 383 of file canvas_navigation_manager.cc.
References ctx_, yaze::editor::CanvasNavigationContext::ow_map_canvas, and yaze::gui::Canvas::set_global_scale().

| void yaze::editor::CanvasNavigationManager::CenterOverworldView | ( | ) |
Center the viewport on the current map.
Definition at line 390 of file canvas_navigation_manager.cc.
References ctx_, yaze::editor::CanvasNavigationContext::current_map, yaze::gui::Canvas::global_scale(), yaze::editor::kOverworldMapSize, and yaze::editor::CanvasNavigationContext::ow_map_canvas.

| void yaze::editor::CanvasNavigationManager::CheckForMousePan | ( | ) |
Legacy wrapper – delegates to HandleOverworldPan().
Definition at line 419 of file canvas_navigation_manager.cc.
References HandleOverworldPan().

| void yaze::editor::CanvasNavigationManager::ScrollBlocksetCanvasToCurrentTile | ( | ) |
Scroll the blockset (tile16 selector) to show the currently selected tile16.
Definition at line 428 of file canvas_navigation_manager.cc.
References yaze::editor::CanvasNavigationContext::blockset_selector, ctx_, and yaze::editor::CanvasNavigationContext::current_tile16.
| void yaze::editor::CanvasNavigationManager::UpdateBlocksetSelectorState | ( | ) |
Push current tile count and selection into the blockset widget.
Definition at line 445 of file canvas_navigation_manager.cc.
References yaze::editor::CanvasNavigationContext::blockset_selector, ctx_, yaze::editor::CanvasNavigationContext::current_tile16, and yaze::zelda3::kNumTile16Individual.
| void yaze::editor::CanvasNavigationManager::QueueAdjacentMapsForPreload | ( | int | center_map | ) |
Queue the 4-connected neighbors of center_map for lazy build.
Definition at line 458 of file canvas_navigation_manager.cc.
References ctx_, yaze::zelda3::kNumOverworldMaps, yaze::zelda3::kSpecialWorldMapIdStart, yaze::editor::CanvasNavigationContext::overworld, yaze::zelda3::Overworld::overworld_map(), and preload_queue_.
Referenced by CheckForCurrentMap().

| void yaze::editor::CanvasNavigationManager::ProcessPreloadQueue | ( | ) |
Process one map from the preload queue (call once per frame).
Definition at line 498 of file canvas_navigation_manager.cc.
References ctx_, yaze::zelda3::Overworld::EnsureMapBuilt(), LOG_DEBUG, yaze::editor::CanvasNavigationContext::overworld, and preload_queue_.
Referenced by CheckForCurrentMap().

|
private |
Definition at line 154 of file canvas_navigation_manager.h.
Referenced by CenterOverworldView(), CheckForCurrentMap(), HandleMapInteraction(), HandleOverworldPan(), Initialize(), ProcessPreloadQueue(), QueueAdjacentMapsForPreload(), ResetOverworldView(), ScrollBlocksetCanvasToCurrentTile(), UpdateBlocksetSelectorState(), ZoomIn(), and ZoomOut().
|
private |
Definition at line 155 of file canvas_navigation_manager.h.
Referenced by CheckForCurrentMap(), HandleMapInteraction(), HandleOverworldPan(), and Initialize().
|
private |
Definition at line 158 of file canvas_navigation_manager.h.
Referenced by CheckForCurrentMap().
|
private |
Definition at line 159 of file canvas_navigation_manager.h.
Referenced by CheckForCurrentMap().
|
staticconstexprprivate |
Definition at line 160 of file canvas_navigation_manager.h.
Referenced by CheckForCurrentMap().
|
private |
Definition at line 163 of file canvas_navigation_manager.h.
Referenced by CheckForCurrentMap(), ProcessPreloadQueue(), and QueueAdjacentMapsForPreload().
|
staticconstexprprivate |
Definition at line 164 of file canvas_navigation_manager.h.
Referenced by CheckForCurrentMap().