Hide the additional parameters field as it is not implemented

This commit is contained in:
Magnus Norddahl 2024-01-18 11:59:10 +01:00
commit fbceb44b60
4 changed files with 41 additions and 1 deletions

View file

@ -7,10 +7,15 @@
#include "version.h"
#include "i_interface.h"
#include "gstrings.h"
#include "c_cvars.h"
#include <zwidget/core/resourcedata.h>
#include <zwidget/window/window.h>
#include <zwidget/widgets/tabwidget/tabwidget.h>
#if defined(EXTRAARGS)
CVAR(String, additional_parameters, "", CVAR_ARCHIVE | CVAR_NOSET | CVAR_GLOBALCONFIG);
#endif
int LauncherWindow::ExecModal(WadStuff* wads, int numwads, int defaultiwad, int* autoloadflags)
{
Size screenSize = GetScreenSize();
@ -46,6 +51,10 @@ LauncherWindow::LauncherWindow(WadStuff* wads, int numwads, int defaultiwad, int
UpdateLanguage();
#if defined(EXTRAARGS)
PlayGame->SetExtraArgs(static_cast<FString>(additional_parameters).GetChars());
#endif
Pages->SetCurrentWidget(PlayGame);
PlayGame->SetFocus();
}
@ -54,11 +63,15 @@ void LauncherWindow::Start()
{
Settings->Save();
#if defined(EXTRAARGS)
std::string extraargs = PlayGame->GetExtraArgs();
if (!extraargs.empty())
if (extraargs != static_cast<FString>(additional_parameters).GetChars())
{
additional_parameters = extraargs.c_str();
// To do: restart the process like the cocoa backend is doing?
}
#endif
ExecResult = PlayGame->GetSelectedGame();
DisplayWindow::ExitLoop();