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"
9
#include "
app/editor/overworld/maps/map_properties.h
"
10
#include "
rom/rom.h
"
11
#include "
zelda3/overworld/overworld.h
"
12
13
namespace
yaze::project
{
14
struct
YazeProject;
15
}
// namespace yaze::project
16
17
namespace
yaze
{
18
namespace
editor {
19
21
class
OverworldSidebar
{
22
public
:
23
using
RenameLabelCallback
=
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
42
void
SetRenameLabelCallback
(
RenameLabelCallback
callback) {
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
74
zelda3::Overworld
*
overworld_
;
75
Rom
*
rom_
;
76
MapPropertiesSystem
*
map_properties_system_
;
77
project::YazeProject
*
project_
=
nullptr
;
78
RenameLabelCallback
rename_label_
;
79
80
std::string
edit_error_
;
81
int
edit_error_map_
= -1;
82
83
// Project-label rename popup state (one popup shared by all fields).
84
bool
open_label_popup_
=
false
;
85
LabelTarget
label_target_
;
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
yaze::Rom
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
yaze::editor::MapPropertiesSystem
Definition
map_properties.h:32
yaze::editor::OverworldSidebar
Map properties and canvas appearance controls share the same edit path.
Definition
overworld_sidebar.h:21
yaze::editor::OverworldSidebar::rom_
Rom * rom_
Definition
overworld_sidebar.h:75
yaze::editor::OverworldSidebar::label_target_
LabelTarget label_target_
Definition
overworld_sidebar.h:85
yaze::editor::OverworldSidebar::FieldLabel
void FieldLabel(const char *label, const char *tooltip)
Definition
overworld_sidebar.cc:302
yaze::editor::OverworldSidebar::draw_project_tools
std::function< void(int, int &) draw_project_tools)
Definition
overworld_sidebar.h:38
yaze::editor::OverworldSidebar::DrawQuickProperties
void DrawQuickProperties(int current_map, bool current_map_lock, project::YazeProject *project=nullptr, bool compact=false)
Definition
overworld_sidebar.cc:145
yaze::editor::OverworldSidebar::open_label_popup_
bool open_label_popup_
Definition
overworld_sidebar.h:84
yaze::editor::OverworldSidebar::RenameLabelCallback
std::function< absl::Status(const std::string &, int, const std::string &)> RenameLabelCallback
Definition
overworld_sidebar.h:23
yaze::editor::OverworldSidebar::DrawAreaSection
void DrawAreaSection(int property_map, int &game_state)
Definition
overworld_sidebar.cc:414
yaze::editor::OverworldSidebar::LabelContextMenu
void LabelContextMenu(const LabelTarget &target)
Definition
overworld_sidebar.cc:350
yaze::editor::OverworldSidebar::DrawGraphicsSection
void DrawGraphicsSection(int property_map, int game_state)
Definition
overworld_sidebar.cc:463
yaze::editor::OverworldSidebar::label_error_
std::string label_error_
Definition
overworld_sidebar.h:87
yaze::editor::OverworldSidebar::map_properties_system_
MapPropertiesSystem * map_properties_system_
Definition
overworld_sidebar.h:76
yaze::editor::OverworldSidebar::BeginFieldTable
bool BeginFieldTable(const char *id)
Definition
overworld_sidebar.cc:292
yaze::editor::OverworldSidebar::on_story_changed
std::function< void(int)> on_story_changed
Definition
overworld_sidebar.h:37
yaze::editor::OverworldSidebar::DrawLabelPopup
void DrawLabelPopup()
Definition
overworld_sidebar.cc:365
yaze::editor::OverworldSidebar::DrawPaletteSection
void DrawPaletteSection(int property_map, int game_state, bool &show_custom_bg_color_editor)
Definition
overworld_sidebar.cc:513
yaze::editor::OverworldSidebar::rename_label_
RenameLabelCallback rename_label_
Definition
overworld_sidebar.h:78
yaze::editor::OverworldSidebar::overworld_
zelda3::Overworld * overworld_
Definition
overworld_sidebar.h:74
yaze::editor::OverworldSidebar::OverworldSidebar
OverworldSidebar(zelda3::Overworld *overworld, Rom *rom, MapPropertiesSystem *map_properties_system)
Definition
overworld_sidebar.cc:45
yaze::editor::OverworldSidebar::HexByteField
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)
Definition
overworld_sidebar.cc:320
yaze::editor::OverworldSidebar::edit_error_map_
int edit_error_map_
Definition
overworld_sidebar.h:81
yaze::editor::OverworldSidebar::DrawMusicSection
void DrawMusicSection(int property_map)
Definition
overworld_sidebar.cc:554
yaze::editor::OverworldSidebar::label_buffer_
std::array< char, 128 > label_buffer_
Definition
overworld_sidebar.h:86
yaze::editor::OverworldSidebar::SetRenameLabelCallback
void SetRenameLabelCallback(RenameLabelCallback callback)
Definition
overworld_sidebar.h:42
yaze::editor::OverworldSidebar::Draw
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)
Definition
overworld_sidebar.cc:51
yaze::editor::OverworldSidebar::DrawEffectsSection
void DrawEffectsSection(int property_map, bool &show_overlay_editor)
Definition
overworld_sidebar.cc:570
yaze::editor::OverworldSidebar::Apply
void Apply(OverworldPropertyField field, int index, int property_map, int value)
Definition
overworld_sidebar.cc:313
yaze::editor::OverworldSidebar::DrawHeader
void DrawHeader(int current_world, int current_map, int property_map, bool ¤t_map_lock, int game_state)
Definition
overworld_sidebar.cc:243
yaze::editor::OverworldSidebar::project_
project::YazeProject * project_
Definition
overworld_sidebar.h:77
yaze::editor::OverworldSidebar::edit_error_
std::string edit_error_
Definition
overworld_sidebar.h:80
yaze::zelda3::Overworld
Definition
overworld.h:422
map_properties.h
yaze::editor::OverworldPropertyField
OverworldPropertyField
Definition
overworld_property_edit.h:10
yaze::project
Definition
feature_flag_editor_panel.h:10
yaze
Definition
patch_export_usage.cc:8
overworld.h
rom.h
yaze::editor::OverworldSidebar::LabelTarget
Definition
overworld_sidebar.h:47
yaze::editor::OverworldSidebar::LabelTarget::hex_width
int hex_width
Definition
overworld_sidebar.h:51
yaze::editor::OverworldSidebar::LabelTarget::type
std::string type
Definition
overworld_sidebar.h:49
yaze::editor::OverworldSidebar::LabelTarget::title
std::string title
Definition
overworld_sidebar.h:48
yaze::project::YazeProject
Modern project structure with comprehensive settings consolidation.
Definition
project.h:290
src
app
editor
overworld
ui
navigation
overworld_sidebar.h
Generated by
1.10.0