|
Odamex
Setting the Standard in Multiplayer Doom
|
00001 // Emacs style mode select -*- C++ -*- 00002 //----------------------------------------------------------------------------- 00003 // 00004 // $Id: agol_settings.h 2163 2011-05-07 19:44:07Z hypereye $ 00005 // 00006 // Copyright (C) 2006-2010 by The Odamex Team. 00007 // 00008 // This program is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU General Public License 00010 // as published by the Free Software Foundation; either version 2 00011 // of the License, or (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // DESCRIPTION: 00019 // Settings Dialog 00020 // 00021 // AUTHORS: 00022 // Michael Wood (mwoodj at huntsvegas dot org) 00023 // 00024 //----------------------------------------------------------------------------- 00025 00026 #ifndef _AGOL_SETTINGS_H 00027 #define _AGOL_SETTINGS_H 00028 00029 #include "agol_dirsel.h" 00030 #include "event_handler.h" 00031 #include "typedefs.h" 00032 00039 namespace agOdalaunch { 00040 00041 typedef struct 00042 { 00043 AG_Box *optionsBox; 00044 AG_Checkbox *masterOnStartCheck; 00045 AG_Checkbox *showBlockedCheck; 00046 AG_Numerical *masterTimeoutSpin; 00047 AG_Numerical *serverTimeoutSpin; 00048 } ODA_SrvOptionsBox; 00049 00050 typedef struct 00051 { 00052 AG_Box *optionsBox; 00053 AG_Label *driverLabel; 00054 AG_UCombo *driverCombo; 00055 } ODA_GuiOptionsBox; 00056 00062 class AGOL_Settings : private ODA_EventRegister 00063 { 00064 public: 00068 AGOL_Settings(); 00069 00073 ~AGOL_Settings(); 00074 00082 void SetWindowCloseEvent(EventHandler *handler); 00083 00084 private: 00085 bool IsWadDirDuplicate(std::string waddir); 00086 00087 // Event Handlers 00088 void OnCancel(AG_Event *event); 00089 void OnOK(AG_Event *event); 00090 void UpdateWadDirList(AG_Event *event); 00091 void AddWadDirSelectorOk(AG_Event *event); 00092 void OnAddWadDir(AG_Event *event); 00093 void ReplaceWadDirSelectorOk(AG_Event *event); 00094 void OnReplaceWadDir(AG_Event *event); 00095 void OnDeleteWadDir(AG_Event *event); 00096 void OnMoveWadDirUp(AG_Event *event); 00097 void OnMoveWadDirDown(AG_Event *event); 00098 void OdamexPathSelectorOk(AG_Event *event); 00099 void OnBrowseOdamexPath(AG_Event *event); 00100 void DirectorySelectorCancel(AG_Event *event); 00101 00102 // Interface Creation Functions 00103 AG_Box *CreateTopOptionsBox(void *parent); 00104 ODA_SrvOptionsBox *CreateSrvOptionsBox(void *parent); 00105 ODA_GuiOptionsBox *CreateGuiOptionsBox(void *parent); 00106 AG_Box *CreateOdamexPathBox(void *parent); 00107 AG_Label *CreateOdamexPathLabel(void *parent); 00108 AG_Box *CreateWadDirConfigBox(void *parent); 00109 AG_Tlist *CreateWadDirList(void *parent); 00110 AG_Box *CreateWadDirButtonBox(void *parent); 00111 AG_Box *CreateExtraCmdParamsBox(void *parent); 00112 AG_Textbox *CreateExtraCmdParamsEntry(void *parent); 00113 AG_Box *CreateMainButtonBox(void *parent); 00114 00115 // Save Functions 00116 void SaveServerOptions(); 00117 void SaveGuiOptions(); 00118 void SaveOdamexPath(); 00119 void SaveWadDirs(); 00120 void SaveExtraParams(); 00121 00122 // Interface Components 00123 AG_Window *SettingsDialog; 00124 AG_Box *TopOptionsBox; 00125 ODA_SrvOptionsBox *SrvOptionsBox; 00126 ODA_GuiOptionsBox *GuiOptionsBox; 00127 AG_Box *OdamexPathBox; 00128 AG_Label *OdamexPathLabel; 00129 AG_Box *WadDirConfigBox; 00130 AG_Tlist *WadDirList; 00131 AG_Box *WadDirButtonBox; 00132 AG_Box *ExtraCmdParamsBox; 00133 AG_Textbox *ExtraCmdParamsEntry; 00134 AG_Box *MainButtonBox; 00135 00136 AGOL_DirSelector *DirSel; 00137 00138 EventHandler *CloseEventHandler; 00139 EventHandler *DirSelOkHandler; 00140 EventHandler *DirSelCancelHandler; 00141 00142 int MasterOnStart; 00143 int ShowBlocked; 00144 unsigned int MasterTimeout; 00145 unsigned int ServerTimeout; 00146 00147 std::list<std::string> WadDirs; 00148 }; 00149 00150 } // namespace 00151 00152 #endif