14 : scope_type_{scope_type}, scope_{std::move(scope)}, source_info_{std::move(source_info)}
20 return "OverrideConfigProvider(" + source_info_ +
")";
23bool OverrideConfigProvider::scope_matches(
ConfigScopeType type,
const std::string &scope)
const
25 return type == scope_type_ && scope == scope_;
30 num_tiles_in_primary_override_ = std::move(value);
35 num_tiles_total_override_ = std::move(value);
40 num_metatiles_in_primary_override_ = std::move(value);
45 num_metatiles_total_override_ = std::move(value);
50 num_palettes_in_primary_override_ = std::move(value);
55 num_palettes_total_override_ = std::move(value);
60 max_map_data_size_override_ = std::move(value);
65 num_tiles_per_metatile_override_ = std::move(value);
70 extrinsic_transparency_override_ = std::move(value);
75 ignore_triple_layer_content_override_ = std::move(value);
80 tiles_edit_mode_override_ = std::move(value);
85 palettes_edit_mode_override_ = std::move(value);
90 palette_hints_enabled_override_ = std::move(value);
95 palette_hints_override_ = std::move(value);
100 packing_strategy_override_ = std::move(value);
105 packing_strategy_params_override_ = std::move(value);
110 tile_sharing_packing_override_ = std::move(value);
115 tile_sharing_alignment_override_ = std::move(value);
120 tiles_palette_mode_override_ = std::move(value);
125 global_anim_palette_resolution_strategy_override_ = std::move(value);
130 global_anim_key_frame_resolution_strategy_override_ = std::move(value);
136 global_anim_multi_palette_subtile_resolution_strategy_override_ = std::move(value);
141 global_frame_linking_override_ = std::move(value);
146 per_anim_overrides_override_ = std::move(value);
151 cross_tileset_anim_linking_override_ = std::move(value);
156 verify_checksums_override_ = std::move(value);
161 primary_pairing_mode_override_ = std::move(value);
166 primary_pairing_partners_override_ = std::move(value);
171 diagnostic_warnings_exclude_override_ = std::move(value);
176 diagnostic_warnings_include_override_ = std::move(value);
181 diagnostic_remarks_exclude_override_ = std::move(value);
186 diagnostic_remarks_include_override_ = std::move(value);
191 tileset_paths_primary_src_override_ = std::move(value);
196 tileset_paths_primary_bin_override_ = std::move(value);
201 tileset_paths_secondary_src_override_ = std::move(value);
206 tileset_paths_secondary_bin_override_ = std::move(value);
211 metatile_attribute_size_override_ = std::move(value);
216 metatile_attribute_declaration_size_override_ = std::move(value);
221 metatile_attribute_fields_override_ = std::move(value);
226 metatile_attribute_field_overrides_override_ = std::move(value);
231 role_pins_override_ = std::move(value);
236 tileset_animations_wire_anim_code_override_ = std::move(value);
242 if (!scope_matches(type, scope) || !num_tiles_in_primary_override_.has_value()) {
250 if (!scope_matches(type, scope) || !num_tiles_total_override_.has_value()) {
259 if (!scope_matches(type, scope) || !num_metatiles_in_primary_override_.has_value()) {
263 num_metatiles_in_primary_override_.value(),
"num_metatiles_in_primary", source_info_);
269 if (!scope_matches(type, scope) || !num_metatiles_total_override_.has_value()) {
278 if (!scope_matches(type, scope) || !num_palettes_in_primary_override_.has_value()) {
282 num_palettes_in_primary_override_.value(),
"num_palettes_in_primary", source_info_);
287 if (!scope_matches(type, scope) || !num_palettes_total_override_.has_value()) {
295 if (!scope_matches(type, scope) || !max_map_data_size_override_.has_value()) {
304 if (!scope_matches(type, scope) || !num_tiles_per_metatile_override_.has_value()) {
308 num_tiles_per_metatile_override_.value(),
"num_tiles_per_metatile", source_info_);
313 if (!scope_matches(type, scope) || !extrinsic_transparency_override_.has_value()) {
322 if (!scope_matches(type, scope) || !ignore_triple_layer_content_override_.has_value()) {
326 ignore_triple_layer_content_override_.value(),
"ignore_triple_layer_content", source_info_);
332 if (!scope_matches(type, scope) || !tiles_edit_mode_override_.has_value()) {
341 if (!scope_matches(type, scope) || !palettes_edit_mode_override_.has_value()) {
345 palettes_edit_mode_override_.value(),
"palettes_edit_mode", source_info_);
350 if (!scope_matches(type, scope) || !palette_hints_enabled_override_.has_value()) {
353 return LayerValue<bool>::valid(palette_hints_enabled_override_.value(),
"palette_hints_enabled", source_info_);
359 if (!scope_matches(type, scope) || !palette_hints_override_.has_value()) {
368 if (!scope_matches(type, scope) || !packing_strategy_override_.has_value()) {
377 if (!scope_matches(type, scope) || !packing_strategy_params_override_.has_value()) {
381 packing_strategy_params_override_.value(),
"packing_strategy_params", source_info_);
387 if (!scope_matches(type, scope) || !tile_sharing_packing_override_.has_value()) {
391 tile_sharing_packing_override_.value(),
"tile_sharing_packing", source_info_);
397 if (!scope_matches(type, scope) || !tile_sharing_alignment_override_.has_value()) {
401 tile_sharing_alignment_override_.value(),
"tile_sharing_alignment", source_info_);
407 if (!scope_matches(type, scope) || !tiles_palette_mode_override_.has_value()) {
411 tiles_palette_mode_override_.value(),
"tiles_palette_mode", source_info_);
417 if (!scope_matches(type, scope) || !global_anim_palette_resolution_strategy_override_.has_value()) {
421 global_anim_palette_resolution_strategy_override_.value(),
422 "global_anim_palette_resolution_strategy",
429 if (!scope_matches(type, scope) || !global_anim_key_frame_resolution_strategy_override_.has_value()) {
433 global_anim_key_frame_resolution_strategy_override_.value(),
434 "global_anim_key_frame_resolution_strategy",
442 if (!scope_matches(type, scope) || !global_anim_multi_palette_subtile_resolution_strategy_override_.has_value()) {
446 global_anim_multi_palette_subtile_resolution_strategy_override_.value(),
447 "global_anim_multi_palette_subtile_resolution_strategy",
454 if (!scope_matches(type, scope) || !global_frame_linking_override_.has_value()) {
458 global_frame_linking_override_.value(),
"global_frame_linking", source_info_);
464 if (!scope_matches(type, scope) || !per_anim_overrides_override_.has_value()) {
468 per_anim_overrides_override_.value(),
"per_anim_overrides", source_info_);
474 if (!scope_matches(type, scope) || !cross_tileset_anim_linking_override_.has_value()) {
478 cross_tileset_anim_linking_override_.value(),
"cross_tileset_anim_linking", source_info_);
483 if (!scope_matches(type, scope) || !verify_checksums_override_.has_value()) {
492 if (!scope_matches(type, scope) || !primary_pairing_mode_override_.has_value()) {
496 primary_pairing_mode_override_.value(),
"primary_pairing_mode", source_info_);
502 if (!scope_matches(type, scope) || !primary_pairing_partners_override_.has_value()) {
506 primary_pairing_partners_override_.value(),
"primary_pairing_partners", source_info_);
512 if (!scope_matches(type, scope) || !diagnostic_warnings_exclude_override_.has_value()) {
516 diagnostic_warnings_exclude_override_.value(),
"diagnostic_warnings_exclude", source_info_);
522 if (!scope_matches(type, scope) || !diagnostic_warnings_include_override_.has_value()) {
526 diagnostic_warnings_include_override_.value(),
"diagnostic_warnings_include", source_info_);
532 if (!scope_matches(type, scope) || !diagnostic_remarks_exclude_override_.has_value()) {
536 diagnostic_remarks_exclude_override_.value(),
"diagnostic_remarks_exclude", source_info_);
542 if (!scope_matches(type, scope) || !diagnostic_remarks_include_override_.has_value()) {
546 diagnostic_remarks_include_override_.value(),
"diagnostic_remarks_include", source_info_);
552 if (!scope_matches(type, scope) || !tileset_paths_primary_src_override_.has_value()) {
556 tileset_paths_primary_src_override_.value(),
"tileset_paths_primary_src", source_info_);
562 if (!scope_matches(type, scope) || !tileset_paths_primary_bin_override_.has_value()) {
566 tileset_paths_primary_bin_override_.value(),
"tileset_paths_primary_bin", source_info_);
572 if (!scope_matches(type, scope) || !tileset_paths_secondary_src_override_.has_value()) {
576 tileset_paths_secondary_src_override_.value(),
"tileset_paths_secondary_src", source_info_);
582 if (!scope_matches(type, scope) || !tileset_paths_secondary_bin_override_.has_value()) {
586 tileset_paths_secondary_bin_override_.value(),
"tileset_paths_secondary_bin", source_info_);
592 if (!scope_matches(type, scope) || !metatile_attribute_size_override_.has_value()) {
596 metatile_attribute_size_override_.value(),
"metatile_attribute_size", source_info_);
602 if (!scope_matches(type, scope) || !metatile_attribute_declaration_size_override_.has_value()) {
606 metatile_attribute_declaration_size_override_.value(),
"metatile_attribute_declaration_size", source_info_);
612 if (!scope_matches(type, scope) || !metatile_attribute_fields_override_.has_value()) {
616 metatile_attribute_fields_override_.value(),
"metatile_attribute_fields", source_info_);
622 if (!scope_matches(type, scope) || !metatile_attribute_field_overrides_override_.has_value()) {
626 metatile_attribute_field_overrides_override_.value(),
"metatile_attribute_field_overrides", source_info_);
631 if (!scope_matches(type, scope) || !role_pins_override_.has_value()) {
640 if (!scope_matches(type, scope) || !tileset_animations_wire_anim_code_override_.has_value()) {
644 tileset_animations_wire_anim_code_override_.value(),
"tileset_animations_wire_anim_code", source_info_);
LayerValue< std::string > tileset_paths_secondary_bin(ConfigScopeType type, const std::string &scope) const override
void set_num_tiles_total(std::size_t value)
LayerValue< AnimMultiPaletteSubtileResolutionStrategy > global_anim_multi_palette_subtile_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
void set_role_pins(RolePinDefinitions value)
LayerValue< PerAnimOverrides > per_anim_overrides(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > diagnostic_remarks_include(ConfigScopeType type, const std::string &scope) const override
void set_global_anim_key_frame_resolution_strategy(AnimKeyFrameResolutionStrategy value)
LayerValue< std::string > tileset_paths_primary_src(ConfigScopeType type, const std::string &scope) const override
LayerValue< RolePinDefinitions > role_pins(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > max_map_data_size(ConfigScopeType type, const std::string &scope) const override
void set_global_frame_linking(FrameLinking value)
LayerValue< FrameLinking > global_frame_linking(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_metatiles_in_primary(ConfigScopeType type, const std::string &scope) const override
void set_tileset_paths_secondary_src(std::string value)
LayerValue< std::size_t > num_palettes_in_primary(ConfigScopeType type, const std::string &scope) const override
void set_global_anim_palette_resolution_strategy(AnimPaletteResolutionStrategy value)
void set_metatile_attribute_fields(MetatileAttributeFieldDefinitions value)
LayerValue< bool > cross_tileset_anim_linking(ConfigScopeType type, const std::string &scope) const override
void set_palettes_edit_mode(ArtifactEditMode value)
void set_num_palettes_in_primary(std::size_t value)
void set_num_metatiles_total(std::size_t value)
LayerValue< AnimKeyFrameResolutionStrategy > global_anim_key_frame_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
void set_num_metatiles_in_primary(std::size_t value)
OverrideConfigProvider(ConfigScopeType scope_type, std::string scope, std::string source_info)
Constructs an OverrideConfigProvider scoped to a single config scope.
void set_primary_pairing_mode(PrimaryPairingMode value)
void set_palette_hints(std::vector< PaletteHint > value)
LayerValue< PackingStrategyType > packing_strategy(ConfigScopeType type, const std::string &scope) const override
void set_packing_strategy(PackingStrategyType value)
LayerValue< std::vector< std::string > > diagnostic_warnings_exclude(ConfigScopeType type, const std::string &scope) const override
void set_tile_sharing_packing(TileSharingPacking value)
void set_tiles_palette_mode(TilesPaletteMode value)
void set_palette_hints_enabled(bool value)
void set_diagnostic_warnings_exclude(std::vector< std::string > value)
void set_metatile_attribute_field_overrides(MetatileAttributeFieldOverrides value)
void set_max_map_data_size(std::size_t value)
LayerValue< bool > ignore_triple_layer_content(ConfigScopeType type, const std::string &scope) const override
void set_extrinsic_transparency(Rgba32 value)
LayerValue< std::vector< std::string > > diagnostic_warnings_include(ConfigScopeType type, const std::string &scope) const override
void set_cross_tileset_anim_linking(bool value)
void set_tileset_animations_wire_anim_code(bool value)
LayerValue< std::size_t > num_tiles_in_primary(ConfigScopeType type, const std::string &scope) const override
void set_tiles_edit_mode(ArtifactEditMode value)
LayerValue< std::optional< std::size_t > > metatile_attribute_declaration_size(ConfigScopeType type, const std::string &scope) const override
LayerValue< bool > tileset_animations_wire_anim_code(ConfigScopeType type, const std::string &scope) const override
void set_num_tiles_per_metatile(std::size_t value)
void set_packing_strategy_params(PackingStrategyParams value)
LayerValue< PrimaryPairingMode > primary_pairing_mode(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > primary_pairing_partners(ConfigScopeType type, const std::string &scope) const override
void set_tileset_paths_primary_src(std::string value)
void set_metatile_attribute_size(std::optional< std::size_t > value)
void set_diagnostic_remarks_include(std::vector< std::string > value)
LayerValue< std::string > tileset_paths_secondary_src(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_palettes_total(ConfigScopeType type, const std::string &scope) const override
LayerValue< Rgba32 > extrinsic_transparency(ConfigScopeType type, const std::string &scope) const override
LayerValue< TilesPaletteMode > tiles_palette_mode(ConfigScopeType type, const std::string &scope) const override
void set_per_anim_overrides(PerAnimOverrides value)
void set_diagnostic_remarks_exclude(std::vector< std::string > value)
void set_ignore_triple_layer_content(bool value)
void set_tileset_paths_secondary_bin(std::string value)
LayerValue< bool > verify_checksums(ConfigScopeType type, const std::string &scope) const override
LayerValue< ArtifactEditMode > tiles_edit_mode(ConfigScopeType type, const std::string &scope) const override
std::string name() const override
Gets the name of this ConfigProvider, useful for diagnostic purposes.
void set_diagnostic_warnings_include(std::vector< std::string > value)
LayerValue< std::size_t > num_tiles_total(ConfigScopeType type, const std::string &scope) const override
void set_metatile_attribute_declaration_size(std::optional< std::size_t > value)
LayerValue< TileSharingAlignment > tile_sharing_alignment(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > diagnostic_remarks_exclude(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< PaletteHint > > palette_hints(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_tiles_per_metatile(ConfigScopeType type, const std::string &scope) const override
void set_verify_checksums(bool value)
LayerValue< TileSharingPacking > tile_sharing_packing(ConfigScopeType type, const std::string &scope) const override
LayerValue< PackingStrategyParams > packing_strategy_params(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_metatiles_total(ConfigScopeType type, const std::string &scope) const override
void set_tile_sharing_alignment(TileSharingAlignment value)
void set_primary_pairing_partners(std::vector< std::string > value)
LayerValue< AnimPaletteResolutionStrategy > global_anim_palette_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
void set_tileset_paths_primary_bin(std::string value)
LayerValue< MetatileAttributeFieldOverrides > metatile_attribute_field_overrides(ConfigScopeType type, const std::string &scope) const override
void set_num_palettes_total(std::size_t value)
LayerValue< MetatileAttributeFieldDefinitions > metatile_attribute_fields(ConfigScopeType type, const std::string &scope) const override
LayerValue< ArtifactEditMode > palettes_edit_mode(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::string > tileset_paths_primary_bin(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::optional< std::size_t > > metatile_attribute_size(ConfigScopeType type, const std::string &scope) const override
void set_num_tiles_in_primary(std::size_t value)
void set_global_anim_multi_palette_subtile_resolution_strategy(AnimMultiPaletteSubtileResolutionStrategy value)
LayerValue< bool > palette_hints_enabled(ConfigScopeType type, const std::string &scope) const override
Represents a 32-bit RGBA color.
PrimaryPairingMode
Controls how a secondary tileset finds its partner primary for compilation.
std::map< std::string, MetatileAttributeFieldOverride > MetatileAttributeFieldOverrides
A map from field name to its override; applied at schema load time.
std::vector< RolePinDefinition > RolePinDefinitions
An ordered list of role pin definitions; order is display/declaration order (also CSV column order).
TileSharingAlignment
Controls palette slot alignment strategy for tile sharing deduplication.
std::vector< MetatileAttributeFieldDefinition > MetatileAttributeFieldDefinitions
An ordered list of metatile attribute field definitions; order is display/declaration order.
TilesPaletteMode
Controls how tiles.png is rendered.
ArtifactEditMode
Specifies whether artifacts (tiles or palettes) can be modified during patch compilation.
AnimPaletteResolutionStrategy
Strategy for determining which palette to use when decompiling animation tiles.
std::unordered_map< std::string, PerAnimOverride > PerAnimOverrides
Per-animation configuration map.
TileSharingPacking
Controls whether palette packing considers tile sharing shape group membership.
@ not_provided
nothing attribute-related was found; other providers should be consulted
@ valid
one or more usable candidate sets were inferred
AnimKeyFrameResolutionStrategy
Strategy for handling duplicate key frame tiles in animation decompilation.
FrameLinking
Controls how animation frames are linked to metatile entries.
ConfigScopeType
Specifies the scope type for configuration value lookups.
AnimMultiPaletteSubtileResolutionStrategy
Strategy for handling animation subtiles referenced with multiple palettes.
PackingStrategyType
Selects the palette packing algorithm to use during tileset compilation.
A small container that holds an optional-wrapped value, validation state, and metadata about the valu...
static LayerValue valid(T val, std::string source_key, std::string source_info)
Creates a LayerValue representing a valid configuration value.
static LayerValue not_provided()
Creates a LayerValue representing that the provider does not supply this configuration.
Container for per-strategy packing parameters.