diff options
author | jacopograndi <jak.sk8@hotmail.it> | 2021-09-05 22:36:13 +0200 |
---|---|---|
committer | jacopograndi <jak.sk8@hotmail.it> | 2021-09-05 22:36:13 +0200 |
commit | 728abda9dc6fc8e65c7c0e0240a2e7d61a43a583 (patch) | |
tree | 545187ed3d634792af1082ce021665d3ef4934fc /game/view.cpp | |
parent | c298eb988874bc2cf3adb39c2532419ec76a24bc (diff) |
tech tostring, all sprites, heal and convert
Diffstat (limited to 'game/view.cpp')
-rw-r--r-- | game/view.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/game/view.cpp b/game/view.cpp index 7fddcd5..78a9932 100644 --- a/game/view.cpp +++ b/game/view.cpp @@ -85,6 +85,34 @@ void View::process (Gst &gst, vec2 cam, vec2 mouse, int *mheld) { } found = true; } + + if (heals.size() > 0 && !found) { + for (int i=0; i<heals.size() && !found; i++) { + int x = heals[i] % gr.sizex; + int y = heals[i] / gr.sizex; + vec2 pos { (float)x*32, (float)y*32 }; + if (pos.x < absmouse.x && absmouse.x <= pos.x+32 + && pos.y < absmouse.y && absmouse.y <= pos.y+32) + { + cursor_ground = heals[i]; + } + } + found = true; + } + + if (converts.size() > 0 && !found) { + for (int i=0; i<converts.size() && !found; i++) { + int x = converts[i] % gr.sizex; + int y = converts[i] / gr.sizex; + vec2 pos { (float)x*32, (float)y*32 }; + if (pos.x < absmouse.x && absmouse.x <= pos.x+32 + && pos.y < absmouse.y && absmouse.y <= pos.y+32) + { + cursor_ground = converts[i]; + } + } + found = true; + } if (menu_train.active && !found) { int selected = menu_train.mouse_option(mouse); |