@momo2555/koppeliajs 0.0.160 → 0.0.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scripts/koppelia.d.ts +5 -1
- package/dist/scripts/koppelia.js +23 -11
- package/dist/scripts/play.js +3 -0
- package/package.json +1 -1
|
@@ -89,7 +89,11 @@ export declare class Koppelia {
|
|
|
89
89
|
* Add a new resizable text element and define the callback that will be executed when receive and a resizable
|
|
90
90
|
* text update notification form koppelia application
|
|
91
91
|
*/
|
|
92
|
-
registerNewResizableText(id: string, defaultSize: number
|
|
92
|
+
registerNewResizableText(id: string, defaultSize: number): Promise<void>;
|
|
93
|
+
onResizableTextChanged(id: string, onTextResized: (newSize: number) => void): void;
|
|
94
|
+
getResizableTexts(): Promise<{
|
|
95
|
+
[key: string]: any;
|
|
96
|
+
}[]>;
|
|
93
97
|
writeGameConfig(config_id: string, config_value: {
|
|
94
98
|
[key: string]: any;
|
|
95
99
|
}, current_play?: boolean): Promise<void>;
|
package/dist/scripts/koppelia.js
CHANGED
|
@@ -282,7 +282,7 @@ export class Koppelia {
|
|
|
282
282
|
* Add a new resizable text element and define the callback that will be executed when receive and a resizable
|
|
283
283
|
* text update notification form koppelia application
|
|
284
284
|
*/
|
|
285
|
-
async registerNewResizableText(id, defaultSize
|
|
285
|
+
async registerNewResizableText(id, defaultSize) {
|
|
286
286
|
return new Promise((resolve, reject) => {
|
|
287
287
|
if (get(routeType) == "monitor") {
|
|
288
288
|
let addGrowableElRequest = new Message();
|
|
@@ -294,18 +294,30 @@ export class Koppelia {
|
|
|
294
294
|
this._console.sendMessage(addGrowableElRequest, (response) => {
|
|
295
295
|
});
|
|
296
296
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
297
|
+
resolve();
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
onResizableTextChanged(id, onTextResized) {
|
|
301
|
+
this._console.onRequest((req, params) => {
|
|
302
|
+
if (req == "resizableTextNotification") {
|
|
303
|
+
if (params.id !== undefined && params.id == id &&
|
|
304
|
+
params.fontSize != undefined) {
|
|
305
|
+
let fontSize = params.fontSize;
|
|
306
|
+
onTextResized(fontSize);
|
|
306
307
|
}
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
async getResizableTexts() {
|
|
312
|
+
return new Promise((resolve, reject) => {
|
|
313
|
+
let addGrowableElRequest = new Message();
|
|
314
|
+
addGrowableElRequest.setRequest("getResizableTexts");
|
|
315
|
+
addGrowableElRequest.setDestination(PeerType.MASTER, "");
|
|
316
|
+
// send the message to the console (only the controller sends the )
|
|
317
|
+
this._console.sendMessage(addGrowableElRequest, (response) => {
|
|
318
|
+
let resizables = response.getParam("resizableTexts", []);
|
|
319
|
+
resolve(resizables);
|
|
307
320
|
});
|
|
308
|
-
resolve();
|
|
309
321
|
});
|
|
310
322
|
}
|
|
311
323
|
async writeGameConfig(config_id, config_value, current_play = true) {
|
package/dist/scripts/play.js
CHANGED
|
@@ -26,6 +26,9 @@ export class Play {
|
|
|
26
26
|
if (playRawObj.file_name !== undefined) {
|
|
27
27
|
this._playFileName = playRawObj.file_name;
|
|
28
28
|
}
|
|
29
|
+
if (playRawObj.thumbnail !== undefined) {
|
|
30
|
+
this._playImagebase64 = playRawObj.thumbnail;
|
|
31
|
+
}
|
|
29
32
|
this._playContentLoaded = false;
|
|
30
33
|
}
|
|
31
34
|
getPlayMediaPath(mediaName) {
|