Much better narration/dialogue/action handling (and for lua too)

This commit is contained in:
2026-01-23 02:42:29 +03:00
parent cd91174f5d
commit 1d358d206e
7 changed files with 220 additions and 28 deletions

View File

@@ -2,6 +2,7 @@
#define __GUIMODULECOMMON_H__
#include <iostream>
#include <Ogre.h>
#include <nlohmann/json.hpp>
#include "Components.h"
#include "GameData.h"
namespace ECS
@@ -21,6 +22,7 @@ struct GUI {
Ogre::String mnarrationText;
std::vector<Ogre::String> mchoices;
int narration_answer;
nlohmann::json props;
private:
bool complete;
@@ -91,6 +93,18 @@ struct GUI {
event(ev);
}
virtual ~NarrationHandler() {}
void setProperties(const Ogre::String &properties)
{
props = nlohmann::json::parse(properties);
}
Ogre::String getProperties() const
{
return props.dump();
}
const nlohmann::json &getPropsJSON() const
{
return props;
}
};
static void setWindowGrab(bool g = true)