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 (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) |
Rom * | rom () const |
![]() | |
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::DungeonMap > | dungeon_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::Bitmap > | tile16_individual_ |
std::vector< gfx::Bitmap > | tile8_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_ |
Rom * | rom_ |
absl::Status | status_ |
Additional Inherited Members | |
![]() | |
bool | active_ = false |
EditorType | type_ |
EditorContext * | context_ = nullptr |
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.
|
strongprivate |
Enumerator | |
---|---|
DRAW | |
EDIT |
Definition at line 73 of file screen_editor.h.
|
inlineexplicit |
Definition at line 34 of file screen_editor.h.
References yaze::editor::kScreen, rom(), rom_, screen_canvas_, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 29 of file screen_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 31 of file screen_editor.cc.
References ASSIGN_OR_RETURN, dungeon_map_labels_, dungeon_maps_, yaze::editor::Renderer::Get(), yaze::gfx::Arena::Get(), yaze::zelda3::LoadDungeonMaps(), yaze::zelda3::LoadDungeonMapTile16(), yaze::core::Renderer::RenderBitmap(), RETURN_IF_ERROR, rom(), sheets_, tile16_blockset_, and tile8_individual_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 59 of file screen_editor.cc.
References DrawDungeonMapsEditor(), DrawInventoryMenuEditor(), DrawNamingScreenEditor(), DrawOverworldMapEditor(), DrawTitleScreenEditor(), and status_.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 42 of file screen_editor.h.
|
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.
|
inline |
|
inline |
Definition at line 50 of file screen_editor.h.
References rom_.
Referenced by DrawDungeonMapsEditor(), DrawDungeonMapsRoomGfx(), DrawInventoryMenuEditor(), Load(), LoadBinaryGfx(), ScreenEditor(), and set_rom().
|
private |
Definition at line 410 of file screen_editor.cc.
Referenced by Update().
|
private |
Definition at line 416 of file screen_editor.cc.
Referenced by Update().
|
private |
Definition at line 422 of file screen_editor.cc.
Referenced by Update().
|
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().
|
private |
Definition at line 428 of file screen_editor.cc.
|
private |
Definition at line 115 of file screen_editor.cc.
References current_mode_, DRAW, 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 screen_canvas_.
Referenced by DrawInventoryMenuEditor().
|
private |
|
private |
|
private |
Definition at line 160 of file screen_editor.cc.
References copy_button_pressed, dungeon_map_labels_, dungeon_maps_, floor_number, yaze::util::HexByte(), yaze::gui::InputHexByte(), yaze::gui::InputHexWord(), yaze::zelda3::kNumRooms, yaze::editor::kRedPen, paste_button_pressed, yaze::gfx::RenderTile16(), screen_canvas_, selected_dungeon, selected_room, and tile16_blockset_.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 314 of file screen_editor.cc.
References current_mode_, DRAW, DrawDungeonMapsRoomGfx(), DrawDungeonMapsTabs(), EDIT, ICON_MD_DRAW, ICON_MD_EDIT, ICON_MD_SAVE, LoadBinaryGfx(), PRINT_IF_ERROR, yaze::Rom::resource_label(), rom(), yaze::zelda3::SaveDungeonMapTile16(), yaze::ResourceLabelManager::SelectableLabelWithNameEdit(), selected_dungeon, selected_tile8_, sheets_, tile16_blockset_, and tilemap_canvas_.
Referenced by Update().
|
private |
Definition at line 259 of file screen_editor.cc.
References current_tile16_info, current_tile_canvas_, dungeon_maps_, floor_number, yaze::gui::InputTileInfo(), yaze::gfx::ModifyTile16(), yaze::gfx::RenderTile16(), rom(), screen_canvas_, selected_dungeon, selected_room, selected_tile16_, tile16_blockset_, tilesheet_canvas_, and yaze::gfx::UpdateTile16().
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 380 of file screen_editor.cc.
References binary_gfx_loaded_, yaze::editor::Renderer::Get(), yaze::zelda3::LoadDungeonMapTile16(), yaze::core::Renderer::RenderBitmap(), rom(), sheets_, yaze::core::FileDialogWrapper::ShowOpenFileDialog(), yaze::gfx::SnesTo8bppSheet(), status_, and tile16_blockset_.
Referenced by DrawDungeonMapsEditor().
std::vector<zelda3::DungeonMap> yaze::editor::ScreenEditor::dungeon_maps_ |
Definition at line 52 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx(), DrawDungeonMapsTabs(), and Load().
|
private |
Definition at line 75 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), and DrawInventoryToolset().
|
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 81 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx().
|
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(), DrawDungeonMapsRoomGfx(), and DrawDungeonMapsTabs().
|
private |
Definition at line 84 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx(), 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 Load().
|
private |
Definition at line 91 of file screen_editor.h.
Referenced by DrawDungeonMapsTabs(), and Load().
|
private |
Definition at line 93 of file screen_editor.h.
Referenced by DrawInventoryMenuEditor().
|
private |
Definition at line 94 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), Load(), and LoadBinaryGfx().
|
private |
Definition at line 95 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor(), DrawDungeonMapsRoomGfx(), DrawDungeonMapsTabs(), Load(), and LoadBinaryGfx().
|
private |
Definition at line 96 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx().
|
private |
Definition at line 98 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx().
|
private |
Definition at line 100 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx(), DrawDungeonMapsTabs(), DrawInventoryMenuEditor(), DrawInventoryToolset(), and ScreenEditor().
|
private |
Definition at line 101 of file screen_editor.h.
Referenced by DrawDungeonMapsRoomGfx(), and DrawInventoryMenuEditor().
|
private |
Definition at line 102 of file screen_editor.h.
Referenced by DrawDungeonMapsEditor().
|
private |
Definition at line 105 of file screen_editor.h.
Referenced by DrawInventoryMenuEditor().
|
private |
Definition at line 106 of file screen_editor.h.
Referenced by rom(), ScreenEditor(), and set_rom().
|
private |
Definition at line 107 of file screen_editor.h.
Referenced by DrawInventoryMenuEditor(), LoadBinaryGfx(), and Update().