diff options
Diffstat (limited to 'src/engine/actors/Text.cpp')
| -rw-r--r-- | src/engine/actors/Text.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/engine/actors/Text.cpp b/src/engine/actors/Text.cpp index 2d2fab0b0..06a74c54d 100644 --- a/src/engine/actors/Text.cpp +++ b/src/engine/actors/Text.cpp @@ -77,7 +77,11 @@ AText::AText(const SpawnParams& params) : AActor(params) { * But these need to be checked thoroughly before white-listing. */ std::string AText::ValidateString(const std::string_view& s) { - if (s.empty()) { return "Blank Text"; } + if (CVarGetInteger("gIsEditorEnabled", false) == true) { + if (s.empty()) { return "Blank Text"; } + } else { + if (s.empty()) { return ""; } + } Text.clear(); @@ -100,6 +104,11 @@ std::string AText::ValidateString(const std::string_view& s) { return Text; } +void AText::SetText(std::string text) { + AText::ValidateString(text); + Refresh(); +} + /* * Most changes during runtime require a refresh because the text is generated statically * with the intention of this code being somewhat performant @@ -353,7 +362,9 @@ void AText::DrawText3D(Camera* camera) { // Based on func_80095BD0 FrameInterpolation_RecordOpenChild("actor_text", TAG_LETTER(this)); gSPDisplayList(gDisplayListHead++, (Gfx*)D_020077A8); - switch (1) { + + for (CharacterList& tex : TextureList) { + switch (tex.mode) { case 1: gSPDisplayList(gDisplayListHead++, (Gfx*)D_020077F8); break; @@ -361,8 +372,6 @@ void AText::DrawText3D(Camera* camera) { // Based on func_80095BD0 gSPDisplayList(gDisplayListHead++, (Gfx*)D_02007818); break; } - - for (CharacterList& tex : TextureList) { //printf("tex texture %p width %d height %d mode %d col %f\n", tex.Texture, tex.width, tex.height, tex.mode, tex.column); gDPLoadTextureTile_4b(gDisplayListHead++, (Gfx*)tex.Texture, G_IM_FMT_I, tex.width, 0, 0, 0, tex.width, tex.height + 2, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, @@ -585,4 +594,4 @@ void AText::DrawColourEditor(bool* updated) { } } } -}
\ No newline at end of file +} |
