1#ifndef YAZE_APP_EDITOR_OVERWORLDEDITOR_H
2#define YAZE_APP_EDITOR_OVERWORLDEDITOR_H
5#include <unordered_map>
7#include "absl/container/flat_hash_map.h"
8#include "absl/status/status.h"
9#include "absl/status/statusor.h"
10#include "absl/strings/str_format.h"
24#include "imgui/imgui.h"
44 ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable;
47 ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable |
48 ImGuiTableFlags_Hideable | ImGuiTableFlags_BordersOuter |
49 ImGuiTableFlags_BordersV;
51static constexpr absl::string_view kToolsetColumnNames[] = {
52 "#undoTool",
"#redoTool",
"#separator2",
"#zoomOutTool",
53 "#zoomInTool",
"#separator",
"#drawTool",
"#history",
54 "#entranceTool",
"#exitTool",
"#itemTool",
"#spriteTool",
55 "#transportTool",
"#musicTool",
"#separator3",
"#tilemapTool",
56 "propertiesTool",
"#separator4",
"#experimentalTool",
"#properties",
60 "Light World\0Dark World\0Extra World\0";
86 return absl::OkStatus();
120 absl::Status
Update() final;
121 absl::Status
Undo()
override {
return absl::UnimplementedError(
"Undo"); }
122 absl::Status
Redo()
override {
return absl::UnimplementedError(
"Redo"); }
123 absl::Status
Cut()
override {
return absl::UnimplementedError(
"Cut"); }
124 absl::Status
Copy()
override {
return absl::UnimplementedError(
"Copy"); }
125 absl::Status
Paste()
override {
return absl::UnimplementedError(
"Paste"); }
127 return absl::UnimplementedError(
"Find Unused Tiles");
184 const std::vector<uint8_t>& tile_data);
Shared graphical context across editors.
The Rom class is used to load, save, and modify Rom data.
absl::StatusOr< uint16_t > ReadWord(int offset)
A class to hold a shared pointer to a Rom object.
A class to manage experimental feature flags.
Interface for editor classes.
std::vector< uint16_t > entrance_tile_types_low_
absl::Status LoadEntranceTileTypes(Rom &rom)
std::vector< uint16_t > entrance_tile_types_high_
Manage graphics group configurations in a Rom.
Manipulates the Overworld and OverworldMap data in a Rom.
void RefreshMapProperties()
absl::Status Redo() override
zelda3::overworld::OverworldItem current_item_
gui::Canvas blockset_canvas_
absl::Status Update() final
EditingMode previous_mode
zelda3::GameEntity * current_entity_
std::vector< gfx::Bitmap > tile16_individual_
zelda3::GameEntity * dragged_entity_
std::vector< std::vector< uint8_t > > tile16_individual_data_
gfx::BitmapTable current_graphics_set_
void DrawOverworldItems()
Tile16Editor tile16_editor_
PaletteEditor palette_editor_
gfx::SnesPalette palette_
zelda3::Sprite current_sprite_
GfxGroupEditor gfx_group_editor_
absl::Status Copy() override
absl::Status Paste() override
gui::Canvas graphics_bin_canvas_
void DrawOverworldCanvas()
Allows the user to make changes to the overworld map.
absl::Status Cut() override
void DrawCustomOverworldMapSettings()
Draw the overworld settings for ZSCustomOverworld.
void DrawOverworldEntrances(ImVec2 canvas_p, ImVec2 scrolling, bool holes=false)
void DrawFullscreenCanvas()
Draws the canvas, tile16 selector, and toolset in fullscreen.
gfx::Bitmap selected_tile_bmp_
absl::Status CheckForCurrentMap()
Check for changes to the overworld map. Calls RefreshOverworldMap and RefreshTile16Blockset on the cu...
gui::Canvas ow_map_canvas_
void CheckForSelectRectangle()
Draw and create the tile16 IDs that are currently selected.
absl::Status DrawAreaGraphics()
gui::Canvas current_gfx_canvas_
zelda3::overworld::Overworld overworld_
absl::Status UpdateUsageStats()
gfx::BitmapTable maps_bmp_
absl::Status Undo() override
absl::Status LoadSpriteGraphics()
std::vector< gfx::Bitmap > tile8_individual_
void DrawOverworldEdits()
absl::Status RefreshTile16Blockset()
bool map_blockset_loaded_
std::vector< std::vector< uint8_t > > tile8_individual_data_
bool middle_mouse_dragging_
void DrawOverworldSprites()
std::vector< uint8_t > selected_tile_data_
absl::Status RefreshMapPalette()
void RefreshChildMap(int i)
zelda3::overworld::OverworldExit current_exit_
gui::Canvas properties_canvas_
absl::Status Find() override
gui::zeml::Node layout_node_
gfx::Bitmap current_gfx_bmp_
zelda3::overworld::OverworldEntrance current_entrance_
gfx::BitmapTable sprite_previews_
zelda3::OWBlockset refresh_blockset_
void DrawOverworldProperties()
void DrawOverworldExits(ImVec2 zero, ImVec2 scrolling)
absl::Status DrawTile16Selector()
void RenderUpdatedMapBitmap(const ImVec2 &click_position, const std::vector< uint8_t > &tile_data)
void RefreshOverworldMap()
void CheckForOverworldEdits()
Check for changes to the overworld map.
absl::Status LoadGraphics()
Load the Bitmap objects for each OverworldMap.
bool selected_tile_loaded_
void DrawToolset()
Toolset for entrances, exits, items, sprites, and transports.
bool overworld_canvas_fullscreen_
gfx::Bitmap tile16_blockset_bmp_
absl::Status DrawTileSelector()
void DrawOverworldMapSettings()
Draws the overworld map settings. Graphics, palettes, etc.
Allows the user to view and edit in game palettes.
Popup window to edit Tile16 data.
Represents a bitmap image.
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
Represents a canvas for drawing and manipulating graphics.
Base class for all overworld and dungeon entities.
A class for managing sprites in the overworld and underworld.
Represents the full Overworld data, light and dark world.
#define ASSIGN_OR_RETURN(type_variable_name, expression)
constexpr int kEntranceTileTypePtrHigh
constexpr uint kOverworldMapSize
constexpr absl::string_view kTileSelectorTab
constexpr ImVec2 kOverworldCanvasSize(kOverworldMapSize *8, kOverworldMapSize *8)
constexpr absl::string_view kOWMapTable
constexpr ImGuiTableFlags kOWMapFlags
constexpr int kEntranceTileTypePtrLow
constexpr absl::string_view kGamePartComboString
constexpr uint kTile8DisplayHeight
constexpr uint kNumSheetsToLoad
constexpr ImVec2 kGraphicsBinCanvasSize(0x100+1, kNumSheetsToLoad *0x40+1)
constexpr ImVec2 kBlocksetCanvasSize(0x100+1, 0x4000+1)
constexpr uint kMessageIdSize
constexpr ImGuiTableFlags kOWEditFlags
constexpr ImGuiTableFlags kToolsetTableFlags
constexpr absl::string_view kWorldList
constexpr ImVec2 kCurrentGfxCanvasSize(0x100+1, 0x10 *0x40+1)
constexpr int kNumEntranceTileTypes
constexpr float kInputFieldSize
constexpr absl::string_view kOWEditTable
std::unordered_map< int, gfx::Bitmap > BitmapTable
std::vector< std::vector< uint16_t > > OWBlockset
Represents tile32 data for the overworld.