#include <map_properties.h>

Classes | |
| struct | ContextViewToggle |
| A View-menu toggle that mirrors a toolbar toggle. More... | |
Public Types | |
| using | RefreshMapCallback = std::function<void(int)> |
| using | RefreshMapPaletteCallback = std::function<absl::Status(int)> |
| using | RefreshCallback = std::function<void()> |
| using | RefreshPaletteCallback = std::function<absl::Status()> |
| using | ForceRefreshGraphicsCallback = std::function<void(int)> |
| using | PropertyEditCallback |
| using | PropertyEditBatchCallback |
| using | ResourceLabelEditCallback |
Public Member Functions | |
| MapPropertiesSystem (zelda3::Overworld *overworld, Rom *rom, std::array< gfx::Bitmap, zelda3::kExpandedMapCount > *maps_bmp=nullptr, gui::Canvas *canvas=nullptr, int *game_state=nullptr) | |
| void | SetRefreshCallbacks (RefreshMapCallback refresh_map_properties, RefreshCallback refresh_overworld_map, RefreshMapPaletteCallback refresh_map_palette, RefreshPaletteCallback refresh_tile16_blockset=nullptr, ForceRefreshGraphicsCallback force_refresh_graphics=nullptr) |
| void | SetEntityCallbacks (std::function< void(const std::string &, const OverworldContextTarget &)> insert_callback) |
| void | SetTile16EditCallback (std::function< void(const OverworldContextTarget &)> callback) |
| void | SetTile16SampleCallback (std::function< bool(const OverworldContextTarget &)> callback) |
| void | SetTile16GraphicsCallback (std::function< void(const OverworldContextTarget &)> callback) |
| void | SetMapSelectionCallback (std::function< void(int, bool)> callback) |
| void | SetOpenMapPropertiesCallback (std::function< void()> callback) |
| Opens (and focuses) the Map Properties window for the selected map. | |
| void | SetContextNavigationCallbacks (std::function< void()> reset_view, std::function< void()> zoom_in, std::function< void()> zoom_out, std::function< void()> zoom_fit=nullptr, std::function< void()> center_map=nullptr) |
| void | SetShortcutHintProvider (std::function< std::string(const char *)> provider) |
| void | SetContextViewToggles (ContextViewToggle grid, ContextViewToggle entities, ContextViewToggle overlay_preview) |
| void | SetCurrentMapProvider (std::function< int()> provider) |
| Current map id; hides "Select This Map" when its area is current. | |
| void | SetMapJumpCallback (std::function< void(int)> callback) |
| void | SetPropertyEditCallback (PropertyEditCallback callback) |
| void | SetPropertyEditBatchCallback (PropertyEditBatchCallback callback) |
| void | SetResourceLabelEditCallback (ResourceLabelEditCallback callback) |
| void | DrawCustomBackgroundColorEditor (int current_map, bool &show_custom_bg_color_editor) |
| void | DrawOverlayEditor (int current_map, bool &show_overlay_editor) |
| void | DrawOverlayPreviewOnMap (int current_map, int current_world, bool show_overlay_preview) |
| void | SetupCanvasContextMenu (gui::Canvas &canvas, const OverworldContextTarget &target, bool ¤t_map_lock, int current_mode=0, project::YazeProject *project=nullptr, SharedClipboard *shared_clipboard=nullptr) |
| absl::Status | ApplyPropertyEdit (const OverworldPropertyEdit &edit) |
| absl::Status | ApplyPropertyEdits (const std::vector< OverworldPropertyEdit > &edits, const std::string &description={}) |
| absl::Status | ApplyPropertyEditDirect (const OverworldPropertyEdit &edit) |
| absl::Status | CheckPropertyEditSupported (const OverworldPropertyEdit &edit) const |
| absl::StatusOr< int > | ReadPropertyValue (const OverworldPropertyEdit &edit) const |
| void | RefreshMapProperties (int map_id) |
| void | RefreshOverworldMap () |
| absl::Status | RefreshMapPalette (int map_id) |
| absl::Status | RefreshTile16Blockset () |
| void | ForceRefreshGraphics (int map_index) |
| void | RefreshSiblingMapGraphics (int map_index, bool include_self=false) |
Private Member Functions | |
| std::string | GetOverlayDescription (uint16_t overlay_id) |
| int | CurrentGameState () const |
| int | CurrentGameState (int fallback) const |
| void | SetCurrentGameState (int game_state) |
| void | PrepareMapForGraphicsRefresh (int map_index) |
Definition at line 32 of file map_properties.h.
| using yaze::editor::MapPropertiesSystem::RefreshMapCallback = std::function<void(int)> |
Definition at line 35 of file map_properties.h.
| using yaze::editor::MapPropertiesSystem::RefreshMapPaletteCallback = std::function<absl::Status(int)> |
Definition at line 36 of file map_properties.h.
| using yaze::editor::MapPropertiesSystem::RefreshCallback = std::function<void()> |
Definition at line 37 of file map_properties.h.
| using yaze::editor::MapPropertiesSystem::RefreshPaletteCallback = std::function<absl::Status()> |
Definition at line 38 of file map_properties.h.
| using yaze::editor::MapPropertiesSystem::ForceRefreshGraphicsCallback = std::function<void(int)> |
Definition at line 39 of file map_properties.h.
Definition at line 40 of file map_properties.h.
Definition at line 42 of file map_properties.h.
Definition at line 44 of file map_properties.h.
|
inlineexplicit |
Definition at line 47 of file map_properties.h.
|
inline |
Definition at line 58 of file map_properties.h.
References force_refresh_graphics_, refresh_map_palette_, refresh_map_properties_, refresh_overworld_map_, and refresh_tile16_blockset_.
|
inline |
Definition at line 72 of file map_properties.h.
References entity_insert_callback_.
|
inline |
Definition at line 79 of file map_properties.h.
References edit_tile16_callback_.
|
inline |
Definition at line 84 of file map_properties.h.
References sample_tile16_callback_.
|
inline |
Definition at line 89 of file map_properties.h.
References edit_graphics_callback_.
|
inline |
Definition at line 94 of file map_properties.h.
References map_selection_callback_.
|
inline |
Opens (and focuses) the Map Properties window for the selected map.
Definition at line 99 of file map_properties.h.
References open_map_properties_callback_.
|
inline |
Definition at line 103 of file map_properties.h.
References center_map_callback_, reset_view_callback_, zoom_fit_callback_, zoom_in_callback_, and zoom_out_callback_.
|
inline |
Maps a ShortcutManager name to its display string ("Cmd+L") so menu items show the live binding.
Definition at line 116 of file map_properties.h.
References shortcut_hint_.
|
inline |
Definition at line 126 of file map_properties.h.
References entities_toggle_, grid_toggle_, and overlay_toggle_.
|
inline |
Current map id; hides "Select This Map" when its area is current.
Definition at line 134 of file map_properties.h.
References current_map_provider_.
|
inline |
Selects a map that may be off screen or in the other world, and brings it into view (Related Maps). Falls back to the map selection callback.
Definition at line 140 of file map_properties.h.
References map_jump_callback_.
|
inline |
Definition at line 144 of file map_properties.h.
References property_edit_callback_.
|
inline |
Definition at line 148 of file map_properties.h.
References property_edit_batch_callback_.
|
inline |
Definition at line 152 of file map_properties.h.
References resource_label_edit_callback_.
| void yaze::editor::MapPropertiesSystem::DrawCustomBackgroundColorEditor | ( | int | current_map, |
| bool & | show_custom_bg_color_editor ) |
Definition at line 221 of file map_properties.cc.
References ApplyPropertyEdit(), yaze::gui::ConvertImVec4ToSnesColor(), yaze::gui::ConvertSnesColorToImVec4(), yaze::zelda3::OverworldVersionHelper::GetVersion(), yaze::zelda3::Overworld::is_loaded(), yaze::editor::kAreaSpecificBgColor, overworld_, yaze::zelda3::Overworld::overworld_map(), yaze::zelda3::OverworldCustomAreaSpecificBGEnabled, rom_, yaze::gfx::SnesColor::snes(), and yaze::zelda3::OverworldVersionHelper::SupportsCustomBGColors().
| void yaze::editor::MapPropertiesSystem::DrawOverlayEditor | ( | int | current_map, |
| bool & | show_overlay_editor ) |
Definition at line 275 of file map_properties.cc.
References ApplyPropertyEdit(), GetOverlayDescription(), yaze::zelda3::OverworldVersionHelper::GetVersion(), ICON_MD_BLOCK, ICON_MD_HELP_OUTLINE, ICON_MD_INFO, ICON_MD_LAYERS, ICON_MD_LIGHTBULB, ICON_MD_PHOTO, ICON_MD_VISIBILITY, yaze::gui::InputHexWord(), yaze::zelda3::Overworld::is_loaded(), yaze::editor::kInputFieldSize, yaze::editor::kSubscreenOverlay, yaze::zelda3::kVanilla, overworld_, yaze::zelda3::Overworld::overworld_map(), yaze::zelda3::OverworldCustomSubscreenOverlayEnabled, and rom_.
| void yaze::editor::MapPropertiesSystem::DrawOverlayPreviewOnMap | ( | int | current_map, |
| int | current_world, | ||
| bool | show_overlay_preview ) |
Definition at line 1024 of file map_properties.cc.
References canvas_, yaze::gui::Canvas::draw_list(), yaze::gui::Canvas::global_scale(), yaze::zelda3::kNumOverworldMaps, yaze::editor::kOverworldMapSize, maps_bmp_, overworld_, and yaze::zelda3::Overworld::overworld_map().

