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

#include <map_properties.h>

Collaboration diagram for yaze::editor::MapPropertiesSystem:

Public Types

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::kNumOverworldMaps > *maps_bmp=nullptr, gui::Canvas *canvas=nullptr, int *game_state=nullptr)
 
void SetRefreshCallbacks (RefreshCallback refresh_map_properties, RefreshCallback refresh_overworld_map, RefreshPaletteCallback refresh_map_palette, RefreshPaletteCallback refresh_tile16_blockset=nullptr, ForceRefreshGraphicsCallback force_refresh_graphics=nullptr)
 
void SetEntityCallbacks (std::function< void(const std::string &)> insert_callback)
 
void SetTile16EditCallback (std::function< void()> callback)
 
void SetTile16SampleCallback (std::function< bool()> callback)
 
void SetMapSelectionCallback (std::function< void(int, bool)> callback)
 
void SetPropertyEditCallback (PropertyEditCallback callback)
 
void SetPropertyEditBatchCallback (PropertyEditBatchCallback callback)
 
void SetResourceLabelEditCallback (ResourceLabelEditCallback callback)
 
void DrawCanvasToolbar (int &current_world, int &current_map, bool &current_map_lock, bool &show_map_properties_panel, bool &show_custom_bg_color_editor, bool &show_overlay_editor, bool &show_overlay_preview, int &game_state, EditingMode &current_mode, EntityEditMode &entity_edit_mode)
 
void DrawMapPropertiesPanel (int current_map, bool &show_map_properties_panel)
 
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, int current_map, bool &current_map_lock, bool &show_map_properties_panel, bool &show_custom_bg_color_editor, bool &show_overlay_editor, 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 ()
 
void RefreshOverworldMap ()
 
absl::Status RefreshMapPalette ()
 
absl::Status RefreshTile16Blockset ()
 
void ForceRefreshGraphics (int map_index)
 
void RefreshSiblingMapGraphics (int map_index, bool include_self=false)
 

Private Member Functions

void DrawGraphicsPopup (int current_map, int game_state)
 
void DrawPalettesPopup (int current_map, int game_state, bool &show_custom_bg_color_editor)
 
void DrawPropertiesPopup (int current_map, bool &show_map_properties_panel, bool &show_overlay_preview, int &game_state)
 
void DrawMosaicControls (int current_map)
 
void DrawOverlayControls (int current_map, bool &show_overlay_preview)
 
std::string GetOverlayDescription (uint16_t overlay_id)
 
void DrawToolsPopup (int &current_mode)
 
void DrawViewPopup ()
 
void DrawQuickAccessPopup ()
 
void DrawBasicPropertiesTab (int current_map)
 
void DrawSpritePropertiesTab (int current_map)
 
void DrawCustomFeaturesTab (int current_map)
 
void DrawTileGraphicsTab (int current_map)
 
void DrawMusicTab (int current_map)
 
int CurrentGameState () const
 
int CurrentGameState (int fallback) const
 
void SetCurrentGameState (int game_state)
 
void PrepareMapForGraphicsRefresh (int map_index)
 

Private Attributes

zelda3::Overworldoverworld_
 
Romrom_
 
std::array< gfx::Bitmap, zelda3::kNumOverworldMaps > * maps_bmp_
 
gui::Canvascanvas_
 
int * game_state_
 
int local_game_state_ = 0
 
RefreshCallback refresh_map_properties_
 
RefreshCallback refresh_overworld_map_
 
RefreshPaletteCallback refresh_map_palette_
 
RefreshPaletteCallback refresh_tile16_blockset_
 
ForceRefreshGraphicsCallback force_refresh_graphics_
 
std::function< void(const std::string &) entity_insert_callback_ )
 
std::function< void()> edit_tile16_callback_
 
std::function< bool()> sample_tile16_callback_
 
std::function< void(int, bool)> map_selection_callback_
 
PropertyEditCallback property_edit_callback_
 
PropertyEditBatchCallback property_edit_batch_callback_
 
ResourceLabelEditCallback resource_label_edit_callback_
 

Detailed Description

Definition at line 30 of file map_properties.h.

Member Typedef Documentation

◆ RefreshCallback

Definition at line 33 of file map_properties.h.

◆ RefreshPaletteCallback

