Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.4.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rlnt committed Mar 25, 2021
2 parents 2bc53bb + 718f3ec commit 7bbbf91
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 29 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ The format is based on [Keep a Changelog][keep a changelog] and this project adh

## [Released]

## [0.4.0] - 2021-03-25

### Added
- getCurrentWorldInfo function
- getCurrentGameInfo function
- getSkillManager function
- getActionSkill function
- getVaultHunterClassName function
- missing functions to all array


## [0.3.2] - 2021-03-22

### Added
Expand Down Expand Up @@ -67,6 +78,7 @@ The format is based on [Keep a Changelog][keep a changelog] and this project adh
<!-- Versions -->
[unreleased]: https://github.com/RLNT/bl2_eridium/compare/v1.0.0...HEAD
[released]: https://github.com/RLNT/bl2_eridium/releases
[0.4.0]: https://github.com/RLNT/bl2_eridium/compare/v0.3.2...v0.4.0
[0.3.2]: https://github.com/RLNT/bl2_eridium/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/RLNT/bl2_eridium/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/RLNT/bl2_eridium/compare/v0.2.0...v0.3.0
Expand Down
51 changes: 48 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import unrealsdk
import sys
import webbrowser
from typing import Any, Dict, cast
from typing import Any, Dict, Optional, cast

from Mods.EridiumLib import debug, keys
from Mods.EridiumLib.keys import KeyBinds
Expand Down Expand Up @@ -40,8 +40,14 @@
"log",
"isClient",
"getCurrentPlayerController",
"getCurrentWorldInfo",
"getCurrentGameInfo",
"getSkillManager",
"getActionSkill",
"getVaultHunterClassName",
"getLatestVersion",
"isLatestRelease",
"EridiumMod",
"missions",
"keys",
"debug",
# redistributed modules
Expand All @@ -52,7 +58,7 @@
"socket",
"ssl",
]
__version__ = "0.3.2"
__version__ = "0.4.0"


def log(mod: SDKMod, *args: Any) -> None:
Expand All @@ -69,6 +75,45 @@ def getCurrentPlayerController() -> unrealsdk.UObject:
return cast(unrealsdk.UObject, unrealsdk.GetEngine().GamePlayers[0].Actor)


def getCurrentWorldInfo() -> unrealsdk.UObject:
"""Returns the current world info."""
return cast(unrealsdk.UObject, unrealsdk.GetEngine().GetCurrentWorldInfo())


def getCurrentGameInfo() -> unrealsdk.UObject:
"""Returns the current game info."""
return cast(unrealsdk.UObject, getCurrentWorldInfo().Game)


def getSkillManager() -> unrealsdk.UObject:
"""Returns the global skill manager from the game info."""
return cast(unrealsdk.UObject, getCurrentGameInfo().GetSkillManager())


def getActionSkill(PC: Optional[unrealsdk.UObject] = None) -> unrealsdk.UObject:
"""
Returns the action skill of a player controller.
A player controller can be passed in.
If no player controller is passed in, the local player will be used.
"""
if PC is None:
PC = getCurrentPlayerController()

return cast(unrealsdk.UObject, PC.PlayerSkillTree.GetActionSkill())


def getVaultHunterClassName(PC: Optional[unrealsdk.UObject] = None) -> str:
"""
Returns the class name of a Vault Hunter of a player controller.
A player controller can be passed in.
If no player controller is passed in, the local player will be used.
"""
if PC is None:
PC = getCurrentPlayerController()

return str(PC.PlayerClass.CharacterNameId.CharacterClassId.ClassName)


def getLatestVersion(repo: str) -> str:
response = requests.get(f"https://api.github.com/repos/{repo}/releases")
response.raise_for_status()
Expand Down
50 changes: 24 additions & 26 deletions modinfo.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
{
"mods": [
{
"name": "EridiumLib",
"authors": ["Chronophylos", "Relentless"],
"description": [
"Holds utility functions for some mods.\n",
"\n",
"Everything related to versions and their release notes can be found in the [changelog](https://github.com/RLNT/bl2_eridium/blob/main/CHANGELOG.md).\n",
"If you found a bug or you have a feature request, please use our issue tracker linked below.\n",
"In case you need support, please join our [Discord](https://discordapp.com/invite/Q3qxws6)."
],
"tagline": "Holds utility functions for some mods.",
"types": ["Library"],
"supports": ["BL2", "TPS"],
"issues": "https://github.com/RLNT/bl2_eridium/issues",
"source": "https://github.com/RLNT/bl2_eridium",
"latest": "0.3.2",
"versions": {
"0.3.2": "https://github.com/RLNT/bl2_eridium/releases/tag/v0.3.2"
},
"license": [
"GNU Lesser General Public License v2.1",
"https://github.com/RLNT/bl2_eridium/blob/main/LICENSE"
]
}
]
"mods": [
{
"name": "EridiumLib",
"authors": ["Chronophylos", "Relentless"],
"description": [
"Holds utility functions for some mods.\n",
"\n",
"Everything related to versions and their release notes can be found in the [changelog](https://github.com/RLNT/bl2_eridium/blob/main/CHANGELOG.md).\n",
"If you found a bug or you have a feature request, please use our issue tracker linked below.\n",
"In case you need support, please join our [Discord](https://discordapp.com/invite/Q3qxws6)."
],
"tagline": "Holds utility functions for some mods.",
"types": ["Library"],
"supports": ["BL2", "TPS"],
"issues": "https://github.com/RLNT/bl2_eridium/issues",
"source": "https://github.com/RLNT/bl2_eridium",
"latest": "0.4.0",
"versions": {
"0.4.0": "https://github.com/RLNT/bl2_eridium/releases/tag/v0.4.0",
"0.3.2": "https://github.com/RLNT/bl2_eridium/releases/tag/v0.3.2"
},
"license": ["GNU Lesser General Public License v2.1", "https://github.com/RLNT/bl2_eridium/blob/main/LICENSE"]
}
]
}

0 comments on commit 7bbbf91

Please sign in to comment.