Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "[email protected]:bl-sdk/common_dotfiles.git",
"commit": "d03eee713ad436d20033d0598eb88f1529c56ca8",
"commit": "3d7189e61172cb95877261df8313ae595fe6c02d",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -15,7 +15,8 @@
"__project_slug": "console_mod_menu",
"include_cpp": false,
"include_py": true,
"_template": "[email protected]:bl-sdk/common_dotfiles.git"
"_template": "[email protected]:bl-sdk/common_dotfiles.git",
"_commit": "3d7189e61172cb95877261df8313ae595fe6c02d"
}
},
"directory": null
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vs
.vscode
.idea

__pycache__
4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ a message as the second (both positionally), and show them in a temporary messag

# Changelog

### v1.5
- Support host-only coop support value
- Linting fixes

### v1.4
- Improved suggestions when trying to bind a key by name, and misspelling it.
- Swap known controller key names between UE3/UE4 versions, based on game.
Expand Down
5 changes: 3 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from mods_base import command
from mods_base.mod_list import base_mod
from unrealsdk import logging

from .screens import start_interactive_menu

Expand All @@ -11,7 +12,7 @@
"__version_info__",
)

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

Expand All @@ -24,7 +25,7 @@ def mods_command(_: argparse.Namespace) -> None:
mods_command.add_argument("-v", "--version", action="version", version=__version__)

mods_command.enable()
print("Console Mod Menu loaded. Type 'mods' to get started.")
logging.info("Console Mod Menu loaded. Type 'mods' to get started.")


base_mod.components.append(base_mod.ComponentInfo("Console Mod Menu", __version__))
5 changes: 3 additions & 2 deletions draw.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from textwrap import TextWrapper

from mods_base import html_to_plain_text
from unrealsdk import logging

wrapper = TextWrapper(width=100, expand_tabs=True, tabsize=2)

Expand All @@ -18,11 +19,11 @@ def draw(msg: str, indent: int = 0) -> None:
prefix = "Mod Menu | " + (" " * indent)

if not msg:
print("Mod Menu |")
logging.info("Mod Menu |")
return

for line in wrapper.fill(html_to_plain_text(msg)).splitlines():
print(prefix, line)
logging.info(prefix, line)


def draw_description(description: str, indent: int = 0) -> None:
Expand Down
56 changes: 28 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@ target-version = "py313"
line-length = 100

[tool.ruff.lint]
# Last time rules scrutinised: ruff 0.6.9 / 2024-10-08
# Last time rules scrutinised: ruff 0.11.0 / 2025-03-20
select = [
"F",
"W",
"E",
"C90",
"I",
"N",
"D",
"UP",
"ERA",
"YTT",
"ANN",
"ASYNC",
Expand All @@ -31,34 +24,51 @@ select = [
"C4",
"DTZ",
"T10",
"FIX",
"FA",
"INT",
"ISC",
"ICN",
"LOG",
"G",
"PIE",
"T20",
"PYI",
"Q",
"RSE",
"RET",
"SLOT",
"SIM",
"SLOT",
"TID",
"TCH",
"INT",
"TD",
"TC",
"ARG",
"PTH",
"TD",
"FIX",
"ERA",
"PGH",
"PL",
"FLY",
"I",
"C90",
"N",
"PERF",
"E",
"W",
"D",
"F",
"PGH",
"PL",
"UP",
"FURB",
"RUF",
]
ignore = [
"ANN401",
"S101",
"S603",
"S607",
"PYI011",
"PYI021",
"PYI029",
"PYI044",
"TC006",
"D100",
"D101",
"D104",
Expand All @@ -76,16 +86,6 @@ ignore = [
"D410",
"D411",
"D413",
"ANN101",
"ANN102",
"ANN401",
"S101",
"S603",
"S607",
"PYI011",
"PYI021",
"PYI029",
"PYI044",
"PGH003",
"PLR0904",
"PLR0911",
Expand All @@ -100,4 +100,4 @@ ignore = [
]

[tool.ruff.lint.per-file-ignores]
"*.pyi" = ["D418", "A002", "A003"]
"*.pyi" = ["A002", "A003", "D418"]
2 changes: 2 additions & 0 deletions screens/mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ def draw_mod_header(self) -> None:
draw("Coop Support: Requires All Players")
case CoopSupport.ClientSide:
draw("Coop Support: Client Side")
case CoopSupport.HostOnly:
draw("Coop Support: Host Only")

draw("")

Expand Down