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:
Malin E
2023-09-07 13:21:29 +02:00
committed by GitHub
parent b49a8704dc
commit 4447de87f5
43 changed files with 449 additions and 165 deletions

View File

@@ -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;