From 14e53a978b2a8e9b0c2ea5b9a4ebabb38fc2f394 Mon Sep 17 00:00:00 2001 From: Zash Date: Fri, 18 Jun 2021 19:42:52 +0200 Subject: [PATCH] Add basic support for Control with forced load lib for Loose Files Loader and Control Plugin Loader --- README.md | 1 + games/game_control.py | 64 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 games/game_control.py diff --git a/README.md b/README.md index 961ed8d..e0a08fb 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ You can rename `modorganizer-basic_games-xxx` to whatever you want (e.g., `basic |------|--------|------|--------| | The Binding of Isaac: Rebirth — [STEAM](https://store.steampowered.com/app/250900/The_Binding_of_Isaac_Rebirth/) |[EzioTheDeadPoet](https://github.com/EzioTheDeadPoet)|[game_thebindingofisaacrebirth.py](games/game_thebindingofisaacrebirth.py)|| | Darkest Dungeon — [GOG](https://www.gog.com/game/darkest_dungeon) / [STEAM](https://store.steampowered.com/app/262060/Darkest_Dungeon/) | [erri120](https://github.com/erri120) | [game_darkestdungeon.py](games/game_darkestdungeon.py) | | +| Control — [STEAM](https://store.steampowered.com/app/870780/Control_Ultimate_Edition/) / [GOG](https://www.gog.com/game/control_ultimate_edition) / [EGS](https://www.epicgames.com/store/p/control) | [Zash](https://github.com/ZashIn) | [game_control.py](games/game_control.py) | | | Dark Messiah of Might & Magic — [STEAM](https://store.steampowered.com/app/2100/Dark_Messiah_of_Might__Magic/) | [Holt59](https://github.com/holt59/) | [game_darkmessiahofmightandmagic.py](games/game_darkmessiahofmightandmagic.py) | | | Dark Souls — [STEAM](https://store.steampowered.com/app/211420/DARK_SOULS_Prepare_To_Die_Edition/) | [Holt59](https://github.com/holt59/) | [game_darksouls.py](games/game_darkestdungeon.py) | | | Divinity: Original Sin (Classic) — [STEAM](https://store.steampowered.com/app/230230/Divinity_Original_Sin_Classic/) | [LostDragonist](https://github.com/LostDragonist/) | [game_divinityoriginalsin.py](games/game_divinityoriginalsin.py) | | diff --git a/games/game_control.py b/games/game_control.py new file mode 100644 index 0000000..8e283a0 --- /dev/null +++ b/games/game_control.py @@ -0,0 +1,64 @@ +# -*- encoding: utf-8 -*- + +from __future__ import annotations + +import mobase +from PyQt5.QtCore import QFileInfo + +from ..basic_game import BasicGame + + +class ControlGame(BasicGame): + + Name = "Control Support Plugin" + Author = "Zash" + Version = "1.0.0" + + GameName = "Control" + GameShortName = "control" + GameNexusId = 2936 + GameSteamId = 870780 + GameGogId = 2049187585 + GameBinary = "Control.exe" + GameDataPath = "" + + def executables(self): + return [ + mobase.ExecutableInfo( + "Control (Launcher)", + QFileInfo( + self.gameDirectory(), + self.binaryName(), + ), + ), + mobase.ExecutableInfo( + "Control DX11", + QFileInfo( + self.gameDirectory(), + "Control_DX11.exe", + ), + ), + mobase.ExecutableInfo( + "Control DX12", + QFileInfo( + self.gameDirectory(), + "Control_DX12.exe", + ), + ), + ] + + def executableForcedLoads(self) -> list[mobase.ExecutableForcedLoadSetting]: + try: + efls = super().executableForcedLoads() + except AttributeError: + efls = [] + + libraries = ["iphlpapi.dll", "xinput1_4.dll"] + efls.extend( + mobase.ExecutableForcedLoadSetting( + exe.binary().fileName(), lib + ).withEnabled(True) + for lib in libraries + for exe in self.executables() + ) + return efls