-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from Root-Core/bethesda
Mod support for multiple Bethesda games
- Loading branch information
Showing
8 changed files
with
58 additions
and
45 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
22330.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"""Mod support for following Bethesda games: | ||
- Fallout 3 - Game of the Year Edition | ||
- Fallout 4 | ||
- Fallout: New Vegas | ||
- The Elder Scrolls IV: Oblivion | ||
- The Elder Scrolls V: Skyrim | ||
- The Elder Scrolls V: Skyrim Special Edition | ||
- Starfield | ||
""" | ||
|
||
import os | ||
|
||
from dataclasses import dataclass | ||
from protonfixes import util | ||
|
||
def main_with_id(game_id: str) -> None: | ||
"""Enable modding and fixes""" | ||
# modorganizer2 features a redirector and breaks if we replace the command. (Issue #103) | ||
if os.path.exists('modorganizer2'): | ||
return | ||
|
||
# Run script extender if it exists. | ||
mapping = get_redirect_name(game_id) | ||
if os.path.isfile(mapping.from_name): | ||
util.replace_command(mapping.from_name, mapping.to_name) | ||
|
||
|
||
@dataclass | ||
class Redirect: | ||
"""Used for replacements""" | ||
|
||
from_name: str | ||
to_name: str | ||
|
||
|
||
def get_redirect_name(game_id: str) -> Redirect: | ||
"""Mapping for SteamID -> script extender replacements""" | ||
mapping = { | ||
'22380': ('FalloutNV.exe', 'nvse_loader.exe'), # Fallout New Vegas | ||
'22370': ('FalloutLauncher.exe', 'fose_loader.exe'), # Fallout 3 | ||
'377160': ('Fallout4Launcher.exe', 'f4se_loader.exe'), # Fallout 4 | ||
'22330': ('OblivionLauncher.exe', 'obse_loader.exe'), # Oblivion | ||
'72850': ('SkyrimLauncher.exe', 'skse_loader.exe'), # Skyrim | ||
'489830': ('SkyrimSELauncher.exe', 'skse64_loader.exe'), # Skyrim SE | ||
'1716740': ('Starfield.exe', 'sfse_loader.exe') # Starfield | ||
}.get(game_id, ('', '')) | ||
return Redirect(*mapping) |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
22330.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
22330.py |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
22330.py |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
22330.py |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
22330.py |