From 727160212f9a71b0f5208cab1a11e69f7327bc87 Mon Sep 17 00:00:00 2001 From: codereader Date: Sun, 20 Sep 2020 10:13:45 +0200 Subject: [PATCH] #5248: DifficultyEditor doesn't show classname of difficulty setting when typing it into the combo box instead of selecting one from the dropdown --- plugins/dm.difficulty/DifficultyEditor.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/dm.difficulty/DifficultyEditor.cpp b/plugins/dm.difficulty/DifficultyEditor.cpp index 7047492c88..cbe84916a9 100644 --- a/plugins/dm.difficulty/DifficultyEditor.cpp +++ b/plugins/dm.difficulty/DifficultyEditor.cpp @@ -5,6 +5,7 @@ #include "wxutil/TreeView.h" #include "wxutil/ChoiceHelper.h" +#include "wxutil/dialog/MessageBox.h" #include #include @@ -200,10 +201,24 @@ void DifficultyEditor::saveSetting() difficulty::SettingPtr setting(new difficulty::Setting); // Load the widget contents - setting->className = _classCombo->GetStringSelection(); + setting->className = _classCombo->GetValue(); + + if (setting->className.empty()) + { + wxutil::Messagebox::ShowError(_("Classname cannot be left empty"), wxGetTopLevelParent(_classCombo)); + return; + } + setting->spawnArg = _spawnArgEntry->GetValue(); setting->argument = _argumentEntry->GetValue(); + if (setting->spawnArg.empty() || setting->argument.empty()) + { + wxutil::Messagebox::ShowError(_("Spawnarg name and value cannot be left empty"), + wxGetTopLevelParent(_spawnArgEntry)); + return; + } + // Get the apptype from the dropdown list setting->appType = difficulty::Setting::EAssign;