diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2017-07-30 11:02:39 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2017-07-30 11:02:39 -0400 |
commit | b1f93a4f8a5a3e84db9f00d0b41749d4fb32ed26 (patch) | |
tree | 83016b80294f6b7681093ae46aa55840b6fb9ec1 /src/inventory.cpp | |
parent | 69768fdc5050bbe5877bf80108584400ea292a4f (diff) |
event feature work; ozone bgm redone
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 95ab523..f200705 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -212,7 +212,7 @@ void InventorySystem::render(void) Render::textShader.unuse(); } -void InventorySystem::receive(const MouseClickEvent &mce) +bool InventorySystem::receive(const MouseClickEvent &mce) { if (mce.button == SDL_BUTTON_RIGHT) { game::entities.each<ItemDrop>([&](entityx::Entity e, ItemDrop& id) { @@ -248,9 +248,10 @@ void InventorySystem::receive(const MouseClickEvent &mce) game::events.emit<UseItemEvent>(mce.position, items[0].item, &attack->second); } } + return true; } -void InventorySystem::receive(const MouseReleaseEvent &mre) +bool InventorySystem::receive(const MouseReleaseEvent &mre) { if (movingItem != -1) { int end = fullInventory ? items.size() : hotbarSize; @@ -265,7 +266,7 @@ void InventorySystem::receive(const MouseReleaseEvent &mre) } movingItem = -1; - return; + return true; } } @@ -274,6 +275,7 @@ void InventorySystem::receive(const MouseReleaseEvent &mre) items[movingItem].count = 0; movingItem = -1; } + return true; } void InventorySystem::makeDrop(const vec2& p, InventoryEntry& ie) @@ -308,11 +310,11 @@ void InventorySystem::makeDrop(const vec2& p, const std::string& s, int c) e.assign<Physics>(); } -void InventorySystem::receive(const KeyDownEvent &kde) +bool InventorySystem::receive(const KeyDownEvent &kde) { - if (kde.keycode == SDLK_e) { + if (kde.keycode == SDLK_e) fullInventory ^= true; - } + return true; } void InventorySystem::add(const std::string& name, int count) |