Skip to content

Commit

Permalink
#5248: DifficultyEditor doesn't show classname of difficulty setting …
Browse files Browse the repository at this point in the history
…when typing it into the combo box instead of selecting one from the dropdown
  • Loading branch information
codereader committed Sep 20, 2020
1 parent f6a15a9 commit 7271602
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion plugins/dm.difficulty/DifficultyEditor.cpp
Expand Up @@ -5,6 +5,7 @@

#include "wxutil/TreeView.h"
#include "wxutil/ChoiceHelper.h"
#include "wxutil/dialog/MessageBox.h"

#include <wx/panel.h>
#include <wx/choice.h>
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 7271602

Please sign in to comment.