Skip to content

Commit

Permalink
Merge branch 'master' into pr/tdu2
Browse files Browse the repository at this point in the history
  • Loading branch information
uwx authored Apr 12, 2024
2 parents dfc0b31 + 78ced90 commit 77c57c6
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ You can rename `modorganizer-basic_games-xxx` to whatever you want (e.g., `basic
| METAL GEAR SOLID 3: Snake Eater — [STEAM](https://store.steampowered.com/app/2131650/METAL_GEAR_SOLID_3_Snake_Eater__Master_Collection_Version/)|[AkiraJkr](https://github.com/AkiraJkr)|[game_metalgearsolid3mc.py](games/game_metalgearsolid3mc.py)| |
| Mirror's Edge — [GOG](https://www.gog.com/game/mirrors_edge) / [STEAM](https://store.steampowered.com/app/17410/Mirrors_Edge)|[EzioTheDeadPoet](https://eziothedeadpoet.github.io/AboutMe/)|[game_mirrorsedge.py](games/game_mirrorsedge.py)| |
| Mount & Blade II: Bannerlord — [GOG](https://www.gog.com/game/mount_blade_ii_bannerlord) / [STEAM](https://store.steampowered.com/app/261550/Mount__Blade_II_Bannerlord/) | [Holt59](https://github.com/holt59/) | [game_mountandblade2.py](games/game_mountandblade2.py) | <ul><li>mod data checker</li></ul> |
| Need for Speed: High Stakes | [uwx](https://github.com/uwx) | [game_nfshs.py](games/game_nfshs.py) | |
| No Man's Sky - [GOG](https://www.gog.com/game/no_mans_sky) / [Steam](https://store.steampowered.com/app/275850/No_Mans_Sky/)|[EzioTheDeadPoet](https://eziothedeadpoet.github.io/AboutMe/)|[game_nomanssky.py](games/game_nomanssky.py)| |
| S.T.A.L.K.E.R. Anomaly — [MOD](https://www.stalker-anomaly.com/) | [Qudix](https://github.com/Qudix) | [game_stalkeranomaly.py](games/game_stalkeranomaly.py) | <ul><li>mod data checker</li></ul> |
| Stardew Valley — [GOG](https://www.gog.com/game/stardew_valley) / [STEAM](https://store.steampowered.com/app/413150/Stardew_Valley/) | [Syer10](https://github.com/Syer10), [Holt59](https://github.com/holt59/) | [game_stardewvalley.py](games/game_stardewvalley.py) | <ul><li>mod data checker</li></ul> |
Expand All @@ -69,9 +70,11 @@ You can rename `modorganizer-basic_games-xxx` to whatever you want (e.g., `basic
| Subnautica: Below Zero — [STEAM](https://store.steampowered.com/app/848450/) | [dekart811](https://github.com/dekart811), [Zash](https://github.com/ZashIn) | [game_subnautica-below-zero.py](games/game_subnautica-below-zero.py) | <ul><li>mod data checker</li><li>save game preview</li></ul> |
| Train Simulator Classic — [STEAM](https://store.steampowered.com/app/24010/) | [Ryan Young](https://github.com/YoRyan) | [game_trainsimulator.py](games/game_trainsimulator.py) | |
| Valheim — [STEAM](https://store.steampowered.com/app/892970/Valheim/) | [Zash](https://github.com/ZashIn) | [game_valheim.py](games/game_valheim.py) | <ul><li>mod data checker</li><li>overwrite config sync</li><li>save game support (no preview)</li></ul> |
| Test Drive Unlimited | [uwx](https://github.com/uwx) | [game_tdu.py](games/game_tdu.py) | |
| Test Drive Unlimited 2 — [STEAM](https://steamcommunity.com/app/9930/) | [uwx](https://github.com/uwx) | [game_tdu2.py](games/game_tdu2.py) | |
| The Witcher: Enhanced Edition - [GOG](https://www.gog.com/game/the_witcher) / [STEAM](https://store.steampowered.com/app/20900/The_Witcher_Enhanced_Edition_Directors_Cut/) | [erri120](https://github.com/erri120) | [game_witcher1.py](games/game_witcher1.py) | <ul><li>save game parsing (no preview)</li></ul> |
| The Witcher 3: Wild Hunt — [GOG](https://www.gog.com/game/the_witcher_3_wild_hunt) / [STEAM](https://store.steampowered.com/app/292030/The_Witcher_3_Wild_Hunt/) | [Holt59](https://github.com/holt59/) | [game_witcher3.py](games/game_witcher3.py) | <ul><li>save game preview</li></ul> |
| Trackmania United Forever — [STEAM](https://store.steampowered.com/app/7200/Trackmania_United_Forever/) | [uwx](https://github.com/uwx) | [game_tmuf.py](games/game_tmuf.py) | |
| Yu-Gi-Oh! Master Duel — [STEAM](https://store.steampowered.com/app/1449850/) | [The Conceptionist](https://github.com/the-conceptionist) & [uwx](https://github.com/uwx) | [game_masterduel.py](games/game_masterduel.py) | |
| Zeus and Poseidon — [GOG](https://www.gog.com/game/zeus_poseidon) / [STEAM](https://store.steampowered.com/app/566050/Zeus__Poseidon/) | [Holt59](https://github.com/holt59/) | [game_zeusandpoiseidon.py](games/game_zeusandpoiseidon.py) | <ul><li>mod data checker</li></ul> |

Expand Down
44 changes: 39 additions & 5 deletions games/game_cyberpunk2077.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,12 @@ def init(self, organizer: mobase.IOrganizer) -> bool:
archive=ModListFile(
Path("archive/pc/mod/modlist.txt"),
"archive/pc/mod/*",
reversed_priority=True,
reversed_priority=bool(self._get_setting("reverse_archive_load_order")),
),
redmod=ModListFile(
Path(self._redmod_deploy_path, "MO_REDmod_load_order.txt"),
"mods/*/",
reversed_priority=True,
reversed_priority=bool(self._get_setting("reverse_redmod_load_order")),
),
)
self._rootbuilder_settings = PluginDefaultSettings(
Expand Down Expand Up @@ -363,8 +363,23 @@ def apply_rootbuilder_settings_once(*args: Any):
organizer.onUserInterfaceInitialized(apply_rootbuilder_settings_once)
organizer.onPluginEnabled("RootBuilder", apply_rootbuilder_settings_once)
organizer.onAboutToRun(self._onAboutToRun)

organizer.onPluginSettingChanged(self._on_settings_changed)
return True

def _on_settings_changed(
self,
plugin_name: str,
setting: str,
old: mobase.MoVariant,
new: mobase.MoVariant,
):
if self.name() == plugin_name:
if setting == "reverse_archive_load_order":
self._modlist_files["archive"].reversed_priority = bool(new)
elif setting == "reverse_remod_load_order":
self._modlist_files["redmod"].reversed_priority = bool(new)

def iniFiles(self):
return ["UserSettings.json"]

Expand All @@ -379,8 +394,11 @@ def settings(self) -> list[mobase.PluginSetting]:
return [
mobase.PluginSetting(
"skipStartScreen",
'Skips the "Breaching..." start screen on game launch',
True,
(
'Skips the "Breaching..." start screen on game launch'
" (can also skip loading of GOG rewards)"
),
False,
),
mobase.PluginSetting(
"enforce_archive_load_order",
Expand All @@ -390,11 +408,28 @@ def settings(self) -> list[mobase.PluginSetting]:
),
False,
),
mobase.PluginSetting(
"reverse_archive_load_order",
(
"Reverse MOs load order in"
" <code>archive/pc/mod/modlist.txt</code>"
" (first loaded mod wins = last one / highest prio in MO)"
),
False,
),
mobase.PluginSetting(
"enforce_redmod_load_order",
"Enforce the current load order on redmod deployment",
True,
),
mobase.PluginSetting(
"reverse_redmod_load_order",
(
"Reverse MOs load order on redmod deployment"
" (first loaded mod wins = last one / highest prio in MO)"
),
False,
),
mobase.PluginSetting(
"auto_deploy_redmod",
"Deploy redmod before game launch if necessary",
Expand Down Expand Up @@ -487,7 +522,6 @@ def _onAboutToRun(self, app_path_str: str, wd: QDir, args: str) -> bool:
qWarning("Aborting game launch.")
return False # Auto deploy failed
self._map_cache_files()
return False
if self._get_setting("enforce_archive_load_order"):
self._modlist_files.update_modlist("archive")
return True
Expand Down
28 changes: 28 additions & 0 deletions games/game_nfshs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- encoding: utf-8 -*-

import mobase
from PyQt6.QtCore import QFileInfo

from ..basic_game import BasicGame


class NFSHSGame(BasicGame):

Name = "Need for Speed: High Stakes Support Plugin"
Author = "uwx"
Version = "1.0.0"

GameName = "Need for Speed: High Stakes"
GameShortName = "nfshs"
GameNexusName = "needforspeedhighstakes"
GameNexusId = 6032
GameBinary = "nfshs.exe"
GameDataPath = ""

def executables(self):
return [
mobase.ExecutableInfo(
"Need for Speed: High Stakes",
QFileInfo(self.gameDirectory().absoluteFilePath(self.binaryName())),
)
]
36 changes: 36 additions & 0 deletions games/game_tdu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- encoding: utf-8 -*-

import mobase
from PyQt6.QtCore import QFileInfo

from ..basic_game import BasicGame


class TDUGame(BasicGame):

Name = "Test Drive Unlimited Support Plugin"
Author = "uwx"
Version = "1.0.0"

GameName = "Test Drive Unlimited"
GameShortName = "tdu"
GameNexusName = "testdriveunlimited"
GameNexusId = 4615
GameBinary = "TestDriveUnlimited.exe"
GameDataPath = ""

def executables(self):
return [
mobase.ExecutableInfo(
"Test Drive Unlimited",
QFileInfo(self.gameDirectory().absoluteFilePath(self.binaryName())),
).withArgument("-w -wx -vsync -bigbnks -offline"),
mobase.ExecutableInfo(
"Project Paradise Launcher",
QFileInfo(
self.gameDirectory().absoluteFilePath(
"TDU - Project Paradise Launcher.exe"
)
),
),
]
35 changes: 35 additions & 0 deletions games/game_tmuf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- encoding: utf-8 -*-

from __future__ import annotations

import mobase
from PyQt6.QtCore import QFileInfo

from ..basic_game import BasicGame


class TmufGame(BasicGame):

Name = "Trackmania United Forever Support Plugin"
Author = "uwx"
Version = "1.0.0"
Description = "Adds support for Trackmania United Forever game folder mods."

GameName = "Trackmania United Forever"
GameShortName = "tmuf"
GameNexusName = "trackmaniaunited"
GameNexusId = 1500
GameSteamId = 7200
GameBinary = "TmForeverLauncher.exe"
GameDataPath = "GameData"

def executables(self):
return [
mobase.ExecutableInfo(
"Trackmania United Forever",
QFileInfo(
self.gameDirectory(),
self.binaryName(),
),
),
]

0 comments on commit 77c57c6

Please sign in to comment.