@wwawing/engine 3.9.0-beta.0 → 3.9.0-beta.1
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/debug/make-debug-pages.ts +5 -0
- package/lib/json_api_client/index.d.ts +12 -0
- package/lib/wwa.js +3 -3
- package/lib/wwa_data.d.ts +11 -8
- package/lib/wwa_main.d.ts +9 -5
- package/lib/wwa_message.d.ts +5 -0
- package/lib/wwa_password_window.d.ts +2 -0
- package/lib/wwa_save/WWASaveDataDBList.d.ts +0 -3
- package/lib/wwa_sound.d.ts +24 -0
- package/lib/wwa_symbol_parser/index.d.ts +5 -0
- package/lib/wwa_symbol_parser/parsers.d.ts +14 -0
- package/lib/wwa_symbol_parser/value-assign-operation.d.ts +5 -0
- package/package.json +22 -22
- package/lib/wwa_audio/WWAAudio.d.ts +0 -9
- package/lib/wwa_audio/WWAAudioElement.d.ts +0 -13
- package/lib/wwa_audio/WWAWebAudio.d.ts +0 -18
- package/lib/wwa_audio/index.d.ts +0 -4
- package/lib/wwa_save/WWASaveDataDBListForIE.d.ts +0 -20
package/lib/wwa_data.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { WWA } from "./wwa_main";
|
|
|
2
2
|
import { Camera } from "./wwa_camera";
|
|
3
3
|
import { KeyCode } from "./wwa_input";
|
|
4
4
|
import { WWAData } from "@wwawing/common-interface";
|
|
5
|
+
import type { JsonResponseErrorKind } from "./json_api_client";
|
|
5
6
|
export { WWAData };
|
|
6
7
|
export declare class EquipmentStatus {
|
|
7
8
|
strength: number;
|
|
@@ -142,8 +143,6 @@ export declare enum BROWSER_TYPE {
|
|
|
142
143
|
CHROME = 1,
|
|
143
144
|
FIREFOX = 2,
|
|
144
145
|
SAFARI = 3,
|
|
145
|
-
EDGE = 4,
|
|
146
|
-
INTERNET_EXPLORER = 5,
|
|
147
146
|
OTHERS = 9999
|
|
148
147
|
}
|
|
149
148
|
export declare enum ChoiceCallInfo {
|
|
@@ -256,6 +255,10 @@ export declare enum MacroType {
|
|
|
256
255
|
VAR_MAP = 54,
|
|
257
256
|
VAR_MOD = 55,
|
|
258
257
|
NO_GAMEOVER = 56,
|
|
258
|
+
ELSE_IF = 57,
|
|
259
|
+
ELSE = 58,
|
|
260
|
+
END_IF = 59,
|
|
261
|
+
SET = 60,
|
|
259
262
|
GAMEPAD_BUTTON = 100,
|
|
260
263
|
OLDMOVE = 101
|
|
261
264
|
}
|
|
@@ -315,6 +318,10 @@ export declare var macrotable: {
|
|
|
315
318
|
$var_map: number;
|
|
316
319
|
$var_mod: number;
|
|
317
320
|
$no_gameover: number;
|
|
321
|
+
$else_if: number;
|
|
322
|
+
$else: number;
|
|
323
|
+
$endif: number;
|
|
324
|
+
$set: number;
|
|
318
325
|
$gamepad_button: number;
|
|
319
326
|
$oldmove: number;
|
|
320
327
|
};
|
|
@@ -559,9 +566,5 @@ export declare enum IDTable {
|
|
|
559
566
|
BITMASK = 65535
|
|
560
567
|
}
|
|
561
568
|
export declare type StatusSolutionKind = "all" | "bare" | "equipment";
|
|
562
|
-
export declare type
|
|
563
|
-
export declare type
|
|
564
|
-
export declare type JsonRequestError<ErrorKind = JsonRequestErrorKind> = {
|
|
565
|
-
kind: ErrorKind;
|
|
566
|
-
detail: string;
|
|
567
|
-
};
|
|
569
|
+
export declare type UserVarNameListRequestErrorKind = JsonResponseErrorKind | "notObject" | "noFileSpecified";
|
|
570
|
+
export declare type ConditionalMacroExecStatus = "outside-ifelse" | "can-execute" | "cannot-execute" | "executed";
|
package/lib/wwa_main.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Coord, Position, LoaderProgress, LoadStage, YesNoState, Face, SidebarButton, SpeedChange, PartsType, AppearanceTriggerType, EquipmentStatus, ChangeStyleType, MacroStatusIndex, UserDevice, MacroImgFrameIndex, StatusKind, StatusSolutionKind
|
|
1
|
+
import { Coord, Position, LoaderProgress, LoadStage, YesNoState, Face, SidebarButton, SpeedChange, PartsType, AppearanceTriggerType, EquipmentStatus, ChangeStyleType, MacroStatusIndex, UserDevice, MacroImgFrameIndex, StatusKind, StatusSolutionKind } from "./wwa_data";
|
|
2
2
|
import { MessageWindow, ParsedMessage } from "./wwa_message";
|
|
3
3
|
import { ItemMenu } from "./wwa_item_menu";
|
|
4
4
|
import { WWACompress } from "./wwa_save";
|
|
@@ -52,7 +52,7 @@ export declare class WWA {
|
|
|
52
52
|
private _lastMessage;
|
|
53
53
|
private _frameCoord;
|
|
54
54
|
private _battleEffectCoord;
|
|
55
|
-
private
|
|
55
|
+
private sounds;
|
|
56
56
|
private _temporaryInputDisable;
|
|
57
57
|
private _isLoadedSound;
|
|
58
58
|
private _isSkippedSoundMessage;
|
|
@@ -80,6 +80,7 @@ export declare class WWA {
|
|
|
80
80
|
private _mapObjectIDTable;
|
|
81
81
|
wwaCustomEventEmitter: IEventEmitter;
|
|
82
82
|
private _scoreRates?;
|
|
83
|
+
private _conditionalMacroExecStatus;
|
|
83
84
|
debug: boolean;
|
|
84
85
|
private hoge;
|
|
85
86
|
private _loadHandler;
|
|
@@ -90,12 +91,12 @@ export declare class WWA {
|
|
|
90
91
|
private soundLoadedCheckTimer;
|
|
91
92
|
private _startTime;
|
|
92
93
|
private _dumpElement;
|
|
93
|
-
constructor(mapFileName: string, urlgateEnabled: boolean, titleImgName: string, classicModeEnabled: boolean, itemEffectEnabled: boolean, useGoToWWA: boolean, audioDirectory: string, disallowLoadOldSave: boolean, dumpElm: HTMLElement, userVarNamesFile: string | null, canDisplayUserVars: boolean);
|
|
94
|
+
constructor(mapFileName: string, urlgateEnabled: boolean, titleImgName: string, classicModeEnabled: boolean, itemEffectEnabled: boolean, useGoToWWA: boolean, audioDirectory: string, disallowLoadOldSave: boolean, dumpElm: HTMLElement, userVarNamesFile: string | null, canDisplayUserVars: boolean, enableVirtualPad?: boolean, virtualpadControllerElm?: HTMLElement);
|
|
94
95
|
private convertUserVariableNameListToArray;
|
|
95
96
|
private _setProgressBar;
|
|
96
97
|
private _setLoadingMessage;
|
|
97
98
|
private _setErrorMessage;
|
|
98
|
-
|
|
99
|
+
createSoundInstance(soundId: number): void;
|
|
99
100
|
loadSound(): void;
|
|
100
101
|
checkAllSoundLoaded(): void;
|
|
101
102
|
private _setSoundLoadedCheckTimer;
|
|
@@ -273,6 +274,10 @@ export declare class WWA {
|
|
|
273
274
|
setUserValRandNum(x: number, num: number, bias: number): void;
|
|
274
275
|
private _generateUserValString;
|
|
275
276
|
speedChangeJudge(speedChangeFlag: boolean): void;
|
|
277
|
+
switchConditionalExecutionStatus(descriminant?: string): void;
|
|
278
|
+
execSetMacro(macroStr?: string): void;
|
|
279
|
+
private _generateTokenValues;
|
|
280
|
+
resetConditionalMacroExecStaus(): void;
|
|
276
281
|
userVarUserIf(_triggerPartsPosition: Coord, args: string[]): void;
|
|
277
282
|
private compareUserVar;
|
|
278
283
|
setPlayerSpeedIndex(speedIndex: number): void;
|
|
@@ -297,4 +302,3 @@ export declare class WWA {
|
|
|
297
302
|
isCalledByMacro: boolean;
|
|
298
303
|
}): boolean;
|
|
299
304
|
}
|
|
300
|
-
export declare const getJSONFile: (fileName: string, callback: (error: JsonRequestError, result: unknown) => void) => void;
|
package/lib/wwa_message.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare class Macro {
|
|
|
22
22
|
macroType: MacroType;
|
|
23
23
|
macroArgs: string[];
|
|
24
24
|
constructor(_wwa: WWA, _triggerPartsID: number, _triggerPartsType: number, _triggerPartsPosition: Coord, macroType: MacroType, macroArgs: string[]);
|
|
25
|
+
isJunction(): boolean;
|
|
25
26
|
execute(): void;
|
|
26
27
|
private _concatEmptyArgs;
|
|
27
28
|
private _parseInt;
|
|
@@ -51,6 +52,9 @@ export declare class Macro {
|
|
|
51
52
|
private _executeVarSetRandMacro;
|
|
52
53
|
private _executeGameSpeedMacro;
|
|
53
54
|
private _executeIfMacro;
|
|
55
|
+
private _executeIfElseMacro;
|
|
56
|
+
private _executeElseMacro;
|
|
57
|
+
private _executeEndIfMacro;
|
|
54
58
|
private _executeSetSpeedMacro;
|
|
55
59
|
private _executeCopyTimeToMacro;
|
|
56
60
|
private _executeHideStatusMacro;
|
|
@@ -81,6 +85,7 @@ export declare class Macro {
|
|
|
81
85
|
private _executeGamePadButtonMacro;
|
|
82
86
|
private _executeOldMoveMacro;
|
|
83
87
|
private _executeNoGameOverMacro;
|
|
88
|
+
private _executeSetMacro;
|
|
84
89
|
}
|
|
85
90
|
export declare function parseMacro(wwa: WWA, partsID: number, partsType: PartsType, position: Coord, macroStr: string): Macro;
|
|
86
91
|
export declare class TextWindow {
|
|
@@ -7,9 +7,11 @@ export declare class PasswordWindow {
|
|
|
7
7
|
private _wwa;
|
|
8
8
|
private _parent;
|
|
9
9
|
private _isDisallowLoadOldSave;
|
|
10
|
+
private readonly COPIED_MESSAGE_DISPLAY_MS;
|
|
10
11
|
private _element;
|
|
11
12
|
private _okButtonElement;
|
|
12
13
|
private _cancelButtonElement;
|
|
14
|
+
private _copyButtonElement;
|
|
13
15
|
private _descriptionElement;
|
|
14
16
|
private _passwordBoxElement;
|
|
15
17
|
private _buttonWrapperElement;
|
|
@@ -13,15 +13,12 @@ declare type WWASaveDataItem = {
|
|
|
13
13
|
};
|
|
14
14
|
export default class WWASaveDataDBList extends WWASaveDataList {
|
|
15
15
|
private selectDatas;
|
|
16
|
-
private selectLoad;
|
|
17
|
-
private indexedDB;
|
|
18
16
|
private IDBTransaction;
|
|
19
17
|
private onCheckLoadingSaveData;
|
|
20
18
|
private onCompleteLoadingSaveData;
|
|
21
19
|
private static doNotAnything;
|
|
22
20
|
protected keyPath: string | string[];
|
|
23
21
|
constructor(onCheckLoadingSaveData: OnCheckLoadingSaveDataFunction, onCompleteLoadingSaveData: OnCompleteLoadingSaveDataFunction, prototype?: WWASaveDataDBList);
|
|
24
|
-
private getAlEmulate;
|
|
25
22
|
private indexDBOpen;
|
|
26
23
|
private createDataBase;
|
|
27
24
|
private getObjectStore;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare class Sound {
|
|
2
|
+
private id;
|
|
3
|
+
private fileName;
|
|
4
|
+
private audioContext;
|
|
5
|
+
private audioGain;
|
|
6
|
+
private audioBuffer;
|
|
7
|
+
private bufferSources;
|
|
8
|
+
private isLoaded;
|
|
9
|
+
private isExceededMaxRetryCount?;
|
|
10
|
+
constructor(id: number, fileName: string, audioContext: AudioContext, audioGain: GainNode);
|
|
11
|
+
private fetchSoundFile;
|
|
12
|
+
private getArrayBuffer;
|
|
13
|
+
private load;
|
|
14
|
+
private retry;
|
|
15
|
+
private setData;
|
|
16
|
+
private cancelLoad;
|
|
17
|
+
play(): void;
|
|
18
|
+
pause(): void;
|
|
19
|
+
isBgm(): boolean;
|
|
20
|
+
hasData(): boolean;
|
|
21
|
+
isLoading(): boolean;
|
|
22
|
+
isError(): boolean;
|
|
23
|
+
private disposeBufferSource;
|
|
24
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type TokenValues } from "./parsers";
|
|
2
|
+
import { type ValueAssignOperation } from "./value-assign-operation";
|
|
3
|
+
export { TokenValues, ValueAssignOperation };
|
|
4
|
+
export declare function parseSetMacroExpression(macroStr: string, tokenValues: TokenValues): ValueAssignOperation;
|
|
5
|
+
export declare function checkCondition(descriminant: string, tokenValues: TokenValues): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Status } from "../wwa_data";
|
|
2
|
+
export interface TokenValues {
|
|
3
|
+
status: Status;
|
|
4
|
+
energyMax: number;
|
|
5
|
+
moveCount: number;
|
|
6
|
+
playTime: number;
|
|
7
|
+
userVars: number[];
|
|
8
|
+
}
|
|
9
|
+
export declare type SetMacroType = 'VARIABLE' | 'NUMBER' | 'HP' | 'HPMAX' | 'AT' | 'DF' | 'GD' | 'TIME' | 'STEP' | 'RAND';
|
|
10
|
+
export declare function calc(operator: string, leftValue: number, rightValue: number): number;
|
|
11
|
+
export declare function parseType(str: string): SetMacroType | null;
|
|
12
|
+
export declare function parseValue(value: string, tokenValues: TokenValues): number;
|
|
13
|
+
export declare function parseVariable(value: string, tokenValues: TokenValues): number;
|
|
14
|
+
export declare function parseNumber(value: string): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wwawing/engine",
|
|
3
|
-
"version": "3.9.0-beta.
|
|
3
|
+
"version": "3.9.0-beta.1",
|
|
4
4
|
"description": "World Wide Adventure: an RPG Engine.",
|
|
5
5
|
"main": "./lib/wwa.js",
|
|
6
6
|
"files": [
|
|
@@ -41,29 +41,29 @@
|
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://github.com/WWAWing/WWAWing#readme",
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@types/crypto-js": "^4.
|
|
45
|
-
"@types/pug": "^2.0.
|
|
46
|
-
"@types/terser-webpack-plugin": "^5.0
|
|
44
|
+
"@types/crypto-js": "^4.1.1",
|
|
45
|
+
"@types/pug": "^2.0.6",
|
|
46
|
+
"@types/terser-webpack-plugin": "^5.2.0",
|
|
47
47
|
"@types/webpack": "^5.28.0",
|
|
48
|
-
"@wwawing/assets": "^3.9.0-beta.
|
|
49
|
-
"@wwawing/common-interface": "^3.9.0-beta.
|
|
50
|
-
"@wwawing/debug-server": "^3.9.0-beta.
|
|
51
|
-
"@wwawing/event-emitter": "^3.9.0-beta.
|
|
52
|
-
"@wwawing/loader": "^3.9.0-beta.
|
|
53
|
-
"@wwawing/page-generator": "^3.9.0-beta.
|
|
54
|
-
"@wwawing/styles": "^3.9.0-beta.
|
|
55
|
-
"@wwawing/virtual-pad": "^3.9.0-beta.
|
|
56
|
-
"crypto-js": "4.
|
|
48
|
+
"@wwawing/assets": "^3.9.0-beta.1",
|
|
49
|
+
"@wwawing/common-interface": "^3.9.0-beta.1",
|
|
50
|
+
"@wwawing/debug-server": "^3.9.0-beta.1",
|
|
51
|
+
"@wwawing/event-emitter": "^3.9.0-beta.1",
|
|
52
|
+
"@wwawing/loader": "^3.9.0-beta.1",
|
|
53
|
+
"@wwawing/page-generator": "^3.9.0-beta.1",
|
|
54
|
+
"@wwawing/styles": "^3.9.0-beta.1",
|
|
55
|
+
"@wwawing/virtual-pad": "^3.9.0-beta.1",
|
|
56
|
+
"crypto-js": "^4.1.1",
|
|
57
57
|
"npm-run-all": "^4.1.5",
|
|
58
58
|
"pug": "^3.0.2",
|
|
59
|
-
"shelljs": "^0.8.
|
|
60
|
-
"shx": "^0.3.
|
|
61
|
-
"terser-webpack-plugin": "^5.3.
|
|
62
|
-
"ts-loader": "^
|
|
63
|
-
"ts-node": "^10.
|
|
64
|
-
"typescript": "^4.
|
|
65
|
-
"webpack": "^5.
|
|
66
|
-
"webpack-cli": "^4.
|
|
59
|
+
"shelljs": "^0.8.5",
|
|
60
|
+
"shx": "^0.3.4",
|
|
61
|
+
"terser-webpack-plugin": "^5.3.3",
|
|
62
|
+
"ts-loader": "^9.3.0",
|
|
63
|
+
"ts-node": "^10.8.1",
|
|
64
|
+
"typescript": "^4.7.3",
|
|
65
|
+
"webpack": "^5.73.0",
|
|
66
|
+
"webpack-cli": "^4.10.0"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"node": ">=16",
|
|
73
73
|
"npm": ">=8"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "afa09088a3983d144a072dfae45751d0b6c8aad4"
|
|
76
76
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import WWAAudio from './WWAAudio';
|
|
2
|
-
export default class WWAAudioElement extends WWAAudio {
|
|
3
|
-
private _mainElement;
|
|
4
|
-
private _subElement;
|
|
5
|
-
private _currentElement;
|
|
6
|
-
private _nextIsSub;
|
|
7
|
-
constructor(idx: number, file: string, parentNode: Node);
|
|
8
|
-
private _createElement;
|
|
9
|
-
play(): void;
|
|
10
|
-
pause(): void;
|
|
11
|
-
hasData(): boolean;
|
|
12
|
-
isError(): boolean;
|
|
13
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import WWAAudio from './WWAAudio';
|
|
2
|
-
export default class WWAWebAudio extends WWAAudio {
|
|
3
|
-
private audioContext;
|
|
4
|
-
private audioGain;
|
|
5
|
-
private audioBuffer;
|
|
6
|
-
private bufferSources;
|
|
7
|
-
private isLoaded;
|
|
8
|
-
private pos;
|
|
9
|
-
constructor(idx: number, file: string, audioContext: AudioContext, audioGain: GainNode);
|
|
10
|
-
private _load;
|
|
11
|
-
private _setData;
|
|
12
|
-
private _cancelLoad;
|
|
13
|
-
play(): void;
|
|
14
|
-
pause(): void;
|
|
15
|
-
hasData(): boolean;
|
|
16
|
-
isLoading(): boolean;
|
|
17
|
-
isError(): boolean;
|
|
18
|
-
}
|
package/lib/wwa_audio/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import WWASaveDataDBList from "./WWASaveDataDBList";
|
|
2
|
-
import { OnCompleteLoadingSaveDataFunction, OnCheckLoadingSaveDataFunction } from ".";
|
|
3
|
-
declare type WWASaveDataItem = {
|
|
4
|
-
url?: string;
|
|
5
|
-
id: number;
|
|
6
|
-
hash: string;
|
|
7
|
-
image: string;
|
|
8
|
-
data: object;
|
|
9
|
-
date: Date;
|
|
10
|
-
worldName: string;
|
|
11
|
-
urlWithId: string;
|
|
12
|
-
mapDataRevisionKey: string;
|
|
13
|
-
};
|
|
14
|
-
export default class WWASaveDataDBListForIE extends WWASaveDataDBList {
|
|
15
|
-
constructor(onCheckLoadingSaveData: OnCheckLoadingSaveDataFunction, onCompleteLoadingSaveData: OnCompleteLoadingSaveDataFunction);
|
|
16
|
-
protected keyPath: string;
|
|
17
|
-
protected makeSaveDataItem(saveID: number, gameCvs: HTMLCanvasElement, compressedData: object, date: Date): WWASaveDataItem;
|
|
18
|
-
protected getSaveDataResult(store: IDBObjectStore, onsuccess: (result: WWASaveDataItem[]) => void): void;
|
|
19
|
-
}
|
|
20
|
-
export {};
|