1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

Merge pull request #2138 from HullSeals/fix/change-resource-location

[2135] Resource Folders are not unified
This commit is contained in:
Phoebe 2024-01-04 01:11:23 +01:00 committed by GitHub
commit aff1ba15a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

View File

@ -77,8 +77,8 @@ def generate_data_files(
"snd_good.wav",
"snd_bad.wav",
"modules.p", # TODO: Remove in 6.0
"resources/modules.json",
"resources/ships.json",
"modules.json",
"ships.json",
"ships.p", # TODO: Remove in 6.0
f"{app_name}.VisualElementsManifest.xml",
f"{app_name}.ico",

View File

@ -57,7 +57,7 @@ if __name__ == "__main__":
modules['_'.join([reverse_ship_map[name], 'armour', bulkhead])] = {'mass': m['bulkheads'][i]['mass']}
ships = OrderedDict([(k, ships[k]) for k in sorted(ships)]) # sort for easier diffing
with open("resources/ships.json", "w") as ships_file:
with open("ships.json", "w") as ships_file:
json.dump(ships, ships_file, indent=4)
# Module masses
@ -92,5 +92,5 @@ if __name__ == "__main__":
add(modules, 'hpt_multicannon_fixed_medium_advanced', {'mass': 4})
modules = OrderedDict([(k, modules[k]) for k in sorted(modules)]) # sort for easier diffing
with open("resources/modules.json", "w") as modules_file:
with open("modules.json", "w") as modules_file:
json.dump(modules, modules_file, indent=4)

View File

@ -24,7 +24,7 @@ __Module = dict[str, Union[str, list[str]]] # Have to keep old-style here for c
ship_map = ship_name_map.copy()
# Ship masses
ships_file = config.respath_path / "resources" / "ships.json"
ships_file = config.respath_path / "ships.json"
with open(ships_file, encoding="utf-8") as ships_file_handle:
ships = json.load(ships_file_handle)

View File

@ -57,7 +57,7 @@ def lookup(module, ship_map, entitled=False) -> dict | None: # noqa: C901, CCR0
"""
# Lazily populate
if not moduledata:
modules_path = config.respath_path / "resources" / "modules.json"
modules_path = config.respath_path / "modules.json"
moduledata.update(json.loads(modules_path.read_text()))
if not module.get('name'):