diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index b6f4272c..8fb4fa02 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -3191,7 +3191,7 @@ void Graphics::textboxcenterx(void) return; } - textboxes[m].centerx(); + textboxes[m].should_centerx = true; } int Graphics::textboxwidth(void) @@ -3224,7 +3224,7 @@ void Graphics::textboxcentery(void) return; } - textboxes[m].centery(); + textboxes[m].should_centery = true; } int Graphics::textboxwrap(int pad) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 690a2a54..1128a244 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -569,6 +569,8 @@ void scriptclass::run(void) textcrewmateposition.text_above = true; } + textx = 0; + texty = 0; textcrewmateposition.x = obj.entities[i].xp; textcrewmateposition.override_x = true; textcrewmateposition.y = obj.entities[i].yp; @@ -653,6 +655,8 @@ void scriptclass::run(void) textcrewmateposition.text_above = true; } + textx = 0; + texty = 0; textcrewmateposition.x = obj.entities[i].xp; textcrewmateposition.override_x = true; textcrewmateposition.y = obj.entities[i].xp; diff --git a/desktop_version/src/Textbox.cpp b/desktop_version/src/Textbox.cpp index 700a6019..c329dbe2 100644 --- a/desktop_version/src/Textbox.cpp +++ b/desktop_version/src/Textbox.cpp @@ -28,6 +28,9 @@ textboxclass::textboxclass(int gap) large = false; + should_centerx = false; + should_centery = false; + print_flags = PR_FONT_LEVEL; fill_buttons = false; @@ -72,6 +75,14 @@ void textboxclass::adjust(void) { resize(); repositionfromcrewmate(); + if (should_centerx) + { + centerx(); + } + if (should_centery) + { + centery(); + } if (xp < 10) xp = 10; if (yp < 10) yp = 10; if (xp + w > 310) xp = 310 - w; diff --git a/desktop_version/src/Textbox.h b/desktop_version/src/Textbox.h index 4a6ef58f..45d76860 100644 --- a/desktop_version/src/Textbox.h +++ b/desktop_version/src/Textbox.h @@ -94,6 +94,9 @@ public: bool large; + bool should_centerx; + bool should_centery; + uint32_t print_flags; bool fill_buttons;