Skip to content

Commit

Permalink
fixed bug with user settings not being created when first running
Browse files Browse the repository at this point in the history
VALocker. also fixed an issue
with the gui rendering the overview tab incorrectly.
  • Loading branch information
E1Bos committed Sep 16, 2023
1 parent d3400fb commit 7a736f2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions data/instalocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 7a736f2

Please sign in to comment.