18 if (metadata_provider_->
exists(tileset_name)) {
20 std::vector<std::string>{
"Cannot create tileset '{}'.",
"A tileset with this name already exists."},
33 primary_pairing_partners,
36 layout_metadata_provider_,
40 "Failed to resolve partner primary for secondary '{}'.",
48 "Failed to create Porytiles source assets for '{}'.",
52 auto porymap_component = std::make_unique<PorymapTilesetComponent>();
54 std::make_unique<Tileset>(tileset_name, std::move(porytiles_component), std::move(porymap_component));
63 auto create_override = std::make_unique<OverrideConfigProvider>(
65 create_override->set_extrinsic_transparency(
rgba_magenta);
68 domain_config_->
add_provider(std::move(create_override));
75 "Compilation failed for '{}'.",
82 "Failed to persist managed state for '{}'.",
87 tileset_repo_->
save(*compiled_tileset),
89 "Failed to save tileset '{}'.",
93 if (!compiled_tileset->porymap_component().anims().empty()) {
97 "Failed to wire animation code for '{}'.",
104 "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 secondary 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_secondary_porytiles_component(const std::string &tileset_name) const
Creates a new basic secondary PorytilesTilesetComponent with some default assets.
ChainableResult< void > save(const Tileset &tileset) const
Persists a given Tileset and caches new artifact checksums.
ChainableResult< std::unique_ptr< Tileset > > resolve_partner_primary(const std::string &tileset_name, const ConfigValue< PrimaryPairingMode > &pairing_mode, const ConfigValue< std::vector< std::string > > &partners, const TilesetRepo *tileset_repo, const TilesetMetadataProvider *metadata_provider, const LayoutMetadataProvider *layout_metadata_provider, const PorytilesTilesetManager *tileset_manager, const UserDiagnostics *diag)
Resolves the partner primary tileset for a secondary tileset.
constexpr Rgba32 rgba_magenta
@ optimize
The Porytiles1 behavior; artifact is cleared and packed optimally.
@ tileset
Configuration scoped to a specific tileset.
#define PT_UNWRAP_TILESET_CONFIG_PTR(ptr, config, tileset_name, return_type)
Unwraps a tileset-scoped config value via pointer access, returning early if the value is not availab...