Skip to content

Commit

Permalink
run.py: use last hash from game dir in config.xml and stop storing co…
Browse files Browse the repository at this point in the history
…nfig
  • Loading branch information
aaptel committed Dec 14, 2023
1 parent f9d3607 commit 38b4681
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ luaExtensions.pdb
luaExtensions.exp
*.pdb
.building/lua_noitamp_native/*.user
config_test.xml

# Object files
# *.o
Expand Down
36 changes: 0 additions & 36 deletions miscs/autostarter/config_test.xml

This file was deleted.

18 changes: 12 additions & 6 deletions miscs/autostarter/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def main():

make_client_exe(noita_bin, noita2_bin)
update_lua(args.noita_dir, args.lua)
write_config(CONFIG_PATH)
write_config(args.noita_dir, CONFIG_PATH)

if args.update:
update_mod(args.noita_dir)
Expand Down Expand Up @@ -262,9 +262,15 @@ def find_noita_window(exclude=None):
return w
return winlist[0]

def write_config(path):
with open(path, "w+") as f:
print("""

def write_config(noita_dir, config_path):
# skip release note pop up
last_hash = None
with open(os.path.join(noita_dir, "_version_hash.txt")) as f:
last_hash = f.read().strip()

with open(config_path, "w+") as f:
print(f"""
<Config
vsync="2"
Expand Down Expand Up @@ -292,15 +298,15 @@ def write_config(path):
is_default_config="0"
has_been_started_before="1"
last_started_game_version_hash="3cb5b0870058b819c65ca3288fdfc6c2cf554021"
last_started_game_version_hash="{last_hash}"
mods_disclaimer_accepted="1"
mods_sandbox_enabled="0"
mods_sandbox_warning_done="1"
config_format_version="14"
mods_active_privileged="1"
>
</Config>
""", file=f)
""", file=f)


def start_log_console(log_client, log_server, pos_y=0):
Expand Down

0 comments on commit 38b4681

Please sign in to comment.