From acca4747f73f066e002a74db5dd2edaacc8ea8d2 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 17 Feb 2023 20:38:05 -0800 Subject: [PATCH] Remove x-position from `setactivityposition` After discussing with Ally and Dav, we came to the agreement that this is basically useless since the prompt will always be centered and take up most of the horizontal space of the screen. And the x-position was only added as an offset because at some point, there was a missing space from the side of the "- Press ENTER to Teleport -" prompt, and the offset was there so people could mimic the prompt accordingly. But that was fixed at some point, so it's useless now. --- desktop_version/src/BlockV.cpp | 1 - desktop_version/src/BlockV.h | 2 +- desktop_version/src/Entity.cpp | 6 +----- desktop_version/src/Entity.h | 1 - desktop_version/src/Game.cpp | 1 - desktop_version/src/Game.h | 2 +- desktop_version/src/Logic.cpp | 1 - desktop_version/src/Render.cpp | 12 +++++------- desktop_version/src/Script.cpp | 2 -- 9 files changed, 8 insertions(+), 20 deletions(-) diff --git a/desktop_version/src/BlockV.cpp b/desktop_version/src/BlockV.cpp index bd82390a..0275600f 100644 --- a/desktop_version/src/BlockV.cpp +++ b/desktop_version/src/BlockV.cpp @@ -28,7 +28,6 @@ void blockclass::clear(void) g = 0; b = 0; - activity_x = 0; activity_y = 0; /* std::strings get initialized automatically, but this is diff --git a/desktop_version/src/BlockV.h b/desktop_version/src/BlockV.h index 58ecb419..ef7fc684 100644 --- a/desktop_version/src/BlockV.h +++ b/desktop_version/src/BlockV.h @@ -22,7 +22,7 @@ public: int xp, yp, wp, hp; std::string script, prompt; int r, g, b; - int activity_x, activity_y; + int activity_y; uint32_t print_flags; }; diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index acd84ccc..a50d9722 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -84,7 +84,6 @@ void entityclass::init(void) customenemy = 0; customwarpmode = false; customwarpmodevon = false; customwarpmodehon = false; customactivitycolour = ""; - customactivitypositionx = -1; customactivitypositiony = -1; customactivitytext = ""; trophytext = 0; @@ -1102,16 +1101,13 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= customactivitycolour = ""; } - if (customactivitypositionx != -1) + if (customactivitypositiony != -1) { - block.activity_x = customactivitypositionx; block.activity_y = customactivitypositiony; - customactivitypositionx = -1; customactivitypositiony = -1; } else { - block.activity_x = 0; block.activity_y = 0; } diff --git a/desktop_version/src/Entity.h b/desktop_version/src/Entity.h index 0c7ffe2a..796918b3 100644 --- a/desktop_version/src/Entity.h +++ b/desktop_version/src/Entity.h @@ -199,7 +199,6 @@ public: bool customcrewmoods[Game::numcrew]; std::string customactivitycolour; std::string customactivitytext; - int customactivitypositionx; int customactivitypositiony; }; diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index dda14b3e..847044da 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -225,7 +225,6 @@ void Game::init(void) activity_r = 0; activity_g = 0; activity_b = 0; - activity_x = 0; activity_y = 0; creditposition = 0; oldcreditposition = 0; diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index b15fd298..6dc2517f 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -430,7 +430,7 @@ public: bool activetele; int readytotele; int oldreadytotele; - int activity_r, activity_g, activity_b, activity_x, activity_y; + int activity_r, activity_g, activity_b, activity_y; std::string activity_lastprompt; uint32_t activity_print_flags; diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index 5cf608b9..4286c0d2 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -1431,7 +1431,6 @@ void gamelogic(void) game.activity_r = obj.blocks[game.activeactivity].r; game.activity_g = obj.blocks[game.activeactivity].g; game.activity_b = obj.blocks[game.activeactivity].b; - game.activity_x = obj.blocks[game.activeactivity].activity_x; game.activity_y = obj.blocks[game.activeactivity].activity_y; } diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 010cdacc..02cb9ea2 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -2222,13 +2222,11 @@ void gamerender(void) game.activity_lastprompt.c_str() ); - int centered_x = ((160 ) - ((font::len(game.activity_print_flags, final_string)) / 2)); - if (game.activity_r == 0 && game.activity_g == 0 && game.activity_b == 0) { font::print( - game.activity_print_flags | PR_BRIGHTNESS(act_alpha*255), - centered_x + game.activity_x, + game.activity_print_flags | PR_BRIGHTNESS(act_alpha*255) | PR_CEN, + -1, game.activity_y + 12, final_string, 196, @@ -2239,7 +2237,7 @@ void gamerender(void) else { graphics.drawpixeltextbox( - game.activity_x + 4, + 4, game.activity_y + 4, 39*8, 16 + font::height(game.activity_print_flags), @@ -2248,8 +2246,8 @@ void gamerender(void) game.activity_b*act_alpha ); font::print( - game.activity_print_flags | PR_BRIGHTNESS(act_alpha*255) | PR_CJK_LOW, - centered_x + game.activity_x, + game.activity_print_flags | PR_BRIGHTNESS(act_alpha*255) | PR_CJK_LOW | PR_CEN, + -1, game.activity_y + 12, final_string, game.activity_r, diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 1235c092..9e710b43 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -1709,7 +1709,6 @@ void scriptclass::run(void) } else if (words[0] == "setactivityposition") { - obj.customactivitypositionx = ss_toi(words[1]); obj.customactivitypositiony = ss_toi(words[2]); } else if (words[0] == "createrescuedcrew") @@ -3280,7 +3279,6 @@ void scriptclass::hardreset(void) obj.customactivitycolour = ""; obj.customactivitytext = ""; - obj.customactivitypositionx = -1; obj.customactivitypositiony = -1; }