From 7a736f21c8aadcee00eb5b1dae2262d491c3806c Mon Sep 17 00:00:00 2001 From: Luca B Date: Sat, 16 Sep 2023 20:33:50 +0100 Subject: [PATCH] fixed bug with user settings not being created when first running VALocker. also fixed an issue with the gui rendering the overview tab incorrectly. --- data/instalocker.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/data/instalocker.py b/data/instalocker.py index e7253cf..d442354 100644 --- a/data/instalocker.py +++ b/data/instalocker.py @@ -419,7 +419,7 @@ def create_gui(self): hover=False, text="On" if self.safe_mode is True else "Off", fg_color=self.button_colors["enabled"] - if self.enabled + if self.safe_mode else self.button_colors["disabled"], font=self.button_font_and_size, command=self.toggle_safe_mode, @@ -2200,6 +2200,11 @@ def load_data_from_files(self, first_run=False): self.map_lookup[None] = map_name # Loads the user_settings.json file, clears time_to_lock if new timings are added + if not os.path.exists(resource_path("data/user_settings.json")): + with open(resource_path("data/user_settings.json"), "w") as empty_file: + empty_file.write("{}") + + with open( resource_path("data/user_settings.json"), "r" ) as user_settings_file: @@ -2260,7 +2265,7 @@ def load_data_from_files(self, first_run=False): self.start_tools_thread_automatically = user_settings.get( "START_TOOLS_THREAD_AUTOMATICALLY", True ) - + with open(resource_path("data/user_settings.json"), "w") as us: user_settings_file_json = { "ACTIVE_SAVE_FILE": self.current_save_file,