Skip to content

Commit a298be9

Browse files
authored
Core: change HINT_FOUND to 40 and HINT_UNSPECIFIED to 0 (ArchipelagoMW#4620)
1 parent 18bcaa8 commit a298be9

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

Diff for: NetUtils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313

1414
class HintStatus(ByValue, enum.IntEnum):
15-
HINT_FOUND = 0
16-
HINT_UNSPECIFIED = 1
15+
HINT_UNSPECIFIED = 0
1716
HINT_NO_PRIORITY = 10
1817
HINT_AVOID = 20
1918
HINT_PRIORITY = 30
19+
HINT_FOUND = 40
2020

2121

2222
class JSONMessagePart(typing.TypedDict, total=False):

Diff for: docs/network protocol.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,11 @@ An enumeration containing the possible hint states.
363363
```python
364364
import enum
365365
class HintStatus(enum.IntEnum):
366-
HINT_FOUND = 0 # The location has been collected. Status cannot be changed once found.
367-
HINT_UNSPECIFIED = 1 # The receiving player has not specified any status
366+
HINT_UNSPECIFIED = 0 # The receiving player has not specified any status
368367
HINT_NO_PRIORITY = 10 # The receiving player has specified that the item is unneeded
369368
HINT_AVOID = 20 # The receiving player has specified that the item is detrimental
370369
HINT_PRIORITY = 30 # The receiving player has specified that the item is needed
370+
HINT_FOUND = 40 # The location has been collected. Status cannot be changed once found.
371371
```
372372
- Hints for items with `ItemClassification.trap` default to `HINT_AVOID`.
373373
- Hints created with `LocationScouts`, `!hint_location`, or similar (hinting a location) default to `HINT_UNSPECIFIED`.

Diff for: kvui.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,11 @@ def on_touch_down(self, touch):
444444
if child.collide_point(*touch.pos):
445445
key = child.sort_key
446446
if key == "status":
447-
parent.hint_sorter = lambda element: element["status"]["hint"]["status"]
448-
else: parent.hint_sorter = lambda element: remove_between_brackets.sub("", element[key]["text"]).lower()
447+
parent.hint_sorter = lambda element: status_sort_weights[element["status"]["hint"]["status"]]
448+
else:
449+
parent.hint_sorter = lambda element: (
450+
remove_between_brackets.sub("", element[key]["text"]).lower()
451+
)
449452
if key == parent.sort_key:
450453
# second click reverses order
451454
parent.reversed = not parent.reversed
@@ -829,7 +832,13 @@ def __init__(self, *args, **kwargs):
829832
HintStatus.HINT_AVOID: "salmon",
830833
HintStatus.HINT_PRIORITY: "plum",
831834
}
832-
835+
status_sort_weights: dict[HintStatus, int] = {
836+
HintStatus.HINT_FOUND: 0,
837+
HintStatus.HINT_UNSPECIFIED: 1,
838+
HintStatus.HINT_NO_PRIORITY: 2,
839+
HintStatus.HINT_AVOID: 3,
840+
HintStatus.HINT_PRIORITY: 4,
841+
}
833842

834843

835844
class HintLog(RecycleView):

0 commit comments

Comments
 (0)