summaryrefslogtreecommitdiff
path: root/src/gui/npcdialog.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-06-24 17:46:48 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-08-04 21:24:44 +0200
commit638206c925cbe6db40b0ccdf7a39bc8029c6b9fa (patch)
treeff6dfcbc8654f674617c122302eddfb3ae15af2b /src/gui/npcdialog.cpp
parent8a5fc68d22fc85736d4c379ef88d3a7fd0eee391 (diff)
downloadmana-638206c925cbe6db40b0ccdf7a39bc8029c6b9fa.tar.gz
mana-638206c925cbe6db40b0ccdf7a39bc8029c6b9fa.tar.bz2
mana-638206c925cbe6db40b0ccdf7a39bc8029c6b9fa.tar.xz
mana-638206c925cbe6db40b0ccdf7a39bc8029c6b9fa.zip
Removed a bunch of unused NPC related events
Nobody cared for the events that were emitted when NPC related network messages had been sent.
Diffstat (limited to 'src/gui/npcdialog.cpp')
-rw-r--r--src/gui/npcdialog.cpp33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index 376813f7..be076fc5 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -330,16 +330,9 @@ bool NpcDialog::isInputFocused() const
bool NpcDialog::isAnyInputFocused()
{
- auto it = instances.begin();
- auto it_end = instances.end();
-
- for (; it != it_end; it++)
- {
- if ((*it)->isInputFocused())
- {
+ for (auto dialog : instances)
+ if (dialog->isInputFocused())
return true;
- }
- }
return false;
}
@@ -415,29 +408,17 @@ NpcDialog *NpcDialog::getActive()
if (instances.size() == 1)
return instances.front();
- auto it = instances.begin();
- auto it_end = instances.end();
-
- for (; it != it_end; it++)
- {
- if ((*it)->isFocused())
- {
- return (*it);
- }
- }
+ for (auto dialog : instances)
+ if (dialog->isFocused())
+ return dialog;
return nullptr;
}
void NpcDialog::closeAll()
{
- auto it = instances.begin();
- auto it_end = instances.end();
-
- for (; it != it_end; it++)
- {
- (*it)->close();
- }
+ for (auto dialog : instances)
+ dialog->close();
}
void NpcDialog::setup()