Skip to content

Commit 926299c

Browse files
committed
Add process for getting graphic ids from fsdbinary (not utilizing them yet)
1 parent e8d5e9f commit 926299c

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,4 @@ gitversion
122122
/.version
123123
*.swp
124124

125+
*.fsdbinary

scripts/icons_update.py

+23-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env python2.7
22

33
"""
44
This script updates only market/item icons.
@@ -11,7 +11,7 @@
1111
import sqlite3
1212

1313
from PIL import Image
14-
14+
from shutil import copyfile
1515

1616
parser = argparse.ArgumentParser(description='This script updates module icons for pyfa')
1717
parser.add_argument('-e', '--eve', required=True, type=str, help='path to eve\'s ')
@@ -73,13 +73,31 @@
7373
resfileindex = file_index['app:/resfileindex.txt']
7474

7575
res_cache = os.path.join(args.eve, 'ResFiles')
76+
7677
with open(os.path.join(res_cache, resfileindex[1]), 'r') as f:
7778
lines = f.readlines()
7879
res_index = {x.split(',')[0].lower(): x.split(',') for x in lines}
7980

80-
for x in res_index:
81-
if x.startswith('res:/ui/texture/icons/ammo/'):
82-
print(x)
81+
# Need to copy the file to our cuirrent directory
82+
graphics_loader_file = os.path.join(res_cache, file_index['app:/bin/graphicIDsLoader.pyd'][1])
83+
to_path = os.path.dirname(os.path.abspath(__file__))
84+
copyfile(graphics_loader_file, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'graphicIDsLoader.pyd'))
85+
86+
# The loader expect it to be the correct filename, so copy trhe file as well
87+
graphics_file = os.path.join(res_cache, res_index['res:/staticdata/graphicIDs.fsdbinary'.lower()][1])
88+
to_path = os.path.dirname(os.path.abspath(__file__))
89+
copyfile(graphics_file, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'graphicIDs.fsdbinary'))
90+
91+
import graphicIDsLoader
92+
93+
print(dir(graphicIDsLoader))
94+
95+
graphics = graphicIDsLoader.load(os.path.join(to_path, 'graphicIDs.fsdbinary'))
96+
97+
graphics_py_ob = {}
98+
for x, v in graphics.items():
99+
if (hasattr(v, 'iconFolder')):
100+
graphics_py_ob[x] = v.iconFolder
83101

84102
# Add children to market group list
85103
# {parent: {children}}

0 commit comments

Comments
 (0)