Skip to content

Commit

Permalink
#5864: Fix crashes when opening the mission info edit dialog.
Browse files Browse the repository at this point in the history
Some tokens were unsupported by the parser, and one windowDef has been removed from the TDM main menu.
  • Loading branch information
codereader committed Mar 1, 2022
1 parent 9ae183a commit a2dd94b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion plugins/dm.editing/MissionInfoGuiView.cpp
Expand Up @@ -89,7 +89,11 @@ void DarkmodTxtGuiView::updateGuiState()
gui->findWindowDef("modCompletedValue")->text.setValue("2017-11-26");
gui->findWindowDef("modSizeTitle")->text.setValue("Space used:");
gui->findWindowDef("modSizeValue")->text.setValue("123 MB");
gui->findWindowDef("modSizeEraseFromDiskAction")->text.setValue("[Erase from disk]");

if (gui->findWindowDef("modSizeEraseFromDiskAction"))
{
gui->findWindowDef("modSizeEraseFromDiskAction")->text.setValue("[Erase from disk]");
}

gui->findWindowDef("modLoadN")->text.setValue("Install Mission");
gui->findWindowDef("modLoadH")->text.setValue("Install Mission");
Expand Down
6 changes: 5 additions & 1 deletion plugins/dm.gui/gui/GuiWindowDef.cpp
Expand Up @@ -326,7 +326,7 @@ void GuiWindowDef::constructFromTokens(parser::DefTokeniser& tokeniser)

// TODO
}
else if (token == "onesc")
else if (token == "onesc" || token == "onactivate")
{
GuiScriptPtr script(new GuiScript(*this));
script->constructFromTokens(tokeniser);
Expand Down Expand Up @@ -425,6 +425,10 @@ void GuiWindowDef::constructFromTokens(parser::DefTokeniser& tokeniser)
rWarning() << "'choiceType' token encountered in windowDef block in " << name << std::endl;
tokeniser.nextToken(); // the choicetype value
}
else if (token == "matscalex" || token == "matscaley")
{
tokeniser.nextToken(); // value
}
else if (token == "}")
{
break;
Expand Down

0 comments on commit a2dd94b

Please sign in to comment.