diff --git a/README.md b/README.md index 961ed8d..03a9237 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ You can rename `modorganizer-basic_games-xxx` to whatever you want (e.g., `basic | Divinity: Original Sin (Enhanced Edition) — [STEAM](https://store.steampowered.com/app/373420/Divinity_Original_Sin__Enhanced_Edition/) | [LostDragonist](https://github.com/LostDragonist/) | [game_divinityoriginalsinee.py](games/game_divinityoriginalsinee.py) | | | Dragon's Dogma: Dark Arisen — [GOG](https://www.gog.com/game/dragons_dogma_dark_arisen) / [STEAM](https://store.steampowered.com/app/367500/Dragons_Dogma_Dark_Arisen/) | [EzioTheDeadPoet](https://github.com/EzioTheDeadPoet) | [game_dragonsdogmadarkarisen.py](games/game_dragonsdogmadarkarisen.py) | | | Dungeon Siege II — [GOG](https://www.gog.com/game/dungeon_siege_collection) / [STEAM](https://store.steampowered.com/app/39200/Dungeon_Siege_II/) | [Holt59](https://github.com/holt59/) | [game_dungeonsiege2.py](games/game_dungeonsiege2.py) | | +| Fallout 2 — [GOG](https://www.gog.com/en/game/fallout_2) / [STEAM](https://store.steampowered.com/app/38410/Fallout_2_A_Post_Nuclear_Role_Playing_Game/) |[MrowrPurr](https://github.com/mrowrpurr)|[game_fallout2.py](games/game_fallout2.py)|| | Kingdom Come: Deliverance — [GOG](https://www.gog.com/game/kingdom_come_deliverance) / [STEAM](https://store.steampowered.com/app/379430/Kingdom_Come_Deliverance/)| [Silencer711](https://github.com/Silencer711) | [game_kingdomcomedeliverance.py](games/game_kingdomcomedeliverance.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) | | diff --git a/games/game_fallout2.py b/games/game_fallout2.py new file mode 100644 index 0000000..05b2bfc --- /dev/null +++ b/games/game_fallout2.py @@ -0,0 +1,53 @@ +# -*- encoding: utf-8 -*- + +import os +import configparser +from PyQt5.QtCore import QDir + +from ..basic_game import BasicGame + + +class Fallout2Game(BasicGame): + Name = "Fallout 2 - Support Plugin" + Author = "mrowrpurr" + Version = "0.1.0" + + GameName = "Fallout 2" + GameShortName = "fallout2" + GameNexusName = "fallout2" + GameNexusId = 430 + GameSteamId = 38410 + GameGogId = 1440151285 + GameBinary = "fallout2HR.exe" + GameDataPath = "%GAME_PATH%" + GameDocumentsDirectory = "%GAME_PATH%" + + def iniFiles(self): + return ["ddraw.ini", "f2_res.ini"] + + def updateFallout2cfg(self): + # Update fallout2.cfg (.ini format) for game to run via Mod Organizer 2 + # + # [system] + # critter_dat=critter.dat <-- these paths must all be set to + # critter_patches=data <-- to absolute paths + # master_dat=master.dat <-- + # master_patches=data <-- + game_directory = self.gameDirectory().absolutePath() + fallout2_cfg_path = os.path.join(game_directory, "fallout2.cfg") + config = configparser.ConfigParser() + config.read(fallout2_cfg_path) + config["system"]["critter_dat"] = os.path.join(game_directory, "critter.dat") + config["system"]["critter_patches"] = os.path.join(game_directory, "data") + config["system"]["master_dat"] = os.path.join(game_directory, "master.dat") + config["system"]["master_patches"] = os.path.join(game_directory, "data") + with open(fallout2_cfg_path, "w") as configfile: + config.write(configfile, space_around_delimiters=False) + + def initializeProfile(self, path: QDir, settings: int): + # Update fallout2.cfg, if present + game_directory = self.gameDirectory().absolutePath() + fallout2_cfg_path = os.path.join(game_directory, "fallout2.cfg") + if os.path.exists(fallout2_cfg_path): + self.updateFallout2cfg() + super().initializeProfile(path, settings)