From 74f6a9360a1809ac763fc9f9954af1b6e77da43a Mon Sep 17 00:00:00 2001
From: mattn <mattn@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Date: Mon, 24 Mar 2008 16:53:15 +0000
Subject: [PATCH] * added nexuiz and quake2 gamepack support

git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/branches/ZeroRadiant@237 8a3a26a2-13c4-0310-b231-cf6edde360e5
---
 radiant/preferences.cpp | 32 ++++++++++++++++++++++++++++++++
 radiant/preferences.h   |  4 ++++
 2 files changed, 36 insertions(+)

diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp
index 7a0f6d2f..ecd4d0a1 100644
--- a/radiant/preferences.cpp
+++ b/radiant/preferences.cpp
@@ -3160,6 +3160,9 @@ void CGameInstall::BuildDialog() {
 	int iGame = 0;
 	while ( m_availGames[ iGame ] != GAME_NONE ) {
 		switch ( m_availGames[ iGame ] ) {
+		case GAME_Q2:
+			combo_list = g_list_append( combo_list, "Quake II" );
+			break;
 		case GAME_Q3:
 			combo_list = g_list_append( combo_list, "Quake III Arena (including mods)" );
 			break;
@@ -3175,6 +3178,9 @@ void CGameInstall::BuildDialog() {
 		case GAME_WARSOW:
 			combo_list = g_list_append( combo_list, "Warsow" );
 			break;
+		case GAME_NEXUIZ:
+			combo_list = g_list_append( combo_list, "Nexuiz" );
+			break;
 		}
 		iGame++;
 	}
@@ -3241,6 +3247,16 @@ void CGameInstall::Run() {
 	fprintf( fg, "  gametools=\"%sgames/%s\"\n", g_strAppPath.GetBuffer(), m_strName.GetBuffer() );
 	fprintf( fg, "  enginepath=\"%s\"\n", m_strEngine.GetBuffer() );
 	switch ( m_availGames[ m_nComboSelect ] ) {
+	case GAME_Q2: {
+		fprintf( fg, "  prefix=\".quake2\"\n" );
+		Str source = g_strAppPath.GetBuffer();
+		source += "installs/";
+		source += Q2_PACK;
+		Str dest = m_strEngine.GetBuffer();
+		CopyTree( source.GetBuffer(), dest.GetBuffer() );
+		fprintf( fg, "  basegame=\"baseq2\"\n" );
+		break;
+	}
 	case GAME_Q3: {
 		fprintf( fg, "  prefix=\".q3a\"\n" );
 		Str source = g_strAppPath.GetBuffer();
@@ -3291,6 +3307,16 @@ void CGameInstall::Run() {
 		fprintf( fg, "  basegame=\"basewsw\"\n" );
 		break;
 	}
+	case GAME_NEXUIZ: {
+		fprintf( fg, "  prefix=\".nexuiz\"\n" );
+		Str source = g_strAppPath.GetBuffer();
+		source += "installs/";
+		source += NEXUIZ_PACK;
+		Str dest = m_strEngine.GetBuffer();
+		CopyTree( source.GetBuffer(), dest.GetBuffer() );
+		fprintf( fg, "  basegame=\"data\"\n" );
+		break;
+	}
 	}
 	fprintf( fg, "/>\n" );
 	fclose( fg );
@@ -3325,6 +3351,12 @@ void CGameInstall::ScanGames() {
 		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;
+		}
 	}
 }
 
diff --git a/radiant/preferences.h b/radiant/preferences.h
index 76e1432f..00e2b15d 100644
--- a/radiant/preferences.h
+++ b/radiant/preferences.h
@@ -203,6 +203,8 @@ select games, copy editing assets and write out configuration files
 #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:
@@ -218,6 +220,8 @@ public:
 		GAME_UFOAI,
 		GAME_Q2W,
 		GAME_WARSOW,
+		GAME_NEXUIZ,
+		GAME_Q2,
 		GAME_COUNT
 	};
 
-- 
2.39.5