diff --git a/assets/games/liminal/fonts/Ysabeau-Medium.ttf b/assets/games/liminal/fonts/Ysabeau-Medium.ttf
new file mode 100644
index 00000000..8ece58eb
Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-Medium.ttf differ
diff --git a/assets/games/liminal/prefabs/VNTextbox.xml b/assets/games/liminal/prefabs/VNTextbox.xml
index 73b3102f..e6953f56 100644
--- a/assets/games/liminal/prefabs/VNTextbox.xml
+++ b/assets/games/liminal/prefabs/VNTextbox.xml
@@ -17,10 +17,10 @@
diff --git a/assets/games/liminal/scenes/Scene1Prologue.xml b/assets/games/liminal/scenes/Scene1Prologue.xml
deleted file mode 100644
index c6862dfe..00000000
--- a/assets/games/liminal/scenes/Scene1Prologue.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/assets/games/liminal/scenes/Scene1Prologue0.xml b/assets/games/liminal/scenes/Scene1Prologue0.xml
new file mode 100644
index 00000000..7923922e
--- /dev/null
+++ b/assets/games/liminal/scenes/Scene1Prologue0.xml
@@ -0,0 +1,35 @@
+
+
+
+ There is a bucket.
+
+
+
+ It sways above your head like the mouth of a god. You are on Angelwood's best stage, and they are cheering for you, calling you their Queen, their Prom Queen.
+
+
+
+ And you are dead soon.
+
+
+
+ It's Prom Day. The metal bucket is swaying. Over you. Drenching your white pristine dress in guts and gore red. They aren't cheering anymore. They're gasping. But not screaming: oh, no, not in respectable Angelwood.
+
+
+
+ God. You didn't think a pig's intestines could feel so cold.
+
+
+
+ You are dead when the bucket falls — crushes your skull — caves you open — drenches you and drenches you, drowns you, fells you and kills, kills, kills you.
+
+
+
+ And the last thing you see ---
+
+
+
+ Is their eyes.
+
+
+
\ No newline at end of file
diff --git a/assets/games/liminal/scenes/SceneBase.xml b/assets/games/liminal/scenes/SceneBase.xml
index 583e4c19..490e63a7 100644
--- a/assets/games/liminal/scenes/SceneBase.xml
+++ b/assets/games/liminal/scenes/SceneBase.xml
@@ -26,6 +26,10 @@
+ -
+
+
+
useEvent([&]{
assertNotNull(camTexture);
diff --git a/src/dawn/games/vn/components/VNTextboxScroller.cpp b/src/dawn/games/vn/components/VNTextboxScroller.cpp
index f7f85084..48184cae 100644
--- a/src/dawn/games/vn/components/VNTextboxScroller.cpp
+++ b/src/dawn/games/vn/components/VNTextboxScroller.cpp
@@ -22,17 +22,21 @@ void VNTextboxScroller::onStart() {
this->timeCharacter = 0;
this->label->startQuad = 0;
this->label->quadCount = 0;
+ this->readyToClose = false;
};
x();
+ useEvent(x, this->label->eventTextChanged);
+
useEvent([&](float_t delta){
auto game = this->getGame();
this->timeCharacter += delta;
if(this->hasRevealedAllCurrentCharacters()) {
if(this->hasRevealedAllCharacters()) {
- if(game->inputManager.isPressed(INPUT_BIND_ACCEPT)) {
- std::cout << "HIDE" << std::endl;
+ if(!this->readyToClose) {
+ this->readyToClose = true;
+ this->eventReadyToClose.invoke();
}
} else {
if(game->inputManager.isPressed(INPUT_BIND_ACCEPT)) {
@@ -43,21 +47,6 @@ void VNTextboxScroller::onStart() {
}
this->label->quadCount = 0;
this->timeCharacter = 0.0f;
-
- // this->label.setTransform(
- // UI_COMPONENT_ALIGN_STRETCH,
- // UI_COMPONENT_ALIGN_STRETCH,
- // glm::vec4(
- // glm::vec2(
- // this->border.getBorderSize().x + this->labelPadding.x,
- // this->border.getBorderSize().y + this->labelPadding.y -
- // this->label.measure.getHeightOfLineCount(this->lineCurrent)
- // ),
- // this->border.getBorderSize() + this->labelPadding
- // ),
- // 5.0f
- // );
- // this->eventNewPage.invoke();
}
}
@@ -71,8 +60,10 @@ void VNTextboxScroller::onStart() {
this->timeCharacter += game->timeManager.delta * VN_TEXTBOX_SPEED;
}
+ auto newCount = mathFloor(this->timeCharacter);
+ if(newCount == this->label->quadCount) return;
this->label->quadCount = mathFloor(this->timeCharacter);
- // this->eventCharacterRevealed.invoke();
+ this->eventCharacterRevealed.invoke();
}, getScene()->eventSceneUpdate);
}
diff --git a/src/dawn/games/vn/components/VNTextboxScroller.hpp b/src/dawn/games/vn/components/VNTextboxScroller.hpp
index 40a679b4..636157ee 100644
--- a/src/dawn/games/vn/components/VNTextboxScroller.hpp
+++ b/src/dawn/games/vn/components/VNTextboxScroller.hpp
@@ -13,17 +13,19 @@
namespace Dawn {
class VNTextboxScroller : public SceneItemComponent {
- protected:
-
public:
// @optional
StateProperty label;
+ StateEvent<> eventReadyToClose;
+ StateEvent<> eventCharacterRevealed;
+
+ bool_t readyToClose = false;
+
size_t lineCurrent = 0;
float_t timeCharacter = 0.0f;
VNTextboxScroller(SceneItem *item);
-
virtual void onStart() override;
/**
diff --git a/src/dawn/games/vn/events/VNTextEvent.hpp b/src/dawn/games/vn/events/VNTextEvent.hpp
index d5890c1d..ab7a367c 100644
--- a/src/dawn/games/vn/events/VNTextEvent.hpp
+++ b/src/dawn/games/vn/events/VNTextEvent.hpp
@@ -5,6 +5,8 @@
#pragma once
#include "VNEvent.hpp"
+#include "scene/Scene.hpp"
+#include "games/vn/components/VNTextboxScroller.hpp"
namespace Dawn {
class VNTextEvent : public VNEvent {
@@ -12,8 +14,19 @@ namespace Dawn {
std::string text;
protected:
+ VNTextboxScroller *scroller = nullptr;
+
void onStart() override {
- std::cout << "TEXT: " << text << std::endl;
+ scroller = this->getScene()->findComponent();
+ assertNotNull(scroller);
+
+ scroller->label->text = text;
+
+ useEvent([&](inputbind_t bind){
+ if(bind != INPUT_BIND_ACCEPT) return;
+ if(!scroller->readyToClose) return;
+ this->next();
+ }, this->getScene()->game->inputManager.eventBindPressed);
}
};
}
\ No newline at end of file
diff --git a/src/dawn/scene/SceneItem.hpp b/src/dawn/scene/SceneItem.hpp
index 37489e97..8b544765 100644
--- a/src/dawn/scene/SceneItem.hpp
+++ b/src/dawn/scene/SceneItem.hpp
@@ -12,7 +12,7 @@
namespace Dawn {
class SceneItemComponent;
- class SceneItem {
+ class SceneItem : public StateOwner {
private:
std::vector components;
diff --git a/src/dawn/scene/components/ui/UILabel.cpp b/src/dawn/scene/components/ui/UILabel.cpp
index 7e8dc69b..a1dcd378 100644
--- a/src/dawn/scene/components/ui/UILabel.cpp
+++ b/src/dawn/scene/components/ui/UILabel.cpp
@@ -111,6 +111,10 @@ void UILabel::onStart() {
alignmentNeedsUpdating = true;
}, { &fontSize, &font, &text, &maxWidth, &startQuad, &quadCount });
+ useEffect([&]{
+ eventTextChanged.invoke();
+ }, text);
+
useEffect([&]{
needsRebuffering = true;
}, alignmentNeedsUpdating);
diff --git a/src/dawn/scene/components/ui/UILabel.hpp b/src/dawn/scene/components/ui/UILabel.hpp
index c06b025c..7037fa03 100644
--- a/src/dawn/scene/components/ui/UILabel.hpp
+++ b/src/dawn/scene/components/ui/UILabel.hpp
@@ -45,6 +45,7 @@ namespace Dawn {
StateProperty quadCount;
StateEvent<> eventFontRebuffered;
+ StateEvent<> eventTextChanged;
struct FontMeasure measure;
diff --git a/src/dawnliminal/CMakeLists.txt b/src/dawnliminal/CMakeLists.txt
index 6da8524a..c0224a20 100644
--- a/src/dawnliminal/CMakeLists.txt
+++ b/src/dawnliminal/CMakeLists.txt
@@ -19,12 +19,12 @@ add_subdirectory(save)
# Assets
set(LIMINAL_ASSETS_DIR ${DAWN_ASSETS_DIR}/games/liminal)
-tool_truetype(font_main ${DAWN_ASSETS_DIR}/ark-pixel.ttf)
+tool_truetype(font_main ${LIMINAL_ASSETS_DIR}/fonts/Ysabeau-Medium.ttf)
tool_texture(texture_eth ${LIMINAL_ASSETS_DIR}/textures/eth.png)
tool_texture(texture_border ${LIMINAL_ASSETS_DIR}/textures/texture_test.png)
tool_scene(${LIMINAL_ASSETS_DIR}/scenes/SceneBase.xml)
-tool_vnscene(${LIMINAL_ASSETS_DIR}/scenes/Scene1Prologue.xml)
+tool_vnscene(${LIMINAL_ASSETS_DIR}/scenes/Scene1Prologue0.xml)
tool_prefab(${LIMINAL_ASSETS_DIR}/prefabs/EthPrefab.xml)
tool_prefab(${LIMINAL_ASSETS_DIR}/prefabs/VNTextbox.xml)
\ No newline at end of file
diff --git a/src/dawnopengl/display/Texture.cpp b/src/dawnopengl/display/Texture.cpp
index dc8f5e92..60809e86 100644
--- a/src/dawnopengl/display/Texture.cpp
+++ b/src/dawnopengl/display/Texture.cpp
@@ -36,10 +36,10 @@ void Texture::setSize(int32_t width, int32_t height) {
// Setup our preferred texture params, later this will be configurable.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Initialize the texture to blank
glTexImage2D(
diff --git a/src/dawnshared/util/Xml.cpp b/src/dawnshared/util/Xml.cpp
index 5626bf58..5a4bf1cb 100644
--- a/src/dawnshared/util/Xml.cpp
+++ b/src/dawnshared/util/Xml.cpp
@@ -134,7 +134,7 @@ void Xml::load(Xml *xml, std::string data, size_t *j) {
case XML_PARSE_STATE_PARSING_VALUE:
// Keep parsing child until we find a < for an opening/closing tag.
- if(c == '<') {
+ if(c == '<' && !(data[i] == '<' || data[i-2] == '<')) {
// In HTML Spec there could be a child here but not in XML spec.
doing = XML_PARSE_STATE_PARSING_CLOSE;
xml->value = buffer;
diff --git a/src/dawntools/vnscenetool/VNSceneGen.cpp b/src/dawntools/vnscenetool/VNSceneGen.cpp
index f05629c6..372f395f 100644
--- a/src/dawntools/vnscenetool/VNSceneGen.cpp
+++ b/src/dawntools/vnscenetool/VNSceneGen.cpp
@@ -168,10 +168,8 @@ void VNSceneGen::generate(
// Events
- classInfo.includes.push_back("games/vn/components/VNManager.hpp");
classInfo.includes.push_back("games/vn/events/VNDummyEvent.hpp");
- line(&methodInit.body, "auto vnItem = this->createSceneItem();", "");
- line(&methodInit.body, "auto vnManager = vnItem->addComponent();", "");
+ line(&methodInit.body, "assertNotNull(vnManager);", "");
line(&methodInit.body, "VNEvent *previous = vnManager->createEvent();", "");
line(&methodInit.body, "auto eventStart = previous;", "");
diff --git a/src/dawntools/vnscenetool/events/VNSceneEventsParser.cpp b/src/dawntools/vnscenetool/events/VNSceneEventsParser.cpp
index 0f7ef58a..383144dc 100644
--- a/src/dawntools/vnscenetool/events/VNSceneEventsParser.cpp
+++ b/src/dawntools/vnscenetool/events/VNSceneEventsParser.cpp
@@ -29,8 +29,6 @@ int32_t VNSceneEventsParser::onParse(
Xml *child = *itChildren;
struct VNSceneEvent event;
- std::cout << "CHILD: " << child->node << std::endl;
-
// Parse event(s)
if(child->node == "text") {
event.type = VN_SCENE_EVENT_TYPE_TEXT;