From 55d001b4f63258b2cccd928b11c85406374f613f Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 22 Jun 2020 15:30:10 -0700 Subject: [PATCH] Move mapinput() ACTION press handling to separate function It's a bit too much to consolidate all the ACTION press handling into one function, especially given the increasing amount of indentation levels. --- desktop_version/src/Input.cpp | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index 770b671c..433a69a7 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -1859,6 +1859,8 @@ void gameinput() } } +void mapmenuactionpress(); + void mapinput() { //TODO Mouse Input! @@ -1973,6 +1975,24 @@ void mapinput() game.menupage++; } + mapmenuactionpress(); + + if (game.menupage < 0) game.menupage = 3; + if (game.menupage > 3 && game.menupage < 9) game.menupage = 0; + + if (game.menupage == 9) game.menupage = 11; + if (game.menupage == 12) game.menupage = 10; + + if (game.menupage == 19) game.menupage = 21; + if (game.menupage == 22) game.menupage = 20; + + if (game.menupage == 29) game.menupage = 33; + if (game.menupage == 34) game.menupage = 30; + } +} + +void mapmenuactionpress() +{ if (game.menupage == 1 && obj.flags[67] && game.press_action && !game.insecretlab && !map.custommode) { //Warp back to the ship @@ -2056,19 +2076,6 @@ void mapinput() game.fadetolab = true; game.fadetolabdelay = 16; } - - if (game.menupage < 0) game.menupage = 3; - if (game.menupage > 3 && game.menupage < 9) game.menupage = 0; - - if (game.menupage == 9) game.menupage = 11; - if (game.menupage == 12) game.menupage = 10; - - if (game.menupage == 19) game.menupage = 21; - if (game.menupage == 22) game.menupage = 20; - - if (game.menupage == 29) game.menupage = 33; - if (game.menupage == 34) game.menupage = 30; - } } void teleporterinput()