shithub: choc

Download patch

ref: 9eb11191b5ac68764da60c2f583d9c34ac05794e
parent: 664c35903202a2e7c56479eff1786e952718e4df
author: Simon Howard <fraggle@gmail.com>
date: Thu May 14 15:54:49 EDT 2009

Add character class selectors for Hexen.

Subversion-branch: /branches/raven-branch
Subversion-revision: 1523

--- a/src/setup/multiplayer.c
+++ b/src/setup/multiplayer.c
@@ -103,6 +103,13 @@
     "Titan/Pope/Archimage"
 };
 
+static char *character_classes[] =
+{
+    "Fighter",
+    "Cleric",
+    "Mage"
+};
+
 static struct
 {
     GameMission_t mission;
@@ -114,7 +121,7 @@
     { hexen,   hexen_skills }
 };
 
-static char *gamemodes[] = 
+static char *gamemodes[] =
 {
     "Co-operative",
     "Deathmatch",
@@ -128,6 +135,7 @@
 
 static char *wads[NUM_WADS];
 static char *extra_params[NUM_EXTRA_PARAMS];
+static int character_class = 0;
 static int skill = 2;
 static int nomonsters = 0;
 static int deathmatch = 0;
@@ -215,6 +223,11 @@
     AddCmdLineParameter(exec, "-server");
     AddCmdLineParameter(exec, "-skill %i", skill + 1);
 
+    if (gamemission == hexen)
+    {
+        AddCmdLineParameter(exec, "-class %i", character_class);
+    }
+
     if (nomonsters)
     {
         AddCmdLineParameter(exec, "-nomonsters");
@@ -618,6 +631,15 @@
                            NULL),
            NULL);
 
+    if (gamemission == hexen)
+    {
+        TXT_AddWidgets(gameopt_table,
+                       TXT_NewLabel("Character class "),
+                       TXT_NewDropdownList(&character_class,
+                                           character_classes, 3),
+                       NULL);
+    }
+
     TXT_SetColumnWidths(advanced_table, 12, 12);
 
     TXT_SignalConnect(iwad_selector, "changed", UpdateWarpType, NULL);
@@ -646,6 +668,11 @@
         AddCmdLineParameter(exec, "-autojoin");
     }
 
+    if (gamemission == hexen)
+    {
+        AddCmdLineParameter(exec, "-class %i", character_class);
+    }
+
     // Extra parameters come first, so that they can be used to override
     // the other parameters.
 
@@ -704,6 +731,15 @@
                    TXT_NewLabel("Game"),
                    IWADSelector(),
                    NULL);
+
+    if (gamemission == hexen)
+    {
+        TXT_AddWidgets(gameopt_table,
+                       TXT_NewLabel("Character class "),
+                       TXT_NewDropdownList(&character_class,
+                                           character_classes, 3),
+                       NULL);
+    }
 
     TXT_AddWidgets(serveropt_table,
                    TXT_NewRadioButton("Connect to address:",