Showing the changes to libraries/script-engine/src/ScriptManagerScriptingInterface.h (1 of 2 files). Show all
Unified · Split
| @@ -58,6 +58,9 @@ public: · 57 unmodified lines | ||
| 58 | 58 | |
| 59 | 59 | class ScriptManagerScriptingInterface : public QObject { |
| 60 | 60 | Q_OBJECT |
| 61 | + Q_PROPERTY(QString context READ getContext) | |
| 62 | + Q_PROPERTY(QString type READ getTypeAsString) | |
| 63 | + Q_PROPERTY(QString fileName READ getAbsoluteFilename CONSTANT) | |
| 61 | 64 | public: |
| 62 | 65 | ScriptManagerScriptingInterface(ScriptManager *parent); |
| 63 | 66 | |
| @@ -96,6 +99,26 @@ public: · 32 unmodified lines | ||
| 96 | 99 | */ |
| 97 | 100 | Q_INVOKABLE QString getContext() const { return _manager->getContext(); } |
| 98 | 101 | |
| 102 | + /*@jsdoc | |
| 103 | + * Gets the type of script that is running: Interface, avatar, client entity, server entity, or assignment client. | |
| 104 | + * @function Script.getTypeAsString | |
| 105 | + * @returns {string} The type of script that is running: | |
| 106 | + * <ul> | |
| 107 | + * <li><code>"client"</code>: An Interface script.</li> | |
| 108 | + * <li><code>"entity_client"</code>: A client entity script.</li> | |
| 109 | + * <li><code>"avatar"</code>: An avatar script.</li> | |
| 110 | + * <li><code>"entity_server"</code>: A server entity script.</li> | |
| 111 | + * <li><code>"agent"</code>: An assignment client script.</li> | |
| 112 | + * </ul> | |
| 113 | + */ | |
| 114 | + Q_INVOKABLE QString getTypeAsString() const { return _manager->getTypeAsString(); } | |
| 115 | + | |
| 116 | + /*@jsdoc | |
| 117 | + * Gets the filename of the script file. | |
| 118 | + * @function Script.getAbsoluteFilename | |
| 119 | + * @returns {string} The filename of the script file. | |
| 120 | + */ | |
| 121 | + Q_INVOKABLE QString getAbsoluteFilename() const { return _manager->getAbsoluteFilename(); } | |
| 99 | 122 | |
| 100 | 123 | /*@jsdoc |
| 101 | 124 | * Checks whether the script is running as an Interface or avatar script. |