yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::app::editor::ScreenEditor Class Reference

The ScreenEditor class allows the user to edit a variety of screens in the game or create a custom menu. More...

#include <screen_editor.h>

Inheritance diagram for yaze::app::editor::ScreenEditor:
Collaboration diagram for yaze::app::editor::ScreenEditor:

Public Member Functions

 ScreenEditor ()
 
absl::Status Update () override
 
absl::Status Undo () override
 
absl::Status Redo () override
 
absl::Status Cut () override
 
absl::Status Copy () override
 
absl::Status Paste () override
 
absl::Status Find () override
 
absl::Status SaveDungeonMaps ()
 
- Public Member Functions inherited from yaze::app::SharedRom
 SharedRom ()=default
 
virtual ~SharedRom ()=default
 
std::shared_ptr< Romshared_rom ()
 
auto rom ()
 
- Public Member Functions inherited from yaze::app::editor::Editor
 Editor ()=default
 
virtual ~Editor ()=default
 
EditorType type () const
 

Private Types

enum class  EditingMode { DRAW , EDIT }
 

Private Member Functions

void DrawTitleScreenEditor ()
 
void DrawNamingScreenEditor ()
 
void DrawOverworldMapEditor ()
 
void DrawInventoryMenuEditor ()
 
void DrawToolset ()
 
void DrawInventoryToolset ()
 
absl::Status LoadDungeonMaps ()
 
absl::Status LoadDungeonMapTile16 (const std::vector< uint8_t > &gfx_data, bool bin_mode=false)
 
absl::Status SaveDungeonMapTile16 ()
 
void DrawDungeonMapsTabs ()
 
void DrawDungeonMapsEditor ()
 
void LoadBinaryGfx ()
 

Private Attributes

EditingMode current_mode_ = EditingMode::DRAW
 
bool dungeon_maps_loaded_ = false
 
bool binary_gfx_loaded_ = false
 
uint8_t selected_room = 0
 
uint8_t boss_room = 0
 
int selected_tile16_ = 0
 
int selected_tile8_ = 0
 
int selected_dungeon = 0
 
int floor_number = 1
 
bool copy_button_pressed = false
 
bool paste_button_pressed = false
 
std::vector< uint8_t > all_gfx_
 
std::unordered_map< int, gfx::Bitmaptile16_individual_
 
std::vector< zelda3::screen::DungeonMapdungeon_maps_
 
std::vector< std::vector< std::array< std::string, 25 > > > dungeon_map_labels_
 
std::array< uint16_t, 4 > current_tile16_data_
 
std::vector< uint8_t > gfx_bin_data_
 
absl::Status status_
 
gfx::SnesPalette palette_
 
gfx::BitmapTable sheets_
 
gfx::Tilesheet tile16_sheet_
 
gfx::InternalTile16 current_tile16_info
 
gui::Canvas current_tile_canvas_ {"##CurrentTileCanvas"}
 
gui::Canvas screen_canvas_
 
gui::Canvas tilesheet_canvas_
 
gui::Canvas tilemap_canvas_
 
zelda3::screen::Inventory inventory_
 

Additional Inherited Members

- Static Public Attributes inherited from yaze::app::SharedRom
static std::shared_ptr< Romshared_rom_ = nullptr
 
- Protected Attributes inherited from yaze::app::editor::Editor
EditorType type_
 
EditorContext context_
 

Detailed Description

The ScreenEditor class allows the user to edit a variety of screens in the game or create a custom menu.

This class is currently a work in progress (WIP) and provides functionality for updating the screens, saving dungeon maps, drawing different types of screens, loading dungeon maps, and managing various properties related to the editor.

The screens that can be edited include the title screen, naming screen, overworld map, inventory menu, and more.

The class inherits from the SharedRom class.

Definition at line 35 of file screen_editor.h.

Member Enumeration Documentation

◆ EditingMode

Enumerator
DRAW 
EDIT 

Definition at line 71 of file screen_editor.h.

Constructor & Destructor Documentation

◆ ScreenEditor()

