@wwawing/loader 4.0.0 → 4.0.3
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/LICENSE +2 -2
- package/lib/core/map-data-client/NodeLocalMapDataClient.js +2 -2
- package/lib/core/text-loader/index.js +5 -1
- package/lib/infra/index.js +3 -0
- package/module/core/map-data-client/NodeLocalMapDataClient.js +1 -1
- package/module/core/text-loader/index.js +5 -1
- package/module/infra/index.js +3 -0
- package/package.json +11 -15
package/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 1996-
|
|
4
|
-
Copyright (c) 2015-
|
|
3
|
+
Copyright (c) 1996-2026 NAO
|
|
4
|
+
Copyright (c) 2015-2026 WWA Wing Team
|
|
5
5
|
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
7
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.NodeLocalMapDataClient = void 0;
|
|
7
|
-
const
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const BaseMapDataClient_1 = require("./BaseMapDataClient");
|
|
9
9
|
class NodeLocalMapDataClient extends BaseMapDataClient_1.BaseMapDataClient {
|
|
10
10
|
constructor(fileName) {
|
|
@@ -13,7 +13,7 @@ class NodeLocalMapDataClient extends BaseMapDataClient_1.BaseMapDataClient {
|
|
|
13
13
|
}
|
|
14
14
|
async request() {
|
|
15
15
|
return new Promise((resolve, reject) => {
|
|
16
|
-
|
|
16
|
+
node_fs_1.default.readFile(this.fileName, (error, data) => {
|
|
17
17
|
if (error) {
|
|
18
18
|
reject(error);
|
|
19
19
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TextLoader = void 0;
|
|
4
4
|
const infra_1 = require("../../infra");
|
|
5
|
+
const common_interface_1 = require("@wwawing/common-interface");
|
|
5
6
|
class TextLoader {
|
|
6
7
|
constructor(wwaData, compressedMapData, startPosition, eventEmitter) {
|
|
7
8
|
this.wwaData = wwaData;
|
|
@@ -117,7 +118,7 @@ class TextLoader {
|
|
|
117
118
|
wwaData.gameSpeedIndex = infra_1.WWAConsts.DEFAULT_SPEED_INDEX;
|
|
118
119
|
wwaData.permitChangeGameSpeed = true;
|
|
119
120
|
wwaData.userVar = Array.from({ length: infra_1.WWAConsts.USER_VAR_NUM }).map(() => 0);
|
|
120
|
-
wwaData.userNamedVar =
|
|
121
|
+
wwaData.userNamedVar = new Map();
|
|
121
122
|
wwaData.playTime = 0;
|
|
122
123
|
wwaData.isVisibleStatusEnergy = true;
|
|
123
124
|
wwaData.isVisibleStatusStrength = true;
|
|
@@ -125,6 +126,9 @@ class TextLoader {
|
|
|
125
126
|
wwaData.isVisibleStatusGold = true;
|
|
126
127
|
wwaData.gameOverPolicy = "default";
|
|
127
128
|
wwaData.bgmDelayDurationMs = 0;
|
|
129
|
+
wwaData.pictureRegistry = [];
|
|
130
|
+
wwaData.decisionSound = common_interface_1.SystemSound.DECISION;
|
|
131
|
+
wwaData.attackSound = common_interface_1.SystemSound.ATTACK;
|
|
128
132
|
return wwaData;
|
|
129
133
|
}
|
|
130
134
|
getMessageFromData() {
|
package/lib/infra/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LoadStage, WWAConsts } from "../../infra";
|
|
2
|
+
import { SystemSound } from "@wwawing/common-interface";
|
|
2
3
|
export class TextLoader {
|
|
3
4
|
constructor(wwaData, compressedMapData, startPosition, eventEmitter) {
|
|
4
5
|
this.wwaData = wwaData;
|
|
@@ -114,7 +115,7 @@ export class TextLoader {
|
|
|
114
115
|
wwaData.gameSpeedIndex = WWAConsts.DEFAULT_SPEED_INDEX;
|
|
115
116
|
wwaData.permitChangeGameSpeed = true;
|
|
116
117
|
wwaData.userVar = Array.from({ length: WWAConsts.USER_VAR_NUM }).map(() => 0);
|
|
117
|
-
wwaData.userNamedVar =
|
|
118
|
+
wwaData.userNamedVar = new Map();
|
|
118
119
|
wwaData.playTime = 0;
|
|
119
120
|
wwaData.isVisibleStatusEnergy = true;
|
|
120
121
|
wwaData.isVisibleStatusStrength = true;
|
|
@@ -122,6 +123,9 @@ export class TextLoader {
|
|
|
122
123
|
wwaData.isVisibleStatusGold = true;
|
|
123
124
|
wwaData.gameOverPolicy = "default";
|
|
124
125
|
wwaData.bgmDelayDurationMs = 0;
|
|
126
|
+
wwaData.pictureRegistry = [];
|
|
127
|
+
wwaData.decisionSound = SystemSound.DECISION;
|
|
128
|
+
wwaData.attackSound = SystemSound.ATTACK;
|
|
125
129
|
return wwaData;
|
|
126
130
|
}
|
|
127
131
|
getMessageFromData() {
|
package/module/infra/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wwawing/loader",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"description": "a World Wide Adventure mapdata loader for client-side web applications",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./module/index.js",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"build:lib": "npm run clean:lib && tsc -p .",
|
|
19
19
|
"build:module": "npm run clean:module && tsc -p ./tsconfig.module.json",
|
|
20
20
|
"start": "run-s start:browser",
|
|
21
|
-
"start:browser": "
|
|
21
|
+
"start:browser": "vite",
|
|
22
22
|
"start:node": "run-s debug:build:node debug:start:node",
|
|
23
23
|
"debug:build": "run-p debug:build:*",
|
|
24
|
-
"debug:build:browser": "run-s clean:debug:browser &&
|
|
24
|
+
"debug:build:browser": "run-s clean:debug:browser && vite build && shx cp ./src/___debug-resources___/wwamap.dat ./debug/browser",
|
|
25
25
|
"debug:build:node": "run-s clean:debug:node && tsc -p tsconfig-debug-for-node.json && shx cp ./src/___debug-resources___/wwamap.dat ./debug/node/___debug-resources___/",
|
|
26
26
|
"debug:start:browser": "http-server ./debug/browser -o",
|
|
27
27
|
"debug:start:node": "node ./debug/node/___debug-resources___/demo-node.js",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"clean:debug": "shx rm -rf debug",
|
|
32
32
|
"clean:debug:browser": "shx rm -rf debug/browser",
|
|
33
33
|
"clean:debug:node": "shx rm -rf debug/node",
|
|
34
|
-
"test": "echo \"no test specified\""
|
|
34
|
+
"test": "echo \"no test specified\"",
|
|
35
|
+
"type-check": "tsc -p . --watch --noEmit"
|
|
35
36
|
},
|
|
36
37
|
"repository": {
|
|
37
38
|
"type": "git",
|
|
@@ -45,29 +46,24 @@
|
|
|
45
46
|
},
|
|
46
47
|
"homepage": "https://github.com/WWAWing/WWALoader#readme",
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@wwawing/event-emitter": "^4.0.
|
|
49
|
+
"@wwawing/event-emitter": "^4.0.3"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"@wwawing/common-interface": "^4.0.
|
|
52
|
-
"cross-env": "^7.0.3",
|
|
53
|
-
"html-loader": "^5.1.0",
|
|
54
|
-
"html-webpack-plugin": "^5.5.0",
|
|
52
|
+
"@wwawing/common-interface": "^4.0.3",
|
|
55
53
|
"http-server": "^14.1.1",
|
|
56
54
|
"npm-run-all2": "^8.0.1",
|
|
57
|
-
"shelljs": "^0.
|
|
55
|
+
"shelljs": "^0.10.0",
|
|
58
56
|
"shx": "^0.4.0",
|
|
59
|
-
"ts-loader": "^9.5.2",
|
|
60
57
|
"ts-node": "^10.9.2",
|
|
61
58
|
"typescript": "^5.8.3",
|
|
62
|
-
"
|
|
63
|
-
"webpack-cli": "^5.1.1"
|
|
59
|
+
"vite": "^8.0.8"
|
|
64
60
|
},
|
|
65
61
|
"publishConfig": {
|
|
66
62
|
"access": "public"
|
|
67
63
|
},
|
|
68
64
|
"engines": {
|
|
69
|
-
"node": ">=
|
|
65
|
+
"node": ">=24",
|
|
70
66
|
"npm": ">=11"
|
|
71
67
|
},
|
|
72
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "c72197df927c7f0c6e16e70c9f13384567350772"
|
|
73
69
|
}
|