From 8a395a3021f248a5a14dd4d533bee4637041af4c Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 21 Feb 2021 20:37:43 +0100 Subject: [PATCH] update guis --- Adjuster.py | 3 +-- BaseClasses.py | 32 +++----------------------------- Gui.py | 1 - test/TestBase.py | 3 +-- worlds/alttp/AdjusterMain.py | 0 worlds/alttp/__init__.py | 1 - 6 files changed, 5 insertions(+), 35 deletions(-) delete mode 100644 worlds/alttp/AdjusterMain.py diff --git a/Adjuster.py b/Adjuster.py index 5d3b1057..002be6ae 100755 --- a/Adjuster.py +++ b/Adjuster.py @@ -6,7 +6,6 @@ import textwrap import sys import time -from AdjusterMain import adjust from worlds.alttp.Rom import Sprite, LocalRom, apply_rom_settings from Utils import output_path @@ -161,7 +160,7 @@ def adjustGUI(): else: messagebox.showinfo(title="Success", message=f"Rom patched successfully to {path}") from Utils import persistent_store - from Rom import Sprite + from worlds.alttp.Rom import Sprite if isinstance(guiargs.sprite, Sprite): guiargs.sprite = guiargs.sprite.name persistent_store("adjuster", "last_settings_3", guiargs) diff --git a/BaseClasses.py b/BaseClasses.py index 8fd3c4ee..fa320842 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -10,10 +10,6 @@ from typing import * import secrets import random -from worlds.alttp.EntranceShuffle import indirect_connections -from worlds.alttp.Items import item_name_groups -from worlds.generic import PlandoItem, PlandoConnection - class MultiWorld(): debug_types = False @@ -513,6 +509,7 @@ class CollectionState(object): self.collect(item, True) def update_reachable_regions(self, player: int): + from worlds.alttp.EntranceShuffle import indirect_connections self.stale[player] = False rrp = self.reachable_regions[player] bc = self.blocked_connections[player] @@ -1467,28 +1464,5 @@ class Spoiler(object): outfile.write('\n'.join(path_listings)) - -class PlandoItem(NamedTuple): - item: str - location: str - world: Union[bool, str] = False # False -> own world, True -> not own world - from_pool: bool = True # if item should be removed from item pool - force: str = 'silent' # false -> warns if item not successfully placed. true -> errors out on failure to place item. - - def warn(self, warning: str): - if self.force in ['true', 'fail', 'failure', 'none', 'false', 'warn', 'warning']: - logging.warning(f'{warning}') - else: - logging.debug(f'{warning}') - - def failed(self, warning: str, exception=Exception): - if self.force in ['true', 'fail', 'failure']: - raise exception(warning) - else: - self.warn(warning) - - -class PlandoConnection(NamedTuple): - entrance: str - exit: str - direction: str # entrance, exit or both +from worlds.alttp.Items import item_name_groups +from worlds.generic import PlandoItem, PlandoConnection \ No newline at end of file diff --git a/Gui.py b/Gui.py index 3177b57a..69ae2f26 100755 --- a/Gui.py +++ b/Gui.py @@ -14,7 +14,6 @@ from concurrent.futures import ThreadPoolExecutor, as_completed import ModuleUpdate ModuleUpdate.update() -from worlds.alttp.AdjusterMain import adjust from worlds.alttp.EntranceRandomizer import parse_arguments from GuiUtils import ToolTips, set_icon, BackgroundTaskProgress from Main import main, get_seed, __version__ as MWVersion diff --git a/test/TestBase.py b/test/TestBase.py index aa5e0b14..b96bb240 100644 --- a/test/TestBase.py +++ b/test/TestBase.py @@ -1,7 +1,6 @@ import unittest -from BaseClasses import CollectionState -from BaseClasses import MultiWorld +from BaseClasses import MultiWorld, CollectionState from worlds.alttp.Items import ItemFactory diff --git a/worlds/alttp/AdjusterMain.py b/worlds/alttp/AdjusterMain.py deleted file mode 100644 index e69de29b..00000000 diff --git a/worlds/alttp/__init__.py b/worlds/alttp/__init__.py index 19376059..633cc50c 100644 --- a/worlds/alttp/__init__.py +++ b/worlds/alttp/__init__.py @@ -1,7 +1,6 @@ from typing import Optional from BaseClasses import Location, Item -from worlds.generic import World #class ALTTPWorld(World):