| void yaze::editor::MapPropertiesSystem::SetupCanvasContextMenu | ( | gui::Canvas & | canvas, |
| const OverworldContextTarget & | target, | ||
| bool & | current_map_lock, | ||
| int | current_mode = 0, | ||
| project::YazeProject * | project = nullptr, | ||
| SharedClipboard * | shared_clipboard = nullptr ) |
Definition at line 381 of file map_properties.cc.
References yaze::gui::Canvas::AddContextMenuItem(), ApplyPropertyEdits(), yaze::editor::BuildOverworldMapMetadata(), yaze::editor::BuildOverworldMetadataPasteEdits(), yaze::editor::CanPasteOverworldMapMetadata(), center_map_callback_, yaze::gui::CanvasMenuItem::checked_condition, yaze::gui::Canvas::ClearContextMenuItems(), yaze::gui::CanvasMenuItem::Conditional(), current_map_provider_, yaze::editor::DescribeOverworldMapMetadataClipboard(), yaze::gui::CanvasMenuItem::Disabled(), edit_graphics_callback_, edit_tile16_callback_, yaze::gui::CanvasMenuItem::enabled_condition, entities_toggle_, entity_insert_callback_, yaze::editor::OverworldContextTarget::game_state, grid_toggle_, yaze::editor::SharedClipboard::has_overworld_map_metadata, yaze::gui::CanvasMenuItem::icon, ICON_MD_ACCOUNT_TREE, ICON_MD_ADD_LOCATION, ICON_MD_CENTER_FOCUS_STRONG, ICON_MD_CHECK, ICON_MD_COLORIZE, ICON_MD_CONTENT_COPY, ICON_MD_CONTENT_PASTE, ICON_MD_CYCLONE, ICON_MD_DOOR_BACK, ICON_MD_DOOR_FRONT, ICON_MD_FIT_SCREEN, ICON_MD_GRASS, ICON_MD_GRID_4X4, ICON_MD_GRID_ON, ICON_MD_GRID_VIEW, ICON_MD_IMAGE, ICON_MD_LAYERS, ICON_MD_MAP, ICON_MD_PEST_CONTROL_RODENT, ICON_MD_PLACE, ICON_MD_PUSH_PIN, ICON_MD_TUNE, ICON_MD_VISIBILITY, ICON_MD_ZOOM_IN, ICON_MD_ZOOM_OUT, yaze::zelda3::Overworld::is_loaded(), yaze::editor::kAll, yaze::zelda3::kNumOverworldMaps, yaze::editor::kTile16Size, yaze::gui::CanvasMenuItem::label, yaze::editor::OverworldContextTarget::map_id, map_jump_callback_, map_selection_callback_, open_map_properties_callback_, overlay_toggle_, overworld_, yaze::zelda3::Overworld::overworld_map(), yaze::editor::SharedClipboard::overworld_map_metadata, yaze::editor::OverworldContextTarget::parent_map_id, rom_, sample_tile16_callback_, yaze::editor::OverworldMapMetadataClipboard::scope, yaze::gui::CanvasMenuItem::separator_after, yaze::gui::Canvas::SetShowBuiltinContextMenu(), yaze::gui::CanvasMenuItem::shortcut, shortcut_hint_, yaze::editor::OverworldMapMetadataClipboard::source_map_id, yaze::gui::CanvasMenuItem::subitems, yaze::editor::OverworldContextTarget::tile16_id, yaze::gui::CanvasMenuItem::tooltip, yaze::editor::OverworldContextTarget::valid(), yaze::editor::OverworldMapMetadataClipboard::valid, yaze::gui::CanvasMenuItem::visible_condition, yaze::editor::OverworldContextTarget::world, yaze::editor::OverworldContextTarget::world_position, zoom_fit_callback_, zoom_in_callback_, and zoom_out_callback_.
| absl::Status yaze::editor::MapPropertiesSystem::ApplyPropertyEdit | ( | const OverworldPropertyEdit & | edit | ) |
Definition at line 700 of file map_properties.cc.
References ApplyPropertyEditDirect(), and property_edit_callback_.
Referenced by yaze::editor::OverworldSidebar::Apply(), ApplyPropertyEdits(), DrawCustomBackgroundColorEditor(), and DrawOverlayEditor().

