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
11
12namespace 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.
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"; }
31 WindowScope GetScope() const override { return WindowScope::kGlobal; }
32
33 void Draw(bool* p_open) override;
34
35 private:
37
38 std::optional<std::filesystem::path> ShotsPath() const;
39 void Load();
40 void Save();
41 void DrawShotList();
45 // The open Overworld editor, for the ROM's area sizes and screen images.
46 class OverworldEditor* OverworldSource() const;
47
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;
57 0; // 0 ROM/vanilla, 1 512x512, 2 1024x1024, 3 wide, 4 tall
58 enum class Drag { kNone, kViewport, kLink, kActor };
60 int drag_actor_ = -1;
61};
62
63} // namespace yaze::editor
64
65#endif // YAZE_APP_EDITOR_CUTSCENE_UI_WINDOW_CUTSCENE_CAMERA_PANEL_H_
void DrawCanvas(zelda3::CutsceneShot &shot)
std::optional< std::filesystem::path > ShotsPath() const
void DrawShotFields(zelda3::CutsceneShot &shot)
zelda3::AreaExtent ExtentFor(const zelda3::CutsceneShot &shot) const
std::string GetEditorCategory() const override
Editor category this panel belongs to.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
std::string GetIcon() const override
Material Design icon for this panel.
void Draw(bool *p_open) override
Draw the panel content.
class OverworldEditor * OverworldSource() const
std::string GetId() const override
Unique identifier for this panel.
WindowScope GetScope() const override
Get the registration scope for this window.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
std::optional< std::string > loaded_bytes_
Main UI class for editing overworld maps in A Link to the Past.
Base interface for all logical window content components.
#define ICON_MD_VIDEOCAM
Definition icons.h:2074
Editors are the view controllers for the application.
WindowScope
Defines whether a window is session-scoped or global.
static WindowPresentationPolicy OptionalPopOut()