summaryrefslogtreecommitdiffstats
path: root/src/Render.cpp
diff options
context:
space:
mode:
authorElisey Puzko <puzko.e02@gmail.com>2018-02-22 20:07:08 +0100
committerElisey Puzko <puzko.e02@gmail.com>2018-02-22 20:07:08 +0100
commit228423d91518d0b8bd1c4bf047f3d378567e00f9 (patch)
treee05f4d5ddb11794bb4eb8691e8970d063599e669 /src/Render.cpp
parentNew event: SelectedBlockChanged (diff)
downloadAltCraft-228423d91518d0b8bd1c4bf047f3d378567e00f9.tar
AltCraft-228423d91518d0b8bd1c4bf047f3d378567e00f9.tar.gz
AltCraft-228423d91518d0b8bd1c4bf047f3d378567e00f9.tar.bz2
AltCraft-228423d91518d0b8bd1c4bf047f3d378567e00f9.tar.lz
AltCraft-228423d91518d0b8bd1c4bf047f3d378567e00f9.tar.xz
AltCraft-228423d91518d0b8bd1c4bf047f3d378567e00f9.tar.zst
AltCraft-228423d91518d0b8bd1c4bf047f3d378567e00f9.zip
Diffstat (limited to '')
-rw-r--r--src/Render.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/Render.cpp b/src/Render.cpp
index c5c295d..cb05f65 100644
--- a/src/Render.cpp
+++ b/src/Render.cpp
@@ -244,16 +244,23 @@ void Render::HandleEvents() {
}
case SDL_MOUSEBUTTONDOWN: {
- if (event.button.button == SDL_BUTTON_LEFT && !ImGui::GetIO().WantCaptureMouse)
- PUSH_EVENT("LmbPressed", 0);
+ if (!ImGui::GetIO().WantCaptureMouse) {
+ if (event.button.button == SDL_BUTTON_LEFT)
+ PUSH_EVENT("LmbPressed", 0);
+ else if (event.button.button == SDL_BUTTON_RIGHT)
+ PUSH_EVENT("RmbPressed", 0);
+ }
break;
}
case SDL_MOUSEBUTTONUP: {
- if (event.button.button == SDL_BUTTON_LEFT && !ImGui::GetIO().WantCaptureMouse)
- PUSH_EVENT("LmbReleased", 0);
-
+ if (!ImGui::GetIO().WantCaptureMouse) {
+ if (event.button.button == SDL_BUTTON_LEFT)
+ PUSH_EVENT("LmbReleased", 0);
+ else if (event.button.button == SDL_BUTTON_RIGHT)
+ PUSH_EVENT("RmbReleased", 0);
+ }
break;
}