Skip to content

Commit 9570d02

Browse files
committed
Merge parent/master into Hint_extend_information
# Conflicts resolved: # schemas/Manual.locations.schema.json
2 parents 89e16da + 958874e commit 9570d02

File tree

7 files changed

+30
-8
lines changed

7 files changed

+30
-8
lines changed

schemas/Manual.items.schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@
9494
"type": ["boolean", "integer"],
9595
"default": false
9696
},
97+
"id": {
98+
"description": "(Optional) Skips the item ID forward to the given value.\nThis can be used to provide buffer space for future items.",
99+
"type": "integer"
100+
},
97101
"_comment": {"$ref": "#/definitions/comment"}
98102
},
99103
"required": ["name"]
@@ -107,4 +111,4 @@
107111
}
108112
}
109113
}
110-
}
114+
}

schemas/Manual.locations.schema.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@
9595
"hint_entrance": {
9696
"description": "(Optional) Adds additional text to this location's hints to convey useful information. Typically used for entrance randomization.",
9797
"type": "string"
98-
}
98+
},
99+
"id": {
100+
"description": "(Optional) Skips the item ID forward to the given value.\nThis can be used to provide buffer space for future items.",
101+
"type": "integer"
102+
},
99103
"_comment": {"$ref": "#/definitions/comment"}
100104
}
101105
},
@@ -122,4 +126,4 @@
122126
}
123127
}
124128
}
125-
}
129+
}

src/Items.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323

2424
# add sequential generated ids to the lists
2525
for key, val in enumerate(item_table):
26+
if "id" in item_table[key]:
27+
item_id = item_table[key]["id"]
28+
if item_id >= count:
29+
count = item_id
30+
else:
31+
raise ValueError(f"{item_table[key]['name']} has an invalid ID. ID must be at least {count + 1}")
32+
2633
item_table[key]["id"] = count
2734
item_table[key]["progression"] = val["progression"] if "progression" in val else False
2835
count += 1

src/Locations.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
if "victory" in location_table[key] and location_table[key]["victory"]:
1616
victory_names.append(location_table[key]["name"])
1717

18+
if "id" in location_table[key]:
19+
item_id = location_table[key]["id"]
20+
if item_id >= count:
21+
count = item_id
22+
else:
23+
raise ValueError(f"{location_table[key]['name']} has an invalid ID. ID must be at least {count + 1}")
24+
1825
location_table[key]["id"] = count
1926

2027
if not "region" in location_table[key]:

src/ManualClient.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def enable_death_link(self):
320320
self.death_link_button = Button(text="Death Link: Primed",
321321
size_hint_x=None, width=150)
322322
self.connect_layout.add_widget(self.death_link_button)
323-
self.death_link_button.bind(on_press=self.send_death_link)
323+
self.death_link_button.bind(on_release=self.send_death_link)
324324

325325
def send_death_link(self, *args):
326326
if self.ctx.last_death_link:
@@ -458,7 +458,7 @@ def build_tracker_and_locations_table(self):
458458

459459
for location_id in self.listed_locations[location_category]:
460460
location_button = TreeViewButton(text=self.ctx.location_names.lookup_in_game(location_id), size_hint=(None, None), height=30, width=400)
461-
location_button.bind(on_press=lambda *args, loc_id=location_id: self.location_button_callback(loc_id, *args))
461+
location_button.bind(on_release=lambda *args, loc_id=location_id: self.location_button_callback(loc_id, *args))
462462
location_button.id = location_id
463463
category_layout.add_widget(location_button)
464464

@@ -470,7 +470,7 @@ def build_tracker_and_locations_table(self):
470470
victory_text = "VICTORY! (seed finished)" if victory_location["name"] == "__Manual Game Complete__" else "GOAL: " + victory_location["name"]
471471
location_button = TreeViewButton(text=victory_text, size_hint=(None, None), height=30, width=400)
472472
location_button.victory = True
473-
location_button.bind(on_press=self.victory_button_callback)
473+
location_button.bind(on_release=self.victory_button_callback)
474474
category_layout.add_widget(location_button)
475475

476476
tracker_panel_scrollable.add_widget(tracker_panel)

src/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ManualWorld(World):
6464
victory_names = victory_names
6565

6666
def get_filler_item_name(self) -> str:
67-
return hook_get_filler_item_name() or filler_item_name
67+
return hook_get_filler_item_name(self, self.multiworld, self.player) or filler_item_name
6868

6969
def interpret_slot_data(self, slot_data: dict[str, any]):
7070
#this is called by tools like UT

src/hooks/World.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
# Use this function to change the valid filler items to be created to replace item links or starting items.
3535
# Default value is the `filler_item_name` from game.json
36-
def hook_get_filler_item_name() -> str | bool:
36+
def hook_get_filler_item_name(world: World, multiworld: MultiWorld, player: int) -> str | bool:
3737
return False
3838

3939
# Called before regions and locations are created. Not clear why you'd want this, but it's here. Victory location is included, but Victory event is not placed yet.

0 commit comments

Comments
 (0)