Fixed parallel event bug
This commit is contained in:
@ -25,13 +25,14 @@ namespace Dawn {
|
||||
auto itEvents = this->events.begin();
|
||||
while(itEvents != this->events.end()) {
|
||||
auto event = *itEvents;
|
||||
event->start(this, this);
|
||||
eventCount++;
|
||||
|
||||
useEvent([&]{
|
||||
eventCompleteCount++;
|
||||
if(eventCompleteCount >= eventCount) this->next();
|
||||
}, event->eventFinished);
|
||||
|
||||
event->start(this, this);
|
||||
itEvents++;
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ void VNSceneGen::test(
|
||||
case VN_SCENE_EVENT_TYPE_TEXT:
|
||||
initType = "VNTextEvent";
|
||||
toInclude = "games/vn/events/VNTextEvent.hpp";
|
||||
line(body, eventName + "->" + "text = \"" + event->text.texts.begin()->text + "\";", "");
|
||||
line(&afterLines, eventName + "->" + "text = \"" + event->text.texts.begin()->text + "\";", "");
|
||||
break;
|
||||
|
||||
case VN_SCENE_EVENT_TYPE_POSITION:
|
||||
|
25
src/dawntools/vnscenetool/events/VNMarkerParser.hpp
Normal file
25
src/dawntools/vnscenetool/events/VNMarkerParser.hpp
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "util/XmlParser.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
struct VNMarker {
|
||||
std::string name;
|
||||
};
|
||||
|
||||
class VNMarkerParser : public XmlParser<struct VNMarker> {
|
||||
protected:
|
||||
std::vector<std::string> getRequiredAttributes() override;
|
||||
std::map<std::string, std::string> getOptionalAttributes() override;
|
||||
int32_t onParse(
|
||||
Xml *node,
|
||||
std::map<std::string, std::string> values,
|
||||
struct VNMarker *out,
|
||||
std::string *error
|
||||
) override;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user