1#ifndef YAZE_APP_EDITOR_DUNGEON_PANELS_OBJECT_TILE_EDITOR_PANEL_H_
2#define YAZE_APP_EDITOR_DUNGEON_PANELS_OBJECT_TILE_EDITOR_PANEL_H_
13#include "absl/status/status.h"
14#include "absl/status/statusor.h"
29struct ObjectTileEditorPanelTestAccess;
45 const std::vector<std::pair<uint32_t, uint32_t>>&)>;
50 std::string
GetId()
const override {
return "dungeon.object_tile_editor"; }
58 void Draw(
bool* p_open)
override;
67 const std::string& filename, int16_t object_id,
81 std::function<
void(
int,
const std::string&)> cb) {
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Panel for editing the tile8 composition of dungeon objects.
void SetStandardWritePreflightCallback(StandardWritePreflightCallback callback)
void ClearRenderedBitmaps()
StandardTilesAppliedCallback on_standard_tiles_applied_
absl::StatusOr< SourceImpactSnapshot > AnalyzeSourceImpactSnapshot() const
void ApplyChanges(bool confirm_shared=true)
void RequestSafeWindowClose(bool *p_open)
void DrawTileProperties()
void SetCurrentPaletteGroup(const gfx::PaletteGroup &group)
void SetCurrentPaletteGroupForRoom(int room_id, const gfx::PaletteGroup &group)
int GetPriority() const override
Get display priority for menu ordering.
ObjectTileEditorPanel(gfx::IRenderer *renderer, Rom *rom)
float GetPreferredHeight() const override
Get preferred height for this panel (optional)
gfx::PaletteGroup current_palette_group_
void SetObjectCreatedCallback(std::function< void(int, const std::string &)> cb)
ActionStatusTone action_status_tone_
absl::Status WriteBackCurrentLayout()
std::string BuildWindowTitle() const
std::function< void()> StandardTilesAppliedCallback
std::unique_ptr< zelda3::ObjectTileEditor > tile_editor_
void ResetTransientState()
bool HasRenderableRoomContext() const
std::function< void(int, const std::string &) on_object_created_)
void RenderObjectPreview()
int16_t current_object_id_
void OnClose() override
Called when panel is hidden.
absl::StatusOr< bool > HasSharedTileDataConflict() const
std::optional< SourceImpactDisplayCacheKey > source_impact_display_cache_key_
float GetPreferredWidth() const override
Get preferred width for this panel (optional)
void RefreshRenderedViewsFromCurrentRoom()
friend struct ObjectTileEditorPanelTestAccess
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
StandardWritePreflightCallback standard_write_preflight_
gfx::Bitmap object_preview_bmp_
zelda3::ObjectTileLayout current_layout_
int shared_tile_data_usage_override_
absl::Status OpenForNewObject(int width, int height, const std::string &filename, int16_t object_id, int room_id, DungeonRoomStore *rooms)
absl::Status OpenForObject(int16_t object_id, int room_id, DungeonRoomStore *rooms)
void SyncSourceSelectionFromSelectedCell()
std::string GetIcon() const override
Material Design icon for this panel.
gfx::IRenderer * renderer_
bool HasUnappliedChanges() const
std::string action_status_message_
std::optional< absl::StatusOr< int > > source_impact_display_cache_result_
int selected_source_tile_
void Draw(bool *p_open) override
Draw the panel content.
bool show_shared_confirm_
gfx::Bitmap tile8_atlas_bmp_
std::function< absl::Status( const std::vector< std::pair< uint32_t, uint32_t > > &)> StandardWritePreflightCallback
absl::StatusOr< int > GetDisplayedSharedTileDataUsageCount()
uint64_t BuildSourceImpactProvenanceFingerprint() const
gui::Canvas tile_grid_canvas_
gui::Canvas source_sheet_canvas_
void SetStandardTilesAppliedCallback(StandardTilesAppliedCallback callback)
void SelectFirstCellIfAvailable()
std::string GetId() const override
Unique identifier for this panel.
void HandleKeyboardShortcuts(bool *p_open)
DungeonRoomStore * rooms_
void DrawActionBar(bool *p_open)
void SetActionStatus(ActionStatusTone tone, std::string message)
absl::StatusOr< int > GetSharedTileDataUsageCount() const
std::optional< SourceImpactSnapshot > pending_shared_confirmation_
Base interface for all logical window content components.
Represents a bitmap image optimized for SNES ROM hacking.
Defines an abstract interface for all rendering operations.
Modern, robust canvas for drawing and manipulating graphics.
bool operator==(const SourceImpactDisplayCacheKey &) const =default
uint64_t provenance_fingerprint
bool operator==(const SourceImpactSnapshot &) const =default
Represents a group of palettes.
Editable tile8 layout captured from an object's draw trace.
bool HasModifications() const