Map properties and canvas appearance controls share the same edit path. More...
#include <overworld_sidebar.h>
Classes | |
| struct | LabelTarget |
Public Types | |
| using | RenameLabelCallback |
Public Member Functions | |
| OverworldSidebar (zelda3::Overworld *overworld, Rom *rom, MapPropertiesSystem *map_properties_system) | |
| void | Draw (int ¤t_world, int ¤t_map, bool ¤t_map_lock, int &game_state, bool &show_custom_bg_color_editor, bool &show_overlay_editor, project::YazeProject *project=nullptr) |
| void | DrawQuickProperties (int current_map, bool current_map_lock, project::YazeProject *project=nullptr, bool compact=false) |
| void | SetRenameLabelCallback (RenameLabelCallback callback) |
Public Attributes | |
| std::function< void(int)> | on_story_changed |
Private Member Functions | |
| void | DrawHeader (int current_world, int current_map, int property_map, bool ¤t_map_lock, int game_state) |
| void | DrawAreaSection (int property_map, int &game_state) |
| void | DrawGraphicsSection (int property_map, int game_state) |
| void | DrawPaletteSection (int property_map, int game_state, bool &show_custom_bg_color_editor) |
| void | DrawMusicSection (int property_map) |
| void | DrawEffectsSection (int property_map, bool &show_overlay_editor) |
| bool | BeginFieldTable (const char *id) |
| void | FieldLabel (const char *label, const char *tooltip) |
| bool | HexByteField (const char *id, const char *label, const char *tooltip, OverworldPropertyField field, int index, int property_map, uint8_t value, const LabelTarget *label_target=nullptr) |
| void | LabelContextMenu (const LabelTarget &target) |
| void | DrawLabelPopup () |
| void | Apply (OverworldPropertyField field, int index, int property_map, int value) |
Private Attributes | |
| zelda3::Overworld * | overworld_ |
| Rom * | rom_ |
| MapPropertiesSystem * | map_properties_system_ |
| project::YazeProject * | project_ = nullptr |
| RenameLabelCallback | rename_label_ |
| std::string | edit_error_ |
| int | edit_error_map_ = -1 |
| bool | open_label_popup_ = false |
| LabelTarget | label_target_ |
| std::array< char, 128 > | label_buffer_ {} |
| std::string | label_error_ |
Map properties and canvas appearance controls share the same edit path.
Definition at line 21 of file overworld_sidebar.h.
Definition at line 23 of file overworld_sidebar.h.
|
explicit |
Definition at line 45 of file overworld_sidebar.cc.
| void yaze::editor::OverworldSidebar::Draw | ( | int & | current_world, |
| int & | current_map, | ||
| bool & | current_map_lock, | ||
| int & | game_state, | ||
| bool & | show_custom_bg_color_editor, | ||
| bool & | show_overlay_editor, | ||
| project::YazeProject * | project = nullptr ) |
Definition at line 51 of file overworld_sidebar.cc.
References DrawAreaSection(), DrawEffectsSection(), DrawGraphicsSection(), DrawHeader(), DrawLabelPopup(), DrawMusicSection(), DrawPaletteSection(), edit_error_, edit_error_map_, yaze::gui::GetErrorColor(), yaze::zelda3::Overworld::is_loaded(), yaze::zelda3::kNumOverworldMaps, map_properties_system_, overworld_, yaze::zelda3::Overworld::overworld_map(), and project_.
| void yaze::editor::OverworldSidebar::DrawQuickProperties | ( | int | current_map, |
| bool | current_map_lock, | ||
| project::YazeProject * | project = nullptr, | ||
| bool | compact = false ) |
Definition at line 117 of file overworld_sidebar.cc.
References Apply(), edit_error_, edit_error_map_, yaze::zelda3::OverworldVersionHelper::GetVersion(), yaze::gui::InputHexByte(), yaze::gui::WidgetIdRegistry::Instance(), yaze::zelda3::Overworld::is_loaded(), yaze::editor::kAreaGraphics, yaze::editor::kAreaPalette, yaze::editor::kMainPalette, yaze::zelda3::kNumOverworldMaps, map_properties_system_, overworld_, yaze::zelda3::Overworld::overworld_map(), project_, yaze::gui::WidgetIdRegistry::RegisterWidget(), rom_, and yaze::zelda3::OverworldVersionHelper::SupportsCustomBGColors().
|
inline |
Renames a project resource label (map names, gfx/palette/music labels) through the editor so the change is undoable.
Definition at line 41 of file overworld_sidebar.h.
References rename_label_.
|
private |
Definition at line 215 of file overworld_sidebar.cc.
References yaze::editor::BuildOverworldMapMetadata(), ICON_MD_EDIT, ICON_MD_GPS_FIXED, ICON_MD_INFO, ICON_MD_MAP, ICON_MD_PUSH_PIN, label_target_, open_label_popup_, overworld_, project_, rom_, and yaze::gui::ToolbarIconButton().
Referenced by Draw().

