mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Options: verify starting inventory counts are positive for more than just Factorio
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
import typing
|
||||
|
||||
from Options import Choice, OptionDict, Option, DefaultOnToggle, Range
|
||||
from Options import Choice, OptionDict, ItemDict, Option, DefaultOnToggle, Range
|
||||
from schema import Schema, Optional, And, Or
|
||||
|
||||
# schema helpers
|
||||
@@ -120,15 +120,11 @@ class RecipeIngredients(Choice):
|
||||
option_science_pack = 1
|
||||
|
||||
|
||||
class FactorioStartItems(OptionDict):
|
||||
class FactorioStartItems(ItemDict):
|
||||
displayname = "Starting Items"
|
||||
verify_item_name = False
|
||||
default = {"burner-mining-drill": 19, "stone-furnace": 19}
|
||||
|
||||
def __init__(self, value: typing.Dict[str, typing.Any]):
|
||||
if any(item_count < 1 for item_count in value.values()):
|
||||
raise Exception("Cannot have non-positive item counts.")
|
||||
super().__init__(value)
|
||||
|
||||
|
||||
class TrapCount(Range):
|
||||
range_end = 4
|
||||
|
||||
Reference in New Issue
Block a user