using yaze::editor::MapPropertiesSystem::RefreshPaletteCallback = std::function<absl::Status()>

Definition at line 34 of file map_properties.h.

◆ ForceRefreshGraphicsCallback

Definition at line 35 of file map_properties.h.

◆ PropertyEditCallback

Initial value:
std::function<absl::Status(const OverworldPropertyEdit&)>

Definition at line 36 of file map_properties.h.

◆ PropertyEditBatchCallback

Initial value:
std::function<absl::Status(
const std::vector<OverworldPropertyEdit>&, const std::string&)>

Definition at line 38 of file map_properties.h.

◆ ResourceLabelEditCallback

Initial value:
std::function<absl::Status(const std::string&, int, const std::string&)>

Definition at line 40 of file map_properties.h.

Constructor & Destructor Documentation

◆ MapPropertiesSystem()

yaze::editor::MapPropertiesSystem::MapPropertiesSystem ( zelda3::Overworld * overworld,
Rom * rom,
std::array< gfx::Bitmap, zelda3::kNumOverworldMaps > * maps_bmp = nullptr,
gui::Canvas * canvas = nullptr,
int * game_state = nullptr )
inlineexplicit

Definition at line 43 of file map_properties.h.

Member Function Documentation

◆ SetRefreshCallbacks()

void yaze::editor::MapPropertiesSystem::SetRefreshCallbacks ( RefreshCallback refresh_map_properties,
RefreshCallback refresh_overworld_map,
RefreshPaletteCallback refresh_map_palette,
RefreshPaletteCallback refresh_tile16_blockset = nullptr,
ForceRefreshGraphicsCallback force_refresh_graphics = nullptr )
inline

◆ SetEntityCallbacks()

void yaze::editor::MapPropertiesSystem::SetEntityCallbacks ( std::function< void(const std::string &)> insert_callback)
inline

Definition at line 68 of file map_properties.h.

References entity_insert_callback_.

◆ SetTile16EditCallback()

void yaze::editor::MapPropertiesSystem::SetTile16EditCallback ( std::function< void()> callback)
inline

Definition at line 74 of file map_properties.h.

References edit_tile16_callback_.

◆ SetTile16SampleCallback()

void yaze::editor::MapPropertiesSystem::SetTile16SampleCallback ( std::function< bool()> callback)
inline

Definition at line 78 of file map_properties.h.

References sample_tile16_callback_.

◆ SetMapSelectionCallback()

void yaze::editor::MapPropertiesSystem::SetMapSelectionCallback ( std::function< void(int, bool)> callback)
inline

Definition at line 82 of file map_properties.h.

References map_selection_callback_.

◆ SetPropertyEditCallback()

void yaze::editor::MapPropertiesSystem::SetPropertyEditCallback ( PropertyEditCallback callback)
inline

Definition at line 86 of file map_properties.h.

References property_edit_callback_.

◆ SetPropertyEditBatchCallback()

void yaze::editor::MapPropertiesSystem::SetPropertyEditBatchCallback ( PropertyEditBatchCallback callback)
inline

Definition at line 90 of file map_properties.h.

References property_edit_batch_callback_.

◆ SetResourceLabelEditCallback()

void yaze::editor::MapPropertiesSystem::SetResourceLabelEditCallback ( ResourceLabelEditCallback callback)
inline

Definition at line 94 of file map_properties.h.

References resource_label_edit_callback_.

◆ DrawCanvasToolbar()

◆ DrawMapPropertiesPanel()

◆ DrawCustomBackgroundColorEditor()

◆ DrawOverlayEditor()

◆ DrawOverlayPreviewOnMap()

void yaze::editor::MapPropertiesSystem::DrawOverlayPreviewOnMap ( int current_map,
int current_world,
bool show_overlay_preview )

◆ SetupCanvasContextMenu()

void yaze::editor::MapPropertiesSystem::SetupCanvasContextMenu ( gui::Canvas & canvas,
int current_map,
bool & current_map_lock,
bool & show_map_properties_panel,
bool & show_custom_bg_color_editor,
bool & show_overlay_editor,
int current_mode = 0,
project::YazeProject * project = nullptr,
SharedClipboard * shared_clipboard = nullptr )

◆ ApplyPropertyEdit()

◆ ApplyPropertyEdits()

