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
VisualNovelTextboxEvent.cpp
VisualNovelChangeSimpleBackgroundEvent.cpp
VisualNovelEmptyEvent.cpp
)
# 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
//
// 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<DeathPrefab> {
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<DeathPrefab> {
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) {}
};
}

View File

@ -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, "");