First pass at scene 1

This commit is contained in:
2023-02-16 08:09:50 -08:00
parent 4cd417a8fc
commit 72508ace53
5 changed files with 76 additions and 28 deletions

View File

@ -9,6 +9,7 @@ target_sources(${DAWN_TARGET_NAME}
VisualNovelFadeEvent.cpp VisualNovelFadeEvent.cpp
VisualNovelTextboxEvent.cpp VisualNovelTextboxEvent.cpp
VisualNovelChangeSimpleBackgroundEvent.cpp VisualNovelChangeSimpleBackgroundEvent.cpp
VisualNovelEmptyEvent.cpp
) )
# Subdirs # Subdirs

View File

@ -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() {
}

View File

@ -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);
};
}

View File

@ -1,28 +1,29 @@
// Copyright (c) 2023 Dominic Masters // Copyright (c) 2023 Dominic Masters
// //
// This software is released under the MIT License. // This software is released under the MIT License.
// https://opensource.org/licenses/MIT // https://opensource.org/licenses/MIT
#pragma once #pragma once
#include "prefabs/characters/CharacterPrefab.hpp" #include "prefabs/characters/CharacterPrefab.hpp"
namespace Dawn { namespace Dawn {
class DeathPrefab : public CharacterPrefab<DeathPrefab> { class DeathPrefab : public CharacterPrefab<DeathPrefab> {
protected: protected:
struct VisualNovelCharacterEmotion defineAndGetInitialEmotion( struct VisualNovelCharacterEmotion defineAndGetInitialEmotion(
AssetManager *man AssetManager *man
) override; ) override;
public: public:
static std::string getCharacterTexture(); static std::string getCharacterTexture();
static std::string getCharacterTileset(); static std::string getCharacterTileset();
static std::string getLanguagePrefix(); static std::string getLanguagePrefix();
struct VisualNovelCharacterEmotion emotionHappy; struct VisualNovelCharacterEmotion emotionHappy;
struct VisualNovelCharacterEmotion emotionConcerned; struct VisualNovelCharacterEmotion emotionConcerned;
struct VisualNovelCharacterEmotion emotionSurprised; struct VisualNovelCharacterEmotion emotionSurprised;
struct VisualNovelCharacterEmotion emotionUnset;
DeathPrefab(Scene *s, sceneitemid_t i) : CharacterPrefab(s,i) {}
}; DeathPrefab(Scene *s, sceneitemid_t i) : CharacterPrefab(s,i) {}
};
} }

View File

@ -48,6 +48,8 @@ namespace Dawn {
if(ret != 0) return ret; if(ret != 0) return ret;
++itChildren; ++itChildren;
} }
out->header.includes.push_back("visualnovel/events/VisualNovelEmptyEvent.hpp");
return ret; return ret;
} }
@ -83,7 +85,7 @@ namespace Dawn {
getVNEvent.name = "getVNEvent"; getVNEvent.name = "getVNEvent";
getVNEvent.type = "IVisualNovelEvent *"; getVNEvent.type = "IVisualNovelEvent *";
getVNEvent.isOverride = true; 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->header.includes, "");
IncludeGen::generate(&c.includes, info->events.includes, ""); IncludeGen::generate(&c.includes, info->events.includes, "");