From: Christian Ratzenhofer Date: Sun, 6 May 2012 15:16:44 +0000 (+0200) Subject: Add support for W:ET to the game setup dialog X-Git-Tag: xonotic-v0.7.0~16^2^2~2^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f0cb191f52b0d1b3606a1b241efda739d515254a;p=xonotic%2Fnetradiant.git Add support for W:ET to the game setup dialog --- diff --git a/config.py b/config.py index f872a25e..60dfa45c 100644 --- a/config.py +++ b/config.py @@ -33,7 +33,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', ] # 'UFOAIPack', 'Q2WPack', 'ReactionPack' ] + self.setup_packs = [ 'Q3Pack', 'UrTPack', 'ETPack', ] # 'UFOAIPack', 'Q2WPack', 'ReactionPack' ] 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 9d70e344..b8910ee5 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -3335,6 +3335,9 @@ void CGameInstall::BuildDialog() { case GAME_REACTION: gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), _( "Reaction Quake 3" ) ); break; + case GAME_ET: + gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), _( "Wolfenstein: Enemy Territory" ) ); + break; } iGame++; } @@ -3443,6 +3446,9 @@ void CGameInstall::Run() { case GAME_REACTION: gameFilePath += "reaction.game"; break; + case GAME_ET: + gameFilePath += "et.game"; + break; } Sys_Printf( "game file: %s\n", gameFilePath.GetBuffer() ); @@ -3584,6 +3590,29 @@ void CGameInstall::Run() { // for a specific game. break; } + case GAME_ET: { +#ifdef _WIN32 + fprintf( fg, " "ENGINE_ATTRIBUTE "=\"ET.exe\"\n"); +#elif __linux__ + fprintf( fg, " "ENGINE_ATTRIBUTE "=\"et\"\n" ); +#endif + fprintf( fg, " "TOOLS_ATTRIBUTE "=\"%sinstalls/"ET_PACK "/game\"\n", g_strAppPath.GetBuffer() ); + fprintf( fg, " prefix=\".etwolf\"\n" ); + Str source = g_strAppPath.GetBuffer(); + source += "installs/"; + source += ET_PACK; + source += "/install/"; + Str dest = m_strEngine.GetBuffer(); + CopyTree( source.GetBuffer(), dest.GetBuffer() ); + // Hardcoded fix for "missing" shaderlist in gamepack + dest += "/etmain/scripts/shaderlist.txt"; + if(CheckFile(dest.GetBuffer()) != PATH_FILE) { + source += "etmain/scripts/default_shaderlist.txt"; + radCopyFile(source.GetBuffer(),dest.GetBuffer()); + } + fprintf( fg, " basegame=\"etmain\"\n" ); + break; + } } fprintf( fg, "/>\n" ); fclose( fg ); @@ -3633,6 +3662,9 @@ void CGameInstall::ScanGames() { if ( stricmp( dirname, REACTION_PACK ) == 0 ) { m_availGames[ iGame++ ] = GAME_REACTION; } + if ( stricmp( dirname, ET_PACK ) == 0 ) { + m_availGames[ iGame++ ] = GAME_ET; + } } Sys_Printf( "No installable games found in: %s\n", pakPaths.GetBuffer() ); diff --git a/radiant/preferences.h b/radiant/preferences.h index 6aad97dd..3d064714 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -213,6 +213,7 @@ void Dump(); #define TREMULOUS_PACK "TremulousPack" #define JA_PACK "JAPack" #define REACTION_PACK "ReactionPack" +#define ET_PACK "ETPack" class CGameInstall : public Dialog { public: @@ -236,6 +237,7 @@ enum gameType_e { GAME_TREMULOUS, GAME_JA, GAME_REACTION, + GAME_ET, GAME_COUNT };