diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 73c813dd..c0885ead 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -929,13 +929,20 @@ void Graphics::drawgui(void) size_t j; for (j = 0; j < textboxes[i].lines.size(); j++) { - font::print( - print_flags | PR_BOR, - text_xp, - yp + text_yoff + text_sign * (j * (font_height + textboxes[i].linegap)), - textbox_line(buffer, sizeof(buffer), i, j), - 0, 0, 0 - ); + const int x = text_xp; + const int y = yp + text_yoff + text_sign * (j * (font_height + textboxes[i].linegap)); + if (!textboxes[i].force_outline) + { + font::print(print_flags | PR_BOR, x, y, textbox_line(buffer, sizeof(buffer), i, j), 0, 0, 0); + } + else if (textboxes[i].outline) + { + // We're forcing an outline, so we'll have to draw it ourselves instead of relying on PR_BOR. + font::print(print_flags, x - 1, y, textbox_line(buffer, sizeof(buffer), i, j), 0, 0, 0); + font::print(print_flags, x + 1, y, textbox_line(buffer, sizeof(buffer), i, j), 0, 0, 0); + font::print(print_flags, x, y - 1, textbox_line(buffer, sizeof(buffer), i, j), 0, 0, 0); + font::print(print_flags, x, y + 1, textbox_line(buffer, sizeof(buffer), i, j), 0, 0, 0); + } } for (j = 0; j < textboxes[i].lines.size(); j++) { @@ -1483,6 +1490,18 @@ void Graphics::setimage(TextboxImage image) textboxes[m].setimage(image); } +void Graphics::textboxoutline(bool enabled) +{ + if (!INBOUNDS_VEC(m, textboxes)) + { + vlog_error("textboxoutline() out-of-bounds!"); + return; + } + + textboxes[m].force_outline = true; + textboxes[m].outline = enabled; +} + void Graphics::addline( const std::string& t ) { if (!INBOUNDS_VEC(m, textboxes)) diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index 4f805c56..ae93e42d 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -137,6 +137,8 @@ public: void setimage(TextboxImage image); + void textboxoutline(bool enabled); + void textboxindex(int index); void textboxremove(void); diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index f3e95342..81c9717d 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -568,6 +568,8 @@ void scriptclass::run(void) textbox_sprites.clear(); textbox_image = TEXTIMAGE_NONE; textbox_forcepos = false; + textbox_force_outline = false; + textbox_outline = false; } else if (words[0] == "position") { @@ -746,6 +748,23 @@ void scriptclass::run(void) textbox_image = TEXTIMAGE_NONE; } } + else if (words[0] == "textoutline") + { + if (words[1] == "default") + { + textbox_force_outline = false; + } + else if (words[1] == "on") + { + textbox_force_outline = true; + textbox_outline = true; + } + else if (words[1] == "off") + { + textbox_force_outline = true; + textbox_outline = false; + } + } else if (words[0] == "flipme") { textflipme = !textflipme; @@ -803,6 +822,11 @@ void scriptclass::run(void) } } + if (textbox_force_outline) + { + graphics.textboxoutline(textbox_outline); + } + TextboxOriginalContext context = TextboxOriginalContext(); context.text_case = textcase; context.lines = std::vector(txt); diff --git a/desktop_version/src/Script.h b/desktop_version/src/Script.h index 304f1276..2f9ee29e 100644 --- a/desktop_version/src/Script.h +++ b/desktop_version/src/Script.h @@ -123,6 +123,8 @@ public: std::vector textbox_sprites; TextboxImage textbox_image; bool textbox_forcepos; + bool textbox_force_outline; + bool textbox_outline; //Misc int i, j, k; diff --git a/desktop_version/src/Textbox.cpp b/desktop_version/src/Textbox.cpp index 5a57a88b..0a164b03 100644 --- a/desktop_version/src/Textbox.cpp +++ b/desktop_version/src/Textbox.cpp @@ -43,6 +43,9 @@ textboxclass::textboxclass(int gap) image = TEXTIMAGE_NONE; + force_outline = false; + outline = false; + crewmate_position = TextboxCrewmatePosition(); original = TextboxOriginalContext(); original.text_case = 1; diff --git a/desktop_version/src/Textbox.h b/desktop_version/src/Textbox.h index edd7a5de..ad3e1546 100644 --- a/desktop_version/src/Textbox.h +++ b/desktop_version/src/Textbox.h @@ -137,6 +137,9 @@ public: std::vector sprites; TextboxImage image; + bool force_outline; + bool outline; + TextboxCrewmatePosition crewmate_position; TextboxOriginalContext original; TextboxSpacing spacing;