| absl::Status yaze::editor::MapPropertiesSystem::ApplyPropertyEdits | ( | const std::vector< OverworldPropertyEdit > & | edits, |
| const std::string & | description = {} ) |
Definition at line 708 of file map_properties.cc.
References ApplyPropertyEdit(), CheckPropertyEditSupported(), property_edit_batch_callback_, and RETURN_IF_ERROR.
Referenced by SetupCanvasContextMenu().

| absl::Status yaze::editor::MapPropertiesSystem::ApplyPropertyEditDirect | ( | const OverworldPropertyEdit & | edit | ) |
Definition at line 778 of file map_properties.cc.
References yaze::zelda3::Overworld::ConfigureMultiAreaMap(), yaze::editor::OverworldPropertyEdit::field, ForceRefreshGraphics(), yaze::editor::OverworldPropertyEdit::index, yaze::editor::kAnimatedGraphics, yaze::editor::kAreaGraphics, yaze::editor::kAreaPalette, yaze::editor::kAreaSize, yaze::editor::kAreaSpecificBgColor, yaze::editor::kCustomTileset, yaze::editor::kMainPalette, yaze::editor::kMessageId, yaze::editor::kMosaic, yaze::editor::kMosaicExpanded, yaze::editor::kMusic, yaze::editor::kSpriteGraphics, yaze::editor::kSpritePalette, yaze::editor::kSubscreenOverlay, yaze::editor::OverworldPropertyEdit::map_id, maps_bmp_, yaze::zelda3::Overworld::mutable_overworld_map(), overworld_, yaze::zelda3::OverworldCustomAreaSpecificBGPalette, yaze::zelda3::OverworldCustomSubscreenOverlayArray, PrepareMapForGraphicsRefresh(), RefreshMapPalette(), RefreshMapProperties(), RefreshOverworldMap(), RefreshSiblingMapGraphics(), RefreshTile16Blockset(), rom_, yaze::Rom::set_dirty(), and yaze::editor::OverworldPropertyEdit::value.
Referenced by ApplyPropertyEdit().
| absl::Status yaze::editor::MapPropertiesSystem::CheckPropertyEditSupported | ( | const OverworldPropertyEdit & | edit | ) | const |
Definition at line 723 of file map_properties.cc.
References rom_.
Referenced by ApplyPropertyEdits().
| absl::StatusOr< int > yaze::editor::MapPropertiesSystem::ReadPropertyValue | ( | const OverworldPropertyEdit & | edit | ) | const |
Definition at line 728 of file map_properties.cc.
References yaze::editor::OverworldPropertyEdit::field, yaze::editor::OverworldPropertyEdit::index, yaze::editor::kAnimatedGraphics, yaze::editor::kAreaGraphics, yaze::editor::kAreaPalette, yaze::editor::kAreaSize, yaze::editor::kAreaSpecificBgColor, yaze::editor::kCustomTileset, yaze::editor::kMainPalette, yaze::editor::kMessageId, yaze::editor::kMosaic, yaze::editor::kMosaicExpanded, yaze::editor::kMusic, yaze::editor::kSpriteGraphics, yaze::editor::kSpritePalette, yaze::editor::kSubscreenOverlay, yaze::editor::OverworldPropertyEdit::map_id, yaze::zelda3::OverworldMap::mosaic_expanded(), overworld_, and yaze::zelda3::Overworld::overworld_map().

