Working on stuff
This commit is contained in:
1 parent
17d903fd52
commit
07f45ad1e1
11 files changed
+176
-70
No files matched your search
@@ -2,6 +2,7 @@
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <functional>
|
||||
#include "quest/QuestJournal.h"
|
||||
#include "external/nlohmann/json.hpp"
|
||||
#include "ISaveable.h"
|
||||
@@ -62,6 +63,14 @@ public:
|
||||
// has already run and registered all callbacks.
|
||||
void loadScriptGlobals(const nlohmann::json& in);
|
||||
|
||||
// Re-wires an in-flight, one-shot callback (NPC/player walk-arrival, object
|
||||
// animation-complete) that was serialized by name rather than by value.
|
||||
// Looks up `name` as a global Lua function and assigns a wrapped invoker to
|
||||
// outCallback; leaves outCallback empty and logs an error if not found.
|
||||
// Call after init() (the script must already have run) and after the owning
|
||||
// state (CharacterState / InteractiveObjectState) has been loaded.
|
||||
void rehydrateNamedCallback(const std::string& name, std::function<void()>& outCallback) const;
|
||||
|
||||
void save(nlohmann::json& out) const override { saveScriptGlobals(out); }
|
||||
void load(const nlohmann::json& in) override { loadScriptGlobals(in); }
|
||||
|
||||
|
||||
Reference in new issue
Block a user