VN textbox event
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user