Avoid delegates being called repeatedly when pressing enter in name dialog.

actorid
Jan Borsodi 15 years ago
parent 07dd5e5631
commit 84acab03ec

@ -21,8 +21,6 @@ namespace MWGui
{
using namespace MyGUI;
typedef delegates::CDelegate0 EventHandle_Void;
class RaceDialog : public OEngine::GUI::Layout
{
public:
@ -47,6 +45,7 @@ namespace MWGui
void setNextButtonShow(bool shown);
// Events
typedef delegates::CDelegate0 EventHandle_Void;
/** Event : Back button clicked.\n
signature : void method()\n

@ -15,8 +15,6 @@ namespace MWGui
{
using namespace MyGUI;
typedef delegates::CDelegate0 EventHandle_Void;
class TextInputDialog : public OEngine::GUI::Layout
{
public:
@ -29,6 +27,7 @@ namespace MWGui
void setTextLabel(const std::string &label);
// Events
typedef delegates::CDelegate0 EventHandle_Void;
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n

@ -115,7 +115,7 @@ void WindowManager::updateVisible()
{
if (!raceDialog)
raceDialog = new RaceDialog(environment);
nameDialog->setNextButtonShow(raceChosen);
raceDialog->setNextButtonShow(raceChosen);
raceDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onRaceDialogDone);
raceDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onRaceDialogBack);
raceDialog->setVisible(true);
@ -189,6 +189,8 @@ void WindowManager::updateCharacterGeneration()
void WindowManager::onNameDialogDone()
{
nameDialog->eventDone = MWGui::TextInputDialog::EventHandle_Void();
bool goNext = nameChosen; // Go to next dialog if name was previously chosen
nameChosen = true;
if (nameDialog)
@ -209,7 +211,9 @@ void WindowManager::onNameDialogDone()
void WindowManager::onRaceDialogDone()
{
bool goNext = nameChosen; // Go to next dialog if race was previously chosen
raceDialog->eventDone = MWGui::RaceDialog::EventHandle_Void();
bool goNext = raceChosen; // Go to next dialog if race was previously chosen
raceChosen = true;
if (raceDialog)
{

Loading…
Cancel
Save