summaryrefslogtreecommitdiff
path: root/src/gui/npcdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-13 22:58:01 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-14 01:42:53 +0300
commite40411cdc287343a32a8371f2116fcc11545b466 (patch)
tree4655f02211f1b08b8ead94175fd419c6e766f9c8 /src/gui/npcdialog.cpp
parent2ebce73d5018945bb5f5363913a4096e04bf5a0f (diff)
downloadmanaplus-e40411cdc287343a32a8371f2116fcc11545b466.tar.gz
manaplus-e40411cdc287343a32a8371f2116fcc11545b466.tar.bz2
manaplus-e40411cdc287343a32a8371f2116fcc11545b466.tar.xz
manaplus-e40411cdc287343a32a8371f2116fcc11545b466.zip
Improve event.getId() speed.
Diffstat (limited to 'src/gui/npcdialog.cpp')
-rw-r--r--src/gui/npcdialog.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index df534c8e0..df253b752 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -270,7 +270,8 @@ void NpcDialog::showCloseButton()
void NpcDialog::action(const gcn::ActionEvent &event)
{
- if (event.getId() == "ok")
+ const std::string &eventId = event.getId();
+ if (eventId == "ok")
{
if (mActionState == NPC_ACTION_NEXT)
{
@@ -330,26 +331,26 @@ void NpcDialog::action(const gcn::ActionEvent &event)
if (!mLogInteraction)
mTextBox->clearRows();
}
- else if (event.getId() == "reset")
+ else if (eventId == "reset")
{
if (mInputState == NPC_INPUT_STRING)
mTextField->setText(mDefaultString);
else if (mInputState == NPC_INPUT_INTEGER)
mIntField->setValue(mDefaultInt);
}
- else if (event.getId() == "inc")
+ else if (eventId == "inc")
{
mIntField->setValue(mIntField->getValue() + 1);
}
- else if (event.getId() == "dec")
+ else if (eventId == "dec")
{
mIntField->setValue(mIntField->getValue() - 1);
}
- else if (event.getId() == "clear")
+ else if (eventId == "clear")
{
clearRows();
}
- else if (event.getId() == "close")
+ else if (eventId == "close")
{
if (mActionState == NPC_ACTION_INPUT)
{