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
42 rename_label_ = std::move(callback);
43 }
44
45 private:
46 struct LabelTarget {
47 std::string title;
48 std::string type;
49 int id = 0;
50 int hex_width = 2;
51 };
52
53 void DrawHeader(int current_world, int current_map, int property_map,
54 bool& current_map_lock, int game_state);
55 void DrawAreaSection(int property_map, int& game_state);
56 void DrawGraphicsSection(int property_map, int game_state);
57 void DrawPaletteSection(int property_map, int game_state,
58 bool& show_custom_bg_color_editor);
59 void DrawMusicSection(int property_map);
60 void DrawEffectsSection(int property_map, bool& show_overlay_editor);
61
62 // Two-column row: label (with tooltip) then a full-width control cell.
63 bool BeginFieldTable(const char* id);
64 void FieldLabel(const char* label, const char* tooltip);
65 bool HexByteField(const char* id, const char* label, const char* tooltip,
66 OverworldPropertyField field, int index, int property_map,
67 uint8_t value, const LabelTarget* label_target = nullptr);
68 void LabelContextMenu(const LabelTarget& target);
69 void DrawLabelPopup();
70 void Apply(OverworldPropertyField field, int index, int property_map,
71 int value);
72
78
79 std::string edit_error_;
81
82 // Project-label rename popup state (one popup shared by all fields).
83 bool open_label_popup_ = false;
85 std::array<char, 128> label_buffer_{};
86 std::string label_error_;
87};
88
89} // namespace editor
90} // namespace yaze
91
92#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:49
Map properties and canvas appearance controls share the same edit path.
void FieldLabel(const char *label, const char *tooltip)
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:287