From 83f5d99c6537dfe9a2beac35a55108a2b63b94b2 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Sat, 8 Jul 2023 19:10:59 -0700 Subject: [PATCH] Prog. --- assets/games/liminal/prefabs/VNTextbox.xml | 3 +-- assets/games/liminal/scenes/prologue/ScenePrologue0.xml | 4 ++-- src/dawn/games/vn/components/VNTextboxScroller.cpp | 2 +- src/dawn/scene/components/ui/text/UILabel.cpp | 6 ++++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/assets/games/liminal/prefabs/VNTextbox.xml b/assets/games/liminal/prefabs/VNTextbox.xml index 325dac8f..0f016ff8 100644 --- a/assets/games/liminal/prefabs/VNTextbox.xml +++ b/assets/games/liminal/prefabs/VNTextbox.xml @@ -20,8 +20,7 @@ alignX="UI_COMPONENT_ALIGN_MIDDLE" alignY="UI_COMPONENT_ALIGN_MIDDLE" ref="uiLabel" - > - + /> diff --git a/assets/games/liminal/scenes/prologue/ScenePrologue0.xml b/assets/games/liminal/scenes/prologue/ScenePrologue0.xml index feb156c4..6d2a1737 100644 --- a/assets/games/liminal/scenes/prologue/ScenePrologue0.xml +++ b/assets/games/liminal/scenes/prologue/ScenePrologue0.xml @@ -144,8 +144,6 @@ I exhale. The town is stirring awake. - - I get dressed. @@ -160,6 +158,8 @@ A pink tulle, a kind of prettier dress. + + On the morning of May 29th, my mother is proud of me. She had been Angelwood's Queen in her eighteens. I am carrying her legacy on my shoulders, and today she finally believes I will be victorious. diff --git a/src/dawn/games/vn/components/VNTextboxScroller.cpp b/src/dawn/games/vn/components/VNTextboxScroller.cpp index 15f06673..dd9c6e29 100644 --- a/src/dawn/games/vn/components/VNTextboxScroller.cpp +++ b/src/dawn/games/vn/components/VNTextboxScroller.cpp @@ -29,7 +29,7 @@ void VNTextboxScroller::onStart() { x(); useEvent(x, this->label->eventTextChanged); - // useEffect(x, visibleLines); + useEffect(x, visibleLines); useEvent([&](float_t delta){ auto game = this->getGame(); diff --git a/src/dawn/scene/components/ui/text/UILabel.cpp b/src/dawn/scene/components/ui/text/UILabel.cpp index 015f0db1..4f896f01 100644 --- a/src/dawn/scene/components/ui/text/UILabel.cpp +++ b/src/dawn/scene/components/ui/text/UILabel.cpp @@ -108,6 +108,8 @@ void UILabel::rebufferQuads(const std::vector newTexts) { quadCountTotal = 0; std::vector realNewTexts; + float_t maxWidth = this->width; + // Reset lines.clear(); @@ -236,8 +238,8 @@ void UILabel::rebufferQuads(const std::vector newTexts) { if( ch != ' ' && lastSpaceCharacter != -1 && - this->width > charInfo.bitmapSize.x && - (position.x + charInfo.advanceX) > this->width + maxWidth > charInfo.bitmapSize.x && + (position.x + charInfo.advanceX) > maxWidth ) { // Basically this rewinds everything we've done to the last space char, // changes it to a newline, and then moves the position along.