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>
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::SharedRom | |
SharedRom ()=default | |
virtual | ~SharedRom ()=default |
std::shared_ptr< Rom > | shared_rom () |
auto | rom () |
Public Member Functions inherited from yaze::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 | DrawDungeonMapsRoomGfx () |
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::array< uint16_t, 4 > | current_tile16_data_ |
std::unordered_map< int, gfx::Bitmap > | tile16_individual_ |
std::vector< gfx::Bitmap > | tile8_individual_ |
std::vector< uint8_t > | all_gfx_ |
std::vector< uint8_t > | gfx_bin_data_ |
std::vector< zelda3::DungeonMap > | dungeon_maps_ |
std::vector< std::vector< std::array< std::string, 25 > > > | dungeon_map_labels_ |
absl::Status | status_ |
gfx::SnesPalette | palette_ |
gfx::BitmapTable | sheets_ |
gfx::Tilesheet | tile16_sheet_ |
gfx::InternalTile16 | current_tile16_info |
gui::Canvas | current_tile_canvas_ |
gui::Canvas | screen_canvas_ |
gui::Canvas | tilesheet_canvas_ |
gui::Canvas | tilemap_canvas_ |
zelda3::Inventory | inventory_ |
Additional Inherited Members | |
Static Public Attributes inherited from yaze::SharedRom | |
static std::shared_ptr< Rom > | shared_rom_ = nullptr |
Protected Attributes inherited from yaze::editor::Editor | |
EditorType | type_ |
EditorContext | context_ |
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 34 of file screen_editor.h.
|
strongprivate |
Enumerator | |
---|---|
DRAW | |
EDIT |
Definition at line 72 of file screen_editor.h.
|
inline |
Definition at line 36 of file screen_editor.h.
References yaze::editor::kScreen, screen_canvas_, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 29 of file screen_editor.cc.
References DrawDungeonMapsEditor(), DrawInventoryMenuEditor(), DrawNamingScreenEditor(), DrawOverworldMapEditor(), DrawTitleScreenEditor(), yaze::SharedRom::rom(), and status_.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 43 of file screen_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 44 of file screen_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 45 of file screen_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 46 of file screen_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 47 of file screen_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 48 of file screen_editor.h.
absl::Status yaze::editor::ScreenEditor::SaveDungeonMaps | ( | ) |
Definition at line 181 of file screen_editor.cc.
References dungeon_maps_, yaze::zelda3::kDungeonMapGfxPtr, yaze::zelda3::kDungeonMapRoomsPtr, RETURN_IF_ERROR, yaze::SharedRom::rom(), and yaze::SnesToPc().
|
private |
Definition at line 573 of file screen_editor.cc.
Referenced by Update().
|
private |
Definition at line 579 of file screen_editor.cc.
Referenced by Update().
|
private |
Definition at line 585 of file screen_editor.cc.
Referenced by Update().
|
private |
Definition at line 46 of file screen_editor.cc.
References yaze::gui::DisplayPalette(), DrawInventoryToolset(), END_TAB_ITEM, inventory_, palette_, yaze::SharedRom::rom(), screen_canvas_, status_, TAB_ITEM, and tilesheet_canvas_.
Referenced by Update().
|
private |
Definition at line 591 of file screen_editor.cc.
|
private |
Definition at line 87 of file screen_editor.cc.
References BUTTON_COLUMN, ICON_MD_BUILD, ICON_MD_DRAW, ICON_MD_MORE_VERT, ICON_MD_REDO, ICON_MD_UNDO, ICON_MD_ZOOM_IN, ICON_MD_ZOOM_OUT, and TEXT_COLUMN.
Referenced by DrawInventoryMenuEditor().
|
private |
Definition at line 112 of file screen_editor.cc.
References ASSIGN_OR_RETURN, dungeon_map_labels_, dungeon_maps_, yaze::util::HexByte(), yaze::zelda3::kDungeonMapBossRooms, yaze::zelda3::kDungeonMapFloors, yaze::zelda3::kDungeonMapGfxPtr, yaze::zelda3::kDungeonMapRoomsPtr, yaze::SharedRom::rom(), and yaze::SnesToPc().
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 204 of file screen_editor.cc.
References ASSIGN_OR_RETURN, yaze::editor::Renderer::GetInstance(), yaze::zelda3::kDungeonMapExpCheck, yaze::zelda3::kDungeonMapTile16, yaze::zelda3::kDungeonMapTile16Expanded, yaze::core::Renderer::RenderBitmap(), RETURN_IF_ERROR, yaze::SharedRom::rom(), yaze::gfx::Tile16, tile16_individual_, tile16_sheet_, and yaze::gfx::WordToTileInfo().
Referenced by DrawDungeonMapsEditor(), and LoadBinaryGfx().
|
private |
Definition at line 248 of file screen_editor.cc.
References yaze::zelda3::kDungeonMapExpCheck, yaze::zelda3::kDungeonMapTile16, yaze::zelda3::kDungeonMapTile16Expanded, RETURN_IF_ERROR, yaze::SharedRom::rom(), tile16_sheet_, and yaze::gfx::TileInfoToWord().
|
private |
Definition at line 275 of file screen_editor.cc.
References boss_room, copy_button_pressed, dungeon_map_labels_, dungeon_maps_, floor_number, yaze::editor::Renderer::GetInstance(), yaze::util::HexByte(), yaze::gui::InputHexByte(), yaze::gui::InputHexWord(), yaze::editor::kRedPen, paste_button_pressed, yaze::core::Renderer::RenderBitmap(), screen_canvas_, selected_dungeon, selected_room, tile16_individual_, and tile16_sheet_.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 436 of file screen_editor.cc.
References current_mode_, DRAW, DrawDungeonMapsRoomGfx(), DrawDungeonMapsTabs(), dungeon_maps_loaded_, EDIT, yaze::editor::Renderer::GetInstance(), yaze::GraphicsSheetManager::GetInstance(), ICON_MD_DRAW, ICON_MD_EDIT, LoadBinaryGfx(), LoadDungeonMaps(), LoadDungeonMapTile16(), yaze::core::Renderer::RenderBitmap(), RETURN_VOID_IF_ERROR, yaze::SharedRom::rom(), selected_dungeon, selected_tile8_, sheets_, tile8_individual_, and tilemap_canvas_.
Referenced by Update().
|
private |
Definition at line 379 of file screen_editor.cc.
References current_tile16_info, current_tile_canvas_, dungeon_maps_, floor_number, yaze::editor::Renderer::GetInstance(), yaze::gui::InputTileInfo(), yaze::core::Renderer::RenderBitmap(), RETURN_VOID_IF_ERROR, yaze::SharedRom::rom(), screen_canvas_, selected_dungeon, selected_room, selected_tile16_, selected_tile8_, tile16_individual_, tile16_sheet_, tile8_individual_, and tilesheet_canvas_.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 541 of file screen_editor.cc.
References binary_gfx_loaded_, yaze::editor::Renderer::GetInstance(), gfx_bin_data_, LoadDungeonMapTile16(), yaze::core::Renderer::RenderBitmap(), yaze::SharedRom::rom(), sheets_, yaze::core::FileDialogWrapper::ShowOpenFileDialog(), yaze::gfx::SnesTo8bppSheet(), status_, and tile16_sheet_.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 74 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 76 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 77 of file screen_editor.h.
Referenced by LoadBinaryGfx().
|
private |
Definition at line 79 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx(), and DrawDungeonMapsTabs().
|
private |
Definition at line 80 of file screen_editor.h.
Referenced by DrawDungeonMapsTabs().
|
private |
Definition at line 82 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx().
|
private |
Definition at line 83 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), and DrawDungeonMapsRoomGfx().
|
private |
Definition at line 84 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), DrawDungeonMapsRoomGfx(), and DrawDungeonMapsTabs().
|
private |
Definition at line 85 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx(), and DrawDungeonMapsTabs().
|
private |
Definition at line 87 of file screen_editor.h.
Referenced by DrawDungeonMapsTabs().
|
private |
Definition at line 88 of file screen_editor.h.
Referenced by DrawDungeonMapsTabs().
|
private |
Definition at line 90 of file screen_editor.h.
|
private |
Definition at line 91 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx(), DrawDungeonMapsTabs(), and LoadDungeonMapTile16().
|
private |
Definition at line 92 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), and DrawDungeonMapsRoomGfx().
|
private |
Definition at line 93 of file screen_editor.h.
|
private |
Definition at line 94 of file screen_editor.h.
Referenced by LoadBinaryGfx().
|
private |
Definition at line 95 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx(), DrawDungeonMapsTabs(), LoadDungeonMaps(), and SaveDungeonMaps().
|
private |
Definition at line 96 of file screen_editor.h.
Referenced by DrawDungeonMapsTabs(), and LoadDungeonMaps().
|
private |
Definition at line 98 of file screen_editor.h.
Referenced by DrawInventoryMenuEditor(), LoadBinaryGfx(), and Update().
|
private |
Definition at line 100 of file screen_editor.h.
Referenced by DrawInventoryMenuEditor().
|
private |
Definition at line 101 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), and LoadBinaryGfx().
|
private |
Definition at line 102 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx(), DrawDungeonMapsTabs(), LoadBinaryGfx(), LoadDungeonMapTile16(), and SaveDungeonMapTile16().
|
private |
Definition at line 103 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx().
|
private |
Definition at line 105 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx().
|
private |
Definition at line 107 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx(), DrawDungeonMapsTabs(), DrawInventoryMenuEditor(), and ScreenEditor().
|
private |
Definition at line 108 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx(), and DrawInventoryMenuEditor().
|
private |
Definition at line 109 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 112 of file screen_editor.h.
Referenced by DrawInventoryMenuEditor().