about to add SDL and probably break everything
This commit is contained in:
@@ -64,15 +64,11 @@ bool_t IVisualNovelEvent::update() {
|
||||
IVisualNovelEvent * IVisualNovelEvent::end() {
|
||||
this->onEnd();
|
||||
|
||||
std::cout << "End";
|
||||
|
||||
if(this->doNext != nullptr) {
|
||||
std::cout << " Nexter" << std::endl;
|
||||
auto next = this->doNext;
|
||||
this->doNext = nullptr;
|
||||
return next;
|
||||
}
|
||||
std::cout << " No nxt" << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
38
src/dawn/visualnovel/events/VisualNovelCallbackEvent.hpp
Normal file
38
src/dawn/visualnovel/events/VisualNovelCallbackEvent.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
// 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 {
|
||||
template<class T>
|
||||
class VisualNovelCallbackEvent : public IVisualNovelEvent {
|
||||
protected:
|
||||
T *instance;
|
||||
void (T::*callback)();
|
||||
|
||||
void onStart(IVisualNovelEvent *previous) {
|
||||
|
||||
}
|
||||
|
||||
bool_t onUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void onEnd() {
|
||||
((*this->instance).*(this->callback))();
|
||||
}
|
||||
|
||||
public:
|
||||
VisualNovelCallbackEvent(
|
||||
VisualNovelManager *manager,
|
||||
T *instance,
|
||||
void (T::*callback)()
|
||||
) : IVisualNovelEvent(manager) {
|
||||
this->instance = instance;
|
||||
this->callback = callback;
|
||||
}
|
||||
};
|
||||
}
|
@@ -17,7 +17,7 @@ std::vector<Asset*> SimpleVNScene::getRequiredAssets() {
|
||||
auto assMan = &this->game->assetManager;
|
||||
std::vector<Asset*> assets;
|
||||
vectorAppend(&assets, VisualNovelTextboxPrefab::getRequiredAssets(assMan));
|
||||
return std::vector<Asset*>();
|
||||
return assets;
|
||||
}
|
||||
|
||||
void SimpleVNScene::stage() {
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include "visualnovel/events/VisualNovelTextboxEvent.hpp"
|
||||
#include "visualnovel/events/VisualNovelPauseEvent.hpp"
|
||||
#include "visualnovel/events/VisualNovelFadeEvent.hpp"
|
||||
#include "visualnovel/events/VisualNovelCAllbackEvent.hpp"
|
||||
#include "visualnovel/events/VisualNovelChangeSimpleBackgroundEvent.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
|
Reference in New Issue
Block a user