yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
catalog_tile_browser.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_GRAPHICS_CATALOG_TILE_BROWSER_H_
2#define YAZE_APP_EDITOR_GRAPHICS_CATALOG_TILE_BROWSER_H_
3
4#include <optional>
5#include <set>
6#include <string>
7#include <vector>
8
13#include "app/gfx/core/bitmap.h"
15
16namespace yaze::editor {
17class GraphicsEditorState;
18class UndoManager;
19
20// Transient source selection; authored pixels remain in the session sheet store.
26 std::string path;
27 std::string loaded_path;
28 std::string search;
30 // 0 shows every kind; see CatalogKindFilterOptions in the browser.
31 int kind_filter = 0;
32 std::string palette_search;
33 std::string status;
34 std::vector<CatalogSheetSource> sources;
35 std::vector<CatalogPreviewPalette> palettes;
36 int source = -1;
37 int palette = -1; // -1 grayscale, -2 destination, -3 source asset colors.
40 int drag_start = -1;
41 bool preserve_layout = true;
42 std::set<int> selected;
43 std::optional<CatalogTileTransferPlan> pending;
44 const void* destination_owner = nullptr;
46 bool default_attempted = false;
47 std::string asset_cache_id;
48 std::optional<CatalogAssetPreview> asset_preview;
50 int art_drag_x = -1, art_drag_y = -1;
51 std::optional<PixelIndexPlan> object_pending;
52 std::optional<uint64_t> candidate_source_revision;
56 gui::Canvas staged_canvas{"CatalogStagedPreview", ImVec2(256, 256),
58};
59
60// Transactional browser commands shared with automated UI tests. A failed
61// catalog load retains the prior loaded library and candidate. Try is detached;
62// Apply uses the existing fixed-palette multi-sheet pixel transaction.
63absl::Status LoadCatalogTileBrowser(CatalogTileBrowserState& browser,
64 const std::string& filename);
65absl::Status TryCatalogArtOnObject(CatalogTileBrowserState& browser,
66 GraphicsEditorState& destination);
67absl::Status ApplyCatalogArtToObject(CatalogTileBrowserState& browser,
68 GraphicsEditorState& destination,
69 UndoManager& history);
70void CancelCatalogArtPreview(CatalogTileBrowserState& browser);
71absl::Status ValidateCatalogArtPreview(CatalogTileBrowserState& browser,
72 const GraphicsEditorState& destination);
73
74void DrawCatalogTileBrowser(CatalogTileBrowserState& browser,
75 GraphicsEditorState& destination,
76 UndoManager* undo_manager,
77 const std::string& destination_usage);
78} // namespace yaze::editor
79#endif
Represents a bitmap image optimized for SNES ROM hacking.
Definition bitmap.h:70
Modern, robust canvas for drawing and manipulating graphics.
Definition canvas.h:64
Editors are the view controllers for the application.
void CancelCatalogArtPreview(CatalogTileBrowserState &browser)
void DrawCatalogTileBrowser(CatalogTileBrowserState &browser, GraphicsEditorState &destination, UndoManager *undo_manager, const std::string &destination_usage)
absl::Status ValidateCatalogArtPreview(CatalogTileBrowserState &browser, const GraphicsEditorState &destination)
absl::Status LoadCatalogTileBrowser(CatalogTileBrowserState &browser, const std::string &filename)
absl::Status ApplyCatalogArtToObject(CatalogTileBrowserState &browser, GraphicsEditorState &destination, UndoManager &history)
absl::Status TryCatalogArtOnObject(CatalogTileBrowserState &browser, GraphicsEditorState &destination)
Room transition destination.
Definition zelda.h:448
std::optional< CatalogTileTransferPlan > pending
std::optional< uint64_t > candidate_source_revision
CatalogTileBrowserState & operator=(const CatalogTileBrowserState &)=delete
CatalogTileBrowserState(const CatalogTileBrowserState &)=delete
std::optional< PixelIndexPlan > object_pending
std::optional< CatalogAssetPreview > asset_preview
std::vector< CatalogSheetSource > sources
std::vector< CatalogPreviewPalette > palettes