Added basic prefabs finally

This commit is contained in:
2023-01-03 16:44:16 -08:00
parent 562e6644ef
commit 659ab3d760
29 changed files with 193 additions and 108 deletions

View File

@ -12,4 +12,5 @@ target_sources(${DAWN_TARGET_NAME}
# Subdirs
add_subdirectory(components)
add_subdirectory(events)
add_subdirectory(scene)
add_subdirectory(ui)

View File

@ -0,0 +1,10 @@
# Copyright (c) 2022 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Sources
target_sources(${DAWN_TARGET_NAME}
PRIVATE
SimpleVNScene.cpp
)

View File

@ -14,7 +14,8 @@ SimpleVNScene::SimpleVNScene(DawnGame *game) : Scene(game) {
std::vector<Asset*> SimpleVNScene::getRequiredAssets() {
auto assMan = &this->game->assetManager;
return PokerGameTextbox::getAssets(assMan);
// return PokerGameTextbox::getAssets(assMan);
return std::vector<Asset*>();
}
void SimpleVNScene::stage() {
@ -29,7 +30,7 @@ void SimpleVNScene::stage() {
// UI
this->canvas = UICanvas::createCanvas(this);
this->textbox = Prefab::create<VisualNovelTextboxPrefab>(this)->getComponent<VisualNovelTextbox>();
// this->textbox = Prefab::create<VisualNovelTextboxPrefab>(this)->getComponent<VisualNovelTextbox>();
this->background = SimpleVisualNovelBackground::create(this);
// VN Manager
@ -44,8 +45,4 @@ void SimpleVNScene::stage() {
// Begin VN.
this->vnManager->setEvent(this->getVNEvent());
}
void SimpleVNScene::vnStage() {
}

View File

@ -8,7 +8,6 @@
#include "game/DawnGame.hpp"
#include "util/array.hpp"
#include "scene/components/Components.hpp"
#include "prefabs/VisualNovelTextboxPrefab.hpp"
#include "visualnovel/VisualNovelManager.hpp"
#include "visualnovel/events/VisualNovelTextboxEvent.hpp"
#include "visualnovel/events/VisualNovelPauseEvent.hpp"
@ -25,7 +24,7 @@ namespace Dawn {
VisualNovelFader *vnFader = nullptr;
VisualNovelManager *vnManager = nullptr;
virtual void vnStage();
virtual void vnStage() = 0;
virtual IVisualNovelEvent * getVNEvent() = 0;
public: