| 466 | } |
| 467 | |
| 468 | void zelda64::renderer::enable_texture_pack(const recomp::mods::ModContext& context, const recomp::mods::ModHandle& mod) { |
| 469 | texture_pack_action_queue.enqueue(TexturePackEnableAction{mod.manifest.mod_id}); |
| 470 | |
| 471 | // Check for the texture pack enabled config option. |
| 472 | const recomp::mods::ConfigSchema& config_schema = context.get_mod_config_schema(mod.manifest.mod_id); |
| 473 | auto find_it = config_schema.options_by_id.find(zelda64::renderer::special_option_texture_pack_enabled); |
| 474 | if (find_it != config_schema.options_by_id.end()) { |
| 475 | const recomp::mods::ConfigOption& config_option = config_schema.options[find_it->second]; |
| 476 | |
| 477 | if (is_texture_pack_enable_config_option(config_option, false)) { |
| 478 | recomp::mods::ConfigValueVariant value_variant = context.get_mod_config_value(mod.manifest.mod_id, config_option.id); |
| 479 | uint32_t value; |
| 480 | if (uint32_t* value_ptr = std::get_if<uint32_t>(&value_variant)) { |
| 481 | value = *value_ptr; |
| 482 | } |
| 483 | else { |
| 484 | value = 0; |
| 485 | } |
| 486 | |
| 487 | if (value) { |
| 488 | zelda64::renderer::secondary_enable_texture_pack(mod.manifest.mod_id); |
| 489 | } |
| 490 | else { |
| 491 | zelda64::renderer::secondary_disable_texture_pack(mod.manifest.mod_id); |
| 492 | } |
| 493 | } |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | void zelda64::renderer::disable_texture_pack(const recomp::mods::ModHandle& mod) { |
| 498 | texture_pack_action_queue.enqueue(TexturePackDisableAction{mod.manifest.mod_id}); |