worlds,clients,kvui: use user_path (#1622)
This commit is contained in:
parent
bb79073ce7
commit
639606e0be
|
@ -289,7 +289,10 @@ async def patch_and_run_game(apz5_file):
|
|||
decomp_path = base_name + '-decomp.z64'
|
||||
comp_path = base_name + '.z64'
|
||||
# Load vanilla ROM, patch file, compress ROM
|
||||
rom = Rom(Utils.local_path(Utils.get_options()["oot_options"]["rom_file"]))
|
||||
rom_file_name = Utils.get_options()["oot_options"]["rom_file"]
|
||||
if not os.path.exists(rom_file_name):
|
||||
rom_file_name = Utils.user_path(rom_file_name)
|
||||
rom = Rom(rom_file_name)
|
||||
apply_patch_file(rom, apz5_file,
|
||||
sub_file=(os.path.basename(base_name) + '.zpf'
|
||||
if zipfile.is_zipfile(apz5_file)
|
||||
|
|
5
Utils.py
5
Utils.py
|
@ -88,7 +88,10 @@ def is_frozen() -> bool:
|
|||
|
||||
|
||||
def local_path(*path: str) -> str:
|
||||
"""Returns path to a file in the local Archipelago installation or source."""
|
||||
"""
|
||||
Returns path to a file in the local Archipelago installation or source.
|
||||
This might be read-only and user_path should be used instead for ROMs, configuration, etc.
|
||||
"""
|
||||
if hasattr(local_path, 'cached_path'):
|
||||
pass
|
||||
elif is_frozen():
|
||||
|
|
2
kvui.py
2
kvui.py
|
@ -612,7 +612,7 @@ class KivyJSONtoTextParser(JSONtoTextParser):
|
|||
ExceptionManager.add_handler(E())
|
||||
|
||||
Builder.load_file(Utils.local_path("data", "client.kv"))
|
||||
user_file = Utils.local_path("data", "user.kv")
|
||||
user_file = Utils.user_path("data", "user.kv")
|
||||
if os.path.exists(user_file):
|
||||
logging.info("Loading user.kv into builder.")
|
||||
Builder.load_file(user_file)
|
||||
|
|
|
@ -955,7 +955,7 @@ def get_base_rom_path(game_version: str) -> str:
|
|||
options = Utils.get_options()
|
||||
file_name = options["pokemon_rb_options"][f"{game_version}_rom_file"]
|
||||
if not os.path.exists(file_name):
|
||||
file_name = Utils.local_path(file_name)
|
||||
file_name = Utils.user_path(file_name)
|
||||
return file_name
|
||||
|
||||
|
||||
|
|
|
@ -74,5 +74,5 @@ def get_base_rom_path(file_name: str = "") -> str:
|
|||
if not file_name:
|
||||
file_name = options["tloz_options"]["rom_file"]
|
||||
if not os.path.exists(file_name):
|
||||
file_name = Utils.local_path(file_name)
|
||||
return file_name
|
||||
file_name = Utils.user_path(file_name)
|
||||
return file_name
|
||||
|
|
Loading…
Reference in New Issue