yaze::app::editor::ScreenEditor::ScreenEditor ( )
inline

Definition at line 37 of file screen_editor.h.

References yaze::app::editor::kScreen, screen_canvas_, yaze::app::gui::Canvas::SetCanvasSize(), and yaze::app::editor::Editor::type_.

Here is the call graph for this function:

Member Function Documentation

◆ Update()

absl::Status yaze::app::editor::ScreenEditor::Update ( )
overridevirtual

◆ Undo()

absl::Status yaze::app::editor::ScreenEditor::Undo ( )
inlineoverridevirtual

Implements yaze::app::editor::Editor.

Definition at line 44 of file screen_editor.h.

◆ Redo()

absl::Status yaze::app::editor::ScreenEditor::Redo ( )
inlineoverridevirtual

Implements yaze::app::editor::Editor.

Definition at line 45 of file screen_editor.h.

◆ Cut()

absl::Status yaze::app::editor::ScreenEditor::Cut ( )
inlineoverridevirtual

Implements yaze::app::editor::Editor.

Definition at line 46 of file screen_editor.h.

◆ Copy()

absl::Status yaze::app::editor::ScreenEditor::Copy ( )
inlineoverridevirtual

Implements yaze::app::editor::Editor.

Definition at line 47 of file screen_editor.h.

◆ Paste()

absl::Status yaze::app::editor::ScreenEditor::Paste ( )
inlineoverridevirtual

Implements yaze::app::editor::Editor.

Definition at line 48 of file screen_editor.h.

◆ Find()

absl::Status yaze::app::editor::ScreenEditor::Find ( )
inlineoverridevirtual

Implements yaze::app::editor::Editor.

Definition at line 49 of file screen_editor.h.

◆ SaveDungeonMaps()

absl::Status yaze::app::editor::ScreenEditor::SaveDungeonMaps ( )

◆ DrawTitleScreenEditor()

void yaze::app::editor::ScreenEditor::DrawTitleScreenEditor ( )
private

Definition at line 553 of file screen_editor.cc.

Referenced by Update().

◆ DrawNamingScreenEditor()

void yaze::app::editor::ScreenEditor::DrawNamingScreenEditor ( )
private

Definition at line 559 of file screen_editor.cc.

Referenced by Update().

◆ DrawOverworldMapEditor()

void yaze::app::editor::ScreenEditor::DrawOverworldMapEditor ( )
private

Definition at line 565 of file screen_editor.cc.

Referenced by Update().

◆ DrawInventoryMenuEditor()

◆ DrawToolset()

void yaze::app::editor::ScreenEditor::DrawToolset ( )
private

Definition at line 571 of file screen_editor.cc.

◆ DrawInventoryToolset()

void yaze::app::editor::ScreenEditor::DrawInventoryToolset ( )
private

◆ LoadDungeonMaps()

◆ LoadDungeonMapTile16()

◆ SaveDungeonMapTile16()

◆ DrawDungeonMapsTabs()

◆ DrawDungeonMapsEditor()

◆ LoadBinaryGfx()

Member Data Documentation

◆ current_mode_

EditingMode yaze::app::editor::ScreenEditor::current_mode_ = EditingMode::DRAW
private

Definition at line 73 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor().

◆ dungeon_maps_loaded_

bool yaze::app::editor::ScreenEditor::dungeon_maps_loaded_ = false
private

Definition at line 75 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor().

◆ binary_gfx_loaded_

bool yaze::app::editor::ScreenEditor::binary_gfx_loaded_ = false
private

Definition at line 76 of file screen_editor.h.

Referenced by LoadBinaryGfx().

◆ selected_room

uint8_t yaze::app::editor::ScreenEditor::selected_room = 0
private

Definition at line 78 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor(), and DrawDungeonMapsTabs().

◆ boss_room

uint8_t yaze::app::editor::ScreenEditor::boss_room = 0
private

Definition at line 79 of file screen_editor.h.

Referenced by DrawDungeonMapsTabs().

◆ selected_tile16_