|
private |
Definition at line 386 of file overworld_sidebar.cc.
References Apply(), BeginFieldTable(), FieldLabel(), yaze::zelda3::OverworldVersionHelper::GetVersion(), yaze::gui::InputHexWord(), yaze::editor::kAreaSize, yaze::editor::kAreaSizeNames, yaze::editor::kGameStateNames, yaze::editor::kMessageId, LabelContextMenu(), yaze::zelda3::LargeArea, on_story_changed, overworld_, yaze::zelda3::Overworld::overworld_map(), rom_, yaze::zelda3::SmallArea, and yaze::zelda3::OverworldVersionHelper::SupportsAreaEnum().
Referenced by Draw().
|
private |
Definition at line 435 of file overworld_sidebar.cc.
References BeginFieldTable(), yaze::zelda3::OverworldVersionHelper::GetVersion(), HexByteField(), yaze::editor::kAnimatedGraphics, yaze::editor::kAreaGraphics, yaze::editor::kCustomTileset, yaze::editor::kGameStateNames, yaze::editor::kSpriteGraphics, overworld_, yaze::zelda3::Overworld::overworld_map(), rom_, yaze::zelda3::OverworldVersionHelper::SupportsAnimatedGFX(), and yaze::zelda3::OverworldVersionHelper::SupportsExpandedSpace().
Referenced by Draw().
|
private |
Definition at line 485 of file overworld_sidebar.cc.
References BeginFieldTable(), yaze::zelda3::OverworldVersionHelper::GetVersion(), HexByteField(), ICON_MD_FORMAT_COLOR_FILL, yaze::editor::kAreaPalette, yaze::editor::kGameStateNames, yaze::editor::kMainPalette, yaze::editor::kSpritePalette, overworld_, yaze::zelda3::Overworld::overworld_map(), rom_, and yaze::zelda3::OverworldVersionHelper::SupportsCustomBGColors().
Referenced by Draw().
|
private |
Definition at line 526 of file overworld_sidebar.cc.
References BeginFieldTable(), HexByteField(), yaze::editor::kMusic, overworld_, and yaze::zelda3::Overworld::overworld_map().
Referenced by Draw().

|
private |
Definition at line 542 of file overworld_sidebar.cc.
References Apply(), yaze::zelda3::OverworldVersionHelper::GetVersion(), ICON_MD_LAYERS, yaze::editor::kMosaic, yaze::editor::kMosaicExpanded, yaze::zelda3::kVanilla, yaze::zelda3::Overworld::mutable_overworld_map(), overworld_, rom_, and yaze::zelda3::OverworldVersionHelper::SupportsCustomBGColors().
Referenced by Draw().

|
private |
Definition at line 264 of file overworld_sidebar.cc.
Referenced by DrawAreaSection(), DrawGraphicsSection(), DrawMusicSection(), and DrawPaletteSection().
|
private |
Definition at line 274 of file overworld_sidebar.cc.
Referenced by DrawAreaSection(), and HexByteField().
|
private |
Definition at line 292 of file overworld_sidebar.cc.
References Apply(), FieldLabel(), yaze::editor::GetProjectResourceLabel(), yaze::editor::OverworldSidebar::LabelTarget::id, yaze::gui::InputHexByte(), LabelContextMenu(), project_, and yaze::editor::OverworldSidebar::LabelTarget::type.
Referenced by DrawGraphicsSection(), DrawMusicSection(), and DrawPaletteSection().
|
private |
Definition at line 322 of file overworld_sidebar.cc.
References ICON_MD_LABEL, label_target_, open_label_popup_, and project_.
Referenced by DrawAreaSection(), and HexByteField().
|
private |
Definition at line 337 of file overworld_sidebar.cc.
References yaze::editor::GetProjectResourceLabel(), yaze::editor::OverworldSidebar::LabelTarget::hex_width, ICON_MD_CHECK, ICON_MD_CLEAR, ICON_MD_LABEL, yaze::editor::OverworldSidebar::LabelTarget::id, label_buffer_, label_error_, label_target_, open_label_popup_, project_, rename_label_, yaze::editor::RenameProjectResourceLabel(), yaze::editor::OverworldSidebar::LabelTarget::title, and yaze::editor::OverworldSidebar::LabelTarget::type.
Referenced by Draw().

|
private |
Definition at line 285 of file overworld_sidebar.cc.
References yaze::editor::MapPropertiesSystem::ApplyPropertyEdit(), edit_error_, and map_properties_system_.
Referenced by DrawAreaSection(), DrawEffectsSection(), DrawQuickProperties(), and HexByteField().

| std::function<void(int)> yaze::editor::OverworldSidebar::on_story_changed |
Definition at line 37 of file overworld_sidebar.h.
Referenced by DrawAreaSection().
|
private |
Definition at line 73 of file overworld_sidebar.h.
Referenced by Draw(), DrawAreaSection(), DrawEffectsSection(), DrawGraphicsSection(), DrawHeader(), DrawMusicSection(), DrawPaletteSection(), and DrawQuickProperties().
|
private |
Definition at line 74 of file overworld_sidebar.h.
Referenced by DrawAreaSection(), DrawEffectsSection(), DrawGraphicsSection(), DrawHeader(), DrawPaletteSection(), and DrawQuickProperties().
|
private |
Definition at line 75 of file overworld_sidebar.h.
Referenced by Apply(), Draw(), and DrawQuickProperties().
|
private |
Definition at line 76 of file overworld_sidebar.h.
Referenced by Draw(), DrawHeader(), DrawLabelPopup(), DrawQuickProperties(), HexByteField(), and LabelContextMenu().
|
private |
Definition at line 77 of file overworld_sidebar.h.
Referenced by DrawLabelPopup(), and SetRenameLabelCallback().
|
private |
Definition at line 79 of file overworld_sidebar.h.
Referenced by Apply(), Draw(), and DrawQuickProperties().
|
private |
Definition at line 80 of file overworld_sidebar.h.
Referenced by Draw(), and DrawQuickProperties().
|
private |
Definition at line 83 of file overworld_sidebar.h.
Referenced by DrawHeader(), DrawLabelPopup(), and LabelContextMenu().
|
private |
Definition at line 84 of file overworld_sidebar.h.
Referenced by DrawHeader(), DrawLabelPopup(), and LabelContextMenu().
|
private |
Definition at line 85 of file overworld_sidebar.h.
Referenced by DrawLabelPopup().
|
private |
Definition at line 86 of file overworld_sidebar.h.
Referenced by DrawLabelPopup().