Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema refactor #458

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion src/open_samus_returns_rando/files/custom/room_names.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function RoomNameGui.GetRoomName(camera)
return nil
end

return dict[scenario][camera]
return dict[scenario][camera]["room_name"]
end

function RoomNameGui.Init()
Expand Down
57 changes: 36 additions & 21 deletions src/open_samus_returns_rando/files/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,6 @@
},
"default": {}
},
"reveal_map_on_start": {
"type": "boolean",
"default": false,
"description": "When true, the game will start with the whole map revealed"
},
"objective": {
"description": "Requirements for completing a seed.",
"type": "object",
Expand Down Expand Up @@ -539,22 +534,10 @@
"default": "NEVER",
"description": "Configures how the room name is displayed on the HUD. Defaults to disabled."
},
"camera_names_dict": {
"type": "object",
"description": "A dictionary of dictionaries mapping scenario and collision camera to room name in the database",
"additionalProperties": false,
"default": {},
"patternProperties": {
".*": {
"type": "object",
"additionalProperties": false,
"patternProperties": {
".*": {
"type": "string"
}
}
}
}
"reveal_map_on_start": {
"type": "boolean",
"default": false,
"description": "When true, the game will start with the whole map revealed"
},
"music_shuffle_dict": {
"description": "A dictionary mapping of music tracks where the keys get swapped with the values.",
Expand Down Expand Up @@ -609,6 +592,38 @@
},
"default": {}
},
"collision_camera_attributes": {
"description": "A dictionary of dictionaries mapping scenario and collision camera to names in the database and custom attributes.",
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"room_name": {
"type": "string"
},
"custom_env_source": {
"type": "string",
"enum": [
"heat",
"lava",
"water",
"acid"
]
}
},
"required": [
"room_name"
]
}
}
}
},
"default": {}
},
"configuration_identifier": {
"type": "string",
"description": "An unique identifier for this configuration. Only save files created with this identifier can be loaded."
Expand Down
2 changes: 1 addition & 1 deletion src/open_samus_returns_rando/lua_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def chunks(array: list[str], n: int) -> Iterable[list[str]]:
"starting_scenario": lua_util.wrap_string(starting_location["scenario"]),
"starting_actor": lua_util.wrap_string(starting_location["actor"]),
"energy_per_tank": energy_per_tank,
"reveal_map_on_start": configuration["reveal_map_on_start"],
"reveal_map_on_start": cosmetic_options["reveal_map_on_start"],
"dna_per_area": self._dna_count_dict,
"scenario_mapping": {key: lua_util.wrap_string(value) for key, value in SCENARIO_MAPPING.items()},
"textbox_count": textboxes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,7 @@


def create_collision_camera_table(editor: PatcherEditor, configuration: dict) -> None:
py_dict: dict = configuration["cosmetic_patches"]["camera_names_dict"]

# Surface
py_dict["s000_surface"]["collision_camera_017"] = "Transport to Area 8"
py_dict["s110_surfaceb"]["collision_camera_018"] = "Surface Stash"
py_dict["s110_surfaceb"]["collision_camera_019"] = "Surface Crumble Block Challenge"
py_dict["s110_surfaceb"]["collision_camera_021"] = "Landing Site"

# Area 2
py_dict["s025_area2b"]["collision_camera020"] = "High Jump Boots Chamber"

# Area 3
py_dict["s033_area3b"]["collision_camera_030"] = "Quarry Shaft"

# Area 4
py_dict["s050_area5"]["collision_camera_AfterChase_002"] = "Diggernaut Excavation Tunnels"
py_dict["s050_area5"]["collision_camera_AfterChase_003"] = "Diggernaut Excavation Tunnels"
py_dict: dict = configuration["collision_camera_attributes"]

file = lua_util.replace_lua_template("cc_to_room_name.lua", {"room_dict": py_dict}, True)
editor.add_new_asset(
Expand Down
Loading