yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
overworld_sidebar.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_OVERWORLD_SIDEBAR_H
2#define YAZE_APP_EDITOR_OVERWORLD_SIDEBAR_H
3
4#include <array>
5#include <functional>
6#include <string>
7
8#include "absl/status/status.h"
10#include "rom/rom.h"
12
13namespace yaze::project {
14struct YazeProject;
15} // namespace yaze::project
16
17namespace yaze {
18namespace editor {
19
22 public:
24 std::function<absl::Status(const std::string&, int, const std::string&)>;
25
26 explicit OverworldSidebar(zelda3::Overworld* overworld, Rom* rom,
27 MapPropertiesSystem* map_properties_system);
28
29 void Draw(int& current_world, int& current_map, bool& current_map_lock,
30 int& game_state, bool& show_custom_bg_color_editor,
31 bool& show_overlay_editor, project::YazeProject* project = nullptr);
32
33 void DrawQuickProperties(int current_map, bool current_map_lock,
34 project::YazeProject* project = nullptr,
35 bool compact = false);
36
37 std::function<void(int)> on_story_changed;
38 std::function<void(int, int&)> draw_project_tools;
39
43 rename_label_ = std::move(callback);
44 }
45
46 private:
47 struct LabelTarget {
48 std::string title;
49 std::string type;
50 int id = 0;
51 int hex_width = 2;
52 };
53
54 void DrawHeader(int current_world, int current_map, int property_map,
55 bool& current_map_lock, int game_state);
56 void DrawAreaSection(int property_map, int& game_state);
57 void DrawGraphicsSection(int property_map, int game_state);
58 void DrawPaletteSection(int property_map, int game_state,
59 bool& show_custom_bg_color_editor);
60 void DrawMusicSection(int property_map);
61 void DrawEffectsSection(int property_map, bool& show_overlay_editor);
62
63 // Two-column row: label (with tooltip) then a full-width control cell.
64 bool BeginFieldTable(const char* id);
65 void FieldLabel(const char* label, const char* tooltip);
66 bool HexByteField(const char* id, const char* label, const char* tooltip,
67 OverworldPropertyField field, int index, int property_map,
68 uint8_t value, const LabelTarget* label_target = nullptr);
69 void LabelContextMenu(const LabelTarget& target);
70 void DrawLabelPopup();
71 void Apply(OverworldPropertyField field, int index, int property_map,
72 int value);
73
79
80 std::string edit_error_;
82
83 // Project-label rename popup state (one popup shared by all fields).
84 bool open_label_popup_ = false;
86 std::array<char, 128> label_buffer_{};
87 std::string label_error_;
88};
89
90} // namespace editor
91} // namespace yaze
92
93#endif // YAZE_APP_EDITOR_OVERWORLD_SIDEBAR_H
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:52
Map properties and canvas appearance controls share the same edit path.
void FieldLabel(const char *label, const char *tooltip)
std::function< void(int, int &) draw_project_tools)
void DrawQuickProperties(int current_map, bool current_map_lock, project::YazeProject *project=nullptr, bool compact=false)
std::function< absl::Status(const std::string &, int, const std::string &)> RenameLabelCallback
void DrawAreaSection(int property_map, int &game_state)
void LabelContextMenu(const LabelTarget &target)
void DrawGraphicsSection(int property_map, int game_state)
MapPropertiesSystem * map_properties_system_
std::function< void(int)> on_story_changed
void DrawPaletteSection(int property_map, int game_state, bool &show_custom_bg_color_editor)
OverworldSidebar(zelda3::Overworld *overworld, Rom *rom, MapPropertiesSystem *map_properties_system)
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 DrawMusicSection(int property_map)
std::array< char, 128 > label_buffer_
void SetRenameLabelCallback(RenameLabelCallback callback)
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 DrawEffectsSection(int property_map, bool &show_overlay_editor)
void Apply(OverworldPropertyField field, int index, int property_map, int value)
void DrawHeader(int current_world, int current_map, int property_map, bool &current_map_lock, int game_state)
project::YazeProject * project_
Modern project structure with comprehensive settings consolidation.
Definition project.h:290