Working on stuff

This commit is contained in:
Vladislav Khorev committed 2026-07-10 14:09:31 +03:00
1 parent 17d903fd52
commit 07f45ad1e1
11 files changed
+176 -70

No files matched your search

+9
View File
@@ -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); }