Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for STALKER: Shadow of Chernobyl. #106

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
2fc690b
Add Monster Hunter Rise support
RodolfoFigueroa Jul 28, 2022
8651887
Update game_monsterhunterrise.py
Jul 28, 2022
92a354f
Add support for STALKER: Shadow of Chernobyl.
lowtied Jan 31, 2023
fba8fd5
Preliminary secondary data directory support
Silarn Sep 4, 2023
bff84ec
Use map so we can set an origin name
Silarn Sep 5, 2023
1b142d0
Fixes for python 3.11
Silarn Sep 8, 2023
fe3cd9b
Return if no INI exists
Silarn Sep 12, 2023
f2aed61
Return if install_path doesn't exist
Silarn Sep 12, 2023
f24f86e
Basic save support
Silarn Sep 15, 2023
1dc70b5
WIP: Add savegame parsing
Silarn Sep 16, 2023
76a1e24
Implement full save display
Silarn Sep 16, 2023
8011cb9
Bump version
Silarn Sep 16, 2023
3303ce5
Merge pull request #112 from ModOrganizer2/starfield
Silarn Sep 17, 2023
6db3411
Merge branch 'master' of https://github.com/ModOrganizer2/modorganize…
Silarn Sep 19, 2023
a846216
Holt's recommendations
Silarn Sep 19, 2023
252ba9f
Use assert
Silarn Sep 19, 2023
0f10636
Merge pull request #114 from ModOrganizer2/bs_saves
Holt59 Sep 19, 2023
55a987b
Additional fixes and cleanup for python updates
Silarn Sep 16, 2023
4b20534
Add contribute section to README.md.
Holt59 Sep 23, 2023
5c84ee6
Fix CI.
Holt59 Sep 23, 2023
1117e72
Merge pull request #102 from RodolfoFigueroa/master
Holt59 Sep 23, 2023
7d4002e
Sekiro: Shadows Die Twice Support Plugin
kols Sep 23, 2023
5fe30fe
Merge pull request #115 from kols/patch-1
Holt59 Sep 23, 2023
adcd06d
Merge pull request #113 from ModOrganizer2/python311
Holt59 Sep 24, 2023
050739e
Fix subnautica mod data checker initialization.
Holt59 Sep 24, 2023
2c68322
Merge pull request #116 from ModOrganizer2/dev/fix-moddatachecker-usage
Holt59 Sep 24, 2023
5ca38c7
Use poe for linting.
Holt59 Sep 25, 2023
0c15b51
Merge pull request #117 from ModOrganizer2/dev/poe
Holt59 Sep 25, 2023
f99da81
Fix python 3.11 psutil error
ZashIn Sep 25, 2023
3749d18
Add .venv linter exception + cleanup
ZashIn Sep 25, 2023
2802df3
Merge pull request #118 from ZashIn/fix/python11_deps_linters
Holt59 Sep 26, 2023
c441e42
Fix valid match in `BasicModDataChecker.dataLooksValid()`
ZashIn Oct 2, 2023
01d2c33
Merge pull request #119 from ZashIn/fix/BasicModDataChecker.dataLooks…
Holt59 Oct 2, 2023
4354644
Add enabledPlugins
Silarn Oct 4, 2023
265b174
Merge pull request #120 from ModOrganizer2/loot_0_22
Silarn Oct 4, 2023
7d3da34
Use defaults set in UIBase
Silarn Oct 4, 2023
34ec663
Bump stubs to dev15
Silarn Oct 4, 2023
27d17ee
Merge pull request #121 from ModOrganizer2/uibase_updates
Silarn Oct 4, 2023
583bb78
Add BasicLocalSavegames (basic_feature) (#122)
ZashIn Oct 8, 2023
44645a5
Add metadata to BasicGameSaveGameInfo(Widget) (#109)
ZashIn Oct 8, 2023
cf2a700
Cyberpunk full support (#105)
ZashIn Oct 15, 2023
22f88eb
Fix CyberpunkModDataChecker not accepting extra files
ZashIn Oct 16, 2023
b99c053
Merge pull request #124 from ZashIn/cyberpunk
Silarn Oct 18, 2023
8995d23
Fix mods expecting alphabetical load order
ZashIn Oct 18, 2023
bcf7f0e
Merge pull request #125 from ZashIn/cyberpunk-archive-load-order
Silarn Oct 19, 2023
fba4bd8
Add mapping GameIniFiles: iniFiles() to BasicGame (#123)
ZashIn Oct 21, 2023
dbcbd91
Fix game updates: clear overwrite/r6/cache
ZashIn Nov 4, 2023
94e43f8
Add setting clear_cache_after_game_update
ZashIn Nov 4, 2023
6036615
Bump cyberpunk plugin version 2.2.3
ZashIn Nov 11, 2023
4d7a7cc
Merge pull request #127 from ZashIn/cyberpunk-fix-game-update
Silarn Nov 17, 2023
9b805f6
Add support for STALKER: Shadow of Chernobyl.
lowtied Jan 31, 2023
07fbb35
Merge branch 'master' of https://github.com/lowtied/modorganizer-basi…
lowtied Dec 7, 2023
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
34 changes: 16 additions & 18 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@ on: [push, pull_request]
jobs:
checks:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v1
with:
path: basic_games
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test with tox
run: tox -e py38-lint
- uses: actions/checkout@v4
with:
path: "basic_games"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- uses: abatilo/actions-poetry@v2
- name: Install
run: |
cd basic_games
poetry install
- name: Lint
run: |
cd basic_games
poetry run poe lint-all
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.mypy_cache
__pycache__
.venv
.tox
.vscode
.idea
Expand Down
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Download the archive for your MO2 version and extract it directly into your MO2
**Important:** Extract the *folder* in your `plugins` folder, not the individual files. Your
`plugins` folder should look like this:

```
```text
dlls/
plugins/
data/
Expand Down Expand Up @@ -152,6 +152,7 @@ class Witcher3Game(BasicGame):
| GameLauncher | Name of the game launcher, relative to the game path (Optional) | `getLauncherName` | `str` |
| GameDataPath | Name of the folder containing mods, relative to game folder| `dataDirectory` | |
| GameDocumentsDirectory | Documents directory (Optional) | `documentsDirectory` | `str` or `QDir` |
| GameIniFiles | Config files in documents, for profile specific config (Optional) | `iniFiles` | `str` or `List[str]` |
| GameSavesDirectory | Directory containing saves (Optional, default to `GameDocumentsDirectory`) | `savesDirectory` | `str` or `QDir` |
| GameSaveExtension | Save file extension (Optional) `savegameExtension` | `str` |
| GameSteamId | Steam ID of the game (Optional) | `steamAPPId` | `List[str]` or `str` or `int` |
Expand All @@ -176,10 +177,13 @@ The meta-plugin provides some useful extra feature:
`GameOriginManifestIds`, `GameEpicId` or `GameEaDesktopId`), the game will be listed
in the list of available games when creating a new MO2 instance (if the game is
installed via Steam, GOG, Origin, Epic Games / Legendary or EA Desktop).
2. **Basic save game preview:** If you use the Python version, and if you can easily obtain a picture (file)
for any saves, you can provide basic save-game preview by using the `BasicGameSaveGameInfo`.
See [games/game_witcher3.py](games/game_witcher3.py) for more details.
3. **Basic mod data checker** (Python):
2. **Basic save game preview / metadata** (Python): If you can easily obtain a picture
(file) and/or metadata (like from json) for any saves, you can provide basic save-game
preview by using the `BasicGameSaveGameInfo`. See
[games/game_witcher3.py](games/game_witcher3.py) and
[games/game_bladeandsorcery.py](games/game_bladeandsorcery.py) for more details.
3. **Basic local save games** (Python): profile specific save games, as in [games/game_valheim.py](games/game_valheim.py).
4. **Basic mod data checker** (Python):
Check and fix different mod archive layouts for an automatic installation with the proper
file structure, using simple (glob) patterns via `BasicModDataChecker`.
See [games/game_valheim.py](games/game_valheim.py) and [game_subnautica.py](games/game_subnautica.py) for an example.
Expand All @@ -195,3 +199,23 @@ Game IDs can be found here:
- For Legendary (alt. Epic launcher) via command `legendary list-games`
or from: `%USERPROFILE%\.config\legendary\installed.json`
- For EA Desktop from `<EA Games install location>\<game title>\__Installer\installerdata.xml`

## Contribute

We recommend using a dedicated Python environment to write a new basic game plugins.

1. Install the required version of Python --- Currently Python 3.11 (MO2 2.5).
2. Remove the repository at `${MO2_INSTALL}/plugins/basic_games`.
3. Clone this repository at the location of the old plugin (
`${MO2_INSTALL}/plugins/basic_games`).
4. Place yourself inside the cloned folder and:

```bash
# create a virtual environment (recommended)
py -3.11 -m venv .\venv
.\venv\scripts\Activate.ps1

# "install" poetry and the development package
pip install poetry
poetry install
```
3 changes: 1 addition & 2 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# pyright: reportUnboundVariable=false

import glob
import importlib
Expand All @@ -17,7 +17,6 @@


def createPlugins():

# List of game class from python:
game_plugins: typing.List[BasicGame] = []

Expand Down
12 changes: 9 additions & 3 deletions basic_features/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# -*- encoding: utf-8 -*-
from .basic_local_savegames import BasicLocalSavegames
from .basic_mod_data_checker import BasicModDataChecker, GlobPatterns
from .basic_save_game_info import BasicGameSaveGameInfo

from .basic_mod_data_checker import BasicModDataChecker # noqa
from .basic_save_game_info import BasicGameSaveGameInfo # noqa
__all__ = [
"BasicModDataChecker",
"BasicGameSaveGameInfo",
"GlobPatterns",
"BasicLocalSavegames",
]
21 changes: 21 additions & 0 deletions basic_features/basic_local_savegames.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import mobase
from PyQt6.QtCore import QDir


class BasicLocalSavegames(mobase.LocalSavegames):
def __init__(self, game_save_dir: QDir):
super().__init__()
self._game_saves_dir = game_save_dir.absolutePath()

def mappings(self, profile_save_dir: QDir):
return [
mobase.Mapping(
source=profile_save_dir.absolutePath(),
destination=self._game_saves_dir,
is_directory=True,
create_target=True,
)
]

def prepareProfile(self, profile: mobase.IProfile) -> bool:
return profile.localSavesEnabled()
Loading