diff --git a/.cruft.json b/.cruft.json index e3b981f..6f9a9b7 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "git@github.com:bl-sdk/common_dotfiles.git", - "commit": "d03eee713ad436d20033d0598eb88f1529c56ca8", + "commit": "3d7189e61172cb95877261df8313ae595fe6c02d", "checkout": null, "context": { "cookiecutter": { @@ -15,7 +15,8 @@ "__project_slug": "console_mod_menu", "include_cpp": false, "include_py": true, - "_template": "git@github.com:bl-sdk/common_dotfiles.git" + "_template": "git@github.com:bl-sdk/common_dotfiles.git", + "_commit": "3d7189e61172cb95877261df8313ae595fe6c02d" } }, "directory": null diff --git a/.gitignore b/.gitignore index ab0f7a4..dcb3783 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .vs .vscode +.idea __pycache__ diff --git a/Readme.md b/Readme.md index d924781..c1b6a91 100644 --- a/Readme.md +++ b/Readme.md @@ -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. diff --git a/__init__.py b/__init__.py index ef42a05..0325246 100644 --- a/__init__.py +++ b/__init__.py @@ -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 @@ -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" @@ -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__)) diff --git a/draw.py b/draw.py index 86b73bb..f796348 100644 --- a/draw.py +++ b/draw.py @@ -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) @@ -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: diff --git a/pyproject.toml b/pyproject.toml index 4ebc61f..48036fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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", @@ -76,16 +86,6 @@ ignore = [ "D410", "D411", "D413", - "ANN101", - "ANN102", - "ANN401", - "S101", - "S603", - "S607", - "PYI011", - "PYI021", - "PYI029", - "PYI044", "PGH003", "PLR0904", "PLR0911", @@ -100,4 +100,4 @@ ignore = [ ] [tool.ruff.lint.per-file-ignores] -"*.pyi" = ["D418", "A002", "A003"] +"*.pyi" = ["A002", "A003", "D418"] diff --git a/screens/mod.py b/screens/mod.py index 3eff81d..a6fee71 100644 --- a/screens/mod.py +++ b/screens/mod.py @@ -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("")