// generic preference functions
-void CXMLPropertyBag::PushAssignment(char *name, PrefTypes_t type, void *pV)
+void CXMLPropertyBag::PushAssignment(const char *name, PrefTypes_t type, void *pV)
{
list<CPrefAssignment>::iterator iAssign;
for(iAssign=mPrefAssignments.begin(); iAssign!=mPrefAssignments.end(); iAssign++)
return ret;
}
-void CXMLPropertyBag::GetPref(char *name, Str *pV, char *V)
+void CXMLPropertyBag::GetPref(const char *name, Str *pV, const char *V)
{
xmlNodePtr pNode = EpairForName( name );
if ( pNode )
PushAssignment(name, PREF_STR, pV);
}
-void CXMLPropertyBag::GetPref(char *name, int *pV, int V)
+void CXMLPropertyBag::GetPref(const char *name, int *pV, int V)
{
- xmlNodePtr pNode;
+ xmlNodePtr pNode;
if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content)
{
*pV = atoi((char *)pNode->children->content);
*pV=V;
}
// push the pref assignment if needed
- PushAssignment(name, PREF_INT, pV);
+ PushAssignment(name, PREF_INT, pV);
}
-void CXMLPropertyBag::GetPref(char *name, bool *pV, bool V)
+void CXMLPropertyBag::GetPref(const char *name, bool *pV, bool V)
{
- xmlNodePtr pNode;
+ xmlNodePtr pNode;
if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content)
{
if (!strcmp((char *)pNode->children->content, "true"))
*pV=V;
}
// push the pref assignment
- PushAssignment(name, PREF_BOOL, pV);
+ PushAssignment(name, PREF_BOOL, pV);
}
-void CXMLPropertyBag::GetPref(char *name, float *pV, float V)
+void CXMLPropertyBag::GetPref(const char *name, float *pV, float V)
{
- xmlNodePtr pNode;
+ xmlNodePtr pNode;
if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content)
{
*pV = atof((char *)pNode->children->content);
*pV=V;
}
// push the pref assignment if needed
- PushAssignment(name, PREF_FLOAT, pV);
+ PushAssignment(name, PREF_FLOAT, pV);
}
-void CXMLPropertyBag::GetPref(char *name, float* pV, float* V)
+void CXMLPropertyBag::GetPref(const char *name, float* pV, float* V)
{
- xmlNodePtr pNode;
+ xmlNodePtr pNode;
if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content)
{
sscanf((char *)pNode->children->content, "%f %f %f", &pV[0], &pV[1], &pV[2]);
pV[2] = V[2];
}
// push the pref assignment if needed
- PushAssignment(name, PREF_VEC3, pV);
+ PushAssignment(name, PREF_VEC3, pV);
}
-void CXMLPropertyBag::GetPref(char *name, window_position_t* pV, window_position_t V)
+void CXMLPropertyBag::GetPref(const char *name, window_position_t* pV, window_position_t V)
{
- xmlNodePtr pNode;
+ xmlNodePtr pNode;
if ((pNode = EpairForName(name)) && pNode->children && pNode->children->content)
{
WindowPosition_Parse(*pV, CString((xmlChar *)pNode->children->content));
*pV = V;
}
// push the pref assignment if needed
- PushAssignment(name, PREF_WNDPOS, pV);
+ PushAssignment(name, PREF_WNDPOS, pV);
}
void CXMLPropertyBag::UpdatePrefTree()
Sys_FPrintf(SYS_ERR, "Wrong version '%s' in <qpref> node for '%s'\n", (char*)tmp_attr_ptr->children->content, mpDoc->URL);
xmlFreeDoc(mpDoc);
mpDoc = NULL;
- }
+ }
Sys_Printf("Opened XML property file: '%s'\n", pFilename);
}
qboolean CXMLPropertyBag::WriteXMLFile(const char* pFilename)
{
int res = xmlSaveFormatFile(pFilename, mpDoc, 1);
-
+
if(res == -1)
return false;
static void OnBtnBrowseEditor (GtkWidget *widget, gpointer data)
{
PrefsDlg *dlg = (PrefsDlg*)data;
-
+
const char *filename = file_dialog(g_PrefsDlg.GetWidget(), TRUE, "Executable for Custom Editor");
-
+
if(filename != NULL)
{
dlg->m_strEditorCommand = filename;
}
}
-static void OnButtonClean (GtkWidget *widget, gpointer data)
+static void OnButtonClean (GtkWidget *widget, gpointer data)
{
// make sure this is what the user wants
if (gtk_MessageBox (g_PrefsDlg.GetWidget (), "This will close Radiant and clean the corresponding registry entries.\n"
{
char *p, *prop;
mpDoc = pDoc;
- // read the user-friendly game name
+ // read the user-friendly game name
xmlNodePtr pNode = mpDoc->children;
while (strcmp((const char*)pNode->name, "game") && pNode != NULL) pNode=pNode->next;
mGameFile = GameFile;
+ prop = (char*)xmlGetProp(pNode, (xmlChar*)"quake2");
+ if (prop == NULL)
+ {
+ // default
+ quake2 = false;
+ }
+ else
+ {
+ quake2 = true;
+ xmlFree(prop);
+ }
+
prop = (char*)xmlGetProp(pNode, (xmlChar*)"basegame");
if (prop == NULL)
{
void CGameDialog::LoadPrefs()
{
- bool bEmpty = false;
-
// if we already have a document loaded, we will free and reload from file
if (mGlobalPrefs.InUse())
{
{
// update the tree and save it
mGlobalPrefs.UpdatePrefTree();
-
+
CString strGlobalPref = g_PrefsDlg.m_global_rc_path->str;
strGlobalPref += "global.pref";
-
- if (!mGlobalPrefs.WriteXMLFile(strGlobalPref.GetBuffer()))
+
+ if ( !mGlobalPrefs.WriteXMLFile( strGlobalPref.GetBuffer() ) ) {
Sys_FPrintf(SYS_ERR, "Error occured while saving global prefs file '%s'\n", strGlobalPref.GetBuffer());
+ }
}
void CGameDialog::DoGameInstall() {
+ // make sure console logging is on whenever we enter the installation loop
+ g_PrefsDlg.mGamesDialog.m_bLogConsole = true;
+ Sys_LogFile();
mGameInstall.Run();
}
void CGameDialog::DoGameDialog() {
// allow looping the game selection dialog with calls to the game configure dialog in between
while ( m_bDoGameInstall ) {
-
+
m_bDoGameInstall = false;
- DoModal();
-
+ if ( DoModal() == IDCANCEL ) {
+ Error( "game selection dialog canceled, cannot continue" );
+ return;
+ }
+
if ( m_bDoGameInstall ) {
DoGameInstall();
ScanForGames();
gtk_widget_show( text );
gtk_box_pack_start( GTK_BOX( vbox ), text, FALSE, FALSE, 0 );
- combo = gtk_combo_new();
+ combo = gtk_combo_box_new_text();
gtk_widget_show( combo );
gtk_box_pack_start( GTK_BOX( vbox ), combo, FALSE, FALSE, 0 );
+ AddDialogData( combo, &m_nComboSelect, DLG_COMBO_BOX_INT );
+ mGameCombo = GTK_COMBO_BOX( combo );
- // fill in with the game descriptions
- GList *combo_list = (GList*)NULL;
- list<CGameDescription *>::iterator iGame;
- for( iGame = mGames.begin(); iGame != mGames.end(); iGame++ ) {
- combo_list = g_list_append( combo_list, (void *)(*iGame)->mGameName.GetBuffer() );
- }
- gtk_combo_set_popdown_strings( GTK_COMBO( combo ), combo_list );
- g_list_free( combo_list );
-
- AddDialogData( combo, &m_nComboSelect, DLG_COMBO_INT );
+ UpdateGameCombo();
check = gtk_check_button_new_with_label( "Auto load selected game on startup" );
gtk_widget_show(check);
gtk_box_pack_start (GTK_BOX(vbox), check, FALSE, FALSE, 0);
AddDialogData (check, &m_bAutoLoadGame, DLG_CHECK_BOOL);
-
+
text = gtk_label_new("(this frame is available in the prefs menu if you set auto-select)");
gtk_widget_show(text);
gtk_box_pack_start (GTK_BOX(vbox), text, FALSE, FALSE, 0);
void CGameDialog::BuildDialog() {
GtkWidget *dlg, *vbox1, *button, *setup_button;
-
+
dlg = m_pWidget;
gtk_window_set_title( GTK_WINDOW( dlg ), "Select Game" );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 );
AddModalButton( button, IDOK );
-
+
+ button = gtk_button_new_with_label( "Cancel" );
+ gtk_widget_show( button );
+ gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 );
+ AddModalButton( button, IDCANCEL );
+
gtk_widget_set_usize( button, 60, -2 );
}
+void CGameDialog::UpdateGameCombo() {
+ // fill in with the game descriptions
+ list<CGameDescription *>::iterator iGame;
+
+ if ( mGameCombo == NULL ) {
+ Sys_Printf( "mGameCombo == NULL\n" );
+ return;
+ }
+
+ // clear whatever is in - wtf no way to know how many text entries?
+ // use set/get active to track
+ gtk_combo_box_set_active( mGameCombo, 0 );
+ while ( gtk_combo_box_get_active( mGameCombo ) == 0 ) {
+ gtk_combo_box_remove_text( mGameCombo, 0 );
+ gtk_combo_box_set_active( mGameCombo, 0 );
+ }
+
+ for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ ) {
+ gtk_combo_box_append_text( mGameCombo, (*iGame)->mGameName.GetBuffer() );
+ }
+ gtk_combo_box_set_active( mGameCombo, 0 );
+}
+
void CGameDialog::ScanForGames()
{
CString strPath;
Sys_FPrintf(SYS_ERR, "XML parser failed on '%s'\n", strPath.GetBuffer());
}
- g_free(dirlist);
+ g_free( dirlist );
}
- g_dir_close (dir);
+ g_dir_close( dir );
}
+
+ // entries in the combo need to be updated
+ UpdateGameCombo();
}
CGameDescription* CGameDialog::GameDescriptionForComboItem()
{
list<CGameDescription *>::iterator iGame;
int i=0;
- for(iGame=mGames.begin(); iGame!=mGames.end(); iGame++,i++)
- {
- if (i == m_nComboSelect)
- {
+ for( iGame = mGames.begin(); iGame != mGames.end(); iGame++,i++ ) {
+ if ( i == m_nComboSelect ) {
return (*iGame);
}
}
#else
g_qeglobals.m_strHomeGame = g_pGameDescription->mEnginePath.GetBuffer();
#endif
-
+
g_pGameDescription->Dump();
}
// FIXME: this is kinda hardcoded for now..
list<CGameDescription *>::iterator iGame;
for(iGame=mGames.begin(); iGame!=mGames.end(); iGame++)
- {
- if ((*iGame)->mGameFile == "q3.game")
+ {
+ if ((*iGame)->mGameFile == "q3.game")
URL += "&Games_dlup%5B%5D=1";
else if ((*iGame)->mGameFile == "wolf.game")
URL += "&Games_dlup%5B%5D=2";
#endif
// this is common to win32 and Linux init now
m_rc_path = g_string_new (m_global_rc_path->str);
-
+
// game sub-dir
g_string_append (m_rc_path, g_pGameDescription->mGameFile.GetBuffer());
g_string_append (m_rc_path, "/");
Q_mkdir (m_rc_path->str, 0775);
-
+
// then the ini file
m_inipath = g_string_new (m_rc_path->str);
g_string_append (m_inipath, PREFS_LOCAL_FILENAME);
-
+
}
void PrefsDlg::UpdateData (bool retrieve)
{
if(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook)) != prefpage)
gtk_notebook_set_page(GTK_NOTEBOOK(notebook), prefpage);
-
+
return;
}
GtkWidget *check, *label, *scale, *hbox2, *combo,
*table, *spin, *entry, *pixmap,
*radio, *button, *pageframe, *vbox;
-
+
GList *combo_list = (GList*)NULL;
-
+
GtkObject *adj;
-
+
dialog = m_pWidget;
gtk_window_set_title(GTK_WINDOW(dialog), "GtkRadiant Preferences");
gtk_widget_realize(dialog);
-
+
mainvbox = gtk_vbox_new(FALSE, 5);
gtk_container_add(GTK_CONTAINER(dialog), mainvbox);
gtk_container_set_border_width(GTK_CONTAINER(mainvbox), 5);
gtk_widget_show(mainvbox);
-
+
hbox = gtk_hbox_new(FALSE, 5);
gtk_widget_show(hbox);
gtk_box_pack_end(GTK_BOX(mainvbox), hbox, FALSE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(OnButtonClean), this);
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_widget_set_usize (button, 60, -2);
-
+
hbox = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(GTK_BOX(mainvbox), hbox, TRUE, TRUE, 0);
gtk_widget_show(hbox);
-
+
sc_win = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sc_win), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_box_pack_start(GTK_BOX(hbox), sc_win, FALSE, FALSE, 0);
gtk_tree_store_set(store, &tab, 0, "Texture Settings", 1, (gpointer)PTAB_TEXTURE, -1);
}
}
-
+
{
GtkTreeIter group;
gtk_tree_store_append(store, &group, NULL);
gtk_tree_store_set(store, &tab, 0, "Editing", 1, (gpointer)PTAB_EDITING, -1);
}
}
-
+
{
GtkTreeIter group;
gtk_tree_store_append(store, &group, NULL);
}
gtk_tree_view_expand_all(GTK_TREE_VIEW(view));
-
+
g_object_unref(G_OBJECT(store));
}
-
+
/**********************************************************************/
/* build the prefs pages */
/**********************************************************************/
-
+
// Front page...
// todo : add something interesting here
// NOTE TTimo: tip of the day? or a logo?
gtk_widget_set_usize(GTK_WIDGET(vbox), 350, -2);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
gtk_container_add(GTK_CONTAINER(pageframe), vbox);
-
+
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel);
/******** global preferences group ****************************/
pageframe = mGamesDialog.GetGlobalFrame();
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel);
-
+
/******** 2D prefs group (xy views/rendering options) *********/
preflabel = gtk_label_new("2D Display");
gtk_widget_show(preflabel);
gtk_widget_show(vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
gtk_container_add(GTK_CONTAINER(pageframe), vbox);
-
+
// OpenGL Display Lists
check = gtk_check_button_new_with_label("OpenGL Display Lists");
gtk_widget_show(check);
gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0);
AddDialogData(check, &m_bDisplayLists, DLG_CHECK_BOOL);
-
+
// Antialiased points & lines
// Fishman - Add antialiazed points and lines support. 09/03/00
check = gtk_check_button_new_with_label ("OpenGL antialiased points and lines");
gtk_widget_show (check);
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
AddDialogData (check, &m_bAntialiasedPointsAndLines, DLG_CHECK_BOOL);
-
+
// Solid selection boxes
check = gtk_check_button_new_with_label ("Solid selection boxes");
gtk_widget_show (check);
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
AddDialogData (check, &m_bNoStipple, DLG_CHECK_BOOL);
-
+
// Display size info
check = gtk_check_button_new_with_label ("Display size info");
gtk_widget_show (check);
gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0);
AddDialogData(check, &m_bGlATIHack, DLG_CHECK_BOOL);
#endif
-
+
// Add the page to the notebook
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel);
-
+
/******** 3D Camera view group *********/
preflabel = gtk_label_new("3D View");
gtk_widget_show(preflabel);
hbox2 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox2);
gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 0);
-
+
// label
label = gtk_label_new("Movement Velocity");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_widget_show(label);
gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0);
-
+
// adjustment
adj = gtk_adjustment_new(100, 50, 300, 1, 10, 10);
AddDialogData(adj, &m_nMoveSpeed, DLG_ADJ_INT);
-
+
// scale
scale = gtk_hscale_new(GTK_ADJUSTMENT(adj));
gtk_widget_show(scale);
gtk_box_pack_start(GTK_BOX (vbox), scale, FALSE, TRUE, 2);
-
+
gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
-
+
// Angular velocity (Rotational Velocity)
// label container
hbox2 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox2);
gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 0);
-
+
// label
label = gtk_label_new ("Rotational Velocity");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_widget_show (label);
gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0);
-
+
// adjustment
adj = gtk_adjustment_new (3, 1, 180, 1, 10, 10); // value, low, high, step, page_step, page_size
AddDialogData (adj, &m_nAngleSpeed, DLG_ADJ_INT);
-
+
// scale
scale = gtk_hscale_new (GTK_ADJUSTMENT (adj));
gtk_widget_show (scale);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, TRUE, 2);
- gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
+ gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
// Text under the velocity sliders
// container
hbox2 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox2);
gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 0);
-
+
// label
label = gtk_label_new ("slow");
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
-
+
// label
label = gtk_label_new ("fast");
gtk_widget_show (label);
gtk_box_pack_end (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
-
+
// Allow drag to select multiple faces/brushes
// container
table = gtk_table_new(2, 1, FALSE);
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE);
- AddDialogData (combo, &m_nCamDragMultiSelect, DLG_COMBO_INT);
+ AddDialogData (combo, &m_nCamDragMultiSelect, DLG_COMBO_INT);
// Freelook in Camera view
check = gtk_check_button_new_with_label ("Freelook in Camera view");
gtk_widget_show(vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
gtk_container_add(GTK_CONTAINER(pageframe), vbox);
-
+
// Texture quality slider
// label
label = gtk_label_new ("Texture quality");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-
+
// adjustment
adj = gtk_adjustment_new (0, 0, 4, 1, 1, 1);
AddDialogData (adj, &m_nLatchedTextureQuality, DLG_ADJ_INT);
-
+
// scale
scale = gtk_hscale_new (GTK_ADJUSTMENT (adj));
gtk_widget_show (scale);
gtk_widget_show (check);
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
AddDialogData (check, &m_bTextureWindow, DLG_CHECK_BOOL);
-
+
// texture scrollbar
check = gtk_check_button_new_with_label ("Texture scrollbar");
gtk_widget_show (check);
(GtkAttachOptions) (0),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
-
+
// combo list
combo_list = NULL;
combo_list = g_list_append (combo_list, (void *)"None");
gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE);
AddDialogData (combo, &m_nLatchedShader, DLG_COMBO_INT);
g_list_free (combo_list);
-
+
// Add the page to the notebook
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel);
-
+
/******** Layout group *********/
preflabel = gtk_label_new("Layout");
gtk_widget_show(preflabel);
(GtkAttachOptions) (0),
(GtkAttachOptions) (0), 0, 0);
AddDialogData (radio, &m_nLatchedView, DLG_RADIO_INT);
-
+
// Floating Z window
check = gtk_check_button_new_with_label ("Floating Z Window");
gtk_widget_show (check);
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
AddDialogData (check, &m_bLatchedFloatingZ, DLG_CHECK_BOOL);
-
+
// show menu tear-off seperators
check = gtk_check_button_new_with_label ("Detachable Menus");
gtk_widget_show (check);
g_object_set_data (G_OBJECT (dialog), "check_startonprimary", check);
gtk_signal_connect( GTK_OBJECT (check), "clicked", GTK_SIGNAL_FUNC(UpdateSensitivity), this );
AddDialogData (check, &m_bStartOnPrimMon, DLG_CHECK_BOOL);
-#endif
+#endif
// Add the page to the notebook
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel);
-
+
/******** Mouse group *********/
preflabel = gtk_label_new("Mouse");
gtk_widget_show(preflabel);
gtk_widget_show(vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
gtk_container_add(GTK_CONTAINER(pageframe), vbox);
-
+
// Buttons
// container
hbox2 = gtk_hbox_new (FALSE, 5);
hbox2 = gtk_hbox_new (FALSE, 5);
gtk_widget_show (hbox2);
gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, 0);
-
+
// label
label = gtk_label_new ("Wheel Mouse inc:");
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
-
+
// entry
entry = gtk_entry_new ();
gtk_widget_show (entry);
gtk_widget_set_usize (entry, 40, -2);
gtk_box_pack_start (GTK_BOX (hbox2), entry, FALSE, FALSE, 0);
- AddDialogData (entry, &m_nWheelInc, DLG_ENTRY_INT);
+ AddDialogData (entry, &m_nWheelInc, DLG_ENTRY_INT);
// Add the page to the notebook
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel);
-
+
/******** Editing group *********/
preflabel = gtk_label_new("Editing");
gtk_widget_show(preflabel);
gtk_widget_show(vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
gtk_container_add(GTK_CONTAINER(pageframe), vbox);
-
+
// Vertex editing splits faces
check = gtk_check_button_new_with_label ("Vertex editing splits face");
gtk_widget_show (check);
gtk_widget_show (check);
gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0);
AddDialogData (check, &m_bDoTargetFix, DLG_CHECK_BOOL);
-
+
// Clipper tool uses caulk
check = gtk_check_button_new_with_label ("Clipper tool uses caulk");
gtk_widget_show (check);
check = gtk_check_button_new_with_label ("Select patches by bounding box");
gtk_widget_show (check);
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
- AddDialogData (check, &m_bPatchBBoxSelect, DLG_CHECK_BOOL);
-
+ AddDialogData (check, &m_bPatchBBoxSelect, DLG_CHECK_BOOL);
+
// Rotation increment
// container
table = gtk_table_new (2, 3, FALSE);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 5);
-
+
// label
label = gtk_label_new ("Rotation increment:");
gtk_widget_show (label);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
(GtkAttachOptions) (0),
(GtkAttachOptions) (0), 0, 0);
-
+
// entry
entry = gtk_entry_new ();
gtk_widget_show (entry);
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
AddDialogData (entry, &m_nRotation, DLG_ENTRY_INT);
-
+
// Undo levels
// label
label = gtk_label_new ("Undo Levels:");
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
(GtkAttachOptions) (0),
(GtkAttachOptions) (0), 0, 0);
-
+
// spinner (allows undo levels to be set to zero)
- spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 64, 1, 10, 10)), 1, 0);
+ spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 64, 1, 10, 10)), 1, 0);
gtk_widget_show (spin);
gtk_table_attach (GTK_TABLE (table), spin, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_FILL),
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3,
(GtkAttachOptions) (0),
(GtkAttachOptions) (0), 0, 0);
-
+
// entry (spinner perhaps? [2-16])
entry = gtk_entry_new ();
gtk_widget_show (entry);
// Add the page to the notebook
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel);
-
+
/******** Save/Load group *********/
preflabel = gtk_label_new("Startup/Auto save");
gtk_widget_show(preflabel);
gtk_widget_show (check);
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
AddDialogData (check, &m_bSnapShots, DLG_CHECK_BOOL);
-
+
// load last project on open
check = gtk_check_button_new_with_label ("Load last project on open");
gtk_widget_show (check);
gtk_widget_show (hbox2);
gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox2), 0);
-
+
// label
check = gtk_check_button_new_with_label ("Auto save every");
gtk_widget_show (check);
gtk_box_pack_start (GTK_BOX (hbox2), check, FALSE, FALSE, 0);
AddDialogData (check, &m_bAutoSave, DLG_CHECK_BOOL);
-
+
// spinner
spin = gtk_spin_button_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 60, 1, 10, 10)), 1, 0);
gtk_widget_show (spin);
gtk_box_pack_start (GTK_BOX (hbox2), spin, FALSE, FALSE, 0);
gtk_widget_set_usize (spin, 60, -2);
AddDialogData (spin, &m_nAutoSave, DLG_SPIN_INT);
-
+
// label
label = gtk_label_new ("minutes");
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
-
+
// Add the page to the notebook
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel);
-
+
/******** Paths group *********/
preflabel = gtk_label_new("Paths");
gtk_widget_show(preflabel);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 5);
-
+
// label
label = gtk_label_new ("Prefab path:");
gtk_widget_show (label);
(GtkAttachOptions) (0),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
-
+
// path entry
entry = gtk_entry_new ();
gtk_widget_show (entry);
AddDialogData (entry, &m_strPrefabPath, DLG_ENTRY_TEXT);
// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=805
-#if 0
+#if 0
// browse button
button = gtk_button_new_with_label ("...");
gtk_widget_show (button);
(GtkAttachOptions) (0),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
-
+
// user ini path entry
entry = gtk_entry_new ();
gtk_widget_show (entry);
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 1, 0);
AddDialogData (entry, &m_strUserPath, DLG_ENTRY_TEXT);
-
+
// user ini browse button
button = gtk_button_new_with_label ("...");
gtk_widget_show (button);
// Add the page to the notebook
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), pageframe, preflabel);
-
+
/******** Misc group *********/
preflabel = gtk_label_new("Misc");
gtk_widget_show(preflabel);
gtk_widget_show(vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
gtk_container_add(GTK_CONTAINER(pageframe), vbox);
-
+
// Light drawing
check = gtk_check_button_new_with_label ("Light drawing");
gtk_widget_show (check);
gtk_signal_connect( GTK_OBJECT (check), "clicked", GTK_SIGNAL_FUNC(UpdateEditorSensitivity), this);
g_object_set_data (G_OBJECT(dialog), "check_customeditor", check);
AddDialogData (check, &g_PrefsDlg.m_bUseCustomEditor, DLG_CHECK_BOOL);
-
+
// custom shader editor executable
// table
table = gtk_table_new (3, 1, FALSE);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 5);
-
+
// label
label = gtk_label_new("Custom Editor Command");
gtk_widget_show(label);
gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
g_object_set_data (G_OBJECT(dialog), "label_customeditor", label);
gtk_widget_set_sensitive (label, g_PrefsDlg.m_bUseCustomEditor);
-
+
// custom editor command entry
entry = gtk_entry_new ();
gtk_widget_show (entry);
AddDialogData (entry, &m_strEditorCommand, DLG_ENTRY_TEXT);
gtk_widget_set_sensitive (entry, g_PrefsDlg.m_bUseCustomEditor);
g_object_set_data (G_OBJECT(dialog), "entry_customeditor", entry);
-
+
// browse button
button = gtk_button_new_with_label ("...");
gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
g_object_set_data (G_OBJECT (dialog), "check_runengine", check);
gtk_signal_connect( GTK_OBJECT (check), "clicked", GTK_SIGNAL_FUNC(UpdateSensitivity), this );
- AddDialogData( check, &g_PrefsDlg.m_bRunQuake, DLG_CHECK_BOOL );
-
+ AddDialogData( check, &g_PrefsDlg.m_bRunQuake, DLG_CHECK_BOOL );
+
// sleep mode when running engine
check = gtk_check_button_new_with_label ("Activate sleep mode when running the engine");
gtk_widget_show (check);
gtk_box_pack_start (GTK_BOX (vbox), check, FALSE, FALSE, 0);
g_object_set_data (G_OBJECT (dialog), "check_sleep", check);
AddDialogData( check, &g_PrefsDlg.m_bDoSleep, DLG_CHECK_BOOL );
-
+
// use q3map2's texture projection
check = gtk_check_button_new_with_label ("Texturing compatible with q3map2");
gtk_widget_show (check);
memset(pTexdef, 0, sizeof(texdef_t));
sprintf(buffer, "%s%s", pName, TD_SCALE1_KEY);
- mLocalPrefs.GetPref(buffer, &pTexdef->scale[0], 0.5f);
+ mLocalPrefs.GetPref(buffer, &pTexdef->scale[0], 0.5f);
sprintf(buffer, "%s%s", pName, TD_SCALE2_KEY);
mLocalPrefs.GetPref(buffer, &pTexdef->scale[1], 0.5f);
Sys_Printf("OpenGL not ready - postpone texture compression capability check\n");
return;
}
-
+
if (g_qeglobals.bTextureCompressionSupported)
{
if (m_nTextureCompressionFormat >= 2 && !g_qeglobals.m_bS3CompressionSupported)
}
#endif
-// TTimo: m_strEnginePath has a special status, if not found in registry we need to
+// TTimo: m_strEnginePath has a special status, if not found in registry we need to
// initiliaze it for sure. It is not totally failsafe but we can use the same
// code than in q3map, expecting to find some "quake" above us. If not, we prompt
// for the engine executable path
mLocalPrefs.GetPref(PATCHSHOWBOUNDS_KEY, &g_bPatchShowBounds, FALSE);
mLocalPrefs.GetPref(MOUSE_KEY, &m_nMouse, MOUSE_DEF);
m_nMouseButtons = m_nMouse ? 3 : 2;
-
+
// project file
// if it's not found here, mainframe.cpp will take care of finding one
mLocalPrefs.GetPref(LASTPROJ_KEY, &m_strLastProject, "");
mLocalPrefs.GetPref(DETACHABLEMENUS_KEY, &m_bLatchedDetachableMenus, TRUE);
m_bDetachableMenus = m_bLatchedDetachableMenus;
-
+
if (g_pGameDescription->mNoPatch)
{
m_bPatchToolbar = false;
mLocalPrefs.GetPref(WIDETOOLBAR_KEY, &m_bLatchedWideToolbar, TRUE);
m_bWideToolbar = m_bLatchedWideToolbar;
-
+
mLocalPrefs.GetPref(PLUGINTOOLBAR_KEY, &m_bLatchedPluginToolbar, TRUE);
m_bPluginToolbar = m_bLatchedPluginToolbar;
mLocalPrefs.GetPref(TARGETFIX_KEY, &m_bDoTargetFix, TRUE);
mLocalPrefs.GetPref(WHEELINC_KEY, &m_nWheelInc, 64);
mLocalPrefs.GetPref(PATCHBBOXSEL_KEY, &m_bPatchBBoxSelect, FALSE);
-
+
// Gef: Kyro GL_POINT workaround
mLocalPrefs.GetPref(GLPOINTWORKAROUND_KEY, &m_bGlPtWorkaround, FALSE);
// menu stuff
mLocalPrefs.GetPref(COUNT_KEY, &m_nMRUCount, 0);
- for(i = 0; i < 4; i++)
+ for(i = 0; i < 4; i++)
{
char buf[64];
sprintf (buf, "%s%d", FILE_KEY, i);
- mLocalPrefs.GetPref(buf, &m_strMRUFiles[i], "");
+ mLocalPrefs.GetPref(buf, &m_strMRUFiles[i], "");
}
// some platform specific prefs
Msg += g_PrefsDlg.m_strLastProject;
Msg += ") is not at least version 2.\nI need version 2 or above to setup BSP monitoring correctly.";
gtk_MessageBox(m_pWidget, Msg.GetBuffer(), MB_OK );
-
+
m_bWarn = false;
}
memset( m_availGames, 0, sizeof( m_availGames ) );
}
+void CGameInstall::OnBtnBrowseEngine( GtkWidget *widget, gpointer data ) {
+ Sys_Printf( "OnBtnBrowseEngine\n" );
+
+ CGameInstall* i = static_cast<CGameInstall*>( data );
+ char *dir = dir_dialog( widget, "Select game directory", NULL );
+
+ i->UpdateData( TRUE );
+
+ if ( dir != NULL ) {
+ i->m_strEngine = dir;
+ i->UpdateData( FALSE );
+ free( dir );
+ }
+}
+
+void CGameInstall::OnGameSelectChanged( GtkWidget *widget, gpointer data ) {
+ Sys_Printf( "OnGameSelectChanged\n" );
+
+ CGameInstall* i = static_cast<CGameInstall*>( data );
+ i->UpdateData( TRUE );
+ i->m_strName = gtk_combo_box_get_active_text( GTK_COMBO_BOX( widget ) );
+ i->UpdateData( FALSE );
+}
+
void CGameInstall::BuildDialog() {
- GtkWidget *dlg, *vbox1, *button, *text, *combo, *entry;
-
+ GtkWidget *dlg, *vbox1, *button, *text, *combo, *entry, *hbox;
+
dlg = m_pWidget;
gtk_window_set_title( GTK_WINDOW( dlg ), "Configure games" );
gtk_widget_show( text );
gtk_box_pack_start( GTK_BOX( vbox1 ), text, FALSE, FALSE, 0 );
- combo = gtk_combo_new();
+ combo = gtk_combo_box_new_text();
gtk_widget_show( combo );
gtk_box_pack_start( GTK_BOX( vbox1 ), combo, FALSE, FALSE, 0 );
- GList *combo_list = NULL;
+ // GList *combo_list = NULL;
int iGame = 0;
while ( m_availGames[ iGame ] != GAME_NONE ) {
switch ( m_availGames[ iGame ] ) {
+ case GAME_Q2:
+ gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Quake II" );
+ break;
case GAME_Q3:
- combo_list = g_list_append( combo_list, "Quake III Arena (including mods)" );
+ gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Quake III Arena and mods" );
break;
case GAME_URT:
- combo_list = g_list_append( combo_list, "Urban Terror (standalone)" );
+ gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Urban Terror (standalone)" );
+ break;
+ case GAME_UFOAI:
+ gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "UFO: Alien Invasion" );
+ break;
+ case GAME_Q2W:
+ gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Quake2World" );
break;
case GAME_WARSOW:
- combo_list = g_list_append( combo_list, "Warsow" );
+ gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Warsow" );
+ break;
+ case GAME_NEXUIZ:
+ gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), "Nexuiz" );
break;
}
iGame++;
}
- gtk_combo_set_popdown_strings( GTK_COMBO( combo ), combo_list );
- g_list_free( combo_list );
- AddDialogData( combo, &m_nComboSelect, DLG_COMBO_INT );
+ AddDialogData( combo, &m_nComboSelect, DLG_COMBO_BOX_INT );
+ gtk_signal_connect( GTK_OBJECT( combo ), "changed", G_CALLBACK( OnGameSelectChanged ), this );
+ gtk_combo_box_set_active( GTK_COMBO_BOX( combo ), 0 ); // NOTE: will trigger signal
text = gtk_label_new( "Name:" );
gtk_widget_show( text );
gtk_box_pack_start( GTK_BOX( vbox1 ), text, FALSE, FALSE, 0 );
-
+
entry = gtk_entry_new();
gtk_widget_show( entry );
gtk_box_pack_start( GTK_BOX( vbox1 ), entry, FALSE, FALSE, 0 );
text = gtk_label_new( "Engine directory:" );
gtk_widget_show( text );
gtk_box_pack_start( GTK_BOX( vbox1 ), text, FALSE, FALSE, 0 );
-
+
+ hbox = gtk_hbox_new( FALSE, 0 );
+ gtk_widget_show( hbox );
+ gtk_box_pack_start( GTK_BOX( vbox1 ), hbox, FALSE, FALSE, 0 );
+
entry = gtk_entry_new();
gtk_widget_show( entry );
- gtk_box_pack_start( GTK_BOX( vbox1 ), entry, FALSE, FALSE, 0 );
+ gtk_box_pack_start( GTK_BOX( hbox ), entry, FALSE, FALSE, 0 );
AddDialogData( entry, &m_strEngine, DLG_ENTRY_TEXT );
+ button = gtk_button_new_with_label ("...");
+ gtk_widget_show( button );
+ gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnBrowseEngine ), this );
+ gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
+
// this gets done in the project stuff atm
#if 0
text = gtk_label_new( "Mod subdirectory:" );
gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 );
AddModalButton( button, IDOK );
+ button = gtk_button_new_with_label( "Cancel" );
+ gtk_widget_show( button );
+ gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 );
+ AddModalButton( button, IDCANCEL );
+
gtk_widget_set_usize( button, 60, -2 );
}
void CGameInstall::Run() {
ScanGames();
- DoModal();
+ if ( DoModal() == IDCANCEL ) {
+ Sys_Printf( "game dialog cancelled\n" );
+ return;
+ }
Sys_Printf( "combo: %d name: %s engine: %s mod: %s\n", m_nComboSelect, m_strName.GetBuffer(), m_strEngine.GetBuffer(), m_strMod.GetBuffer() );
// write out the game file
}
fprintf( fg, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>\n<game\n" );
fprintf( fg, " name=\"%s\"\n", m_strName.GetBuffer() );
- fprintf( fg, " gametools=\"%sgames\"\n", g_strAppPath.GetBuffer() );
fprintf( fg, " enginepath=\"%s\"\n", m_strEngine.GetBuffer() );
- fprintf( fg, " prefix=\".q3a\"\n" );
switch ( m_availGames[ m_nComboSelect ] ) {
+ case GAME_Q2: {
+ fprintf( fg, " gametools=\"%sinstalls/Quake2Pack/game\"\n", g_strAppPath.GetBuffer() );
+ fprintf( fg, " prefix=\".quake2\"\n" );
+ Str source = g_strAppPath.GetBuffer();
+ source += "installs/";
+ source += Q2_PACK;
+ source += "/install/";
+ Str dest = m_strEngine.GetBuffer();
+ CopyTree( source.GetBuffer(), dest.GetBuffer() );
+ fprintf( fg, " basegame=\"baseq2\"\n" );
+ break;
+ }
case GAME_Q3: {
+ fprintf( fg, " gametools=\"%sinstalls/Q3Pack/game\"\n", g_strAppPath.GetBuffer() );
+ fprintf( fg, " prefix=\".q3a\"\n" );
Str source = g_strAppPath.GetBuffer();
source += "installs/";
source += Q3_PACK;
+ source += "/install/";
Str dest = m_strEngine.GetBuffer();
CopyTree( source.GetBuffer(), dest.GetBuffer() );
fprintf( fg, " basegame=\"baseq3\"\n" );
break;
}
case GAME_URT: {
+ fprintf( fg, " gametools=\"%sinstalls/UrTPack/game\"\n", g_strAppPath.GetBuffer() );
+ fprintf( fg, " prefix=\".q3a\"\n" );
Str source = g_strAppPath.GetBuffer();
source += "installs/";
source += URT_PACK;
+ source += "/install/";
Str dest = m_strEngine.GetBuffer();
CopyTree( source.GetBuffer(), dest.GetBuffer() );
fprintf( fg, " basegame=\"q3ut4\"\n" );
break;
}
- case GAME_WARSOW:
+ case GAME_UFOAI: {
+ fprintf( fg, " gametools=\"%sinstalls/UFOAIPack/game\"\n", g_strAppPath.GetBuffer() );
+ fprintf( fg, " prefix=\".ufoai\"\n" );
+ Str source = g_strAppPath.GetBuffer();
+ source += "installs/";
+ source += UFOAI_PACK;
+ source += "/install/";
+ Str dest = m_strEngine.GetBuffer();
+ CopyTree( source.GetBuffer(), dest.GetBuffer() );
+ fprintf( fg, " basegame=\"base\"\n" );
+ break;
+ }
+ case GAME_Q2W: {
+ fprintf( fg, " gametools=\"%sinstalls/Q2WPack/game\"\n", g_strAppPath.GetBuffer() );
+ fprintf( fg, " prefix=\".quake2world\"\n" );
+ Str source = g_strAppPath.GetBuffer();
+ source += "installs/";
+ source += Q2W_PACK;
+ source += "/install/";
+ Str dest = m_strEngine.GetBuffer();
+ CopyTree( source.GetBuffer(), dest.GetBuffer() );
+ fprintf( fg, " basegame=\"default\"\n" );
+ break;
+ }
+ case GAME_WARSOW: {
+ fprintf( fg, " gametools=\"%sinstalls/WarsowPack/game\"\n", g_strAppPath.GetBuffer() );
+ fprintf( fg, " prefix=\".warsow\"\n" );
+ Str source = g_strAppPath.GetBuffer();
+ source += "installs/";
+ source += WARSOW_PACK;
+ source += "/install/";
+ Str dest = m_strEngine.GetBuffer();
+ CopyTree( source.GetBuffer(), dest.GetBuffer() );
fprintf( fg, " basegame=\"basewsw\"\n" );
break;
}
+ case GAME_NEXUIZ: {
+ fprintf( fg, " gametools=\"%sinstalls/NexuizPack/game\"\n", g_strAppPath.GetBuffer() );
+ fprintf( fg, " prefix=\".nexuiz\"\n" );
+ Str source = g_strAppPath.GetBuffer();
+ source += "installs/";
+ source += NEXUIZ_PACK;
+ source += "/install/";
+ Str dest = m_strEngine.GetBuffer();
+ CopyTree( source.GetBuffer(), dest.GetBuffer() );
+ fprintf( fg, " basegame=\"data\"\n" );
+ break;
+ }
+ }
fprintf( fg, "/>\n" );
fclose( fg );
}
/*
===============
CGameInstall::ScanGames
-scan for active games that can be installed, based on the presence
+scan for active games that can be installed, based on the presence
===============
*/
void CGameInstall::ScanGames() {
Str pakPaths = g_strAppPath.GetBuffer();
- DIR *dir;
- struct dirent *dirlist;
int iGame = 0;
+ const char *dirname;
pakPaths += "installs/";
- dir = opendir( pakPaths.GetBuffer() );
- if ( dir != NULL ) {
- while ( ( dirlist = readdir( dir ) ) != NULL ) {
- if ( stricmp( dirlist->d_name, Q3_PACK ) == 0 ) {
- m_availGames[ iGame++ ] = GAME_Q3;
- }
- if ( stricmp( dirlist->d_name, URT_PACK ) == 0 ) {
- m_availGames[ iGame++ ] = GAME_URT;
- }
+ FindFiles fileScan( pakPaths.GetBuffer() );
+ while ( ( dirname = fileScan.NextFile() ) != NULL ) {
+ if ( stricmp( dirname, Q3_PACK ) == 0 ) {
+ m_availGames[ iGame++ ] = GAME_Q3;
+ }
+ if ( stricmp( dirname, URT_PACK ) == 0 ) {
+ m_availGames[ iGame++ ] = GAME_URT;
+ }
+ if ( stricmp( dirname, UFOAI_PACK ) == 0 ) {
+ m_availGames[ iGame++ ] = GAME_UFOAI;
+ }
+ if ( stricmp( dirname, Q2W_PACK ) == 0 ) {
+ m_availGames[ iGame++ ] = GAME_Q2W;
+ }
+ if ( stricmp( dirname, WARSOW_PACK ) == 0 ) {
+ m_availGames[ iGame++ ] = GAME_WARSOW;
+ }
+ if ( stricmp( dirname, NEXUIZ_PACK ) == 0 ) {
+ m_availGames[ iGame++ ] = GAME_NEXUIZ;
+ }
+ if ( stricmp( dirname, Q2_PACK ) == 0 ) {
+ m_availGames[ iGame++ ] = GAME_Q2;
}
- closedir( dir );
}
}
+