@awayfl/awayfl-player 0.2.39 → 0.2.41
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/bundle/awayfl-player.umd.js +30 -30
- package/bundle/awayfl-player.umd.js.gz +0 -0
- package/bundle/awayfl-player.umd.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/index.ts +11 -2
- package/package.json +1 -1
- package/scripts/updateAwayDev_mac.sh +8 -2
- package/template/game_template.html +7 -1
- package/template/loader.js +34 -10
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,QAAQ,IAAI,YAAY,EAAC,MAAM,cAAc,CAAC;AACtD,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { BitmapImage2D, ImageUtils } from "@awayjs/stage";
|
|
2
|
+
console.debug("AwayFL-Player - 0.2.41");
|
|
2
3
|
export { AVMPlayer } from "./lib/AVMPlayer";
|
|
3
4
|
export { AVM1Player } from "./lib/AVM1Player";
|
|
4
5
|
export { AVM2Player } from "./lib/AVM2Player";
|
|
@@ -7,3 +8,4 @@ export { EventBase } from "@awayjs/core";
|
|
|
7
8
|
export { StageManager } from "@awayjs/stage";
|
|
8
9
|
export { Settings as AVM2Settings } from "@awayfl/avm2";
|
|
9
10
|
export { PlayerGlobal } from "@awayfl/playerglobal";
|
|
11
|
+
ImageUtils.registerDefaults(function () { return new BitmapImage2D(1, 1, true, 0x0); }, null, null, null);
|
package/index.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { BitmapImage2D, ImageUtils } from "@awayjs/stage";
|
|
2
|
+
|
|
3
|
+
console.debug("AwayFL-Player - 0.2.41");
|
|
2
4
|
|
|
3
5
|
export {AVMPlayer} from "./lib/AVMPlayer";
|
|
4
6
|
export {AVM1Player} from "./lib/AVM1Player";
|
|
@@ -7,4 +9,11 @@ export {LoaderEvent} from "@awayjs/core";
|
|
|
7
9
|
export {EventBase} from "@awayjs/core";
|
|
8
10
|
export {StageManager} from "@awayjs/stage";
|
|
9
11
|
export {Settings as AVM2Settings} from "@awayfl/avm2";
|
|
10
|
-
export {PlayerGlobal} from "@awayfl/playerglobal";
|
|
12
|
+
export {PlayerGlobal} from "@awayfl/playerglobal";
|
|
13
|
+
|
|
14
|
+
ImageUtils.registerDefaults(
|
|
15
|
+
() => new BitmapImage2D(1, 1, true, 0x0),
|
|
16
|
+
null,
|
|
17
|
+
null,
|
|
18
|
+
null,
|
|
19
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awayfl/awayfl-player",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.41",
|
|
4
4
|
"description": "Flash Player emulator for executing SWF files (published for FP versions 6 and up) in javascript",
|
|
5
5
|
"main": "bundle/awayfl-player.umd.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -3,16 +3,22 @@ set -euo pipefail
|
|
|
3
3
|
cd $(dirname "$0")
|
|
4
4
|
|
|
5
5
|
function updateIfNeeded () {
|
|
6
|
+
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
|
7
|
+
|
|
6
8
|
set +e
|
|
7
|
-
UP_TO_DATE=`git pull origin $1 2>/dev/null | grep "Already up to date"
|
|
9
|
+
UP_TO_DATE=`git pull origin $1 2>/dev/null | grep "Already up to date"`
|
|
8
10
|
set -e
|
|
9
|
-
if [
|
|
11
|
+
if [ -z "$UP_TO_DATE" ]; then
|
|
10
12
|
npm run tsc:build
|
|
13
|
+
else
|
|
14
|
+
echo Already up to date
|
|
11
15
|
fi
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
echo [32m Pulls all updates into the "@awayjs" and "@awayfl" directories, and runs tsc:build[0m
|
|
15
19
|
read -n 1 -s -r -p "Press any key to continue"
|
|
20
|
+
echo
|
|
21
|
+
echo
|
|
16
22
|
cd ..
|
|
17
23
|
cd ..
|
|
18
24
|
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
background-repeat: no-repeat;
|
|
45
45
|
background-image: url("INSERT_SPLASHSCREEN");
|
|
46
46
|
visibility: visible;
|
|
47
|
-
transition: all 0.5s;
|
|
48
47
|
z-index: 10;
|
|
49
48
|
}
|
|
50
49
|
|
|
@@ -57,6 +56,12 @@
|
|
|
57
56
|
height: 100%;
|
|
58
57
|
transition: all 0.5s;
|
|
59
58
|
}
|
|
59
|
+
#loading__image {
|
|
60
|
+
position: absolute;
|
|
61
|
+
background-size: contain;
|
|
62
|
+
background-position: center;
|
|
63
|
+
background-repeat: no-repeat;
|
|
64
|
+
}
|
|
60
65
|
</style>
|
|
61
66
|
</head>
|
|
62
67
|
|
|
@@ -65,6 +70,7 @@
|
|
|
65
70
|
<div id="progress__root">
|
|
66
71
|
<div id="progress__line"></div>
|
|
67
72
|
</div>
|
|
73
|
+
<div id="loading__image"></div>
|
|
68
74
|
</div>
|
|
69
75
|
|
|
70
76
|
<script>
|
package/template/loader.js
CHANGED
|
@@ -303,7 +303,9 @@ var Loader = (function () {
|
|
|
303
303
|
let fillLine = undefined;
|
|
304
304
|
let __config = undefined;
|
|
305
305
|
let __splash = undefined;
|
|
306
|
+
let __loading = undefined;
|
|
306
307
|
let __pr__root = undefined;
|
|
308
|
+
let __pr__line = undefined;
|
|
307
309
|
let handleResize = undefined;
|
|
308
310
|
|
|
309
311
|
window["setStageDimensions"]=function(x, y, w, h){
|
|
@@ -345,20 +347,26 @@ var Loader = (function () {
|
|
|
345
347
|
// rereport
|
|
346
348
|
completeEvent(f);
|
|
347
349
|
|
|
348
|
-
|
|
350
|
+
const st_conf = __config.start;
|
|
351
|
+
if (st_conf) {
|
|
349
352
|
|
|
350
353
|
// start image exists.
|
|
351
354
|
// hide progressbar, show startimage and wait for user-input to start the game
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
opacity: 0,
|
|
355
|
+
Object.assign(__pr__line.style, {
|
|
356
|
+
height: "100%",
|
|
357
|
+
width: "100%",
|
|
356
358
|
});
|
|
357
|
-
Object.assign(
|
|
358
|
-
backgroundImage: `url(${
|
|
359
|
+
Object.assign(__loading.style, {
|
|
360
|
+
backgroundImage: `url(${st_conf.image})`,
|
|
361
|
+
left: `${100 * st_conf.rect[0]}%`,
|
|
362
|
+
top: `${100 * st_conf.rect[1]}%`,
|
|
363
|
+
width: `${100 * st_conf.rect[2]}%`,
|
|
364
|
+
height: `${100 * st_conf.rect[3]}%`,
|
|
365
|
+
cursor: "pointer",
|
|
359
366
|
});
|
|
360
|
-
let
|
|
361
|
-
|
|
367
|
+
let onClick = (e) => {
|
|
368
|
+
__loading.removeEventListener("click", onClick);
|
|
369
|
+
__loading.removeEventListener("touchend", onClick);
|
|
362
370
|
Object.assign(__splash.style, {
|
|
363
371
|
visibility: "hidden",
|
|
364
372
|
opacity: 0,
|
|
@@ -371,7 +379,8 @@ var Loader = (function () {
|
|
|
371
379
|
handleResize=null;
|
|
372
380
|
}, 500)
|
|
373
381
|
};
|
|
374
|
-
|
|
382
|
+
__loading.addEventListener("click", onClick);
|
|
383
|
+
__loading.addEventListener('touchend', onClick);
|
|
375
384
|
}
|
|
376
385
|
else {
|
|
377
386
|
// no start image.
|
|
@@ -428,11 +437,14 @@ var Loader = (function () {
|
|
|
428
437
|
__config = config;
|
|
429
438
|
|
|
430
439
|
const splash = document.querySelector("#splash__image");
|
|
440
|
+
const loading = document.querySelector("#loading__image");
|
|
431
441
|
const pr__root = document.querySelector("#progress__root");
|
|
432
442
|
const pr__line = document.querySelector("#progress__line");
|
|
433
443
|
|
|
434
444
|
__splash = splash;
|
|
445
|
+
__loading = loading;
|
|
435
446
|
__pr__root = pr__root;
|
|
447
|
+
__pr__line = pr__line;
|
|
436
448
|
|
|
437
449
|
const pr_conf = config.progress;
|
|
438
450
|
pr_conf.rect = pr_conf.rect || [0, 0.9, 1, 0.2];
|
|
@@ -442,6 +454,18 @@ var Loader = (function () {
|
|
|
442
454
|
visibility: "visible",
|
|
443
455
|
});
|
|
444
456
|
|
|
457
|
+
const ldg_conf = config.loading;
|
|
458
|
+
|
|
459
|
+
if (ldg_conf) {
|
|
460
|
+
Object.assign(loading.style, {
|
|
461
|
+
backgroundImage: `url(${ldg_conf.image})`,
|
|
462
|
+
left: `${100 * ldg_conf.rect[0]}%`,
|
|
463
|
+
top: `${100 * ldg_conf.rect[1]}%`,
|
|
464
|
+
width: `${100 * ldg_conf.rect[2]}%`,
|
|
465
|
+
height: `${100 * ldg_conf.rect[3]}%`,
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
|
|
445
469
|
Object.assign(pr__root.style, {
|
|
446
470
|
background: pr_conf.back,
|
|
447
471
|
left: `${100 * pr_conf.rect[0]}%`,
|