int yaze::app::editor::ScreenEditor::selected_tile16_ = 0
private

Definition at line 81 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor().

◆ selected_tile8_

int yaze::app::editor::ScreenEditor::selected_tile8_ = 0
private

Definition at line 82 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor().

◆ selected_dungeon

int yaze::app::editor::ScreenEditor::selected_dungeon = 0
private

Definition at line 83 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor(), and DrawDungeonMapsTabs().

◆ floor_number

int yaze::app::editor::ScreenEditor::floor_number = 1
private

Definition at line 84 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor(), and DrawDungeonMapsTabs().

◆ copy_button_pressed

bool yaze::app::editor::ScreenEditor::copy_button_pressed = false
private

Definition at line 86 of file screen_editor.h.

Referenced by DrawDungeonMapsTabs().

◆ paste_button_pressed

bool yaze::app::editor::ScreenEditor::paste_button_pressed = false
private

Definition at line 87 of file screen_editor.h.

Referenced by DrawDungeonMapsTabs().

◆ all_gfx_

std::vector<uint8_t> yaze::app::editor::ScreenEditor::all_gfx_
private

Definition at line 89 of file screen_editor.h.

◆ tile16_individual_

std::unordered_map<int, gfx::Bitmap> yaze::app::editor::ScreenEditor::tile16_individual_
private

◆ dungeon_maps_

std::vector<zelda3::screen::DungeonMap> yaze::app::editor::ScreenEditor::dungeon_maps_
private

◆ dungeon_map_labels_

std::vector<std::vector<std::array<std::string, 25> > > yaze::app::editor::ScreenEditor::dungeon_map_labels_
private

Definition at line 92 of file screen_editor.h.

Referenced by DrawDungeonMapsTabs(), and LoadDungeonMaps().

◆ current_tile16_data_

std::array<uint16_t, 4> yaze::app::editor::ScreenEditor::current_tile16_data_
private

Definition at line 93 of file screen_editor.h.

◆ gfx_bin_data_

std::vector<uint8_t> yaze::app::editor::ScreenEditor::gfx_bin_data_
private

Definition at line 94 of file screen_editor.h.

Referenced by LoadBinaryGfx().

◆ status_

absl::Status yaze::app::editor::ScreenEditor::status_
private

Definition at line 96 of file screen_editor.h.

Referenced by DrawInventoryMenuEditor(), LoadBinaryGfx(), and Update().

◆ palette_

gfx::SnesPalette yaze::app::editor::ScreenEditor::palette_
private

Definition at line 98 of file screen_editor.h.

Referenced by DrawInventoryMenuEditor().

◆ sheets_

gfx::BitmapTable yaze::app::editor::ScreenEditor::sheets_
private

Definition at line 99 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor(), and LoadBinaryGfx().

◆ tile16_sheet_

gfx::Tilesheet yaze::app::editor::ScreenEditor::tile16_sheet_
private

◆ current_tile16_info

gfx::InternalTile16 yaze::app::editor::ScreenEditor::current_tile16_info
private

Definition at line 101 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor().

◆ current_tile_canvas_

gui::Canvas yaze::app::editor::ScreenEditor::current_tile_canvas_ {"##CurrentTileCanvas"}
private

Definition at line 103 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor().

◆ screen_canvas_

gui::Canvas yaze::app::editor::ScreenEditor::screen_canvas_
private

◆ tilesheet_canvas_

gui::Canvas yaze::app::editor::ScreenEditor::tilesheet_canvas_
private

Definition at line 105 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor(), and DrawInventoryMenuEditor().

◆ tilemap_canvas_

gui::Canvas yaze::app::editor::ScreenEditor::tilemap_canvas_
private
Initial value:
{"##TilemapCanvas",
ImVec2(128 + 2, (192) + 4),

Definition at line 106 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor().

◆ inventory_

zelda3::screen::Inventory yaze::app::editor::ScreenEditor::inventory_
private

Definition at line 110 of file screen_editor.h.

Referenced by DrawInventoryMenuEditor().


The documentation for this class was generated from the following files: