-
Notifications
You must be signed in to change notification settings - Fork 104
/
__init__.py
49 lines (36 loc) · 1.46 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import os
import unrealsdk
from ..ModMenu import EnabledSaveType, SDKMod, Game, Keybind, ModTypes
from .challengemanager import ChallengeManagerInstance
from .savegamemanager import SaveGameManager
from .events import KilledEnemyEventManager
from .options import B_FEEDBACK_OPTION
def _get_pc() -> unrealsdk.UObject:
return unrealsdk.GetEngine().GamePlayers[0].Actor
# noinspection PyUnusedLocal
class BadassBounties(SDKMod):
Name = "Badass Bounties"
Description = "Adds many randomly generated Bounties to the game."
Author = "Juso | JoltzDude139"
Version = "1.0"
Types = ModTypes.Gameplay
SaveEnabledState = EnabledSaveType.LoadOnMainMenu
SupportedGames = Game.BL2
def __init__(self):
super().__init__()
self.PATH = os.path.dirname(os.path.realpath(__file__))
self.save_manager = SaveGameManager(self.PATH)
self.Keybinds = [
Keybind("Show Bounty Menu", "F4", OnPress=lambda _: ChallengeManagerInstance.show_challenge_menu()),
Keybind("Show Active Bounties", "F5", OnPress=lambda _: ChallengeManagerInstance.show_current_challenges()),
]
self.Options = [B_FEEDBACK_OPTION]
def Enable(self):
super().Enable()
KilledEnemyEventManager.register_hooks()
self.save_manager.enable()
def Disable(self):
super().Disable()
KilledEnemyEventManager.remove_hooks()
self.save_manager.disable()
unrealsdk.RegisterMod(BadassBounties())