absl::Status yaze::editor::MapPropertiesSystem::ApplyPropertyEdits ( const std::vector< OverworldPropertyEdit > & edits,
const std::string & description = {} )

Definition at line 1631 of file map_properties.cc.

References RETURN_IF_ERROR.

Referenced by SetupCanvasContextMenu().

◆ ApplyPropertyEditDirect()

◆ CheckPropertyEditSupported()

absl::Status yaze::editor::MapPropertiesSystem::CheckPropertyEditSupported ( const OverworldPropertyEdit & edit) const

Definition at line 1646 of file map_properties.cc.

◆ ReadPropertyValue()

absl::StatusOr< int > yaze::editor::MapPropertiesSystem::ReadPropertyValue ( const OverworldPropertyEdit & edit) const

◆ RefreshMapProperties()

void yaze::editor::MapPropertiesSystem::RefreshMapProperties ( )

◆ RefreshOverworldMap()

void yaze::editor::MapPropertiesSystem::RefreshOverworldMap ( )

◆ RefreshMapPalette()

absl::Status yaze::editor::MapPropertiesSystem::RefreshMapPalette ( )

Definition at line 1846 of file map_properties.cc.

◆ RefreshTile16Blockset()

absl::Status yaze::editor::MapPropertiesSystem::RefreshTile16Blockset ( )

Definition at line 1853 of file map_properties.cc.

◆ ForceRefreshGraphics()

void yaze::editor::MapPropertiesSystem::ForceRefreshGraphics ( int map_index)

Definition at line 1860 of file map_properties.cc.

◆ RefreshSiblingMapGraphics()

void yaze::editor::MapPropertiesSystem::RefreshSiblingMapGraphics ( int map_index,
bool include_self = false )

◆ DrawGraphicsPopup()

◆ DrawPalettesPopup()

◆ DrawPropertiesPopup()

◆ DrawMosaicControls()

void yaze::editor::MapPropertiesSystem::DrawMosaicControls ( int current_map)
private

Definition at line 1921 of file map_properties.cc.

References yaze::zelda3::OverworldVersionHelper::GetVersion(), and yaze::zelda3::OverworldVersionHelper::SupportsCustomBGColors().

Here is the call graph for this function:

◆ DrawOverlayControls()

◆ GetOverlayDescription()

std::string yaze::editor::MapPropertiesSystem::GetOverlayDescription ( uint16_t overlay_id)
private

Definition at line 2134 of file map_properties.cc.

Referenced by DrawOverlayEditor().

◆ DrawToolsPopup()

void yaze::editor::MapPropertiesSystem::DrawToolsPopup ( int & current_mode)
private

◆ DrawViewPopup()

◆ DrawQuickAccessPopup()

◆ DrawBasicPropertiesTab()

void yaze::editor::MapPropertiesSystem::DrawBasicPropertiesTab ( int current_map)
private

◆ DrawSpritePropertiesTab()

void yaze::editor::MapPropertiesSystem::DrawSpritePropertiesTab ( int current_map)
private

Definition at line 1331 of file map_properties.cc.

References ICON_MD_COLORIZE, ICON_MD_GAMEPAD, ICON_MD_PETS, yaze::gui::InputHexByte(), yaze::editor::kGameStateNames, and yaze::editor::kInputFieldSize.

Referenced by DrawMapPropertiesPanel().

Here is the call graph for this function:

◆ DrawCustomFeaturesTab()

◆ DrawTileGraphicsTab()

void yaze::editor::MapPropertiesSystem::DrawTileGraphicsTab ( int current_map)
private

◆ DrawMusicTab()

void yaze::editor::MapPropertiesSystem::DrawMusicTab ( int current_map)
private

◆ CurrentGameState() [1/2]

int yaze::editor::MapPropertiesSystem::CurrentGameState ( ) const
private

Definition at line 193 of file map_properties.cc.

References CurrentGameState(), and local_game_state_.

Referenced by CurrentGameState(), PrepareMapForGraphicsRefresh(), and SetupCanvasContextMenu().

Here is the call graph for this function:

◆ CurrentGameState() [2/2]

int yaze::editor::MapPropertiesSystem::CurrentGameState ( int fallback) const
private

Definition at line 197 of file map_properties.cc.

References game_state_.

◆ SetCurrentGameState()

void yaze::editor::MapPropertiesSystem::SetCurrentGameState ( int game_state)
private

