From a7c73754a9f174dc2d1c288138065758b1463c25 Mon Sep 17 00:00:00 2001 From: lil David <1337lilDavid@gmail.com> Date: Tue, 2 Jul 2024 15:38:39 -0500 Subject: [PATCH] Add option groups --- __init__.py | 8 +++++--- options.py | 33 +++++++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/__init__.py b/__init__.py index 9d272367730..9c0df73d75a 100644 --- a/__init__.py +++ b/__init__.py @@ -9,7 +9,7 @@ from .data import data_path from .items import WL4Item, ap_id_from_wl4_data, filter_item_names, filter_items, item_table from .locations import location_name_to_id, location_table -from .options import Goal, GoldenJewels, PoolJewels, WL4Options +from .options import Goal, GoldenJewels, PoolJewels, WL4Options, wl4_option_groups from .regions import connect_regions, create_regions from .rom import MD5_JP, MD5_US_EU, WL4ProcedurePatch, write_tokens from .rules import set_access_rules @@ -28,8 +28,6 @@ class RomFile(settings.UserFilePath): class WL4Web(WebWorld): - theme = 'jungle' - setup_en = Tutorial( 'Multiworld Setup Guide', 'A guide to setting up the Wario Land 4 randomizer connected to an Archipelago Multiworld.', @@ -39,7 +37,9 @@ class WL4Web(WebWorld): ['lil David'] ) + theme = 'jungle' tutorials = [setup_en] + option_groups = wl4_option_groups class WL4World(World): @@ -61,6 +61,8 @@ class WL4World(World): if data[1] is not None} location_name_to_id = location_name_to_id + required_client_version = (0, 5, 0) + item_name_groups = { 'Golden Treasure': { 'Golden Tree Pot', diff --git a/options.py b/options.py index 4a4fc916790..4e574d0161a 100644 --- a/options.py +++ b/options.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from Options import Choice, PerGameCommonOptions, Toggle, DeathLink, Range +from Options import Choice, PerGameCommonOptions, Toggle, DeathLink, Range, OptionGroup class Goal(Choice): @@ -184,20 +184,45 @@ class WarioVoiceShuffle(Toggle): display_name = "Shuffle Wario's voices" +wl4_option_groups = [ + OptionGroup("Goal Options", [ + Goal, + GoldenTreasureCount, + ]), + OptionGroup("World", [ + Difficulty, + PoolJewels, + GoldenJewels, + RequiredJewels, + OpenDoors, + Portal, + ]), + OptionGroup("Quality of Life", [ + MultiworldSend, + TrapBehavior, + SmashThroughHardBlocks, + ]), + OptionGroup("Cosmetic", [ + MusicShuffle, + WarioVoiceShuffle, + ]), +] + + @dataclass class WL4Options(PerGameCommonOptions): + logic: Logic + death_link: DeathLink goal: Goal golden_treasure_count: GoldenTreasureCount difficulty: Difficulty - logic: Logic pool_jewels: PoolJewels golden_jewels: GoldenJewels required_jewels: RequiredJewels open_doors: OpenDoors portal: Portal - smash_through_hard_blocks: SmashThroughHardBlocks send_locations_to_server: MultiworldSend trap_behavior: TrapBehavior - death_link: DeathLink + smash_through_hard_blocks: SmashThroughHardBlocks music_shuffle: MusicShuffle wario_voice_shuffle: WarioVoiceShuffle