yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
cutscene_camera_panel.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_EDITOR_CUTSCENE_UI_WINDOW_CUTSCENE_CAMERA_PANEL_H_
2
#define YAZE_APP_EDITOR_CUTSCENE_UI_WINDOW_CUTSCENE_CAMERA_PANEL_H_
3
4
#include <filesystem>
5
#include <optional>
6
#include <string>
7
8
#include "
app/editor/system/workspace/editor_panel.h
"
9
#include "
app/gui/core/icons.h
"
10
#include "
zelda3/cutscene/cutscene_shot.h
"
11
12
namespace
yaze::editor
{
13
14
// Frames overworld cutscene shots: a 256x224 viewport dragged over an area,
15
// clamped to the game's camera limits, plus Link and actor markers. Shots are
16
// saved to the project's [files] cutscene_shots JSON; without that key the
17
// window is read-only and offers Copy JSON. It never writes the ROM.
18
//
19
// When the Overworld editor is open, area sizes come from the ROM
20
// (ZSCustomOverworld small/large/wide/tall) and the area's screens are drawn
21
// behind the viewport; otherwise the vanilla layout and an outline are used.
22
class
CutsceneCameraPanel
:
public
WindowContent
{
23
public
:
24
std::string
GetId
()
const override
{
return
"overworld.cutscene_camera"
; }
25
std::string
GetDisplayName
()
const override
{
return
"Cutscene Camera"
; }
26
std::string
GetIcon
()
const override
{
return
ICON_MD_VIDEOCAM
; }
27
std::string
GetEditorCategory
()
const override
{
return
"Overworld"
; }
28
WindowPresentationPolicy
GetPresentationPolicy
()
const override
{
29
return
WindowPresentationPolicy::OptionalPopOut
();
30
}
31
WindowScope
GetScope
()
const override
{
return
WindowScope::kGlobal
; }
32
33
void
Draw
(
bool
* p_open)
override
;
34
35
private
:
36
friend
class
CutsceneCameraPanelTestPeer
;
37
38
std::optional<std::filesystem::path>
ShotsPath
()
const
;
39
void
Load
();
40
void
Save
();
41
void
DrawShotList
();
42
void
DrawShotFields
(
zelda3::CutsceneShot
& shot);
43
void
DrawCanvas
(
zelda3::CutsceneShot
& shot);
44
zelda3::AreaExtent
ExtentFor
(
const
zelda3::CutsceneShot
& shot)
const
;
45
// The open Overworld editor, for the ROM's area sizes and screen images.
46
class
OverworldEditor
*
OverworldSource
()
const
;
47
48
zelda3::CutsceneShotSet
shots_
;
49
std::optional<std::string>
loaded_bytes_
;
// file contents at last load
50
std::string
loaded_path_
;
51
std::string
status_
;
52
bool
status_is_error_
=
false
;
53
bool
loaded_once_
=
false
;
54
bool
dirty_
=
false
;
55
int
selected_
= -1;
56
int
size_override_
=
57
0;
// 0 ROM/vanilla, 1 512x512, 2 1024x1024, 3 wide, 4 tall
58
enum class
Drag
{
kNone
,
kViewport
,
kLink
,
kActor
};
59
Drag
drag_
=
Drag::kNone
;
60
int
drag_actor_
= -1;
61
};
62
63
}
// namespace yaze::editor
64
65
#endif
// YAZE_APP_EDITOR_CUTSCENE_UI_WINDOW_CUTSCENE_CAMERA_PANEL_H_
yaze::editor::CutsceneCameraPanel
Definition
cutscene_camera_panel.h:22
yaze::editor::CutsceneCameraPanel::DrawCanvas
void DrawCanvas(zelda3::CutsceneShot &shot)
Definition
cutscene_camera_panel.cc:387
yaze::editor::CutsceneCameraPanel::ShotsPath
std::optional< std::filesystem::path > ShotsPath() const
Definition
cutscene_camera_panel.cc:52
yaze::editor::CutsceneCameraPanel::DrawShotFields
void DrawShotFields(zelda3::CutsceneShot &shot)
Definition
cutscene_camera_panel.cc:316
yaze::editor::CutsceneCameraPanel::size_override_
int size_override_
Definition
cutscene_camera_panel.h:56
yaze::editor::CutsceneCameraPanel::ExtentFor
zelda3::AreaExtent ExtentFor(const zelda3::CutsceneShot &shot) const
Definition
cutscene_camera_panel.cc:191
yaze::editor::CutsceneCameraPanel::drag_
Drag drag_
Definition
cutscene_camera_panel.h:59
yaze::editor::CutsceneCameraPanel::GetEditorCategory
std::string GetEditorCategory() const override
Editor category this panel belongs to.
Definition
cutscene_camera_panel.h:27
yaze::editor::CutsceneCameraPanel::GetDisplayName
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
Definition
cutscene_camera_panel.h:25
yaze::editor::CutsceneCameraPanel::GetIcon
std::string GetIcon() const override
Material Design icon for this panel.
Definition
cutscene_camera_panel.h:26
yaze::editor::CutsceneCameraPanel::Save
void Save()
Definition
cutscene_camera_panel.cc:100
yaze::editor::CutsceneCameraPanel::shots_
zelda3::CutsceneShotSet shots_
Definition
cutscene_camera_panel.h:48
yaze::editor::CutsceneCameraPanel::Draw
void Draw(bool *p_open) override
Draw the panel content.
Definition
cutscene_camera_panel.cc:219
yaze::editor::CutsceneCameraPanel::OverworldSource
class OverworldEditor * OverworldSource() const
Definition
cutscene_camera_panel.cc:181
yaze::editor::CutsceneCameraPanel::GetId
std::string GetId() const override
Unique identifier for this panel.
Definition
cutscene_camera_panel.h:24
yaze::editor::CutsceneCameraPanel::DrawShotList
void DrawShotList()
Definition
cutscene_camera_panel.cc:275
yaze::editor::CutsceneCameraPanel::Drag
Drag
Definition
cutscene_camera_panel.h:58
yaze::editor::CutsceneCameraPanel::Drag::kLink
@ kLink
yaze::editor::CutsceneCameraPanel::Drag::kNone
@ kNone
yaze::editor::CutsceneCameraPanel::Drag::kActor
@ kActor
yaze::editor::CutsceneCameraPanel::Drag::kViewport
@ kViewport
yaze::editor::CutsceneCameraPanel::loaded_once_
bool loaded_once_
Definition
cutscene_camera_panel.h:53
yaze::editor::CutsceneCameraPanel::GetScope
WindowScope GetScope() const override
Get the registration scope for this window.
Definition
cutscene_camera_panel.h:31
yaze::editor::CutsceneCameraPanel::drag_actor_
int drag_actor_
Definition
cutscene_camera_panel.h:60
yaze::editor::CutsceneCameraPanel::CutsceneCameraPanelTestPeer
friend class CutsceneCameraPanelTestPeer
Definition
cutscene_camera_panel.h:36
yaze::editor::CutsceneCameraPanel::selected_
int selected_
Definition
cutscene_camera_panel.h:55
yaze::editor::CutsceneCameraPanel::status_is_error_
bool status_is_error_
Definition
cutscene_camera_panel.h:52
yaze::editor::CutsceneCameraPanel::loaded_path_
std::string loaded_path_
Definition
cutscene_camera_panel.h:50
yaze::editor::CutsceneCameraPanel::GetPresentationPolicy
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
Definition
cutscene_camera_panel.h:28
yaze::editor::CutsceneCameraPanel::loaded_bytes_
std::optional< std::string > loaded_bytes_
Definition
cutscene_camera_panel.h:49
yaze::editor::CutsceneCameraPanel::Load
void Load()
Definition
cutscene_camera_panel.cc:62
yaze::editor::CutsceneCameraPanel::dirty_
bool dirty_
Definition
cutscene_camera_panel.h:54
yaze::editor::CutsceneCameraPanel::status_
std::string status_
Definition
cutscene_camera_panel.h:51
yaze::editor::OverworldEditor
Main UI class for editing overworld maps in A Link to the Past.
Definition
overworld_editor.h:134
yaze::editor::WindowContent
Base interface for all logical window content components.
Definition
editor_panel.h:199
cutscene_shot.h
icons.h
ICON_MD_VIDEOCAM
#define ICON_MD_VIDEOCAM
Definition
icons.h:2074
yaze::editor
Editors are the view controllers for the application.
Definition
patch_export_usage.cc:9
yaze::editor::WindowScope
WindowScope
Defines whether a window is session-scoped or global.
Definition
editor_panel.h:54
yaze::editor::WindowScope::kGlobal
@ kGlobal
yaze::editor::WindowPresentationPolicy
Definition
editor_panel.h:102
yaze::editor::WindowPresentationPolicy::OptionalPopOut
static WindowPresentationPolicy OptionalPopOut()
Definition
editor_panel.h:149
yaze::zelda3::AreaExtent
Definition
cutscene_shot.h:62
yaze::zelda3::CutsceneShotSet
Definition
cutscene_shot.h:42
yaze::zelda3::CutsceneShot
Definition
cutscene_shot.h:32
editor_panel.h
src
app
editor
cutscene
ui
window
cutscene_camera_panel.h
Generated by
1.10.0