From 8af1284654a4a5d454a559eca371bf0ac3c79786 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Tue, 31 Aug 2021 23:53:53 +0200 Subject: tech done, building sprites, upgrade on age up, gui --- game/view.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'game/view.cpp') diff --git a/game/view.cpp b/game/view.cpp index 095a99a..7fddcd5 100644 --- a/game/view.cpp +++ b/game/view.cpp @@ -41,6 +41,12 @@ void View::process (Gst &gst, vec2 cam, vec2 mouse, int *mheld) { if (menu_tech.active) { menu_tech.over = menu_tech.mouse_option(mouse); } + if (menu_trade.active) { + menu_trade.over = menu_trade.mouse_option(mouse); + } + if (menu_age_up.active) { + menu_age_up.over = menu_age_up.mouse_option(mouse); + } if (mheld[0] == 1) { bool found = false; @@ -124,6 +130,24 @@ void View::process (Gst &gst, vec2 cam, vec2 mouse, int *mheld) { back = 1; found = 1; } } + + if (menu_trade.active && !found) { + int selected = menu_trade.mouse_option(mouse); + if (selected != -1) { + opt = selected; found = true; + } else { + back = 1; found = 1; + } + } + + if (menu_age_up.active && !found) { + int selected = menu_age_up.mouse_option(mouse); + if (selected != -1) { + opt = selected; found = true; + } else { + back = 1; found = 1; + } + } for (int i=0; i