Move Factorio data from /data/factorio to /worlds/factorio/data, to contain it in its world folder

This commit is contained in:
Fabian Dill 2021-07-31 15:13:55 +02:00
parent 7f8617d639
commit abf4e82737
18 changed files with 5 additions and 4 deletions

View File

@ -325,7 +325,7 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Optional arguments to FactorioClient follow. "
"Remaining arguments get passed into bound Factorio instance."
"Refer to factorio --help for those.")
"Refer to Factorio --help for those.")
parser.add_argument('--rcon-port', default='24242', type=int, help='Port to use to communicate with Factorio')
parser.add_argument('--rcon-password', help='Password to authenticate with RCON.')
parser.add_argument('--connect', default=None, help='Address of the multiworld host.')

View File

@ -354,6 +354,7 @@ def get_adjuster_settings(romfile: str) -> typing.Tuple[str, bool]:
return romfile, adjusted
return romfile, False
@cache_argsless
def get_unique_identifier():
uuid = persistent_load().get("client", {}).get("uuid", None)

View File

@ -49,7 +49,7 @@ def generate_mod(world, output_directory: str):
global data_final_template, locale_template, control_template, data_template
with template_load_lock:
if not data_final_template:
mod_template_folder = Utils.local_path("data", "factorio", "mod_template")
mod_template_folder = os.path.join(os.path.dirname(__file__), "data", "mod_template")
template_env: Optional[jinja2.Environment] = \
jinja2.Environment(loader=jinja2.FileSystemLoader([mod_template_folder]))
data_template = template_env.get_template("data.lua")
@ -95,7 +95,7 @@ def generate_mod(world, output_directory: str):
mod_dir = os.path.join(output_directory, mod_name + "_" + Utils.__version__)
en_locale_dir = os.path.join(mod_dir, "locale", "en")
os.makedirs(en_locale_dir, exist_ok=True)
shutil.copytree(Utils.local_path("data", "factorio", "mod"), mod_dir, dirs_exist_ok=True)
shutil.copytree(os.path.join(os.path.dirname(__file__), "data", "mod"), mod_dir, dirs_exist_ok=True)
with open(os.path.join(mod_dir, "data.lua"), "wt") as f:
f.write(data_template_code)
with open(os.path.join(mod_dir, "data-final-fixes.lua"), "wt") as f:

View File

@ -13,7 +13,7 @@ import functools
from . import Options
factorio_id = 2 ** 17
source_folder = Utils.local_path("data", "factorio")
source_folder = os.path.join(os.path.dirname(__file__), "data")
with open(os.path.join(source_folder, "techs.json")) as f:
raw = json.load(f)

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB