Last active
June 13, 2024 23:15
-
-
Save phobos2077/c7f1488ee98626cbbfc370ba8a5ba0a5 to your computer and use it in GitHub Desktop.
MO2 Fallout 2 plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
from pathlib import Path | |
from typing import List | |
from PyQt5.QtCore import QDir | |
import mobase | |
from ..basic_features import BasicGameSaveGameInfo | |
from ..basic_features.basic_save_game_info import BasicGameSaveGame | |
from ..basic_game import BasicGame | |
class Fallout2SaveGame(BasicGameSaveGame): | |
def allFiles(self): | |
return [self._filename] | |
class Fallout2Game(BasicGame): | |
Name = "Fallout 2 Support Plugin" | |
Author = "phobos2077" | |
Version = "1.0.0a" | |
GameName = "Fallout 2" | |
GameShortName = "fallout2" | |
GameNexusName = "fallout2" | |
GameSteamId = [38410] | |
GameGogId = "fallout_2" | |
GameBinary = "fallout2.exe" | |
GameDataPath = "" | |
# GameDocumentsDirectory = "%GAME_PATH%/" | |
# GameSavesDirectory = "%GAME_PATH%/data/SAVEGAME" | |
def init(self, organizer: mobase.IOrganizer): | |
super().init(organizer) | |
self._featureMap[mobase.SaveGameInfo] = BasicGameSaveGameInfo( | |
lambda s: s.replace(".sav", ".png") | |
) | |
return True | |
def iniFiles(self): | |
return ["fallout2.cfg"] | |
# def listSaves(self, folder: QDir) -> List[mobase.ISaveGame]: | |
# ext = self._mappings.savegameExtension.get() | |
# return [ | |
# Witcher3SaveGame(path) | |
# for path in Path(folder.absolutePath()).glob(f"*.{ext}") | |
# ] |
Not, because this is a hacky implementation at best. Wouldn't probably get accepted. Someone more familiar with MO2 plugins should do it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you considered opening a pull request in https://github.com/ModOrganizer2/modorganizer-basic_games?