Files
2026-11-23 03:28:32 +02:00

26 lines
996 B
Python

"""Read-only access to the Octo client MPQs in priority order (highest first)."""
import sys
sys.path.insert(0, '/mnt/Games/@project/gateway/runtime/continuation-20261113/claude-lane/tools')
from mpq_read import MPQ
from pathlib import Path
D = Path.home() / 'Games/octo/drive_c/Octowow/Data'
ORDER = ['patch-O.mpq', 'patch-5.mpq', 'patch-4.mpq', 'patch-3.mpq', 'patch-2.mpq', 'patch-1.mpq', 'patch.MPQ', 'interface.MPQ',
'wmo.MPQ', 'terrain.MPQ', 'texture.MPQ', 'model.MPQ', 'misc.MPQ', 'dbc.MPQ', 'backup.MPQ', 'base.MPQ']
_arch = None
def archives():
global _arch
if _arch is None:
_arch = []
for n in ORDER:
p = D / n
if p.exists() and p.stat().st_size > 0:
try: _arch.append((n, MPQ(str(p))))
except Exception: pass
return _arch
def read(name):
for n, a in archives():
try:
if a.find(name) is not None: return a.read(name)
except Exception: continue
return None