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

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 &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)
 
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 &current_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_
 

Detailed Description

Map properties and canvas appearance controls share the same edit path.

Definition at line 21 of file overworld_sidebar.h.

Member Typedef Documentation

◆ RenameLabelCallback

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

Definition at line 23 of file overworld_sidebar.h.

Constructor & Destructor Documentation

◆ OverworldSidebar()

yaze::editor::OverworldSidebar::OverworldSidebar ( zelda3::Overworld * overworld,
Rom * rom,
MapPropertiesSystem * map_properties_system )
explicit

Definition at line 45 of file overworld_sidebar.cc.

Member Function Documentation

◆ Draw()

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 )

◆ DrawQuickProperties()

◆ SetRenameLabelCallback()

void yaze::editor::OverworldSidebar::SetRenameLabelCallback ( RenameLabelCallback callback)
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_.

◆ DrawHeader()

void yaze::editor::OverworldSidebar::DrawHeader ( int current_world,
int current_map,
int property_map,
bool & current_map_lock,
int game_state )
private

◆ DrawAreaSection()

◆ DrawGraphicsSection()

◆ DrawPaletteSection()

◆ DrawMusicSection()

void yaze::editor::OverworldSidebar::DrawMusicSection ( int property_map)
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().

Here is the call graph for this function:

◆ DrawEffectsSection()

void yaze::editor::OverworldSidebar::DrawEffectsSection ( int property_map,
bool & show_overlay_editor )
private

◆ BeginFieldTable()

bool yaze::editor::OverworldSidebar::BeginFieldTable ( const char * id)
private

◆ FieldLabel()

void yaze::editor::OverworldSidebar::FieldLabel ( const char * label,
const char * tooltip )
private

Definition at line 274 of file overworld_sidebar.cc.

Referenced by DrawAreaSection(), and HexByteField().

◆ HexByteField()

bool yaze::editor::OverworldSidebar::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 )
private

◆ LabelContextMenu()

void yaze::editor::OverworldSidebar::LabelContextMenu ( const LabelTarget & target)
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().

◆ DrawLabelPopup()

◆ Apply()

void yaze::editor::OverworldSidebar::Apply ( OverworldPropertyField field,
int index,
int property_map,
int value )
private

Member Data Documentation

◆ on_story_changed

std::function<void(int)> yaze::editor::OverworldSidebar::on_story_changed

Definition at line 37 of file overworld_sidebar.h.

Referenced by DrawAreaSection().

◆ overworld_

zelda3::Overworld* yaze::editor::OverworldSidebar::overworld_
private

◆ rom_

Rom* yaze::editor::OverworldSidebar::rom_
private

◆ map_properties_system_

MapPropertiesSystem* yaze::editor::OverworldSidebar::map_properties_system_
private

Definition at line 75 of file overworld_sidebar.h.

Referenced by Apply(), Draw(), and DrawQuickProperties().

◆ project_

project::YazeProject* yaze::editor::OverworldSidebar::project_ = nullptr
private

◆ rename_label_

RenameLabelCallback yaze::editor::OverworldSidebar::rename_label_
private

Definition at line 77 of file overworld_sidebar.h.

Referenced by DrawLabelPopup(), and SetRenameLabelCallback().

◆ edit_error_

std::string yaze::editor::OverworldSidebar::edit_error_
private

Definition at line 79 of file overworld_sidebar.h.

Referenced by Apply(), Draw(), and DrawQuickProperties().

◆ edit_error_map_

int yaze::editor::OverworldSidebar::edit_error_map_ = -1
private

Definition at line 80 of file overworld_sidebar.h.

Referenced by Draw(), and DrawQuickProperties().

◆ open_label_popup_

bool yaze::editor::OverworldSidebar::open_label_popup_ = false
private

Definition at line 83 of file overworld_sidebar.h.

Referenced by DrawHeader(), DrawLabelPopup(), and LabelContextMenu().

◆ label_target_

LabelTarget yaze::editor::OverworldSidebar::label_target_
private

Definition at line 84 of file overworld_sidebar.h.

Referenced by DrawHeader(), DrawLabelPopup(), and LabelContextMenu().

◆ label_buffer_

std::array<char, 128> yaze::editor::OverworldSidebar::label_buffer_ {}
private

Definition at line 85 of file overworld_sidebar.h.

Referenced by DrawLabelPopup().

◆ label_error_

std::string yaze::editor::OverworldSidebar::label_error_
private

Definition at line 86 of file overworld_sidebar.h.

Referenced by DrawLabelPopup().


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