yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::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::editor::ScreenEditor:

Public Member Functions

 ScreenEditor (Rom *rom=nullptr)
 
void Initialize () override
 
absl::Status Load () override
 
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 Save () override
 
void set_rom (Rom *rom)
 
Romrom () const
 
- Public Member Functions inherited from yaze::editor::Editor
 Editor ()=default
 
virtual ~Editor ()=default
 
virtual absl::Status Clear ()
 
EditorType type () const
 
void set_context (EditorContext *context)
 
bool * active ()
 
void set_active (bool active)
 

Public Attributes

std::vector< zelda3::DungeonMapdungeon_maps_
 

Private Types

enum class  EditingMode { DRAW , EDIT }
 

Private Member Functions

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

Private Attributes

EditingMode current_mode_ = EditingMode::DRAW
 
bool binary_gfx_loaded_ = false
 
uint8_t selected_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::unordered_map< int, gfx::Bitmaptile16_individual_
 
std::vector< gfx::Bitmaptile8_individual_
 
zelda3::DungeonMapLabels dungeon_map_labels_
 
gfx::SnesPalette palette_
 
gfx::BitmapTable sheets_
 
gfx::Tilemap tile16_blockset_
 
std::array< gfx::TileInfo, 4 > current_tile16_info
 
gui::Canvas current_tile_canvas_
 
gui::Canvas screen_canvas_
 
gui::Canvas tilesheet_canvas_
 
gui::Canvas tilemap_canvas_
 
zelda3::Inventory inventory_
 
Romrom_
 
absl::Status status_
 

Additional Inherited Members

- Protected Attributes inherited from yaze::editor::Editor
bool active_ = false
 
EditorType type_
 
EditorContextcontext_ = nullptr
 

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.

Definition at line 32 of file screen_editor.h.

Member Enumeration Documentation

◆ EditingMode

enum class yaze::editor::ScreenEditor::EditingMode
strongprivate
Enumerator
DRAW 
EDIT 

Definition at line 73 of file screen_editor.h.

Constructor & Destructor Documentation

◆ ScreenEditor()

yaze::editor::ScreenEditor::ScreenEditor ( Rom * rom = nullptr)
inlineexplicit

Definition at line 34 of file screen_editor.h.

References yaze::editor::kScreen, rom(), rom_, screen_canvas_, and yaze::editor::Editor::type_.

Here is the call graph for this function:

Member Function Documentation

◆ Initialize()

void yaze::editor::ScreenEditor::Initialize ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 29 of file screen_editor.cc.

◆ Load()

◆ Update()

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

◆ Undo()

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

Implements yaze::editor::Editor.

Definition at line 42 of file screen_editor.h.

◆ Redo()

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

Implements yaze::editor::Editor.

Definition at line 43 of file screen_editor.h.

◆ Cut()

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

Implements yaze::editor::Editor.

Definition at line 44 of file screen_editor.h.

◆ Copy()

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

Implements yaze::editor::Editor.

Definition at line 45 of file screen_editor.h.

◆ Paste()

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

Implements yaze::editor::Editor.

Definition at line 46 of file screen_editor.h.

◆ Find()

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

Implements yaze::editor::Editor.

Definition at line 47 of file screen_editor.h.

◆ Save()

absl::Status yaze::editor::ScreenEditor::Save ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 48 of file screen_editor.h.

◆ set_rom()

void yaze::editor::ScreenEditor::set_rom ( Rom * rom)
inline

Definition at line 49 of file screen_editor.h.

References rom(), and rom_.

Here is the call graph for this function:

◆ rom()

Rom * yaze::editor::ScreenEditor::rom ( ) const
inline

◆ DrawTitleScreenEditor()

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

Definition at line 410 of file screen_editor.cc.

Referenced by Update().

◆ DrawNamingScreenEditor()

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

Definition at line 416 of file screen_editor.cc.

Referenced by Update().

◆ DrawOverworldMapEditor()

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

Definition at line 422 of file screen_editor.cc.

Referenced by Update().

◆ DrawInventoryMenuEditor()

void yaze::editor::ScreenEditor::DrawInventoryMenuEditor ( )
private

Definition at line 74 of file screen_editor.cc.

References yaze::gui::DisplayPalette(), DrawInventoryToolset(), inventory_, palette_, rom(), screen_canvas_, status_, and tilesheet_canvas_.

