diff --git a/assets/games/liminal/prefabs/EthPrefab.xml b/assets/games/liminal/prefabs/EthPrefab.xml
index 8a401037..4b3d0931 100644
--- a/assets/games/liminal/prefabs/EthPrefab.xml
+++ b/assets/games/liminal/prefabs/EthPrefab.xml
@@ -10,56 +10,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- StateProperty<int32_t> faceTile;
- StateProperty<int32_t> poseTile;
-
-
-
- faceTile = 0;
- poseTile = 0;
-
- useEffect([&]{
- faceMaterial->texture = &(
- faceTile == 0 ? faceDayHappy->texture :
- faceTile == 1 ? faceDayAnger->texture :
- faceTile == 2 ? faceDayConfused->texture :
- faceTile == 3 ? faceDayEyeroll->texture :
- faceTile == 4 ? faceDayFear->texture :
- faceTile == 5 ? faceDayHaughty->texture :
- faceTile == 6 ? faceDayNeutral->texture :
- faceTile == 7 ? faceDaySad->texture :
- faceTile == 8 ? faceDaySurprised->texture :
- faceDayHappy->texture
- );
- }, faceTile)();
-
- useEffect([&]{
- bodyMaterial->texture = &(
- poseTile == 0 ? poseDayBack->texture :
- poseTile == 1 ? poseDayCross->texture :
- poseTile == 2 ? poseDayFront->texture :
- poseTile == 3 ? poseDayHips->texture :
- poseTile == 4 ? poseDayNeutral->texture :
- poseDayBack->texture
- );
- }, poseTile)();
-
\ No newline at end of file
diff --git a/assets/games/liminal/scenes/CMakeLists.txt b/assets/games/liminal/scenes/CMakeLists.txt
index 2c80d7e9..3de9a0a6 100644
--- a/assets/games/liminal/scenes/CMakeLists.txt
+++ b/assets/games/liminal/scenes/CMakeLists.txt
@@ -4,4 +4,4 @@
# https://opensource.org/licenses/MIT
tool_scene(${CMAKE_CURRENT_LIST_DIR}/SceneBase.xml)
-tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/Scene1Prologue0.xml)
\ No newline at end of file
+# tool_vnscene(${CMAKE_CURRENT_LIST_DIR}/Scene1Prologue0.xml)
\ No newline at end of file
diff --git a/assets/games/liminal/scenes/Scene1Prologue0.xml b/assets/games/liminal/scenes/Scene1Prologue0.xml
index 15c156bc..08c36e4e 100644
--- a/assets/games/liminal/scenes/Scene1Prologue0.xml
+++ b/assets/games/liminal/scenes/Scene1Prologue0.xml
@@ -1,23 +1,25 @@
+
+
+
+
+
+
+
+
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.
diff --git a/src/dawn/games/vn/events/VNSetEvent.hpp b/src/dawn/games/vn/events/VNSetEvent.hpp
index 9f82c272..ea0d5a33 100644
--- a/src/dawn/games/vn/events/VNSetEvent.hpp
+++ b/src/dawn/games/vn/events/VNSetEvent.hpp
@@ -4,24 +4,20 @@
// https://opensource.org/licenses/MIT
#pragma once
-#include "VNAnimateEvent.hpp"
+#include "VNEvent.hpp"
namespace Dawn {
- template
- class VNSetEvent : public VNAnimateEvent {
+ template
+ class VNSetEvent : public VNEvent {
public:
- StateProperty *modifies = nullptr;
+ T *modifies = nullptr;
+ T value;
protected:
void onStart() override {
assertNotNull(this->modifies);
- this->from = modifies->getValue();
-
- VNAnimateEvent::onStart();
- }
-
- void setValue(T value) override {
- modifies->setValue(value);
+ *modifies = value;
+ this->next();
}
};
}
\ No newline at end of file
diff --git a/src/dawntools/util/generator/SceneGenerator.cpp b/src/dawntools/util/generator/SceneGenerator.cpp
index 88b516f3..2bbcf3d9 100644
--- a/src/dawntools/util/generator/SceneGenerator.cpp
+++ b/src/dawntools/util/generator/SceneGenerator.cpp
@@ -14,13 +14,15 @@ void SceneGenerator::generate(
struct MethodGenInfo &methodInit
) {
assertNotNull(scene);
+
+ std::map assetMap;
+ int32_t assetNumber = 0;
+ std::string baseClassName = "Scene";
classInfo.clazz = scene->name;
classInfo.constructorArgs = "DawnGame *game";
classInfo.extendArgs = "game";
- std::string baseClassName = "Scene";
-
// Determine extends
if(scene->extend.empty()) {
classInfo.includes.push_back("scene/Scene.hpp");
@@ -39,7 +41,7 @@ void SceneGenerator::generate(
methodAssets.name = "getRequiredAssets";
methodAssets.isOverride = true;
methodAssets.type = "std::vector";
- line(&methodAssets.body, "auto assMan = &this->game->assetManager;", "");
+ line(&methodAssets.body, "auto man = &this->game->assetManager;", "");
methodInit.name = "stage";
methodInit.isOverride = true;
@@ -51,11 +53,26 @@ void SceneGenerator::generate(
line(&methodInit.body, baseClassName + "::stage();", "");
}
+ // Scene assets
+ line(&methodInit.body, "auto man = &this->game->assetManager;", "");
+
+ auto itAssets = scene->assets.begin();
+ while(itAssets != scene->assets.end()) {
+ SceneAssetGenerator::generate(
+ assetMap,
+ assetNumber,
+ &classInfo.publicProperties,
+ &methodInit.body,
+ &methodAssets.body,
+ &(*itAssets),
+ ""
+ );
+ ++itAssets;
+ }
+
// Generate
- int32_t assetNumber = 0;
int32_t childNumber = 0;
int32_t componentNumber = 0;
- std::map assetMap;
std::vector componentsUnused;
auto itDeps = scene->dependencies.begin();
diff --git a/src/dawntools/util/generator/SceneItemGenerator.cpp b/src/dawntools/util/generator/SceneItemGenerator.cpp
index 54dce3fb..a8d6fddd 100644
--- a/src/dawntools/util/generator/SceneItemGenerator.cpp
+++ b/src/dawntools/util/generator/SceneItemGenerator.cpp
@@ -118,7 +118,7 @@ void SceneItemGenerator::generate(
// Create prefab
includes.push_back(item->prefab + ".hpp");
line(initBody, (item->ref.empty() ? "auto " : "") + name + " = " + prefabName + "::create(" + sceneRef + ");", "");
- line(assetBody, "vectorAppend(&assets, " + prefabName + "::getRequiredAssets(assMan));", "");
+ line(assetBody, "vectorAppend(&assets, " + prefabName + "::getRequiredAssets(man));", "");
} else {
// Not a prefab, init empty child.
line(initBody, (item->ref.empty() ? "auto " : "") + name + " = " + sceneRef + "->createSceneItem();", "");
diff --git a/src/dawntools/util/parser/SceneParser.cpp b/src/dawntools/util/parser/SceneParser.cpp
index 4499a862..b7ad347b 100644
--- a/src/dawntools/util/parser/SceneParser.cpp
+++ b/src/dawntools/util/parser/SceneParser.cpp
@@ -35,8 +35,14 @@ int32_t SceneParser::onParse(
auto itChildren = node->children.begin();
while(itChildren != node->children.end()) {
Xml *child = *itChildren;
-
- if(child->node == "item") {
+
+ if(child->node == "asset") {
+ struct SceneAsset asset;
+ auto ret = (SceneAssetParser()).parse(child, &asset, error);
+ if(ret != 0) return ret;
+ out->assets.push_back(asset);
+
+ } else if(child->node == "item") {
struct SceneItem item;
item.registry = out->registry;
ret = (SceneItemParser()).parse(child, &item, error);
diff --git a/src/dawntools/util/parser/SceneParser.hpp b/src/dawntools/util/parser/SceneParser.hpp
index e94ea214..1eaceccf 100644
--- a/src/dawntools/util/parser/SceneParser.hpp
+++ b/src/dawntools/util/parser/SceneParser.hpp
@@ -13,6 +13,7 @@ namespace Dawn {
std::string extend;
std::vector items;
std::vector code;
+ std::vector assets;
struct SceneItemComponentRegistry *registry;
std::vector dependencies;
};
diff --git a/src/dawntools/vnscenetool/VNSceneGen.cpp b/src/dawntools/vnscenetool/VNSceneGen.cpp
index 82aedc86..29a13af8 100644
--- a/src/dawntools/vnscenetool/VNSceneGen.cpp
+++ b/src/dawntools/vnscenetool/VNSceneGen.cpp
@@ -39,9 +39,7 @@ void VNSceneGen::test(
initType = "VNSetEvent<" + event->set.type + ">";
toInclude = "games/vn/events/VNSetEvent.hpp";
line(&afterLines, eventName + "->modifies = &" + event->set.property + ";", "");
- line(&afterLines, eventName + "->to = " + event->set.to + ";", "");
- if(event->set.from != "") line(&afterLines, eventName + "->from = " + event->set.from + ";", "");
- if(event->set.duration != "") line(&afterLines, eventName + "->duration = " + event->set.duration + ";", "");
+ line(&afterLines, eventName + "->value = " + event->set.to + ";", "");
break;
case VN_SCENE_EVENT_TYPE_WAIT:
diff --git a/src/dawntools/vnscenetool/events/VNSetEventParser.cpp b/src/dawntools/vnscenetool/events/VNSetEventParser.cpp
index 878dcd7b..cba32b0c 100644
--- a/src/dawntools/vnscenetool/events/VNSetEventParser.cpp
+++ b/src/dawntools/vnscenetool/events/VNSetEventParser.cpp
@@ -14,10 +14,7 @@ std::vector VNSetEventParser::getRequiredAttributes() {
std::map VNSetEventParser::getOptionalAttributes() {
return {
{ "to", "" },
- { "value", "" },
- { "from", "" },
- { "duration", "" },
- { "curve", "" }
+ { "value", "" }
};
}
@@ -38,8 +35,5 @@ int32_t VNSetEventParser::onParse(
out->type = values["type"];
out->property = values["property"];
- out->from = values["from"];
- out->duration = values["duration"];
- out->curve = values["curve"];
return 0;
}
\ No newline at end of file
diff --git a/src/dawntools/vnscenetool/events/VNSetEventParser.hpp b/src/dawntools/vnscenetool/events/VNSetEventParser.hpp
index d085fa54..4a2be102 100644
--- a/src/dawntools/vnscenetool/events/VNSetEventParser.hpp
+++ b/src/dawntools/vnscenetool/events/VNSetEventParser.hpp
@@ -10,9 +10,6 @@ namespace Dawn {
struct VNSetEvent {
std::string property = "";
std::string to = "";
- std::string from = "";
- std::string duration = "";
- std::string curve = "";
std::string type = "";
};