fix: add actual game cache path and search subfolders for icons
- Added: C:\ProgramData\Entropia Universe\public_users_data\cache\icon - Now searches version subfolders (e.g., 19.3.2.201024) - Also searches ProgramData recursively as fallback
This commit is contained in:
parent
acca0d3491
commit
f2dff103a8
|
|
@ -54,7 +54,9 @@ class TGAConverter:
|
|||
DEFAULT_CACHE_PATHS = [
|
||||
Path.home() / "Documents" / "Entropia Universe" / "cache" / "icons",
|
||||
Path.home() / "Documents" / "Entropia Universe" / "cache",
|
||||
Path("C:") / "ProgramData" / "Entropia Universe" / "public_users_data" / "cache" / "icon",
|
||||
Path("C:") / "ProgramData" / "Entropia Universe" / "cache" / "icons",
|
||||
Path("C:") / "ProgramData" / "Entropia Universe" / "cache",
|
||||
Path("C:") / "Program Files (x86)" / "Entropia Universe" / "cache" / "icons",
|
||||
]
|
||||
|
||||
|
|
@ -87,9 +89,17 @@ class TGAConverter:
|
|||
# Check default locations
|
||||
for path in self.DEFAULT_CACHE_PATHS:
|
||||
if path.exists():
|
||||
# Check if this folder directly contains .tga files
|
||||
if list(path.glob("*.tga")):
|
||||
logger.info(f"Found cache folder: {path}")
|
||||
self._cache_path = path
|
||||
return path
|
||||
# Check for subfolders (version folders like "19.3.2.201024")
|
||||
for subfolder in path.iterdir():
|
||||
if subfolder.is_dir() and list(subfolder.glob("*.tga")):
|
||||
logger.info(f"Found cache subfolder: {subfolder}")
|
||||
self._cache_path = subfolder
|
||||
return subfolder
|
||||
|
||||
# Try to find by looking for .tga files
|
||||
logger.info("Searching for .tga files...")
|
||||
|
|
@ -101,6 +111,15 @@ class TGAConverter:
|
|||
self._cache_path = cache_path
|
||||
return cache_path
|
||||
|
||||
# Also search in ProgramData
|
||||
program_data = Path("C:") / "ProgramData" / "Entropia Universe"
|
||||
if program_data.exists():
|
||||
for tga_file in program_data.rglob("*.tga"):
|
||||
cache_path = tga_file.parent
|
||||
logger.info(f"Found cache folder via search: {cache_path}")
|
||||
self._cache_path = cache_path
|
||||
return cache_path
|
||||
|
||||
logger.warning("Could not find Entropia Universe cache folder")
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue