]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/preferences.h
fix
[xonotic/netradiant.git] / radiant / preferences.h
index 581c8fe780dcfc464b494553c33d33ab02510d3b..7042aa1b41406d982d0f033b8a9eb90f3331d260 100644 (file)
@@ -180,6 +180,7 @@ public:
   bool mEClassSingleLoad; ///< only load a single eclass definition file
   bool mNoPatch; ///< this game doesn't support patch technology
   Str mCaulkShader; ///< the shader to use for caulking
+  bool quake2; ///< set this to true to get quake2
 
   CGameDescription() { mpDoc = NULL; }
   /*!
@@ -193,6 +194,50 @@ public:
   void Dump();
 };
 
+/*!
+select games, copy editing assets and write out configuration files
+ */
+
+#define Q3_PACK "Q3Pack"
+#define URT_PACK "UrTPack"
+#define UFOAI_PACK "UFOAIPack"
+#define Q2W_PACK "Q2WPack"
+#define WARSOW_PACK "WarsowPack"
+#define NEXUIZ_PACK "NexuizPack"
+#define Q2_PACK "Q2Pack"
+
+class CGameInstall : public Dialog {
+public:
+       CGameInstall();
+       void ScanGames();
+       void Run();
+       void BuildDialog();
+
+       static void OnBtnBrowseEngine( GtkWidget *widget, gpointer data );
+       static void OnGameSelectChanged( GtkWidget *widget, gpointer data );
+
+       enum gameType_e {
+               GAME_NONE = 0,
+               GAME_Q3 = 1,
+               GAME_URT,
+               GAME_UFOAI,
+               GAME_Q2W,
+               GAME_WARSOW,
+               GAME_NEXUIZ,
+               GAME_Q2,
+               GAME_COUNT
+       };
+
+protected:
+       Str             m_strName;
+       Str             m_strMod;
+       Str             m_strEngine;
+       int             m_nComboSelect;
+
+       // maps from m_nComboSelect to the games
+       int     m_availGames[GAME_COUNT];
+};
+
 /*!
 standalone dialog for games selection, and more generally global settings
 */
@@ -201,6 +246,7 @@ class CGameDialog : public Dialog
   GtkWidget *mFrame; ///< this is built on-demand first time it's used
   GtkWidget *mTopBox; ///< top level box used to store the dialog frame, must unhook after modal use
 
+  GtkComboBox  *mGameCombo;    // combo box holds the selection of available game
 
   /*!
   global prefs storage
@@ -217,6 +263,10 @@ class CGameDialog : public Dialog
   static bool m_bNetRun;
 #endif
 
+  bool m_bDoGameInstall;
+
+  CGameInstall mGameInstall;
+
 protected:
   
   int m_nComboSelect; ///< intermediate int value for combo in dialog box
@@ -258,10 +308,17 @@ public:
   */
   list<CGameDescription *> mGames;
 
-  CGameDialog() { mFrame = NULL; m_pCurrentGameDescription = NULL; m_bLogConsole = false; m_bForceLogConsole = false; }
+  CGameDialog() {
+         mFrame = NULL;
+         m_pCurrentGameDescription = NULL;
+         m_bLogConsole = false;
+         m_bForceLogConsole = false;
+         m_bDoGameInstall = true;      // go through DoModal at least once
+         mGameCombo = NULL;
+  }
   virtual ~CGameDialog(); 
 
-  void AddPacksURL(Str &s);  
+  void AddPacksURL( Str &s );
     
   /*!
   intialize the game dialog, called at CPrefsDlg::Init
@@ -279,12 +336,17 @@ public:
   */
   void DoGameDialog();
 
+  /*!
+       call out to the game installation dialog
+  */
+  void DoGameInstall();
+
   /*!
   Dialog API
   this is only called when the dialog is built at startup for main engine select
   */
-  void BuildDialog ();
-  void UpdateData (bool retrieve);
+  void BuildDialog();
+  void UpdateData( bool retrieve );
 
   /*!
   construction of the dialog frame
@@ -335,6 +397,13 @@ private:
   uses m_nComboItem to find the right mGames
   */
   CGameDescription *GameDescriptionForComboItem();
+
+  /*!
+       callback for the game install button
+  */
+  static void SInstallCallback( GtkWidget *widget, gpointer data );
+
+  void UpdateGameCombo();
 };
 
 typedef struct {