VN textbox event

This commit is contained in:
2023-05-21 15:11:51 -07:00
parent b61c1fc5ba
commit 74cdc66814
16 changed files with 85 additions and 43 deletions

View File

@@ -5,6 +5,8 @@
#pragma once
#include "VNEvent.hpp"
#include "scene/Scene.hpp"
#include "games/vn/components/VNTextboxScroller.hpp"
namespace Dawn {
class VNTextEvent : public VNEvent {
@@ -12,8 +14,19 @@ namespace Dawn {
std::string text;
protected:
VNTextboxScroller *scroller = nullptr;
void onStart() override {
std::cout << "TEXT: " << text << std::endl;
scroller = this->getScene()->findComponent<VNTextboxScroller>();
assertNotNull(scroller);
scroller->label->text = text;
useEvent([&](inputbind_t bind){
if(bind != INPUT_BIND_ACCEPT) return;
if(!scroller->readyToClose) return;
this->next();
}, this->getScene()->game->inputManager.eventBindPressed);
}
};
}