Skip to content

Commit 0996d38

Browse files
authored
Merge pull request #17 from apple1417/master
more tps fixes
2 parents a4ff008 + 025e67b commit 0996d38

File tree

7 files changed

+40
-16
lines changed

7 files changed

+40
-16
lines changed

changelog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## v3.2: (codename tbd)
4+
5+
### Legacy Compat v1.1
6+
- Fixed that some legacy mods would not auto-enable properly.
7+
8+
### [pyunrealsdk v1.5.2](https://github.com/bl-sdk/pyunrealsdk/blob/master/changelog.md#v152)
9+
This version has no `pyunrealsdk` changes, it simply pulled in a new version of `unrealsdk`.
10+
11+
### [unrealsdk v1.6.1](https://github.com/bl-sdk/unrealsdk/blob/master/changelog.md#v161)
12+
> - Handled `UClass::Interfaces` also having a different offset between BL2 and TPS.
13+
14+
### Willow2 Mod Menu v3.1
15+
- Fixed mouse input not working properly in the main menu mod list.
16+
317
## v3.1: Omni-Cannon
418

519
### [pyunrealsdk v1.5.1](https://github.com/bl-sdk/pyunrealsdk/blob/master/changelog.md#v151)

manager_pyproject.toml

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

66
[project]
77
name = "willow_mod_manager"
8-
version = "3.1"
8+
version = "3.2"
99
authors = [{ name = "bl-sdk" }]
1010

1111
[tool.sdkmod]

src/legacy_compat/ModMenu/ModObjects.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,16 @@ def enabling_locked(self, val: bool) -> None: # pyright: ignore[reportIncompati
230230

231231
@property
232232
def auto_enable(self) -> bool:
233-
# Load on main menu is implemented inside LoadModSettings
233+
# During the default save/load mod settings function, return true for both types of saving,
234+
# to make sure that we add it to the settings file
235+
if inspect.stack()[1].function in {
236+
"default_load_mod_settings",
237+
"default_save_mod_settings",
238+
}:
239+
return self.legacy_mod.SaveEnabledState != EnabledSaveType.NotSaved
240+
241+
# At all other times, treat load on main menu as *not* auto enabled, so that we can manually
242+
# implement it (inside LoadModSettings), rather than having mods_base load it immediately.
234243
return self.legacy_mod.SaveEnabledState == EnabledSaveType.LoadWithSettings
235244

236245
@auto_enable.setter

src/legacy_compat/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"legacy_compat",
1515
)
1616

17-
__version_info__: tuple[int, int] = (1, 0)
17+
__version_info__: tuple[int, int] = (1, 1)
1818
__version__: str = f"{__version_info__[0]}.{__version_info__[1]}"
1919
__author__: str = "bl-sdk"
2020

src/willow2_mod_menu/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"__version_info__",
88
]
99

10-
__version_info__: tuple[int, int] = (3, 0)
10+
__version_info__: tuple[int, int] = (3, 1)
1111
__version__: str = f"{__version_info__[0]}.{__version_info__[1]}"
1212
__author__: str = "bl-sdk"
1313

1414
# Importing most of these for side effects
1515
from . import outer_menu # noqa: F401 # pyright: ignore[reportUnusedImport]
1616
from .favourites import favourites_option
1717

18-
base_mod.components.append(base_mod.ComponentInfo("Willow Mod Menu", __version__))
19-
base_mod.options.append(GroupedOption("Willow Mod Menu", (favourites_option,)))
18+
base_mod.components.append(base_mod.ComponentInfo("Willow2 Mod Menu", __version__))
19+
base_mod.options.append(GroupedOption("Willow2 Mod Menu", (favourites_option,)))

src/willow2_mod_menu/outer_menu.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class ENetMode(UnrealEnum):
3535
DLC_MENU_CONTROLLER_TO_KB_KEY_MAP = {
3636
"Gamepad_LeftStick_Up": "Up",
3737
"Gamepad_LeftStick_Down": "Down",
38+
"XboxTypeS_Start": "Enter",
3839
"XboxTypeS_A": "Enter",
3940
"XboxTypeS_B": "Escape",
4041
"XboxTypeS_Y": "Q",
@@ -271,15 +272,12 @@ def marketplace_input_key(
271272
_3: Any,
272273
_4: BoundFunction,
273274
) -> tuple[type[Block], bool] | None:
275+
key: str = DLC_MENU_CONTROLLER_TO_KB_KEY_MAP.get(args.ukey, args.ukey)
276+
274277
try:
275-
key: str = DLC_MENU_CONTROLLER_TO_KB_KEY_MAP.get(args.ukey, args.ukey)
276278
event: EInputEvent = args.uevent
277279

278280
match key, event:
279-
# Keep the standard handling
280-
case (("Escape" | "Up" | "Down" | "W" | "S"), _):
281-
return None
282-
283281
# Page up/down are actually bugged on Gearbox's end: they look for both a released event
284282
# and a pressed or repeat, which is a contradition that can never be true.
285283
# Since there can be quite a few mods and we want to be able to scroll through them
@@ -320,14 +318,17 @@ def marketplace_input_key(
320318
return Block, True
321319

322320
case _, _:
323-
return Block, True
321+
pass
324322

325-
# If we let this function process normally, most inputs end up opening the steam store page
326-
# Make sure we always block it
327323
except Exception: # noqa: BLE001
328324
traceback.print_exc()
329325

330-
return Block, True
326+
# These inputs trigger logic in the standard menu, block them all, even if we got an exception.
327+
# If we let them through it usually ends up opening the steam store page.
328+
if key in {"Enter", "Q", "E"}:
329+
return Block, True
330+
331+
return None
331332

332333

333334
# Called to close the options menu. We temporarily enable it while in a mod options menu triggered

0 commit comments

Comments
 (0)