mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-03 18:19:38 -06:00
Issue/2768 (#2872)
* Rename remote scripting property to reflect better what it does * Change the remote scripting name in all modules * Update all scripts and action calls to use the new property for sync * Simplify code that decides whether to send actions to nodes and peers * Move Lua console hint text to be right top aligned * Update Lua script topic * Added new JSON key whether or not the script should be synced to other nodes and peers * Per default all scripts sync to everyone In the next full release, we should have two separate keys that decides whether to sync and send to nodes and peers separately * Add some comments that explain why there is no sync for some scripts * Make sync argument in trigger action function BooleanType
This commit is contained in:
@@ -51,11 +51,13 @@ namespace openspace::scripting {
|
||||
class ScriptEngine : public Syncable {
|
||||
public:
|
||||
using ScriptCallback = std::function<void(ghoul::Dictionary)>;
|
||||
BooleanType(RemoteScripting);
|
||||
BooleanType(ShouldBeSynchronized);
|
||||
BooleanType(ShouldSendToRemote);
|
||||
|
||||
struct QueueItem {
|
||||
std::string script;
|
||||
RemoteScripting remoteScripting;
|
||||
ShouldBeSynchronized shouldBeSynchronized;
|
||||
ShouldSendToRemote shouldSendToRemote;
|
||||
ScriptCallback callback;
|
||||
};
|
||||
|
||||
@@ -89,8 +91,8 @@ public:
|
||||
virtual void decode(SyncBuffer* syncBuffer) override;
|
||||
virtual void postSync(bool isMaster) override;
|
||||
|
||||
void queueScript(std::string script, RemoteScripting remoteScripting,
|
||||
ScriptCallback cb = ScriptCallback());
|
||||
void queueScript(std::string script, ShouldBeSynchronized shouldBeSynchronized,
|
||||
ShouldSendToRemote shouldSendToRemote, ScriptCallback cb = ScriptCallback());
|
||||
|
||||
std::vector<std::string> allLuaFunctions() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user