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
41
void
SetRenameLabelCallback
(
RenameLabelCallback
callback) {
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
73
zelda3::Overworld
*
overworld_
;
74
Rom
*
rom_
;
75
MapPropertiesSystem
*
map_properties_system_
;
76
project::YazeProject
*
project_
=
nullptr
;
77
RenameLabelCallback
rename_label_
;
78
79
std::string
edit_error_
;
80
int
edit_error_map_
= -1;
81
82
// Project-label rename popup state (one popup shared by all fields).
83
bool
open_label_popup_
=
false
;
84
LabelTarget
label_target_
;
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
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:49
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:74
yaze::editor::OverworldSidebar::label_target_
LabelTarget label_target_
Definition
overworld_sidebar.h:84
yaze::editor::OverworldSidebar::FieldLabel
void FieldLabel(const char *label, const char *tooltip)
Definition
overworld_sidebar.cc:274
yaze::editor::OverworldSidebar::DrawQuickProperties
void DrawQuickProperties(int current_map, bool current_map_lock, project::YazeProject *project=nullptr, bool compact=false)
Definition
overworld_sidebar.cc:117
yaze::editor::OverworldSidebar::open_label_popup_
bool open_label_popup_
Definition
overworld_sidebar.h:83
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:386
yaze::editor::OverworldSidebar::LabelContextMenu
void LabelContextMenu(const LabelTarget &target)
Definition
overworld_sidebar.cc:322
yaze::editor::OverworldSidebar::DrawGraphicsSection
void DrawGraphicsSection(int property_map, int game_state)
Definition
overworld_sidebar.cc:435
yaze::editor::OverworldSidebar::label_error_
std::string label_error_
Definition
overworld_sidebar.h:86
yaze::editor::OverworldSidebar::map_properties_system_
MapPropertiesSystem * map_properties_system_
Definition
overworld_sidebar.h:75
yaze::editor::OverworldSidebar::BeginFieldTable
bool BeginFieldTable(const char *id)
Definition
overworld_sidebar.cc:264
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:337
yaze::editor::OverworldSidebar::DrawPaletteSection
void DrawPaletteSection(int property_map, int game_state, bool &show_custom_bg_color_editor)
Definition
overworld_sidebar.cc:485
yaze::editor::OverworldSidebar::rename_label_
RenameLabelCallback rename_label_
Definition
overworld_sidebar.h:77
yaze::editor::OverworldSidebar::overworld_
zelda3::Overworld * overworld_
Definition
overworld_sidebar.h:73
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:292
yaze::editor::OverworldSidebar::edit_error_map_
int edit_error_map_
Definition
overworld_sidebar.h:80
yaze::editor::OverworldSidebar::DrawMusicSection
void DrawMusicSection(int property_map)
Definition
overworld_sidebar.cc:526
yaze::editor::OverworldSidebar::label_buffer_
std::array< char, 128 > label_buffer_
Definition
overworld_sidebar.h:85
yaze::editor::OverworldSidebar::SetRenameLabelCallback
void SetRenameLabelCallback(RenameLabelCallback callback)
Definition
overworld_sidebar.h:41
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:542
yaze::editor::OverworldSidebar::Apply
void Apply(OverworldPropertyField field, int index, int property_map, int value)
Definition
overworld_sidebar.cc:285
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:215
yaze::editor::OverworldSidebar::project_
project::YazeProject * project_
Definition
overworld_sidebar.h:76
yaze::editor::OverworldSidebar::edit_error_
std::string edit_error_
Definition
overworld_sidebar.h:79
yaze::zelda3::Overworld
Definition
overworld.h:408
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:46
yaze::editor::OverworldSidebar::LabelTarget::hex_width
int hex_width
Definition
overworld_sidebar.h:50
yaze::editor::OverworldSidebar::LabelTarget::type
std::string type
Definition
overworld_sidebar.h:48
yaze::editor::OverworldSidebar::LabelTarget::title
std::string title
Definition
overworld_sidebar.h:47
yaze::project::YazeProject
Modern project structure with comprehensive settings consolidation.
Definition
project.h:287
src
app
editor
overworld
ui
navigation
overworld_sidebar.h
Generated by
1.10.0