Referenced by Update().

Here is the call graph for this function:

◆ DrawToolset()

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

Definition at line 428 of file screen_editor.cc.

◆ DrawInventoryToolset()

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

◆ LoadDungeonMapTile16()

absl::Status yaze::editor::ScreenEditor::LoadDungeonMapTile16 ( const std::vector< uint8_t > & gfx_data,
bool bin_mode = false )
private

◆ SaveDungeonMapTile16()

absl::Status yaze::editor::ScreenEditor::SaveDungeonMapTile16 ( )
private

◆ DrawDungeonMapsTabs()

◆ DrawDungeonMapsEditor()

◆ DrawDungeonMapsRoomGfx()

◆ LoadBinaryGfx()

Member Data Documentation

◆ dungeon_maps_

std::vector<zelda3::DungeonMap> yaze::editor::ScreenEditor::dungeon_maps_

Definition at line 52 of file screen_editor.h.

Referenced by DrawDungeonMapsRoomGfx(), DrawDungeonMapsTabs(), and Load().

◆ current_mode_

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

Definition at line 75 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor(), and DrawInventoryToolset().

◆ binary_gfx_loaded_

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

Definition at line 77 of file screen_editor.h.

Referenced by LoadBinaryGfx().

◆ selected_room

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

Definition at line 79 of file screen_editor.h.

Referenced by DrawDungeonMapsRoomGfx(), and DrawDungeonMapsTabs().

◆ selected_tile16_

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

Definition at line 81 of file screen_editor.h.

Referenced by DrawDungeonMapsRoomGfx().

◆ selected_tile8_

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

Definition at line 82 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor().

◆ selected_dungeon

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

◆ floor_number

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

Definition at line 84 of file screen_editor.h.

Referenced by DrawDungeonMapsRoomGfx(), and DrawDungeonMapsTabs().

◆ copy_button_pressed

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

Definition at line 86 of file screen_editor.h.

Referenced by DrawDungeonMapsTabs().

◆ paste_button_pressed

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

Definition at line 87 of file screen_editor.h.

Referenced by DrawDungeonMapsTabs().

◆ tile16_individual_

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

Definition at line 89 of file screen_editor.h.

◆ tile8_individual_

std::vector<gfx::Bitmap> yaze::editor::ScreenEditor::tile8_individual_
private

Definition at line 90 of file screen_editor.h.

Referenced by Load().

◆ dungeon_map_labels_

zelda3::DungeonMapLabels yaze::editor::ScreenEditor::dungeon_map_labels_
private

Definition at line 91 of file screen_editor.h.

Referenced by DrawDungeonMapsTabs(), and Load().

◆ palette_

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

Definition at line 93 of file screen_editor.h.

Referenced by DrawInventoryMenuEditor().

◆ sheets_

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

Definition at line 94 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor(), Load(), and LoadBinaryGfx().

◆ tile16_blockset_

gfx::Tilemap yaze::editor::ScreenEditor::tile16_blockset_
private

◆ current_tile16_info

std::array<gfx::TileInfo, 4> yaze::editor::ScreenEditor::current_tile16_info
private

Definition at line 96 of file screen_editor.h.

Referenced by DrawDungeonMapsRoomGfx().

◆ current_tile_canvas_

gui::Canvas yaze::editor::ScreenEditor::current_tile_canvas_
private
Initial value:
{"##CurrentTileCanvas", ImVec2(32, 32),

Definition at line 98 of file screen_editor.h.

Referenced by DrawDungeonMapsRoomGfx().

◆ screen_canvas_

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

◆ tilesheet_canvas_

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

Definition at line 101 of file screen_editor.h.

Referenced by DrawDungeonMapsRoomGfx(), and DrawInventoryMenuEditor().

◆ tilemap_canvas_

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

Definition at line 102 of file screen_editor.h.

Referenced by DrawDungeonMapsEditor().

◆ inventory_

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

Definition at line 105 of file screen_editor.h.

Referenced by DrawInventoryMenuEditor().

◆ rom_

Rom* yaze::editor::ScreenEditor::rom_
private

Definition at line 106 of file screen_editor.h.

Referenced by rom(), ScreenEditor(), and set_rom().

◆ status_

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

Definition at line 107 of file screen_editor.h.

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


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