Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.7
rev: v0.9.10
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- id: ruff-format

- repo: https://github.com/henriquegemignani/jsonschema-to-typeddict
rev: v1.3
rev: v1.3.1
hooks:
- id: jsonschema-to-typeddict
files: src/mars_patcher/data/schema.json
Expand Down
20 changes: 2 additions & 18 deletions src/mars_patcher/auto_generated_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
'5',
'6'
]

Minimapidkey = typ.Literal[
'0',
'1',
Expand All @@ -37,7 +36,6 @@
'9',
'10'
]

Sectorid: typ.TypeAlias = typ.Annotated[int, '1 <= value <= 6']
Shortcutsectorlist: typ.TypeAlias = typ.Annotated[list[Sectorid], 'len() == 6']
Huerotation: typ.TypeAlias = typ.Annotated[int, '0 <= value <= 360']
Expand All @@ -64,7 +62,6 @@
'WaveCoreX',
'Ridley'
]

Validitems = typ.Literal[
'None',
'Level0',
Expand Down Expand Up @@ -96,7 +93,6 @@
'IceTrap',
'InfantMetroid'
]

Validitemsprites = typ.Literal[
'Empty',
'Missiles',
Expand Down Expand Up @@ -130,7 +126,6 @@
'ShinyPowerBombTank',
'InfantMetroid'
]

Validabilities = typ.Literal[
'Missiles',
'MorphBall',
Expand All @@ -151,7 +146,6 @@
'ScrewAttack',
'IceBeam'
]

Validelevatortops = typ.Literal[
'OperationsDeckTop',
'MainHubToSector1',
Expand All @@ -164,7 +158,6 @@
'HabitationDeckTop',
'Sector1ToRestrictedLab'
]

Validelevatorbottoms = typ.Literal[
'OperationsDeckBottom',
'MainHubBottom',
Expand All @@ -177,7 +170,6 @@
'Sector5ToMainHub',
'Sector6ToMainHub'
]

Validlanguages = typ.Literal[
'JapaneseKanji',
'JapaneseHiragana',
Expand All @@ -187,8 +179,8 @@
'Italian',
'Spanish'
]

Messagelanguages: typ.TypeAlias = dict[Validlanguages, str]

class Itemmessages(typ.TypedDict, total=False):
Languages: Messagelanguages
Centered: bool = True
Expand All @@ -203,7 +195,6 @@ class BlocklayerItem(typ.TypedDict, total=False):
Value: Typeu10
"""The value that should be used to edit the room. For backgrounds, this is calculated via `((Row-1) * ColumnsInTileset) + (Column-1)`."""


Blocklayer: typ.TypeAlias = typ.Annotated[list[BlocklayerItem], 'Unique items']
Hintlocks = typ.Literal[
'OPEN',
Expand All @@ -215,8 +206,8 @@ class BlocklayerItem(typ.TypedDict, total=False):
'RED'
]


# Schema entries

class MarsschemaLocationsMajorlocationsItem(typ.TypedDict):
Source: Validsources
"""Valid major locations."""
Expand Down Expand Up @@ -272,7 +263,6 @@ class MarsschemaStartinglocation(typ.TypedDict):
BlockY: Typeu8
"""The Y-coordinate in the room where the player should spawn. If the room contains a save station, then this value will not be taken into consideration."""


MarsschemaStartingitemsSecuritylevelsItem = typ.Literal[
0,
1,
Expand Down Expand Up @@ -333,7 +323,6 @@ class MarsschemaSectorshortcuts(typ.TypedDict):
RightAreas: Shortcutsectorlist
"""Destination areas on the right side of sectors"""


MarsschemaDoorlocksItemLocktype = typ.Literal[
'Open',
'Level0',
Expand All @@ -354,7 +343,6 @@ class MarsschemaDoorlocksItem(typ.TypedDict):
LockType: MarsschemaDoorlocksItemLocktype
"""The type of cover on the hatch."""


MarsschemaPalettesRandomizeKey = typ.Literal[
'Tilesets',
'Enemies',
Expand All @@ -373,7 +361,6 @@ class MarsschemaPalettesRandomize(typ.TypedDict, total=False):
"""The maximum value to use for rotating palette hues. If not specified, the patcher will randomly generate one."""



MarsschemaPalettesColorspace = typ.Literal[
'HSV',
'Oklab'
Expand Down Expand Up @@ -454,7 +441,6 @@ class MarsschemaNavigationtext(typ.TypedDict, total=False):
"""Assigns the ship specific text."""



MarsschemaCreditstextItemLinetype = typ.Literal[
'Blank',
'Blue',
Expand All @@ -476,7 +462,6 @@ class MarsschemaCreditstextItem(typ.TypedDict, total=False):
Centered: bool = True
"""Centers the text horizontally when true."""


MarsschemaNavstationlocksKey = typ.Literal[
'MainDeckWest',
'MainDeckEast',
Expand Down Expand Up @@ -627,5 +612,4 @@ class Marsschema(typ.TypedDict, total=False):
RevealHiddenTiles: bool = False
"""When enabled, reveals normally hidden blocks that are breakable by upgrades. Hidden pickup tanks are not revealed regardless of this setting."""


MarsSchema: typ.TypeAlias = Marsschema