From 72508ace53a8dec7b7803618804c66b60d8946a0 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Thu, 16 Feb 2023 08:09:50 -0800 Subject: [PATCH] First pass at scene 1 --- src/dawn/visualnovel/events/CMakeLists.txt | 1 + .../events/VisualNovelEmptyEvent.cpp | 25 +++++++++ .../events/VisualNovelEmptyEvent.hpp | 19 +++++++ .../prefabs/characters/DeathPrefab.hpp | 55 ++++++++++--------- src/dawntools/tools/vnscenegen/parse/root.hpp | 4 +- 5 files changed, 76 insertions(+), 28 deletions(-) create mode 100644 src/dawn/visualnovel/events/VisualNovelEmptyEvent.cpp create mode 100644 src/dawn/visualnovel/events/VisualNovelEmptyEvent.hpp diff --git a/src/dawn/visualnovel/events/CMakeLists.txt b/src/dawn/visualnovel/events/CMakeLists.txt index a4129f27..5666e626 100644 --- a/src/dawn/visualnovel/events/CMakeLists.txt +++ b/src/dawn/visualnovel/events/CMakeLists.txt @@ -9,6 +9,7 @@ target_sources(${DAWN_TARGET_NAME} VisualNovelFadeEvent.cpp VisualNovelTextboxEvent.cpp VisualNovelChangeSimpleBackgroundEvent.cpp + VisualNovelEmptyEvent.cpp ) # Subdirs diff --git a/src/dawn/visualnovel/events/VisualNovelEmptyEvent.cpp b/src/dawn/visualnovel/events/VisualNovelEmptyEvent.cpp new file mode 100644 index 00000000..43a80d32 --- /dev/null +++ b/src/dawn/visualnovel/events/VisualNovelEmptyEvent.cpp @@ -0,0 +1,25 @@ +// Copyright (c) 2023 Dominic Masters +// +// This software is released under the MIT License. +// https://opensource.org/licenses/MIT + +#include "VisualNovelEmptyEvent.hpp" + +using namespace Dawn; + +VisualNovelEmptyEvent::VisualNovelEmptyEvent(VisualNovelManager *man) : + IVisualNovelEvent(man) +{ + +} + +void VisualNovelEmptyEvent::onStart(IVisualNovelEvent *prev) { + +} + +bool_t VisualNovelEmptyEvent::onUpdate() { + return false; +} + +void VisualNovelEmptyEvent::onEnd() { +} \ No newline at end of file diff --git a/src/dawn/visualnovel/events/VisualNovelEmptyEvent.hpp b/src/dawn/visualnovel/events/VisualNovelEmptyEvent.hpp new file mode 100644 index 00000000..a111fe6b --- /dev/null +++ b/src/dawn/visualnovel/events/VisualNovelEmptyEvent.hpp @@ -0,0 +1,19 @@ +// Copyright (c) 2023 Dominic Masters +// +// This software is released under the MIT License. +// https://opensource.org/licenses/MIT + +#pragma once +#include "visualnovel/VisualNovelManager.hpp" + +namespace Dawn { + class VisualNovelEmptyEvent : public IVisualNovelEvent { + protected: + void onStart(IVisualNovelEvent *previous) override; + bool_t onUpdate() override; + void onEnd() override; + + public: + VisualNovelEmptyEvent(VisualNovelManager *manager); + }; +} \ No newline at end of file diff --git a/src/dawnpokergame/prefabs/characters/DeathPrefab.hpp b/src/dawnpokergame/prefabs/characters/DeathPrefab.hpp index ed099ea4..73394164 100644 --- a/src/dawnpokergame/prefabs/characters/DeathPrefab.hpp +++ b/src/dawnpokergame/prefabs/characters/DeathPrefab.hpp @@ -1,28 +1,29 @@ -// Copyright (c) 2023 Dominic Masters -// -// This software is released under the MIT License. -// https://opensource.org/licenses/MIT - -#pragma once -#include "prefabs/characters/CharacterPrefab.hpp" - -namespace Dawn { - class DeathPrefab : public CharacterPrefab { - protected: - - struct VisualNovelCharacterEmotion defineAndGetInitialEmotion( - AssetManager *man - ) override; - - public: - static std::string getCharacterTexture(); - static std::string getCharacterTileset(); - static std::string getLanguagePrefix(); - - struct VisualNovelCharacterEmotion emotionHappy; - struct VisualNovelCharacterEmotion emotionConcerned; - struct VisualNovelCharacterEmotion emotionSurprised; - - DeathPrefab(Scene *s, sceneitemid_t i) : CharacterPrefab(s,i) {} - }; +// Copyright (c) 2023 Dominic Masters +// +// This software is released under the MIT License. +// https://opensource.org/licenses/MIT + +#pragma once +#include "prefabs/characters/CharacterPrefab.hpp" + +namespace Dawn { + class DeathPrefab : public CharacterPrefab { + protected: + + struct VisualNovelCharacterEmotion defineAndGetInitialEmotion( + AssetManager *man + ) override; + + public: + static std::string getCharacterTexture(); + static std::string getCharacterTileset(); + static std::string getLanguagePrefix(); + + struct VisualNovelCharacterEmotion emotionHappy; + struct VisualNovelCharacterEmotion emotionConcerned; + struct VisualNovelCharacterEmotion emotionSurprised; + struct VisualNovelCharacterEmotion emotionUnset; + + DeathPrefab(Scene *s, sceneitemid_t i) : CharacterPrefab(s,i) {} + }; } \ No newline at end of file diff --git a/src/dawntools/tools/vnscenegen/parse/root.hpp b/src/dawntools/tools/vnscenegen/parse/root.hpp index 46afdf35..c94e27b4 100644 --- a/src/dawntools/tools/vnscenegen/parse/root.hpp +++ b/src/dawntools/tools/vnscenegen/parse/root.hpp @@ -48,6 +48,8 @@ namespace Dawn { if(ret != 0) return ret; ++itChildren; } + + out->header.includes.push_back("visualnovel/events/VisualNovelEmptyEvent.hpp"); return ret; } @@ -83,7 +85,7 @@ namespace Dawn { getVNEvent.name = "getVNEvent"; getVNEvent.type = "IVisualNovelEvent *"; getVNEvent.isOverride = true; - line(&getVNEvent.body, "auto start = new VisualNovelPauseEvent(vnManager, 1.0f);", ""); + line(&getVNEvent.body, "auto start = new VisualNovelEmptyEvent(vnManager);", ""); IncludeGen::generate(&c.includes, info->header.includes, ""); IncludeGen::generate(&c.includes, info->events.includes, "");