Skip to content

Commit

Permalink
StringVar: crack at fixing line breaks in show string pic
Browse files Browse the repository at this point in the history
  • Loading branch information
enewey committed Jul 7, 2023
1 parent c2d91ae commit 49f8ea3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/game_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/game_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 49f8ea3

Please sign in to comment.