fix: include core
This commit is contained in:
+54
-31
@@ -843,15 +843,19 @@ class LoadingScreen:
|
||||
|
||||
def extract_name_from_id(self, expansion_id):
|
||||
"""Extract expansion name from ID as fallback"""
|
||||
if 'royalty' in expansion_id.lower():
|
||||
normalized_id = expansion_id.lower()
|
||||
|
||||
if normalized_id == 'ludeon.rimworld':
|
||||
return 'Core'
|
||||
elif 'royalty' in normalized_id:
|
||||
return 'Royalty'
|
||||
elif 'ideology' in expansion_id.lower():
|
||||
elif 'ideology' in normalized_id:
|
||||
return 'Ideology'
|
||||
elif 'biotech' in expansion_id.lower():
|
||||
elif 'biotech' in normalized_id:
|
||||
return 'Biotech'
|
||||
elif 'anomaly' in expansion_id.lower():
|
||||
elif 'anomaly' in normalized_id:
|
||||
return 'Anomaly'
|
||||
elif 'odyssey' in expansion_id.lower():
|
||||
elif 'odyssey' in normalized_id:
|
||||
return 'Odyssey'
|
||||
else:
|
||||
# Extract the last part after the last dot and capitalize
|
||||
@@ -3520,13 +3524,15 @@ class SteamWorkshopGUI:
|
||||
def get_core_mods_from_config(self):
|
||||
"""Get core mods from ModsConfig.xml knownExpansions section - includes ALL DLC the user owns"""
|
||||
core_mods = []
|
||||
seen_core_mod_ids = set()
|
||||
base_game_id = 'ludeon.rimworld'
|
||||
|
||||
try:
|
||||
if not self.modsconfig_path or not os.path.exists(self.modsconfig_path):
|
||||
msg = "ModsConfig.xml not found, using default core mods\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
return [('ludeon.rimworld', 'RimWorld')]
|
||||
return [(base_game_id, self.get_default_mod_name(base_game_id))]
|
||||
|
||||
msg = f"Reading ModsConfig.xml from: {self.modsconfig_path}\n"
|
||||
self._safe_update_output(msg)
|
||||
@@ -3548,34 +3554,47 @@ class SteamWorkshopGUI:
|
||||
msg = "No RimWorld path set, using fallback names\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
|
||||
def add_core_mod(mod_id):
|
||||
mod_id = (mod_id or "").strip()
|
||||
if not mod_id or mod_id in seen_core_mod_ids:
|
||||
return
|
||||
|
||||
mod_name = self.get_expansion_real_name(mod_id, rimworld_data_path)
|
||||
msg = f"get_expansion_real_name returned: {mod_name}\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
if not mod_name:
|
||||
mod_name = self.get_default_mod_name(mod_id)
|
||||
msg = f"Using fallback name: {mod_name}\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
|
||||
core_mods.append((mod_id, mod_name))
|
||||
seen_core_mod_ids.add(mod_id)
|
||||
msg = f"Added to core_mods: {mod_id} -> {mod_name}\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
|
||||
msg = "Seeding base game Core entry...\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
add_core_mod(base_game_id)
|
||||
|
||||
# Find knownExpansions section and include ALL expansions found
|
||||
# Find knownExpansions section and include all owned expansions after Core
|
||||
known_expansions_element = root.find('knownExpansions')
|
||||
if known_expansions_element is not None:
|
||||
msg = "Found knownExpansions section, processing all DLC...\n"
|
||||
msg = "Found knownExpansions section, processing entries...\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
for li in known_expansions_element.findall('li'):
|
||||
expansion_id = li.text
|
||||
if expansion_id:
|
||||
expansion_id = expansion_id.strip()
|
||||
msg = f"Processing DLC: {expansion_id}\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
# Use the same method as DLC detection to get real names
|
||||
mod_name = self.get_expansion_real_name(expansion_id, rimworld_data_path)
|
||||
msg = f"get_expansion_real_name returned: {mod_name}\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
if not mod_name:
|
||||
mod_name = self.get_default_mod_name(expansion_id)
|
||||
msg = f"Using fallback name: {mod_name}\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
core_mods.append((expansion_id, mod_name))
|
||||
msg = f"Added to core_mods: {expansion_id} -> {mod_name}\n"
|
||||
msg = f"Processing known expansion: {expansion_id}\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
add_core_mod(expansion_id)
|
||||
else:
|
||||
msg = "No knownExpansions section found in ModsConfig.xml\n"
|
||||
self._safe_update_output(msg)
|
||||
@@ -3583,7 +3602,7 @@ class SteamWorkshopGUI:
|
||||
|
||||
if not core_mods:
|
||||
# Fallback if no expansions found - just base game
|
||||
core_mods = [('ludeon.rimworld', 'RimWorld')]
|
||||
core_mods = [(base_game_id, self.get_default_mod_name(base_game_id))]
|
||||
msg = "No expansions found, using fallback base game only\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
@@ -3599,7 +3618,7 @@ class SteamWorkshopGUI:
|
||||
msg = f"Error reading core mods: {str(e)}\n"
|
||||
self._safe_update_output(msg)
|
||||
print(msg.strip())
|
||||
core_mods = [('ludeon.rimworld', 'RimWorld')]
|
||||
core_mods = [(base_game_id, self.get_default_mod_name(base_game_id))]
|
||||
|
||||
return core_mods
|
||||
|
||||
@@ -3640,15 +3659,19 @@ class SteamWorkshopGUI:
|
||||
|
||||
def extract_name_from_id(self, expansion_id):
|
||||
"""Extract expansion name from ID as fallback"""
|
||||
if 'royalty' in expansion_id.lower():
|
||||
normalized_id = expansion_id.lower()
|
||||
|
||||
if normalized_id == 'ludeon.rimworld':
|
||||
return 'Core'
|
||||
elif 'royalty' in normalized_id:
|
||||
return 'Royalty'
|
||||
elif 'ideology' in expansion_id.lower():
|
||||
elif 'ideology' in normalized_id:
|
||||
return 'Ideology'
|
||||
elif 'biotech' in expansion_id.lower():
|
||||
elif 'biotech' in normalized_id:
|
||||
return 'Biotech'
|
||||
elif 'anomaly' in expansion_id.lower():
|
||||
elif 'anomaly' in normalized_id:
|
||||
return 'Anomaly'
|
||||
elif 'odyssey' in expansion_id.lower():
|
||||
elif 'odyssey' in normalized_id:
|
||||
return 'Odyssey'
|
||||
else:
|
||||
# Extract the last part after the last dot and capitalize
|
||||
@@ -3660,7 +3683,7 @@ class SteamWorkshopGUI:
|
||||
def get_default_mod_name(self, mod_id):
|
||||
"""Get default display name for core mods"""
|
||||
default_names = {
|
||||
'ludeon.rimworld': 'RimWorld',
|
||||
'ludeon.rimworld': 'Core',
|
||||
'ludeon.rimworld.royalty': 'Royalty',
|
||||
'ludeon.rimworld.ideology': 'Ideology',
|
||||
'ludeon.rimworld.biotech': 'Biotech',
|
||||
|
||||
Reference in New Issue
Block a user