foxygit / doom Log in
commit a16cb18b8457862602c6877dad2f729b7c5238dc
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Mar 31 19:16:25 2013 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun Mar 31 19:16:25 2013 +0000

    Change WAD selectors in setup tool to file selection widgets.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 2572
---
 setup/multiplayer.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/setup/multiplayer.c b/setup/multiplayer.c
index e8977763..d2a38b1b 100644
--- a/setup/multiplayer.c
+++ b/setup/multiplayer.c
@@ -101,6 +101,8 @@ static char *gamemodes[] =
     "Deathmatch 2.0",
 };

+static char *wad_extensions[] = { "wad", "lmp", "deh", NULL };
+
 char *net_player_name;
 char *chat_macros[10];

@@ -154,7 +156,7 @@ static void AddWADs(execute_context_t *exec)
 {
     int have_wads = 0;
     int i;
-
+
     for (i=0; i<NUM_WADS; ++i)
     {
         if (wads[i] != NULL && strlen(wads[i]) > 0)
@@ -263,7 +265,7 @@ static void StartGame(int multiplayer)
     AddWADs(exec);

     TXT_Shutdown();
-
+
     M_SaveDefaults();
     PassThroughArguments(exec);

@@ -568,7 +570,9 @@ static void OpenWadsWindow(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data))

     for (i=0; i<NUM_WADS; ++i)
     {
-        TXT_AddWidget(window, TXT_NewInputBox(&wads[i], 60));
+        TXT_AddWidget(window,
+                      TXT_NewFileSelector(&wads[i], 60, "Select a WAD file",
+                                          wad_extensions));
     }
 }