From c0ef877a2db46acfa485521425091ecc4230eb4e Mon Sep 17 00:00:00 2001 From: beauxq Date: Sun, 19 May 2024 08:35:35 -0700 Subject: [PATCH] Zillion: "item counts" OptionGroup --- worlds/zillion/__init__.py | 4 +++- worlds/zillion/options.py | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/worlds/zillion/__init__.py b/worlds/zillion/__init__.py index 62623edc0803..cce120d7e3f4 100644 --- a/worlds/zillion/__init__.py +++ b/worlds/zillion/__init__.py @@ -14,7 +14,7 @@ from .gen_data import GenData from .logic import cs_to_zz_locs from .region import ZillionLocation, ZillionRegion -from .options import ZillionOptions, validate +from .options import ZillionOptions, validate, z_option_groups from .id_maps import ZillionSlotInfo, get_slot_info, item_name_to_id as _item_name_to_id, \ loc_name_to_id as _loc_name_to_id, make_id_to_others, \ zz_reg_name_to_reg_name, base_id @@ -62,6 +62,8 @@ class ZillionWebWorld(WebWorld): ["beauxq"] )] + option_groups = z_option_groups + class ZillionWorld(World): """ diff --git a/worlds/zillion/options.py b/worlds/zillion/options.py index 0b94e3d63513..d75dd1a1c22c 100644 --- a/worlds/zillion/options.py +++ b/worlds/zillion/options.py @@ -3,7 +3,7 @@ from typing import ClassVar, Dict, Tuple from typing_extensions import TypeGuard # remove when Python >= 3.10 -from Options import DefaultOnToggle, NamedRange, PerGameCommonOptions, Range, Toggle, Choice +from Options import Choice, DefaultOnToggle, NamedRange, OptionGroup, PerGameCommonOptions, Range, Toggle from zilliandomizer.options import ( Options as ZzOptions, char_to_gun, char_to_jump, ID, @@ -279,6 +279,14 @@ class ZillionOptions(PerGameCommonOptions): room_gen: ZillionRoomGen +z_option_groups = [ + OptionGroup("item counts", [ + ZillionIDCardCount, ZillionBreadCount, ZillionOpaOpaCount, ZillionZillionCount, + ZillionFloppyDiskCount, ZillionScopeCount, ZillionRedIDCardCount + ]) +] + + def convert_item_counts(ic: "Counter[str]") -> ZzItemCounts: tr: ZzItemCounts = { ID.card: ic["ID Card"],