| void yaze::editor::MapPropertiesSystem::RefreshMapProperties | ( | int | map_id | ) |
Definition at line 911 of file map_properties.cc.
References refresh_map_properties_.
Referenced by ApplyPropertyEditDirect().
| void yaze::editor::MapPropertiesSystem::RefreshOverworldMap | ( | ) |
Definition at line 917 of file map_properties.cc.
References refresh_overworld_map_.
Referenced by ApplyPropertyEditDirect(), and RefreshSiblingMapGraphics().
| absl::Status yaze::editor::MapPropertiesSystem::RefreshMapPalette | ( | int | map_id | ) |
Definition at line 923 of file map_properties.cc.
References refresh_map_palette_.
Referenced by ApplyPropertyEditDirect().
| absl::Status yaze::editor::MapPropertiesSystem::RefreshTile16Blockset | ( | ) |
Definition at line 930 of file map_properties.cc.
References refresh_tile16_blockset_.
Referenced by ApplyPropertyEditDirect().
| void yaze::editor::MapPropertiesSystem::ForceRefreshGraphics | ( | int | map_index | ) |
Definition at line 937 of file map_properties.cc.
References force_refresh_graphics_.
Referenced by ApplyPropertyEditDirect(), and RefreshSiblingMapGraphics().
| void yaze::editor::MapPropertiesSystem::RefreshSiblingMapGraphics | ( | int | map_index, |
| bool | include_self = false ) |
Definition at line 943 of file map_properties.cc.
References ForceRefreshGraphics(), yaze::zelda3::kNumOverworldMaps, yaze::zelda3::LargeArea, maps_bmp_, yaze::zelda3::Overworld::mutable_overworld_map(), overworld_, PrepareMapForGraphicsRefresh(), RefreshOverworldMap(), yaze::zelda3::SmallArea, yaze::zelda3::TallArea, and yaze::zelda3::WideArea.
Referenced by ApplyPropertyEditDirect().

