save extraArgs to CVar for easier testing
This commit is contained in:
parent
1f1d9dc1b5
commit
f4ac616b57
4 changed files with 12 additions and 1 deletions
|
|
@ -584,6 +584,8 @@ FString FIWadManager::IWADPathFileSearch(const FString &file)
|
|||
return "";
|
||||
}
|
||||
|
||||
CVAR(String, extra_args, "", CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||
|
||||
int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char *iwad, const char *zdoom_wad, const char *optional_wad)
|
||||
{
|
||||
const char *iwadparm = Args->CheckValue ("-iwad");
|
||||
|
|
@ -791,13 +793,15 @@ int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char
|
|||
if (autoloadbrightmaps) flags |= 4;
|
||||
if (autoloadwidescreen) flags |= 8;
|
||||
|
||||
FString extraArgs;
|
||||
FString extraArgs = *extra_args;
|
||||
|
||||
pick = I_PickIWad(&wads[0], (int)wads.Size(), queryiwad, pick, flags, extraArgs);
|
||||
if (pick >= 0)
|
||||
{
|
||||
extraArgs.StripLeftRight();
|
||||
|
||||
extra_args = extraArgs.GetChars();
|
||||
|
||||
if(extraArgs.Len() > 0)
|
||||
{
|
||||
Args->AppendArgsString(extraArgs);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ int LauncherWindow::ExecModal(WadStuff* wads, int numwads, int defaultiwad, int*
|
|||
|
||||
auto launcher = std::make_unique<LauncherWindow>(wads, numwads, defaultiwad, autoloadflags);
|
||||
launcher->SetFrameGeometry((screenSize.width - windowWidth) * 0.5, (screenSize.height - windowHeight) * 0.5, windowWidth, windowHeight);
|
||||
if(extraArgs) launcher->PlayGame->SetExtraArgs(extraArgs->GetChars());
|
||||
launcher->Show();
|
||||
|
||||
DisplayWindow::RunLoop();
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ std::string PlayGamePage::GetExtraArgs()
|
|||
return ParametersEdit->GetText();
|
||||
}
|
||||
|
||||
void PlayGamePage::SetExtraArgs(const std::string& args)
|
||||
{
|
||||
ParametersEdit->SetText(args);
|
||||
}
|
||||
|
||||
int PlayGamePage::GetSelectedGame()
|
||||
{
|
||||
return GamesList->GetSelectedItem();
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ public:
|
|||
PlayGamePage(LauncherWindow* launcher, WadStuff* wads, int numwads, int defaultiwad);
|
||||
void UpdateLanguage();
|
||||
|
||||
void SetExtraArgs(const std::string& args);
|
||||
std::string GetExtraArgs();
|
||||
int GetSelectedGame();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue