This repository was archived by the owner on Jan 1, 2025. It is now read-only.
Mod Manager Rewrite #73
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rewrites most of the mod menu adding new features and cleaning up existing ones, as well as adds a few minor tweaks to the dll. This contains a few breaking changes, but only to features not yet widely used.
Major Changes (aka Update Notes)
Moved some files around, to update you must delete the
Mods\General
folder and all loose.py
files in theMods
folder before copying the new files over.Re-enabled loading of custom dlls from the
Plugins
folder - Command Injector and Borderlands Commander will now be compatible.Added favoriting of mods. Favorites appear at the top of the mods list.
Moved all modded keybinds to their own "Modded Keybinds" menu, and allowed unbinding modded keybinds - just try bind to the key it's already bound to.
Fixed that the mod options menu would just open the gameplay menu if your game's language wasn't English.
All Changes
DLL Changes
unrealsdk.Log()
now accepts varargs, printed as a space-separated string.py
commands now haveunrealsdk
andMods
imported by default.The
Mods
directory is no longer appended tosys.path
.Increased the version number to 0.7.8.
Re-enabled loading of custom dlls from the
Plugins
folder.General Python Changes
Moved all mod-manager specific files into the
ModMenu
folder.Reformatted all code to mostly follow pep 8 and have type hints.
Added/updated docstrings everywhere. Read them, they're probably more accurate than this changelog.
Increased
unrealsdk.PythonManagerVersion
to 2.General\__init__.py
Merged into
ModMenu\MenuManager.py
.Removed the ability to reload mods, as most are not designed with this in mind and cause issues.
Redirected help link to http://borderlandsmodding.com/sdk-mods/.
Util.py
Entirely removed.
__init__.py
Now prints the SDK version on launch.
Prevented attempting to import
__pycache__
, as well as any folder starting with a.
.Print an extra line of traceback when a mod throws an exception while importing, this contains the line number where it was thrown.
ModMenu\__init__.py
Added
VERSION_MAJOR
andVERSION_MINOR
fields - deprecatingunrealsdk.PythonManagerVersion
. This is printed on launch.Added explicit exports.
Added a lot of aliasing to allow compatibility with existing mods, most of which should be considered deprecated.
ModMenu\DeprecationManager.py
Added some helper functions to print deprecation messages only once - so your console doesn't get spammed when loading an old mod.
ModMenu\KeybindManager.py
Deprecated the use of lists for keybinds, now provides the dataclass
Keybind
instead.Added an
InputEvent
enum, which holds the various unreal engine input event types.Moved all custom keybinds to their own "Modded Keybinds" menu. The "Keybinds" menu now only stores the default ones.
Attempted to fix an issue where modded keybinds would occasionally have their keys fail localization.
Allowed unbinding modded keybinds - just bind to the same key.
Made resetting default keybinds also reset all keybinds using the new
Keybind
class. Legacy keybinds will not be reset.ModMenu\MenuManager.py
Renamed from
ModMenuManager.py
.Added favoriting of mods. Favorites appear at the top of the mods list.
Added priorities to mods. Mods of higher priority appear higher up the mod list. Equal priorities are ordered alphabetically by name.
Added a function
GetOrderedModList()
to get a list of mods in the same order that they appear in the menu.Added an extra mod type for libraries.
Moved the ability to filter mods to just the
General
mod that appears at the top of the list.Fixed that mod statuses would only ever display as exactly
Enabled
orDisabled
.Changed where mod author is displayed, and also display mod version.
Removed the
[Escape] Cancel
tooltip from all mods, so they have more space to add their own binds.Updated the control hints at the bottom right of the main menu to also mention the keybind to open the mods menu. In BL2 it will also display the network/character hints like in TPS.
ModMenu\ModObjects.py
Renamed from
ModManager.py
.Added
ModPriorities
,EnabledSaveType
, andGame
enums.Converted the
ModTypes
enum to a flag enum.Renamed
BL2MOD
toSDKMod
.Made
SDKMod
abstract, though with no abstract methods.Added a custom metaclass to
SDKMod
, so that subclassing it creates copies of all attributes rather than references, preventing individual mods from affecting other.Removed the
getModModule
function.Removed the
ModMenuOpened
list.SDKMod
ChangesAdded a string
Version
field to be displayed in the mods menu.Added a
SupportedGames
field that prevents the user from enabling the mod when loaded in an unsupported game.Changed
Types
to be aModTypes
instance rather than a list, since that was changed to a flag enum.Added a
Priority
field to adjust where in the mods list the mod displays by default.Added a
SaveEnabledState
field, which will save the enabled state across game launches. This is disabled by default. Closes #56Added a boolean
IsEnabled
field, which should be used to check enabled state rather than checking status.Changed the default
SettingsInputPressed
method to not overwrite the entireSettingsInputs
dictionary.Added an extra argument
event
toGameInputPressed
. For compatibility reasons, if a mod does not define this argument it will only be called when it is equal toInputEvent.Pressed
.Removed the
GameInputReleased
andGameInputRebound
callbacks.Changed the
ModOptionChanged
callback to be called before theCurrentValue
field on the option is changed.ModMenu\OptionManager.py
Moved the
Options
class out into it's own module.Made the mod options menu always be shown, but be disabled if no enabled mods define any options.
Fixed #72 - that the options menu would only properly open in english.
Added header fields and nested menus.
No longer prefixes every option with the mod's name, instead adds a mod header before any of it's options.
Changed a lot of specific type checks to
isinstance
checks, allowing you to subclass options.ModMenu\Options.py
Added inheritance between different option types. All options eventually inherit from
Option.Base
. All options that store a value inherit fromOptions.Value
.Standardized all field names - e.g. all constructors have
StartingValue
fields, spinners no longer useStartingChoice
.Add a
IsHidden
field to all options, to easily hide it from the menu.Add
Field
andNested
classes to display a header field and a field leading to a nested menu respectively. These do not store values.ModMenu\SettingsManager.py
Renamed from
SaveManager.py
.Added a
GetSettingsFilePath
function which a mod can use to easily get it's own path.Added a
SaveModSettings
function to save settings for a single mod.Made the old function
storeModSettings
a deprecated alias forSaveAllModSettings
, which serves the same purpose.Added a
LoadModSettings
function to load a single mod's settings. This used to only be inRegisterMod
, it's now a separate function thatRegisterMod
calls.