|
private |
Definition at line 998 of file map_properties.cc.
Referenced by DrawOverlayEditor().
|
private |
Definition at line 194 of file map_properties.cc.
References CurrentGameState(), and local_game_state_.
Referenced by CurrentGameState(), and PrepareMapForGraphicsRefresh().

|
private |
Definition at line 198 of file map_properties.cc.
References game_state_.
|
private |
Definition at line 202 of file map_properties.cc.
References game_state_, and local_game_state_.
|
private |
Definition at line 210 of file map_properties.cc.
References CurrentGameState(), yaze::zelda3::kNumOverworldMaps, yaze::zelda3::Overworld::mutable_overworld_map(), and overworld_.
Referenced by ApplyPropertyEditDirect(), and RefreshSiblingMapGraphics().

|
private |
Definition at line 211 of file map_properties.h.
Referenced by ApplyPropertyEditDirect(), DrawCustomBackgroundColorEditor(), DrawOverlayEditor(), DrawOverlayPreviewOnMap(), PrepareMapForGraphicsRefresh(), ReadPropertyValue(), RefreshSiblingMapGraphics(), and SetupCanvasContextMenu().
|
private |
Definition at line 212 of file map_properties.h.
Referenced by ApplyPropertyEditDirect(), CheckPropertyEditSupported(), DrawCustomBackgroundColorEditor(), DrawOverlayEditor(), and SetupCanvasContextMenu().
|
private |
Definition at line 213 of file map_properties.h.
Referenced by ApplyPropertyEditDirect(), DrawOverlayPreviewOnMap(), and RefreshSiblingMapGraphics().
|
private |
Definition at line 214 of file map_properties.h.
Referenced by DrawOverlayPreviewOnMap().
|
private |
Definition at line 215 of file map_properties.h.
Referenced by CurrentGameState(), and SetCurrentGameState().
|
private |
Definition at line 216 of file map_properties.h.
Referenced by CurrentGameState(), and SetCurrentGameState().
|
private |
Definition at line 219 of file map_properties.h.
Referenced by RefreshMapProperties(), and SetRefreshCallbacks().
|
private |
Definition at line 220 of file map_properties.h.
Referenced by RefreshOverworldMap(), and SetRefreshCallbacks().
|
private |
Definition at line 221 of file map_properties.h.
Referenced by RefreshMapPalette(), and SetRefreshCallbacks().
|
private |
Definition at line 222 of file map_properties.h.
Referenced by RefreshTile16Blockset(), and SetRefreshCallbacks().
|
private |
Definition at line 223 of file map_properties.h.
Referenced by ForceRefreshGraphics(), and SetRefreshCallbacks().
|
private |
Definition at line 227 of file map_properties.h.
Referenced by SetEntityCallbacks(), and SetupCanvasContextMenu().
|
private |
Definition at line 230 of file map_properties.h.
Referenced by SetTile16EditCallback(), and SetupCanvasContextMenu().
|
private |
Definition at line 231 of file map_properties.h.
Referenced by SetTile16SampleCallback(), and SetupCanvasContextMenu().
|
private |
Definition at line 232 of file map_properties.h.
Referenced by SetTile16GraphicsCallback(), and SetupCanvasContextMenu().
|
private |
Definition at line 234 of file map_properties.h.
Referenced by SetOpenMapPropertiesCallback(), and SetupCanvasContextMenu().
|
private |
Definition at line 235 of file map_properties.h.
Referenced by SetContextNavigationCallbacks(), and SetupCanvasContextMenu().
|
private |
Definition at line 236 of file map_properties.h.
Referenced by SetContextNavigationCallbacks(), and SetupCanvasContextMenu().
|
private |
Definition at line 237 of file map_properties.h.
Referenced by SetShortcutHintProvider(), and SetupCanvasContextMenu().
|
private |
Definition at line 239 of file map_properties.h.
Referenced by SetContextNavigationCallbacks().
|
private |
Definition at line 240 of file map_properties.h.
Referenced by SetContextNavigationCallbacks(), and SetupCanvasContextMenu().
|
private |
Definition at line 241 of file map_properties.h.
Referenced by SetContextNavigationCallbacks(), and SetupCanvasContextMenu().
|
private |
Definition at line 244 of file map_properties.h.
Referenced by SetMapSelectionCallback(), and SetupCanvasContextMenu().
|
private |
Definition at line 245 of file map_properties.h.
Referenced by SetMapJumpCallback(), and SetupCanvasContextMenu().
|
private |
Definition at line 246 of file map_properties.h.
Referenced by SetCurrentMapProvider(), and SetupCanvasContextMenu().
|
private |
Definition at line 247 of file map_properties.h.
Referenced by SetContextViewToggles(), and SetupCanvasContextMenu().
|
private |
Definition at line 248 of file map_properties.h.
Referenced by SetContextViewToggles(), and SetupCanvasContextMenu().
|
private |
Definition at line 249 of file map_properties.h.
Referenced by SetContextViewToggles(), and SetupCanvasContextMenu().
|
private |
Definition at line 250 of file map_properties.h.
Referenced by ApplyPropertyEdit(), and SetPropertyEditCallback().
|
private |
Definition at line 251 of file map_properties.h.
Referenced by ApplyPropertyEdits(), and SetPropertyEditBatchCallback().
|
private |
Definition at line 252 of file map_properties.h.
Referenced by SetResourceLabelEditCallback().