Skip to content

Commit 212dadd

Browse files
committed
support bl1
1 parent 5757c26 commit 212dadd

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

Readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ game specific things:
2222
### v1.10
2323
- Moved a few warnings to go through Python's system, so they get attributed to the right place.
2424

25+
- Added support for BL1.
26+
2527
### v1.9
2628
- Added a new `CoopSupport.HostOnly` value.
2729

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_pc(*, possibly_loading: bool = False) -> UObject | None:
127127

128128

129129
match Game.get_tree():
130-
case Game.Willow2:
130+
case Game.Willow1 | Game.Willow2:
131131
ENGINE = unrealsdk.find_object( # pyright: ignore[reportConstantRedefinition]
132132
"WillowGameEngine",
133133
"Transient.WillowGameEngine_0",

mod.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,30 @@
2626
class Game(Flag):
2727
"""A flags enum of the supported games."""
2828

29+
BL1 = auto()
2930
BL2 = auto()
3031
TPS = auto()
3132
AoDK = auto()
3233
BL3 = auto()
3334
WL = auto()
3435

36+
Willow1 = BL1
3537
Willow2 = BL2 | TPS | AoDK
3638
Oak = BL3 | WL
3739

3840
@staticmethod
3941
@cache
40-
def get_current() -> Literal[Game.BL2, Game.TPS, Game.AoDK, Game.BL3, Game.WL]:
42+
def get_current() -> Literal[Game.BL1, Game.BL2, Game.TPS, Game.AoDK, Game.BL3, Game.WL]:
4143
"""Gets the current game."""
4244

4345
# As a bit of safety, we can use the architecture to limit which games are allowed
4446
is_64bits = sys.maxsize > 2**32
4547

46-
lower_exe_names: dict[str, Literal[Game.BL2, Game.TPS, Game.AoDK, Game.BL3, Game.WL]]
47-
default_game: Literal[Game.BL2, Game.TPS, Game.AoDK, Game.BL3, Game.WL]
48+
lower_exe_names: dict[
49+
str,
50+
Literal[Game.BL1, Game.BL2, Game.TPS, Game.AoDK, Game.BL3, Game.WL],
51+
]
52+
default_game: Literal[Game.BL1, Game.BL2, Game.TPS, Game.AoDK, Game.BL3, Game.WL]
4853
if is_64bits:
4954
lower_exe_names = {
5055
"borderlands3.exe": Game.BL3,
@@ -53,6 +58,7 @@ def get_current() -> Literal[Game.BL2, Game.TPS, Game.AoDK, Game.BL3, Game.WL]:
5358
default_game = Game.BL3
5459
else:
5560
lower_exe_names = {
61+
"borderlands.exe": Game.BL1,
5662
"borderlands2.exe": Game.BL2,
5763
"borderlandspresequel.exe": Game.TPS,
5864
"tinytina.exe": Game.AoDK,
@@ -72,7 +78,7 @@ def get_current() -> Literal[Game.BL2, Game.TPS, Game.AoDK, Game.BL3, Game.WL]:
7278

7379
@staticmethod
7480
@cache
75-
def get_tree() -> Literal[Game.Willow2, Game.Oak]:
81+
def get_tree() -> Literal[Game.Willow1, Game.Willow2, Game.Oak]:
7682
"""
7783
Gets the "tree" the game we're currently running belongs to.
7884
@@ -84,6 +90,8 @@ def get_tree() -> Literal[Game.Willow2, Game.Oak]:
8490
The current game's tree.
8591
"""
8692
match Game.get_current():
93+
case Game.BL1:
94+
return Game.Willow1
8795
case Game.BL2 | Game.TPS | Game.AoDK:
8896
return Game.Willow2
8997
case Game.BL3 | Game.WL:

mod_list.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ def cmp(a: Mod, b: Mod) -> int:
9797
MOD_RELEASE_DOWNLOAD_URL: str
9898

9999
match Game.get_tree():
100+
case Game.Willow1:
101+
MOD_DB_URL = ( # pyright: ignore[reportConstantRedefinition]
102+
"https://bl-sdk.github.io/willow1-mod-db/"
103+
)
104+
MOD_RELEASE_API_URL = ( # pyright: ignore[reportConstantRedefinition]
105+
"https://api.github.com/repos/bl-sdk/willow1-mod-manager/releases/latest"
106+
)
107+
MOD_RELEASE_DOWNLOAD_URL = ( # pyright: ignore[reportConstantRedefinition]
108+
"https://github.com/bl-sdk/willow1-mod-manager/releases/"
109+
)
100110
case Game.Willow2:
101111
MOD_DB_URL = ( # pyright: ignore[reportConstantRedefinition]
102112
"https://bl-sdk.github.io/willow2-mod-db/"

0 commit comments

Comments
 (0)