diff --git a/desktop_version/src/BlockV.cpp b/desktop_version/src/BlockV.cpp index 43f240a1..b88c5fa6 100644 --- a/desktop_version/src/BlockV.cpp +++ b/desktop_version/src/BlockV.cpp @@ -2,6 +2,8 @@ #include +#include "Font.h" + blockclass::blockclass(void) { clear(); @@ -28,10 +30,12 @@ void blockclass::clear(void) activity_x = 0; activity_y = 0; - /* std::strings get initialized automatically, but this is */ - /* in case this function gets called again after construction */ + /* std::strings get initialized automatically, but this is + * in case this function gets called again after construction */ script.clear(); prompt.clear(); + + print_flags = PR_FONT_INTERFACE; } void blockclass::rectset(const int xi, const int yi, const int wi, const int hi) diff --git a/desktop_version/src/BlockV.h b/desktop_version/src/BlockV.h index 3c4c3151..58ecb419 100644 --- a/desktop_version/src/BlockV.h +++ b/desktop_version/src/BlockV.h @@ -2,6 +2,7 @@ #define BLOCKV_H #include +#include #include class blockclass @@ -22,6 +23,7 @@ public: std::string script, prompt; int r, g, b; int activity_x, activity_y; + uint32_t print_flags; }; #endif /* BLOCKV_H */ diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index 9928e2af..acd84ccc 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -4,6 +4,7 @@ #include #include "CustomLevels.h" +#include "Font.h" #include "Game.h" #include "GlitchrunnerMode.h" #include "Graphics.h" @@ -1087,8 +1088,13 @@ void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= if (customactivitytext != "") { block.prompt = customactivitytext; + block.print_flags = PR_FONT_LEVEL; customactivitytext = ""; } + else + { + block.print_flags = PR_FONT_INTERFACE; + } if (customactivitycolour != "") { diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index a93ed3e0..7a789441 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -429,6 +429,7 @@ public: int oldreadytotele; int activity_r, activity_g, activity_b, activity_x, activity_y; std::string activity_lastprompt; + uint32_t activity_print_flags; std::string telesummary, quicksummary, customquicksummary; bool save_exists(void); diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index e47656fa..7ea2dace 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -1334,18 +1334,6 @@ void Graphics::drawpixeltextbox( drawcoloredtile(x + w - 8, y + h - 8, 47, r, g, b); } -void Graphics::drawtextbox( - const int x, - const int y, - const int w, - const int h, - const int r, - const int g, - const int b -) { - return drawpixeltextbox(x, y, w*8, 16 + (h-2)*font::height(PR_FONT_LEVEL), r, g, b); -} - void Graphics::textboxactive(void) { //Remove all but the most recent textbox diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index 715d7e22..5b692b28 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -125,8 +125,6 @@ public: void textboxactive(void); - void drawtextbox(int x, int y, int w, int h, int r, int g, int b); - void drawpixeltextbox(int x, int y, int w, int h, int r, int g, int b); void drawcrewman(int x, int y, int t, bool act, bool noshift =false); diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index a2545729..5cf608b9 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -1427,6 +1427,7 @@ void gamelogic(void) && INBOUNDS_VEC(game.activeactivity, obj.blocks)) { game.activity_lastprompt = obj.blocks[game.activeactivity].prompt; + game.activity_print_flags = obj.blocks[game.activeactivity].print_flags; game.activity_r = obj.blocks[game.activeactivity].r; game.activity_g = obj.blocks[game.activeactivity].g; game.activity_b = obj.blocks[game.activeactivity].b; diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 72cc13d8..7269645c 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -2213,12 +2213,12 @@ void gamerender(void) game.activity_lastprompt.c_str() ); - int centered_x = ((160 ) - ((graphics.len(final_string)) / 2)); + 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( - PR_COLORGLYPH_BRI(act_alpha*255), + game.activity_print_flags | PR_COLORGLYPH_BRI(act_alpha*255), centered_x + game.activity_x, game.activity_y + 12, final_string, @@ -2229,17 +2229,17 @@ void gamerender(void) } else { - graphics.drawtextbox( + graphics.drawpixeltextbox( game.activity_x + 4, game.activity_y + 4, - 39, - 3, + 39*8, + 16 + font::height(game.activity_print_flags), game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha ); font::print( - PR_COLORGLYPH_BRI(act_alpha*255) | PR_CJK_LOW, + game.activity_print_flags | PR_COLORGLYPH_BRI(act_alpha*255) | PR_CJK_LOW, centered_x + game.activity_x, game.activity_y + 12, final_string, @@ -2431,7 +2431,7 @@ void maprender(void) graphics.fill_rect(0, 12, 320, 240, 10, 24, 26 ); //Menubar: - graphics.drawtextbox( -10, 212, 43, 3, 65, 185, 207); + graphics.drawpixeltextbox( -10, 212, 43*8, 16 + font::height(PR_FONT_INTERFACE), 65, 185, 207); // Draw the selected page name at the bottom // menupage 0 - 3 is the pause screen