19 if (metadata_provider_->
exists(tileset_name)) {
21 std::vector<std::string>{
"Cannot create tileset '{}'.",
"A tileset with this name already exists."},
30 "Failed to create Porytiles source assets for '{}'.",
34 auto porymap_component = std::make_unique<PorymapTilesetComponent>();
36 std::make_unique<Tileset>(tileset_name, std::move(porytiles_component), std::move(porymap_component));
45 auto create_override = std::make_unique<OverrideConfigProvider>(
47 create_override->set_extrinsic_transparency(
rgba_magenta);
50 domain_config_->
add_provider(std::move(create_override));
57 "Compilation failed for '{}'.",
65 "Failed to persist managed state for '{}'.",
70 tileset_repo_->
save(*compiled_tileset),
72 "Failed to save tileset '{}'.",
76 if (!compiled_tileset->porymap_component().anims().empty()) {
81 "Failed to wire animation code for '{}'.",
89 "Failed to remove wired animation code for '{}'.",
#define PT_TRY_ASSIGN_CHAIN_ERR(var, expr, return_type,...)
Unwraps a ChainableResult, chaining a new error message on failure.
#define PT_TRY_CALL_CHAIN_ERR(expr, return_type,...)
Unwraps a void ChainableResult, chaining a new error message on failure.
A result type that maintains a chainable sequence of errors for debugging and error reporting.
ChainableResult< void > create(const std::string &tileset_name) const
Creates a new primary Tileset with the given name.
virtual void add_provider(std::unique_ptr< ConfigProvider > provider)=0
Prepends a ConfigProvider to the provider chain at highest priority.
virtual ChainableResult< void > wire_anim_code(const std::string &tileset_name, bool is_secondary) const =0
Wires animation code for a tileset that already has its manifest persisted.
virtual ChainableResult< void > persist_managed_new(const std::string &tileset_name, bool is_secondary=false) const =0
Persists managed state for a new tileset.
virtual ChainableResult< void > remove_wired_anim_code(const std::string &tileset_name, bool is_secondary) const =0
Removes wired animation code for a tileset from the project.
static const Style bold
Bold text formatting.
ChainableResult< std::unique_ptr< Tileset > > compile(const Tileset &tileset, bool is_secondary=false, const Tileset *paired_primary=nullptr) const
Compiles the given Tileset, producing a new Tileset with compiled Porymap assets.
ChainableResult< std::unique_ptr< PorytilesTilesetComponent > > create_sample_primary_porytiles_component(const std::string &tileset_name) const
Creates a new basic primary PorytilesTilesetComponent with some default assets.
ChainableResult< void > save(const Tileset &tileset) const
Persists a given Tileset and caches new artifact checksums.
constexpr Rgba32 rgba_magenta
@ optimize
The Porytiles1 behavior; artifact is cleared and packed optimally.
@ tileset
Configuration scoped to a specific tileset.