Definition at line 201 of file map_properties.cc.

References game_state_, and local_game_state_.

◆ PrepareMapForGraphicsRefresh()

void yaze::editor::MapPropertiesSystem::PrepareMapForGraphicsRefresh ( int map_index)
private

Definition at line 209 of file map_properties.cc.

References CurrentGameState(), yaze::zelda3::kNumOverworldMaps, yaze::zelda3::Overworld::mutable_overworld_map(), and overworld_.

Here is the call graph for this function:

Member Data Documentation

◆ overworld_

◆ rom_

Rom* yaze::editor::MapPropertiesSystem::rom_
private

◆ maps_bmp_

std::array<gfx::Bitmap, zelda3::kNumOverworldMaps>* yaze::editor::MapPropertiesSystem::maps_bmp_
private

Definition at line 179 of file map_properties.h.

◆ canvas_

gui::Canvas* yaze::editor::MapPropertiesSystem::canvas_
private

Definition at line 180 of file map_properties.h.

Referenced by DrawCanvasToolbar().

◆ game_state_

int* yaze::editor::MapPropertiesSystem::game_state_
private

Definition at line 181 of file map_properties.h.

Referenced by CurrentGameState(), and SetCurrentGameState().

◆ local_game_state_

int yaze::editor::MapPropertiesSystem::local_game_state_ = 0
private

Definition at line 182 of file map_properties.h.

Referenced by CurrentGameState(), and SetCurrentGameState().

◆ refresh_map_properties_

RefreshCallback yaze::editor::MapPropertiesSystem::refresh_map_properties_
private

Definition at line 185 of file map_properties.h.

Referenced by SetRefreshCallbacks().

◆ refresh_overworld_map_

RefreshCallback yaze::editor::MapPropertiesSystem::refresh_overworld_map_
private

Definition at line 186 of file map_properties.h.

Referenced by SetRefreshCallbacks().

◆ refresh_map_palette_

RefreshPaletteCallback yaze::editor::MapPropertiesSystem::refresh_map_palette_
private

Definition at line 187 of file map_properties.h.

Referenced by SetRefreshCallbacks().

◆ refresh_tile16_blockset_

RefreshPaletteCallback yaze::editor::MapPropertiesSystem::refresh_tile16_blockset_
private

Definition at line 188 of file map_properties.h.

Referenced by SetRefreshCallbacks().

◆ force_refresh_graphics_

ForceRefreshGraphicsCallback yaze::editor::MapPropertiesSystem::force_refresh_graphics_
private

Definition at line 189 of file map_properties.h.

Referenced by SetRefreshCallbacks().

◆ entity_insert_callback_

std::function<void(const std::string&) yaze::editor::MapPropertiesSystem::entity_insert_callback_)
private

Definition at line 192 of file map_properties.h.

Referenced by SetEntityCallbacks().

◆ edit_tile16_callback_

std::function<void()> yaze::editor::MapPropertiesSystem::edit_tile16_callback_
private

Definition at line 195 of file map_properties.h.

Referenced by SetTile16EditCallback().

◆ sample_tile16_callback_

std::function<bool()> yaze::editor::MapPropertiesSystem::sample_tile16_callback_
private

Definition at line 196 of file map_properties.h.

Referenced by SetTile16SampleCallback().

◆ map_selection_callback_

std::function<void(int, bool)> yaze::editor::MapPropertiesSystem::map_selection_callback_
private

Definition at line 199 of file map_properties.h.

Referenced by SetMapSelectionCallback(), and SetupCanvasContextMenu().

◆ property_edit_callback_

PropertyEditCallback yaze::editor::MapPropertiesSystem::property_edit_callback_
private

Definition at line 200 of file map_properties.h.

Referenced by SetPropertyEditCallback().

◆ property_edit_batch_callback_

PropertyEditBatchCallback yaze::editor::MapPropertiesSystem::property_edit_batch_callback_
private

Definition at line 201 of file map_properties.h.

Referenced by SetPropertyEditBatchCallback().

◆ resource_label_edit_callback_

ResourceLabelEditCallback yaze::editor::MapPropertiesSystem::resource_label_edit_callback_
private

Definition at line 202 of file map_properties.h.

Referenced by SetResourceLabelEditCallback(), and SetupCanvasContextMenu().


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