367 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
25 lines
1.7 KiB
Python
25 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
"""Read installed70334 CASC UI sources into gateway; never writes client storage."""
|
|
from pathlib import Path
|
|
import hashlib,json,subprocess
|
|
ROOT=Path(__file__).resolve().parents[1]
|
|
TOOL=Path.home()/'Projects/WoW-Hybrid/tools/casc-tool/build/casc-tool'
|
|
LIST=Path.home()/'Projects/WoW-Hybrid/listfiles/community-listfile.csv'
|
|
STORAGE=Path('/mnt/Games/Games/WoW-Forever')
|
|
def main():
|
|
output=ROOT/'runtime/native-talent-ui';ids={}
|
|
groups=('blizzard_sharedtalentui/','blizzard_playerspells/classtalents/','blizzard_playerspells/camelot/classtalents/','blizzard_playerspells/blizzard_playerspellsframe')
|
|
for line in LIST.open():
|
|
key,sep,name=line.strip().partition(';')
|
|
if sep and name.endswith(('.lua','.xml','.toc')) and any(g in name.lower() for g in groups):ids[name]=int(key)
|
|
worklist=ROOT/'runtime/native-talent-ui-ids.txt';worklist.write_text('\n'.join(map(str,ids.values()))+'\n')
|
|
result=subprocess.run([str(TOOL),'extract-batch','--from-list',str(worklist),str(output),'--storage',str(STORAGE),'--listfile',str(LIST),'--locale','enus','--strict-encrypted'])
|
|
files=[]
|
|
for path in sorted(output.rglob('*')):
|
|
if path.is_file():
|
|
name=str(path.relative_to(output));files.append({'path':name,'file_data_id':ids.get(name),'sha256':hashlib.sha256(path.read_bytes()).hexdigest(),'bytes':path.stat().st_size})
|
|
manifest={'build':70334,'storage_read_only':True,'strict_encrypted':True,'extractor_exit':result.returncode,'files':files}
|
|
(output/'extraction-manifest.json').write_text(json.dumps(manifest,indent=2)+'\n')
|
|
print('Extracted',len(files),'local UI sources; missing listfile variants are recorded by extractor, not silently substituted.')
|
|
if __name__=='__main__':main()
|