X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fpreferences.h;h=784f3fc84b803c66a3e032714a1c4fa52145968c;hb=f487ea7c547dbd72e0ac837363c766e6b0f88a53;hp=908616adc5eea9bd889d0428daddd25fb8b97253;hpb=1099f571fe0e8512e4fb36cb84aa3bfc49282bb9;p=xonotic%2Fnetradiant.git diff --git a/radiant/preferences.h b/radiant/preferences.h index 908616ad..784f3fc8 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -50,7 +50,7 @@ public: PrefTypes_t mType; void *mVal; - CPrefAssignment(char *name, PrefTypes_t Type, void *Val) + CPrefAssignment(const char *name, PrefTypes_t Type, void *Val) { mName = name; mType = Type; mVal = Val; } @@ -86,7 +86,7 @@ private: /*! store assignment in the property list if not already there */ - void PushAssignment(char *name, PrefTypes_t type, void *pV); + void PushAssignment(const char *name, PrefTypes_t type, void *pV); /*! find the xmlnode relating to the epair name @@ -95,7 +95,7 @@ private: public: CXMLPropertyBag(); - virtual ~CXMLPropertyBag() + virtual ~CXMLPropertyBag() { if (InUse()) Clear(); @@ -110,12 +110,12 @@ public: (name, type and pointer to value) this is used in UpdatePrefTree */ - void GetPref(char *name, Str *pV, char *V); - void GetPref(char *name, int *pV, int V); - void GetPref(char *name, bool *pV, bool V); - void GetPref(char *name, float *pV, float V); - void GetPref(char *name, float *pV, float* V); - void GetPref(char *name, window_position_t* pV, window_position_t V); + void GetPref(const char *name, Str *pV, const char *V); + void GetPref(const char *name, int *pV, int V); + void GetPref(const char *name, bool *pV, bool V); + void GetPref(const char *name, float *pV, float V); + void GetPref(const char *name, float *pV, float* V); + void GetPref(const char *name, window_position_t* pV, window_position_t V); /*! returns whether or not the property bag is already open @@ -171,6 +171,7 @@ public: Str mBaseGame; ///< basegame directory Str mEnginePath; ///< path to the engine Str mEngine; ///< engine name + Str mMultiplayerEngine; ///< engine name #if defined (__linux__) || defined (__APPLE__) Str mUserPathPrefix; ///< prefix for ~/.q3a ~/.wolf init, only on *nix #endif @@ -180,6 +181,8 @@ 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 + bool noMapsInHome; ///< set this if you want to open the engine path/base dir/maps dir for map open/save dialoges */ CGameDescription() { mpDoc = NULL; } /*! @@ -196,22 +199,49 @@ public: /*! 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" +#define TREMULOUS_PACK "TremulousPack" +#define JA_PACK "JAPack" + 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_Q3, + GAME_NONE = 0, + GAME_Q3 = 1, GAME_URT, - GAME_WARSOW + GAME_UFOAI, + GAME_Q2W, + GAME_WARSOW, + GAME_NEXUIZ, + GAME_Q2, + GAME_TREMULOUS, + GAME_JA, + GAME_COUNT }; protected: - Str m_strName; - Str m_strMod; - Str m_strEngine; - int m_nComboSelect; + Str m_strName; + Str m_strMod; + Str m_strEngine; + int m_nComboSelect; + + // maps from m_nComboSelect to the games + int m_availGames[GAME_COUNT]; }; /*! @@ -222,6 +252,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 @@ -243,13 +274,13 @@ class CGameDialog : public Dialog CGameInstall mGameInstall; protected: - + int m_nComboSelect; ///< intermediate int value for combo in dialog box public: - /*! - those settings are saved in the global prefs file + /*! + those settings are saved in the global prefs file I'm too lazy to wrap behind protected access, not sure this needs to be public NOTE: those are preference settings. if you change them it is likely that you would have to restart the editor for them to take effect @@ -289,11 +320,12 @@ public: m_bLogConsole = false; m_bForceLogConsole = false; m_bDoGameInstall = true; // go through DoModal at least once + mGameCombo = NULL; } - virtual ~CGameDialog(); + virtual ~CGameDialog(); void AddPacksURL( Str &s ); - + /*! intialize the game dialog, called at CPrefsDlg::Init will scan for games, load prefs, and do game selection dialog if needed @@ -306,7 +338,7 @@ public: void Reset(); /*! - run the dialog UI for the list of games + run the dialog UI for the list of games */ void DoGameDialog(); @@ -345,7 +377,7 @@ public: /*! read or set netrun (check file) - \param retrieve + \param retrieve if false, will check if netrun file is present and will set m_bNetRun if true, will create/erase the netrun file depending on m_bNetRun NOTE: this is not backwards, 'retrieve' means 'retrieve from settings dialog' - in terms of UI @@ -376,12 +408,14 @@ private: callback for the game install button */ static void SInstallCallback( GtkWidget *widget, gpointer data ); + + void UpdateGameCombo(); }; typedef struct { int nEntitySplit1; int nEntitySplit2; - + window_position_t position; window_position_t posEntityWnd; @@ -406,7 +440,7 @@ typedef struct { class PrefsDlg : public Dialog { - + public: /*! local prefs file @@ -416,10 +450,10 @@ public: // will enable/disable stuff according to the situation void DoSensitivity(); void PreModal() { DoSensitivity(); } - + // enable/disable custom editor entry void DoEditorSensitivity(); - + /*! this holds global level preferences */ @@ -428,7 +462,7 @@ protected: // warning about old project files bool m_bWarn; list mGames; - + public: // last light intensity used in the CLightPrompt dialog, stored in registry int m_iLastLightIntensity; @@ -440,15 +474,15 @@ public: /*! Preference notebook page numbers */ enum {PTAB_FRONT = 0, PTAB_GAME_SETTINGS, PTAB_2D, PTAB_CAMERA, PTAB_TEXTURE, PTAB_LAYOUT, PTAB_MOUSE, PTAB_EDITING, PTAB_STARTUP, PTAB_PATHS, PTAB_MISC, PTAB_BSPMONITOR} pref_tabs; - + GtkWidget *notebook; - + void UpdateTextureCompression(); #ifdef ATIHACK_812 void UpdateATIHack(); #endif - + void LoadPrefs(); void SavePrefs(); void LoadTexdefPref(texdef_t* pTexdef, char* pName); @@ -505,7 +539,7 @@ public: // path to the project loaded at startup // if g_PrefsDlg can't find the information in the ini file // it will try to guess and eventually ask the user - Str m_strLastProject; + Str m_strLastProject; /*! version of last loaded project file says -1 if there's no version loaded @@ -547,6 +581,7 @@ public: bool m_bPluginToolbar; bool m_bNoClamp; //++timo this is most likely broken, I don't know what it's supposed to do + bool m_bSnap; Str m_strUserPath; int m_nRotation; bool m_bChaseMouse; @@ -596,7 +631,7 @@ public: bool m_bRunQuake; // store prefs setting for automatic sleep mode activation bool m_bDoSleep; - + bool m_bClipCaulk; // make the texture increments match the grid changes @@ -645,7 +680,7 @@ public: int m_nTextureCompressionFormat; int m_nLightRadiuses; - + bool m_bQ3Map2Texturing; #ifdef ATIHACK_812