diff --git a/BaseClasses.py b/BaseClasses.py index 94eb10de..ada18f1e 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -1453,14 +1453,6 @@ class Tutorial(NamedTuple): authors: List[str] -class OptionGroup(NamedTuple): - """Define a grouping of options""" - name: str - """Name of the group to categorize this option in for display on the WebHost and in generated YAMLS.""" - options: List[Type[Options.Option]] - """Options to be in the defined group. """ - - class PlandoOptions(IntFlag): none = 0b0000 items = 0b0001 diff --git a/Options.py b/Options.py index 6b4db10a..7f833d5a 100644 --- a/Options.py +++ b/Options.py @@ -1123,6 +1123,14 @@ class DeathLinkMixin: death_link: DeathLink +class OptionGroup(typing.NamedTuple): + """Define a grouping of options.""" + name: str + """Name of the group to categorize these options in for display on the WebHost and in generated YAMLS.""" + options: typing.List[typing.Type[Option[typing.Any]]] + """Options to be in the defined group.""" + + def generate_yaml_templates(target_folder: typing.Union[str, "pathlib.Path"], generate_hidden: bool = True): import os diff --git a/docs/options api.md b/docs/options api.md index dbf37df7..798e9778 100644 --- a/docs/options api.md +++ b/docs/options api.md @@ -92,7 +92,7 @@ group. ```python from worlds.AutoWorld import WebWorld -from BaseClasses import OptionGroup +from Options import OptionGroup class MyWorldWeb(WebWorld): option_groups = [ diff --git a/worlds/AutoWorld.py b/worlds/AutoWorld.py index d269ee10..b564932e 100644 --- a/worlds/AutoWorld.py +++ b/worlds/AutoWorld.py @@ -11,11 +11,11 @@ from dataclasses import make_dataclass from typing import (Any, Callable, ClassVar, Dict, FrozenSet, List, Mapping, Optional, Set, TextIO, Tuple, TYPE_CHECKING, Type, Union) -from Options import ExcludeLocations, ItemLinks, LocalItems, NonLocalItems, PerGameCommonOptions, \ - PriorityLocations, \ - StartHints, \ - StartInventory, StartInventoryPool, StartLocationHints -from BaseClasses import CollectionState, OptionGroup +from Options import ( + ExcludeLocations, ItemLinks, LocalItems, NonLocalItems, OptionGroup, PerGameCommonOptions, + PriorityLocations, StartHints, StartInventory, StartInventoryPool, StartLocationHints +) +from BaseClasses import CollectionState if TYPE_CHECKING: from BaseClasses import MultiWorld, Item, Location, Tutorial, Region, Entrance