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::app::SharedRom | |
SharedRom ()=default | |
virtual | ~SharedRom ()=default |
std::shared_ptr< Rom > | shared_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::Bitmap > | tile16_individual_ |
std::vector< zelda3::screen::DungeonMap > | dungeon_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< Rom > | shared_rom_ = nullptr |
Protected Attributes inherited from yaze::app::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 35 of file screen_editor.h.
|
strongprivate |
Enumerator | |
---|---|
DRAW | |
EDIT |
Definition at line 71 of file screen_editor.h.
|
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_.
|
overridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 28 of file screen_editor.cc.
References DrawDungeonMapsEditor(), DrawInventoryMenuEditor(), DrawNamingScreenEditor(), DrawOverworldMapEditor(), DrawTitleScreenEditor(), yaze::app::SharedRom::rom(), and status_.
Referenced by yaze::app::editor::EditorManager::ManageActiveEditors().
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 44 of file screen_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 45 of file screen_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 46 of file screen_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 47 of file screen_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 48 of file screen_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 49 of file screen_editor.h.
absl::Status yaze::app::editor::ScreenEditor::SaveDungeonMaps | ( | ) |
Definition at line 185 of file screen_editor.cc.
References dungeon_maps_, yaze::app::zelda3::screen::kDungeonMapGfxPtr, yaze::app::zelda3::screen::kDungeonMapRoomsPtr, RETURN_IF_ERROR, yaze::app::SharedRom::rom(), and yaze::app::core::SnesToPc().
Referenced by yaze::app::editor::EditorManager::SaveRom().
|
private |
Definition at line 553 of file screen_editor.cc.
Referenced by Update().
|
private |
Definition at line 559 of file screen_editor.cc.
Referenced by Update().
|
private |
Definition at line 565 of file screen_editor.cc.
Referenced by Update().
|
private |
Definition at line 45 of file screen_editor.cc.
References yaze::app::zelda3::screen::Inventory::Bitmap(), yaze::app::zelda3::screen::Inventory::Create(), yaze::app::gui::DisplayPalette(), yaze::app::gui::Canvas::DrawBackground(), yaze::app::gui::Canvas::DrawBitmap(), yaze::app::gui::Canvas::DrawContextMenu(), yaze::app::gui::Canvas::DrawGrid(), DrawInventoryToolset(), yaze::app::gui::Canvas::DrawOverlay(), END_TAB_ITEM, inventory_, yaze::app::zelda3::screen::Inventory::Palette(), palette_, yaze::app::SharedRom::rom(), screen_canvas_, status_, TAB_ITEM, yaze::app::zelda3::screen::Inventory::Tilesheet(), and tilesheet_canvas_.
Referenced by Update().
|
private |
Definition at line 571 of file screen_editor.cc.
|
private |
Definition at line 86 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 111 of file screen_editor.cc.
References ASSIGN_OR_RETURN, dungeon_map_labels_, dungeon_maps_, yaze::app::zelda3::screen::kDungeonMapBossRooms, yaze::app::zelda3::screen::kDungeonMapFloors, yaze::app::zelda3::screen::kDungeonMapGfxPtr, yaze::app::zelda3::screen::kDungeonMapRoomsPtr, yaze::app::SharedRom::rom(), yaze::app::core::SnesToPc(), and yaze::app::core::UppercaseHexByte().
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 208 of file screen_editor.cc.
References ASSIGN_OR_RETURN, yaze::app::gfx::Tilesheet::ComposeTile16(), yaze::app::core::Renderer::GetInstance(), yaze::app::gfx::Tilesheet::GetTile16(), yaze::app::gfx::Tilesheet::Init(), yaze::app::zelda3::screen::kDungeonMapExpCheck, yaze::app::zelda3::screen::kDungeonMapTile16, yaze::app::zelda3::screen::kDungeonMapTile16Expanded, yaze::app::gfx::Tilesheet::mutable_bitmap(), yaze::app::gfx::Tilesheet::num_tiles(), yaze::app::core::Renderer::RenderBitmap(), RETURN_IF_ERROR, yaze::app::SharedRom::rom(), yaze::app::gfx::Tile16, tile16_individual_, tile16_sheet_, and yaze::app::gfx::WordToTileInfo().
Referenced by DrawDungeonMapsEditor(), and LoadBinaryGfx().
|
private |
Definition at line 252 of file screen_editor.cc.
References yaze::app::zelda3::screen::kDungeonMapExpCheck, yaze::app::zelda3::screen::kDungeonMapTile16, yaze::app::zelda3::screen::kDungeonMapTile16Expanded, RETURN_IF_ERROR, yaze::app::SharedRom::rom(), tile16_sheet_, yaze::app::gfx::Tilesheet::tile_info(), and yaze::app::gfx::TileInfoToWord().
|
private |
Definition at line 279 of file screen_editor.cc.
References boss_room, copy_button_pressed, yaze::app::gui::Canvas::DrawBackground(), yaze::app::gui::Canvas::DrawBitmap(), yaze::app::gui::Canvas::DrawGrid(), yaze::app::gui::Canvas::DrawOutlineWithColor(), yaze::app::gui::Canvas::DrawOverlay(), yaze::app::gui::Canvas::DrawText(), yaze::app::gui::Canvas::DrawTileSelector(), dungeon_map_labels_, dungeon_maps_, floor_number, yaze::app::core::Renderer::GetInstance(), yaze::app::gfx::Tilesheet::GetTile16(), yaze::app::gui::InputHexByte(), yaze::app::gui::InputHexWord(), yaze::app::editor::kRedPen, paste_button_pressed, yaze::app::gui::Canvas::points(), yaze::app::core::Renderer::RenderBitmap(), screen_canvas_, selected_dungeon, selected_room, tile16_individual_, tile16_sheet_, and yaze::app::core::UppercaseHexByte().
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 383 of file screen_editor.cc.
References yaze::app::gfx::Tilesheet::bitmap(), current_mode_, current_tile16_info, current_tile_canvas_, DRAW, yaze::app::gui::Canvas::DrawBackground(), yaze::app::gui::Canvas::DrawBitmap(), yaze::app::gui::Canvas::DrawBitmapTable(), yaze::app::gui::Canvas::DrawContextMenu(), DrawDungeonMapsTabs(), yaze::app::gui::Canvas::DrawGrid(), yaze::app::gui::Canvas::DrawOverlay(), yaze::app::gui::Canvas::DrawTileSelector(), dungeon_maps_, dungeon_maps_loaded_, EDIT, floor_number, yaze::app::core::Renderer::GetInstance(), yaze::app::gfx::Tilesheet::GetTile16(), yaze::app::gui::Canvas::GetTileIdFromMousePos(), ICON_MD_DRAW, ICON_MD_EDIT, yaze::app::gui::InputTileInfo(), LoadBinaryGfx(), LoadDungeonMaps(), LoadDungeonMapTile16(), yaze::app::gfx::Tilesheet::ModifyTile16(), yaze::app::gui::Canvas::mutable_points(), yaze::app::gui::Canvas::points(), yaze::app::core::Renderer::RenderBitmap(), RETURN_VOID_IF_ERROR, yaze::app::SharedRom::rom(), screen_canvas_, selected_dungeon, selected_room, selected_tile16_, selected_tile8_, sheets_, tile16_individual_, tile16_sheet_, yaze::app::gfx::Tilesheet::tile_info(), tilemap_canvas_, yaze::app::gfx::InternalTile16::tiles, and tilesheet_canvas_.
Referenced by Update().
|
private |
Definition at line 523 of file screen_editor.cc.
References binary_gfx_loaded_, yaze::app::gfx::Tilesheet::clear(), yaze::app::core::Renderer::GetInstance(), gfx_bin_data_, LoadDungeonMapTile16(), yaze::app::core::Renderer::RenderBitmap(), yaze::app::SharedRom::rom(), sheets_, yaze::app::core::FileDialogWrapper::ShowOpenFileDialog(), yaze::app::gfx::SnesTo8bppSheet(), status_, and tile16_sheet_.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 73 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 75 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 76 of file screen_editor.h.
Referenced by LoadBinaryGfx().
|
private |
Definition at line 78 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), and DrawDungeonMapsTabs().
|
private |
Definition at line 79 of file screen_editor.h.
Referenced by DrawDungeonMapsTabs().
|
private |
Definition at line 81 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 82 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 83 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), and DrawDungeonMapsTabs().
|
private |
Definition at line 84 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), and DrawDungeonMapsTabs().
|
private |
Definition at line 86 of file screen_editor.h.
Referenced by DrawDungeonMapsTabs().
|
private |
Definition at line 87 of file screen_editor.h.
Referenced by DrawDungeonMapsTabs().
|
private |
Definition at line 89 of file screen_editor.h.
|
private |
Definition at line 90 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), DrawDungeonMapsTabs(), and LoadDungeonMapTile16().
|
private |
Definition at line 91 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), DrawDungeonMapsTabs(), LoadDungeonMaps(), and SaveDungeonMaps().
|
private |
Definition at line 92 of file screen_editor.h.
Referenced by DrawDungeonMapsTabs(), and LoadDungeonMaps().
|
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 96 of file screen_editor.h.
Referenced by DrawInventoryMenuEditor(), LoadBinaryGfx(), and Update().
|
private |
Definition at line 98 of file screen_editor.h.
Referenced by DrawInventoryMenuEditor().
|
private |
Definition at line 99 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), and LoadBinaryGfx().
|
private |
Definition at line 100 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), DrawDungeonMapsTabs(), LoadBinaryGfx(), LoadDungeonMapTile16(), and SaveDungeonMapTile16().
|
private |
Definition at line 101 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 103 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 104 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), DrawDungeonMapsTabs(), DrawInventoryMenuEditor(), and ScreenEditor().
|
private |
Definition at line 105 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), and DrawInventoryMenuEditor().
|
private |
Definition at line 106 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 110 of file screen_editor.h.
Referenced by DrawInventoryMenuEditor().