-
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.
Added fix for Command and Conquer - Red Alert 2 (#46)
* Added verb for CnCnet RA2-Launcher installation * Added fix for RA2 * Updated and fixed cnc-ddraw in Winetricks * Gamefix RA2: CnCNet is now default / refactoring
- Loading branch information
Showing
3 changed files
with
77 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
""" Game fix for Command & Conquer Red Alert™ 2 and Yuri's Revenge™ | ||
""" | ||
#pylint: disable=C0103 | ||
|
||
import os | ||
|
||
from protonfixes import util | ||
from protonfixes.logger import log | ||
|
||
def main(): | ||
""" Install and launch the CnCNet Launcher | ||
It fixes several issues, allows multiplayer and provides a working UI, | ||
while the game has sometimes problems like missing or shifted buttons. | ||
The game will just show a black screen without cnc-ddraw or the patch in place. | ||
""" | ||
|
||
# Opt out of CnCNet with 'NO_CNCNET=1 %command%' | ||
no_cncnet = os.getenv('NO_CNCNET', '') | ||
if str.lower(no_cncnet) in ['y', 'yes', 'true', 'on', '1']: | ||
log('Skipping CnCNet on user\'s request.') | ||
use_cnc_ddraw() | ||
return | ||
|
||
# Install the CnCNet Launcher | ||
if not util.checkinstalled('cncnet_ra2') and not util.protontricks('cncnet_ra2'): | ||
log('Failed to install CnCNet Launcher, let\'s try cnc-ddraw.') | ||
use_cnc_ddraw() | ||
|
||
# CnCNet Launcher is in place, run it | ||
if os.path.isfile('CnCNetYRLauncher.exe'): | ||
log('CnCNet Launcher found, bypass game execution!') | ||
util.replace_command('Ra2.exe', 'CnCNetYRLauncher.exe') | ||
util.replace_command('RA2MD.exe', 'CnCNetYRLauncher.exe') | ||
|
||
def use_cnc_ddraw(): | ||
""" Install cnc-ddraw, the current replacement from EA isn't working. | ||
""" | ||
|
||
log('Using cnc-ddraw.') | ||
|
||
# Return early, if cnc-ddraw is installed | ||
if util.checkinstalled('cnc_ddraw'): | ||
log('cnc-ddraw found, nothing to do!') | ||
return | ||
|
||
# Install cnc-ddraw | ||
if not util.protontricks('cnc_ddraw'): | ||
log('Failed to install cnc-ddraw') | ||
return | ||
|
||
# After installing cnc_ddraw, we need to prevent the game | ||
# from loading the local ddraw.dll, instead of our override. | ||
# Note: This is only done once. | ||
if os.path.isfile('ddraw.dll'): | ||
log('Renaming local ddraw.dll to ddraw.dll.bak') | ||
os.rename('ddraw.dll', 'ddraw.dll.bak') |
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,13 @@ | ||
w_metadata cncnet_ra2 dlls \ | ||
title="CnCnet5 Red Alert / Yuri's Revenge - Multiplayer / Game patches" \ | ||
publisher="CnCnet community" \ | ||
year="2013" \ | ||
media="download" \ | ||
file1="CnCNet5_YR_Installer.exe" \ | ||
installed_file1="CnCNetYRLauncher.exe" | ||
|
||
load_cncnet_ra2() | ||
{ | ||
w_download https://github.com/CnCNet/cncnet-yr-client-package/releases/download/yr-8.55/CnCNet5_YR_Installer_8.55.0.exe c1cf19fa40bb07e881ffeea33df8a5961162e009c558b33d91076f51ca3f949c ${file1} | ||
w_try "${WINE}" start.exe /exec ${W_CACHE}/${W_PACKAGE}/${file1} /silent /verysilent /norestart /suppressmsgboxes | ||
} |
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