From 38b315352cc6539ddb9cb454ebdf1d5c16aafd3d Mon Sep 17 00:00:00 2001 From: massimilianodelliubaldini <8584296+massimilianodelliubaldini@users.noreply.github.com> Date: Mon, 24 Mar 2025 17:48:04 -0400 Subject: [PATCH] Properly use the settings API instead of Utils. --- worlds/jakanddaxter/Client.py | 7 ++++--- worlds/jakanddaxter/__init__.py | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/worlds/jakanddaxter/Client.py b/worlds/jakanddaxter/Client.py index 81f71150e4..74b101d13d 100644 --- a/worlds/jakanddaxter/Client.py +++ b/worlds/jakanddaxter/Client.py @@ -20,6 +20,7 @@ from pymem.exception import ProcessNotFound # Archipelago imports import ModuleUpdate import Utils +import settings from CommonClient import ClientCommandProcessor, CommonContext, server_loop, gui_enabled from NetUtils import ClientStatus @@ -433,12 +434,12 @@ async def run_game(ctx: JakAndDaxterContext): ctx.on_log_warn(logger, "Compiler not running, attempting to start.") try: - settings = Utils.get_settings() - auto_detect_root_directory = settings["jakanddaxter_options"]["auto_detect_root_directory"] + ap_settings = settings.get_settings() + auto_detect_root_directory = ap_settings.jakanddaxter_options.auto_detect_root_directory if auto_detect_root_directory: root_path = find_root_directory(ctx) else: - root_path = settings["jakanddaxter_options"]["root_directory"] + root_path = ap_settings.jakanddaxter_options.root_directory # Always trust your instincts... the user may not have entered their root_directory properly. # We don't have to do this check if the root directory was auto-detected. diff --git a/worlds/jakanddaxter/__init__.py b/worlds/jakanddaxter/__init__.py index cb0697b7b6..ec79c7f42a 100644 --- a/worlds/jakanddaxter/__init__.py +++ b/worlds/jakanddaxter/__init__.py @@ -4,7 +4,6 @@ from typing import Any, ClassVar, Callable, Union, cast # Archipelago imports import settings -import Utils from worlds.AutoWorld import World, WebWorld from worlds.LauncherComponents import components, Component, launch_subprocess, Type, icon_paths @@ -249,7 +248,8 @@ class JakAndDaxterWorld(World): # For the fairness of other players in a multiworld game, enforce some friendly limitations on our options, # so we don't cause chaos during seed generation. These friendly limits should **guarantee** a successful gen. # We would have done this earlier, but we needed to sort the power cell thresholds first. - enforce_friendly_options = Utils.get_settings()["jakanddaxter_options"]["enforce_friendly_options"] + ap_settings = settings.get_settings() + enforce_friendly_options = ap_settings.jakanddaxter_options.enforce_friendly_options if enforce_friendly_options: if self.multiworld.players > 1: from .Rules import enforce_multiplayer_limits