Skip to content

Commit

Permalink
Merge pull request #17 from apple1417/master
Browse files Browse the repository at this point in the history
more tps fixes
  • Loading branch information
apple1417 authored Jan 2, 2025
2 parents a4ff008 + 025e67b commit 0996d38
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 16 deletions.
14 changes: 14 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## v3.2: (codename tbd)

### Legacy Compat v1.1
- Fixed that some legacy mods would not auto-enable properly.

### [pyunrealsdk v1.5.2](https://github.com/bl-sdk/pyunrealsdk/blob/master/changelog.md#v152)
This version has no `pyunrealsdk` changes, it simply pulled in a new version of `unrealsdk`.

### [unrealsdk v1.6.1](https://github.com/bl-sdk/unrealsdk/blob/master/changelog.md#v161)
> - Handled `UClass::Interfaces` also having a different offset between BL2 and TPS.
### Willow2 Mod Menu v3.1
- Fixed mouse input not working properly in the main menu mod list.

## v3.1: Omni-Cannon

### [pyunrealsdk v1.5.1](https://github.com/bl-sdk/pyunrealsdk/blob/master/changelog.md#v151)
Expand Down
2 changes: 1 addition & 1 deletion libs/pyunrealsdk
2 changes: 1 addition & 1 deletion manager_pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[project]
name = "willow_mod_manager"
version = "3.1"
version = "3.2"
authors = [{ name = "bl-sdk" }]

[tool.sdkmod]
Expand Down
11 changes: 10 additions & 1 deletion src/legacy_compat/ModMenu/ModObjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,16 @@ def enabling_locked(self, val: bool) -> None: # pyright: ignore[reportIncompati

@property
def auto_enable(self) -> bool:
# Load on main menu is implemented inside LoadModSettings
# During the default save/load mod settings function, return true for both types of saving,
# to make sure that we add it to the settings file
if inspect.stack()[1].function in {
"default_load_mod_settings",
"default_save_mod_settings",
}:
return self.legacy_mod.SaveEnabledState != EnabledSaveType.NotSaved

# At all other times, treat load on main menu as *not* auto enabled, so that we can manually
# implement it (inside LoadModSettings), rather than having mods_base load it immediately.
return self.legacy_mod.SaveEnabledState == EnabledSaveType.LoadWithSettings

@auto_enable.setter
Expand Down
2 changes: 1 addition & 1 deletion src/legacy_compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"legacy_compat",
)

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

Expand Down
6 changes: 3 additions & 3 deletions src/willow2_mod_menu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"__version_info__",
]

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

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

base_mod.components.append(base_mod.ComponentInfo("Willow Mod Menu", __version__))
base_mod.options.append(GroupedOption("Willow Mod Menu", (favourites_option,)))
base_mod.components.append(base_mod.ComponentInfo("Willow2 Mod Menu", __version__))
base_mod.options.append(GroupedOption("Willow2 Mod Menu", (favourites_option,)))
19 changes: 10 additions & 9 deletions src/willow2_mod_menu/outer_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ENetMode(UnrealEnum):
DLC_MENU_CONTROLLER_TO_KB_KEY_MAP = {
"Gamepad_LeftStick_Up": "Up",
"Gamepad_LeftStick_Down": "Down",
"XboxTypeS_Start": "Enter",
"XboxTypeS_A": "Enter",
"XboxTypeS_B": "Escape",
"XboxTypeS_Y": "Q",
Expand Down Expand Up @@ -271,15 +272,12 @@ def marketplace_input_key(
_3: Any,
_4: BoundFunction,
) -> tuple[type[Block], bool] | None:
key: str = DLC_MENU_CONTROLLER_TO_KB_KEY_MAP.get(args.ukey, args.ukey)

try:
key: str = DLC_MENU_CONTROLLER_TO_KB_KEY_MAP.get(args.ukey, args.ukey)
event: EInputEvent = args.uevent

match key, event:
# Keep the standard handling
case (("Escape" | "Up" | "Down" | "W" | "S"), _):
return None

# Page up/down are actually bugged on Gearbox's end: they look for both a released event
# and a pressed or repeat, which is a contradition that can never be true.
# Since there can be quite a few mods and we want to be able to scroll through them
Expand Down Expand Up @@ -320,14 +318,17 @@ def marketplace_input_key(
return Block, True

case _, _:
return Block, True
pass

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

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

return None


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

0 comments on commit 0996d38

Please sign in to comment.