Added multiplayer tab for launcher + backend improvements
Adds a multiplayer tab to allow hosting and joining games from within the GZDoom launcher rather than needed to use the command line. This has its own set of defaults independent from the main play page which necessitated rewriting how this information is passed and stored in the backend. A startup info struct is now passed back which has its defaults set from the cvars and then propagates any changes to it back to the defaults after selection is complete, making it much simpler to interface with the engine defaults.
This commit is contained in:
parent
6756c850e7
commit
9701bfaa5c
18 changed files with 1006 additions and 156 deletions
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include "i_common.h"
|
||||
#include "c_cvars.h"
|
||||
#include "i_interface.h"
|
||||
|
||||
#include <fnmatch.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
|
@ -122,21 +123,27 @@ void I_ShowFatalError(const char *message)
|
|||
}
|
||||
|
||||
|
||||
int I_PickIWad(WadStuff* const wads, const int numwads, const bool showwin, const int defaultiwad, int&, FString&)
|
||||
bool I_PickIWad(bool showwin, FStartupSelectionInfo& info)
|
||||
{
|
||||
if (!showwin)
|
||||
{
|
||||
return defaultiwad;
|
||||
return true;
|
||||
}
|
||||
|
||||
I_SetMainWindowVisible(false);
|
||||
|
||||
extern int I_PickIWad_Cocoa(WadStuff*, int, bool, int);
|
||||
const int result = I_PickIWad_Cocoa(wads, numwads, showwin, defaultiwad);
|
||||
const int result = I_PickIWad_Cocoa(&(*info.Wads)[0], (int)info.Wads->Size(), showwin, info.DefaultIWAD);
|
||||
|
||||
I_SetMainWindowVisible(true);
|
||||
|
||||
return result;
|
||||
if (result >= 0)
|
||||
{
|
||||
info.DefaultIWAD = result;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include "zstring.h"
|
||||
|
||||
struct WadStuff;
|
||||
struct FStartupSelectionInfo;
|
||||
|
||||
#ifndef SHARE_DIR
|
||||
#define SHARE_DIR "/usr/local/share/"
|
||||
|
|
@ -37,7 +38,7 @@ void I_PrintStr (const char *str);
|
|||
void I_SetIWADInfo ();
|
||||
|
||||
// Pick from multiple IWADs to use
|
||||
int I_PickIWad (WadStuff *wads, int numwads, bool queryiwad, int defaultiwad, int&, FString &);
|
||||
bool I_PickIWad (bool showwin, FStartupSelectionInfo& info);
|
||||
|
||||
// [RH] Checks the registry for Steam's install path, so we can scan its
|
||||
// directories for IWADs if the user purchased any through Steam.
|
||||
|
|
|
|||
|
|
@ -302,17 +302,23 @@ void I_PrintStr(const char *cp)
|
|||
if (StartWindow) RedrawProgressBar(ProgressBarCurPos,ProgressBarMaxPos);
|
||||
}
|
||||
|
||||
int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad, int& autoloadflags, FString &extraArgs)
|
||||
bool I_PickIWad (bool showwin, FStartupSelectionInfo& info)
|
||||
{
|
||||
if (!showwin)
|
||||
{
|
||||
return defaultiwad;
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
return I_PickIWad_Cocoa (wads, numwads, showwin, defaultiwad);
|
||||
const int ret = I_PickIWad_Cocoa(&(*info.Wads)[0], (int)info.Wads->Size(), showwin, info.DefaultIWAD);
|
||||
if (ret >= 0)
|
||||
{
|
||||
info.DefaultIWAD = ret;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#else
|
||||
return LauncherWindow::ExecModal(wads, numwads, defaultiwad, &autoloadflags, &extraArgs);
|
||||
return LauncherWindow::ExecModal(info);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ static void SetQueryIWad(HWND dialog)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
int I_PickIWad(WadStuff *wads, int numwads, bool showwin, int defaultiwad, int& autoloadflags, FString &extraArgs)
|
||||
bool I_PickIWad(bool showwin, FStartupSelectionInfo& info)
|
||||
{
|
||||
int vkey;
|
||||
if (stricmp(queryiwad_key, "shift") == 0)
|
||||
|
|
@ -375,9 +375,9 @@ int I_PickIWad(WadStuff *wads, int numwads, bool showwin, int defaultiwad, int&
|
|||
}
|
||||
if (showwin || (vkey != 0 && GetAsyncKeyState(vkey)))
|
||||
{
|
||||
return LauncherWindow::ExecModal(wads, numwads, defaultiwad, &autoloadflags, &extraArgs);
|
||||
return LauncherWindow::ExecModal(info);
|
||||
}
|
||||
return defaultiwad;
|
||||
return true;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "utf8.h"
|
||||
|
||||
struct WadStuff;
|
||||
struct FStartupSelectionInfo;
|
||||
|
||||
// [RH] Detects the OS the game is running under.
|
||||
void I_DetectOS (void);
|
||||
|
|
@ -37,7 +38,7 @@ void I_PrintStr (const char *cp);
|
|||
void I_SetIWADInfo ();
|
||||
|
||||
// Pick from multiple IWADs to use
|
||||
int I_PickIWad(WadStuff* wads, int numwads, bool queryiwad, int defaultiwad, int& autoloadflags, FString &extraArgs);
|
||||
bool I_PickIWad(bool showwin, FStartupSelectionInfo& info);
|
||||
|
||||
// The ini could not be saved at exit
|
||||
bool I_WriteIniFailed (const char* filename);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue