diff --git a/crates/coa-core/src/modules.rs b/crates/coa-core/src/modules.rs index 3471cb9..a0d24dd 100644 --- a/crates/coa-core/src/modules.rs +++ b/crates/coa-core/src/modules.rs @@ -247,11 +247,21 @@ fn list_in(cat: &[Entry], root: &Path) -> Vec { let plugin_entry = plugin_reg.as_ref().and_then(|r| { r.plugins.get(&e.id) .or_else(|| r.plugins.get(&e.id.replace('-', "_"))) + .or_else(|| r.plugins.get(&format!("mod-{}", e.id))) + .or_else(|| r.plugins.get(&format!("mod-coa-{}", e.id))) }); let dll_present = root.join("plugins").join(format!("{}.dll", e.id)).is_file() || root.join("plugins").join(format!("{}.dll", e.id.replace('-', "_"))).is_file() + || root.join("plugins").join(format!("mod-{}.dll", e.id)).is_file() + || root.join("plugins").join(format!("mod-{}.dll", e.id.replace('-', "_"))).is_file() + || root.join("plugins").join(format!("mod-coa-{}.dll", e.id)).is_file() + || root.join("plugins").join(format!("mod_coa_{}.dll", e.id.replace('-', "_"))).is_file() || root.join(".manager/plugins").join(format!("{}.dll", e.id)).is_file() - || root.join(".manager/plugins").join(format!("{}.dll", e.id.replace('-', "_"))).is_file(); + || root.join(".manager/plugins").join(format!("{}.dll", e.id.replace('-', "_"))).is_file() + || root.join(".manager/plugins").join(format!("mod-{}.dll", e.id)).is_file() + || root.join(".manager/plugins").join(format!("mod-{}.dll", e.id.replace('-', "_"))).is_file() + || root.join(".manager/plugins").join(format!("mod-coa-{}.dll", e.id)).is_file() + || root.join(".manager/plugins").join(format!("mod_coa_{}.dll", e.id.replace('-', "_"))).is_file(); let is_dynamic = plugin_entry.is_some() || dll_present; // 2. Classify ComponentType and determine installation strictly @@ -265,16 +275,20 @@ fn list_in(cat: &[Entry], root: &Path) -> Vec { || root.join("Data/enUS/patch-enUS-4.mpq").is_file(); (ComponentType::ClientPatch, has_patch, true) } else if matches!(e.id.as_str(), "tbc-content" | "wotlk-content") { - let scaling_entry = cat.iter().find(|entry| entry.id == "content-scaling"); - let is_scaling_installed = scaling_entry.map(|se| { - let sc_name = conf_name(root, se); - let sc_conf = dir(root).join(&sc_name); - let sc_dist = dir(root).join(format!("{sc_name}.dist")); - sc_conf.is_file() || sc_dist.is_file() || installed_commits.contains_key("scaling") + let is_scaling_installed = { + let se_plugin = plugin_reg.as_ref().and_then(|r| { + r.plugins.get("content-scaling") + .or_else(|| r.plugins.get("content_scaling")) + .or_else(|| r.plugins.get("mod-coa-content-scaling")) + }); + let se_dll = root.join("plugins").join("content-scaling.dll").is_file() + || root.join("plugins").join("content_scaling.dll").is_file() || root.join("plugins").join("mod-coa-content-scaling.dll").is_file() - || root.join(".manager/plugins").join("mod-coa-content-scaling.dll").is_file() - || plugin_reg.as_ref().map(|r| r.plugins.contains_key("content-scaling")).unwrap_or(false) - }).unwrap_or(false); + || root.join("plugins").join("mod_coa_content_scaling.dll").is_file() + || root.join(".manager/plugins").join("content-scaling.dll").is_file() + || root.join(".manager/plugins").join("mod-coa-content-scaling.dll").is_file(); + se_plugin.is_some() || se_dll || (!is_modular_host && installed_commits.contains_key("scaling")) + }; let has_content = is_scaling_installed && (conf.is_file() || dist.is_file()); (ComponentType::ContentPack, has_content, false) @@ -300,10 +314,24 @@ fn list_in(cat: &[Entry], root: &Path) -> Vec { .unwrap_or(false); // the active file or plugin registry decides enabled state - let enabled = if let Some(p) = plugin_entry { + let enabled = if !installed { + false + } else if let Some(p) = plugin_entry { p.enabled } else if matches!(e.id.as_str(), "companions" | "playerbots") { bot_enabled(root, &e).unwrap_or(true) + } else if matches!(e.id.as_str(), "tbc-content" | "wotlk-content") { + let sc_entry = cat.iter().find(|entry| entry.id == "content-scaling"); + let sc_conf = sc_entry.map(|se| dir(root).join(conf_name(root, se))); + let sc_enabled = sc_conf + .and_then(|p| read(&p)) + .and_then(|c| c.get("CoAContentScaling.Enable").map(truthy)) + .unwrap_or(true); + + sc_enabled && read(&conf) + .or_else(|| read(&dist)) + .and_then(|c| c.get(&e.enable_key).map(truthy)) + .unwrap_or(e.default_on) } else { !e.switchable || read(&conf) diff --git a/src/screens/ModulesPage.tsx b/src/screens/ModulesPage.tsx index 8b7ce0f..e7de69c 100644 --- a/src/screens/ModulesPage.tsx +++ b/src/screens/ModulesPage.tsx @@ -139,7 +139,7 @@ interface VerifiedCatalogModule { repo: string; category: "official" | "utility" | "economy" | "social" | "profession" | "scaling"; description: { ru: string; en: string }; - qualification: "OFFICIAL_CORE" | "INSTALL_VERIFIED" | "LINK_VERIFIED" | "BUILT"; + qualification: "OPTIMIZED_COA" | "OFFICIAL_CORE" | "INSTALL_VERIFIED" | "LINK_VERIFIED" | "BUILT"; tier: string; verificationLevel: string; notes: { ru: string; en: string }; @@ -177,7 +177,7 @@ function cleanModuleName(name: string, id: string): string { } const VERIFIED_CATALOG: VerifiedCatalogModule[] = [ - // Official Core Modules + // Optimized CoA Modules { id: "companions", name: "CoA Companions", @@ -187,12 +187,12 @@ const VERIFIED_CATALOG: VerifiedCatalogModule[] = [ ru: "Боты-компаньоны для групп, подземелий и гильдии.", en: "Companion bots for groups, dungeons and your guild.", }, - qualification: "OFFICIAL_CORE", - tier: "Core Module", + qualification: "OPTIMIZED_COA", + tier: "Tier 1: Dynamic DLL", verificationLevel: "PRODUCTION_SUPPORTED", notes: { - ru: "Встроенный официальный модуль сервера. Взаимоисключение со SQUID's Playerbots.", - en: "Official built-in server module. Mutually exclusive with Playerbots.", + ru: "Оптимизированный модуль ботов-компаньонов для сервера. Взаимоисключение со SQUID's Playerbots.", + en: "Optimized companion bots module for server. Mutually exclusive with Playerbots.", }, sqlRequired: false, canInstall: true, @@ -208,12 +208,12 @@ const VERIFIED_CATALOG: VerifiedCatalogModule[] = [ ru: "Подстраивает подземелья и рейды под вашу группу, есть соло-режимы.", en: "Scales dungeons and raids to your group, with solo modes.", }, - qualification: "OFFICIAL_CORE", - tier: "Core Module", + qualification: "OPTIMIZED_COA", + tier: "Tier 1: Dynamic DLL", verificationLevel: "PRODUCTION_SUPPORTED", notes: { - ru: "Встроенный официальный модуль динамического масштабирования подземелий.", - en: "Official built-in dynamic dungeon scaling module.", + ru: "Оптимизированный модуль динамического масштабирования подземелий.", + en: "Optimized dynamic dungeon scaling module.", }, sqlRequired: false, canInstall: true, @@ -229,12 +229,12 @@ const VERIFIED_CATALOG: VerifiedCatalogModule[] = [ ru: "Подземелья и рейды Запределья, подогнанные под ваши уровни.", en: "Outland dungeons and raids, scaled to your level range.", }, - qualification: "OFFICIAL_CORE", - tier: "Core Module", + qualification: "OPTIMIZED_COA", + tier: "Content Pack", verificationLevel: "PRODUCTION_SUPPORTED", notes: { - ru: "Встроенный пакет контента Burning Crusade.", - en: "Built-in Burning Crusade content pack.", + ru: "Оптимизированный пакет контента Burning Crusade для Content Scaling.", + en: "Optimized Burning Crusade content pack for Content Scaling.", }, sqlRequired: false, canInstall: true, @@ -250,12 +250,12 @@ const VERIFIED_CATALOG: VerifiedCatalogModule[] = [ ru: "Подземелья и рейды Нордскола, подогнанные под ваши уровни.", en: "Northrend dungeons and raids, scaled to your level range.", }, - qualification: "OFFICIAL_CORE", - tier: "Core Module", + qualification: "OPTIMIZED_COA", + tier: "Content Pack", verificationLevel: "PRODUCTION_SUPPORTED", notes: { - ru: "Встроенный пакет контента Wrath of the Lich King.", - en: "Built-in Wrath of the Lich King content pack.", + ru: "Оптимизированный пакет контента Wrath of the Lich King для Content Scaling.", + en: "Optimized Wrath of the Lich King content pack for Content Scaling.", }, sqlRequired: false, canInstall: true, @@ -271,12 +271,12 @@ const VERIFIED_CATALOG: VerifiedCatalogModule[] = [ ru: "Альтернативная система ботов со случайными ботами и полным ИИ.", en: "An alternative bot system with random bots and full AI.", }, - qualification: "OFFICIAL_CORE", - tier: "Core Module", + qualification: "OPTIMIZED_COA", + tier: "Tier 1: Dynamic DLL", verificationLevel: "PRODUCTION_SUPPORTED", notes: { - ru: "Встроенная система случайных ботов SQUID. Взаимоисключение с CoA Companions.", - en: "Built-in SQUID random bots system. Mutually exclusive with CoA Companions.", + ru: "Оптимизированная система случайных ботов SQUID. Взаимоисключение с CoA Companions.", + en: "Optimized SQUID random bots system. Mutually exclusive with CoA Companions.", }, sqlRequired: true, canInstall: true, @@ -292,12 +292,12 @@ const VERIFIED_CATALOG: VerifiedCatalogModule[] = [ ru: "Пользовательские расы (Esteria и другие) с расширенной внешностью и патчем клиента.", en: "Playable custom races (Esteria and additional races) with extended appearances.", }, - qualification: "OFFICIAL_CORE", - tier: "Core Module", + qualification: "OPTIMIZED_COA", + tier: "Client Patch", verificationLevel: "PRODUCTION_SUPPORTED", notes: { - ru: "Встроенный модуль рас. Требуется установка клиентского MPQ-патча.", - en: "Built-in custom races module. Requires client MPQ patch.", + ru: "Оптимизированный модуль рас CoA. Требуется клиентский MPQ-патч.", + en: "Optimized CoA custom races module. Requires client MPQ patch.", }, sqlRequired: true, canInstall: true, @@ -313,12 +313,12 @@ const VERIFIED_CATALOG: VerifiedCatalogModule[] = [ ru: "Настройка скорости смены дня и ночи и начального времени игрового мира.", en: "Adjust the day and night cycle speed and starting game time.", }, - qualification: "OFFICIAL_CORE", - tier: "Core Module", + qualification: "OPTIMIZED_COA", + tier: "Tier 1: Dynamic DLL", verificationLevel: "PRODUCTION_SUPPORTED", notes: { - ru: "Встроенный модуль синхронизации игрового времени с сервером.", - en: "Built-in world time synchronization module.", + ru: "Оптимизированный модуль синхронизации игрового времени с сервером.", + en: "Optimized world time synchronization module.", }, sqlRequired: false, canInstall: true, @@ -356,12 +356,12 @@ const VERIFIED_CATALOG: VerifiedCatalogModule[] = [ ru: "Наполняет аукцион реалистичными настраиваемыми лотами.", en: "Fills the auction house with realistic, adjustable listings.", }, - qualification: "OFFICIAL_CORE", - tier: "Core Module", + qualification: "OPTIMIZED_COA", + tier: "Tier 1: Dynamic DLL", verificationLevel: "PRODUCTION_SUPPORTED", notes: { - ru: "Встроенный официальный модуль аукциона виртуальных персонажей.", - en: "Built-in official virtual characters auction house module.", + ru: "Оптимизированный модуль аукциона виртуальных персонажей для CoA.", + en: "Optimized virtual characters auction house module for CoA.", }, sqlRequired: false, canInstall: true, @@ -397,12 +397,12 @@ const VERIFIED_CATALOG: VerifiedCatalogModule[] = [ ru: "НПС, который зачаровывает ваше снаряжение.", en: "An NPC that enchants your gear for you.", }, - qualification: "OFFICIAL_CORE", - tier: "Core Module", + qualification: "OPTIMIZED_COA", + tier: "Tier 1: Dynamic DLL", verificationLevel: "PRODUCTION_SUPPORTED", notes: { - ru: "Встроенный официальный модуль зачарования экипировки у НПС.", - en: "Built-in official NPC equipment enchanting module.", + ru: "Оптимизированный модуль зачарования экипировки у НПС для CoA.", + en: "Optimized NPC equipment enchanting module for CoA.", }, sqlRequired: false, canInstall: true, @@ -1735,7 +1735,7 @@ export function ModulesPage({ catalogFilter === "official" ? "bg-sky-400 text-black font-semibold" : "bg-black/30 text-muted hover:text-ink" )} > - {locale === "ru" ? "Официальные ядра" : "Official Core"} ({VERIFIED_CATALOG.filter((c) => c.isOfficial).length}) + {locale === "ru" ? "Оптимизированы" : "Optimized"} ({VERIFIED_CATALOG.filter((c) => c.isOfficial).length}) - ) : item.isOfficial ? ( + ) : item.id === "tbc-content" || item.id === "wotlk-content" ? ( + !isScalingInstalled ? ( + + ) : ( + + ) + ) : item.id === "custom-races" ? ( ) : (