From ce37a9b4f4fa5ddddea4c07c07a72d033fed5809 Mon Sep 17 00:00:00 2001 From: Erich Newey Date: Fri, 7 Jul 2023 17:07:25 -0600 Subject: [PATCH] crack at fixing line breaks in show string pic --- src/game_strings.h | 2 +- src/game_windows.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/game_strings.h b/src/game_strings.h index 6e6d7faeb2c..98636a0d310 100644 --- a/src/game_strings.h +++ b/src/game_strings.h @@ -64,13 +64,13 @@ class Game_Strings { const Strings_t& RangeOp(Str_Params params, int string_id_1, Str_t string, int op, int args[] = nullptr); Str_t PrependMin(Str_t string, int min_size, char c); + Str_t Extract(Str_t string, bool as_hex); private: Str_t Set(Str_Params params, Str_t string); bool ResizeWithId(int id); bool ShouldWarn(int id) const; void WarnGet(int id) const; - Str_t Extract(Str_t string, bool as_hex); private: Strings_t _strings; diff --git a/src/game_windows.cpp b/src/game_windows.cpp index 9acf80b5340..b30cc8931e8 100644 --- a/src/game_windows.cpp +++ b/src/game_windows.cpp @@ -17,6 +17,7 @@ #include "game_windows.h" #include "game_message.h" +#include "game_strings.h" #include "main_data.h" #include "compiler.h" #include "text.h" @@ -203,7 +204,8 @@ void Game_Windows::Window_User::Refresh(bool& async_wait) { fonts.emplace_back(font); - std::stringstream ss(ToString(text.text)); + std::string extracted_text = ToString(Main_Data::game_strings->Extract(text.text, false)); + std::stringstream ss(extracted_text); std::string out; PendingMessage pm; while (Utils::ReadLine(ss, out)) {