From 32aee4bd50866cc96e1d81497c84712a06586e58 Mon Sep 17 00:00:00 2001 From: Christian Ratzenhofer Date: Wed, 21 Aug 2013 12:40:08 +0200 Subject: [PATCH] Add support for RTCW to the game setup dialog --- config.py | 2 +- radiant/preferences.cpp | 23 +++++++++++++++++++++++ radiant/preferences.h | 3 +++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 88fb8000..f32ed3ea 100644 --- a/config.py +++ b/config.py @@ -28,7 +28,7 @@ class Config: # platforms for which to assemble a setup self.setup_platforms = [ 'local', 'x86', 'x64', 'win32' ] # paks to assemble in the setup - self.setup_packs = [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack', 'Q2Pack', 'Q2WPack', 'JAPack', 'STVEFPack' ] + self.setup_packs = [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack', 'Q2Pack', 'Q2WPack', 'JAPack', 'STVEFPack', 'WolfPack' ] def __repr__( self ): return 'config: target=%s config=%s' % ( self.target_selected, self.config_selected ) diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index bcf6468b..b8bf1c04 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -3432,6 +3432,9 @@ void CGameInstall::BuildDialog() { case GAME_STVEF: gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), _( "Star Trek - Voyager: Elite Force" ) ); break; + case GAME_WOLF: + gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), _( "Return To Castle Wolfenstein" ) ); + break; } iGame++; } @@ -3580,6 +3583,10 @@ void CGameInstall::Run() { gamePack = STVEF_PACK; gameFilePath += STVEF_GAME; break; + case GAME_WOLF: + gamePack = WOLF_PACK; + gameFilePath += WOLF_GAME; + break; default: Error( "Invalid game selected: %d", m_availGames[ m_nComboSelect ] ); } @@ -3738,6 +3745,19 @@ void CGameInstall::Run() { } break; } + case GAME_WOLF: { + fprintf( fg, " prefix=\".wolf\"\n" ); + fprintf( fg, " basegame=\"main\"\n" ); + // Hardcoded fix for "missing" shaderlist in gamepack + Str dest = m_strEngine.GetBuffer(); + dest += "/main/scripts/shaderlist.txt"; + if( CheckFile( dest.GetBuffer() ) != PATH_FILE ) { + Str source = gameInstallPath.GetBuffer(); + source += "main/scripts/default_shaderlist.txt"; + radCopyFile( source.GetBuffer(), dest.GetBuffer() ); + } + break; + } } fprintf( fg, "/>\n" ); fclose( fg ); @@ -3796,6 +3816,9 @@ void CGameInstall::ScanGames() { if ( stricmp( dirname, STVEF_PACK ) == 0 ) { m_availGames[ iGame++ ] = GAME_STVEF; } + if ( stricmp( dirname, WOLF_PACK ) == 0) { + m_availGames[ iGame++ ] = GAME_WOLF; + } } Sys_Printf( "No installable games found in: %s\n", pakPaths.GetBuffer() ); diff --git a/radiant/preferences.h b/radiant/preferences.h index 53ed92ec..e15b9064 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -215,6 +215,7 @@ void Dump(); #define ET_GAME "et.game" #define QL_GAME "ql.game" #define STVEF_GAME "stvef.game" +#define WOLF_GAME "wolf.game" #define Q3_PACK "Q3Pack" #define URT_PACK "UrTPack" @@ -229,6 +230,7 @@ void Dump(); #define ET_PACK "ETPack" #define QL_PACK "QLPack" #define STVEF_PACK "STVEFPack" +#define WOLF_PACK "WolfPack" class CGameInstall : public Dialog { public: @@ -256,6 +258,7 @@ enum gameType_e { GAME_ET, GAME_QL, GAME_STVEF, + GAME_WOLF, GAME_COUNT };