aboutsummaryrefslogtreecommitdiffstats
path: root/src/systems/dialog.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-09-07 13:38:56 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-09-07 13:38:56 -0400
commitc3e164c6845b9b32f132aa37cc9707acba0d9eff (patch)
tree549b66f19066863628d74860145a07f6b04ad8ba /src/systems/dialog.cpp
parent643e94897ba5fab0570d118a7aafc7772949d4e3 (diff)
event consumption work
Diffstat (limited to 'src/systems/dialog.cpp')
-rw-r--r--src/systems/dialog.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/systems/dialog.cpp b/src/systems/dialog.cpp
index ee7c834..f4f479f 100644
--- a/src/systems/dialog.cpp
+++ b/src/systems/dialog.cpp
@@ -27,15 +27,17 @@ void DialogSystem::configure(entityx::EventManager &ev)
bool DialogSystem::receive(const MouseClickEvent &mce)
{
+ static bool continueEvent;
+
+ continueEvent = true;
game::entities.each<Position, Solid, Dialog, Name>(
[&](entityx::Entity e, Position &pos, Solid &dim, Dialog &d, Name &name) {
static std::atomic_bool dialogRun;
- (void)e;
- (void)d;
if (((mce.position.x > pos.x) & (mce.position.x < pos.x + dim.width)) &&
((mce.position.y > pos.y) & (mce.position.y < pos.y + dim.height))) {
+ continueEvent = false;
e.replace<Flash>(Color(0, 255, 255));
if (!dialogRun.load()) {
@@ -141,10 +143,12 @@ bool DialogSystem::receive(const MouseClickEvent &mce)
d.talking = false;
dialogRun.store(false);
}).detach();
- }
- }
- });
- return false;
+ } // dialogRun check
+
+ } // mouse check
+ } // .each
+ );
+ return continueEvent;
}
void DialogSystem::update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt)