Add support for W:ET to the game setup dialog
authorChristian Ratzenhofer <christian_ratzenhofer@yahoo.de>
Sun, 6 May 2012 15:16:44 +0000 (17:16 +0200)
committerChristian Ratzenhofer <christian_ratzenhofer@yahoo.de>
Sun, 6 May 2012 15:24:12 +0000 (17:24 +0200)
config.py
radiant/preferences.cpp
radiant/preferences.h

index f872a25e1897f981a8e7d6e4a05f8e5af416a2ef..60dfa45cb2bfb4a8d9b9eeb2c9c127b48d117e58 100644 (file)
--- 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 )
index 9d70e344661caf6998a80f378c8952360a0e0e02..b8910ee56878258a02f0327974a78e4e77781066 100644 (file)
@@ -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() );
index 6aad97dde5c653a909b20b708f088efcfef8c3da..3d0647148fae457f3026c541929afa8bf64bba33 100644 (file)
@@ -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
 };