@wwawing/engine 3.8.0-alpha.2 → 3.8.0

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/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,10 +255,6 @@ export declare enum MacroType {
256
255
  VAR_MAP = 54,
257
256
  VAR_MOD = 55,
258
257
  NO_GAMEOVER = 56,
259
- ELSE_IF = 57,
260
- ELSE = 58,
261
- END_IF = 59,
262
- SET = 60,
263
258
  GAMEPAD_BUTTON = 100,
264
259
  OLDMOVE = 101
265
260
  }
@@ -319,10 +314,6 @@ export declare var macrotable: {
319
314
  $var_map: number;
320
315
  $var_mod: number;
321
316
  $no_gameover: number;
322
- $else_if: number;
323
- $else: number;
324
- $endif: number;
325
- $set: number;
326
317
  $gamepad_button: number;
327
318
  $oldmove: number;
328
319
  };
@@ -567,9 +558,4 @@ export declare enum IDTable {
567
558
  BITMASK = 65535
568
559
  }
569
560
  export declare type StatusSolutionKind = "all" | "bare" | "equipment";
570
- export declare type JsonRequestErrorKind = "brokenJson" | "httpError";
571
- export declare type UserVarNameListRequestErrorKind = JsonRequestErrorKind | "notObject" | "noFileSpecified";
572
- export declare type JsonRequestError<ErrorKind = JsonRequestErrorKind> = {
573
- kind: ErrorKind;
574
- detail: string;
575
- };
561
+ export declare type UserVarNameListRequestErrorKind = JsonResponseErrorKind | "notObject" | "noFileSpecified";
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, JsonRequestError } from "./wwa_data";
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";
@@ -50,7 +50,7 @@ export declare class WWA {
50
50
  private _lastMessage;
51
51
  private _frameCoord;
52
52
  private _battleEffectCoord;
53
- private _audioInstances;
53
+ private sounds;
54
54
  private _temporaryInputDisable;
55
55
  private _isLoadedSound;
56
56
  private _isSkippedSoundMessage;
@@ -92,7 +92,7 @@ export declare class WWA {
92
92
  private _setProgressBar;
93
93
  private _setLoadingMessage;
94
94
  private _setErrorMessage;
95
- createWWAAudioInstance(idx: number): void;
95
+ createSoundInstance(soundId: number): void;
96
96
  loadSound(): void;
97
97
  checkAllSoundLoaded(): void;
98
98
  private _setSoundLoadedCheckTimer;
@@ -270,11 +270,6 @@ export declare class WWA {
270
270
  setUserValRandNum(x: number, num: number, bias: number): void;
271
271
  private _generateUserValString;
272
272
  speedChangeJudge(speedChangeFlag: boolean): void;
273
- execIfMacro(macroStr?: string): void;
274
- execSetMacro(macroStr?: string): void;
275
- parseValue(str: string): number;
276
- checkCondition(macroStr: any): boolean;
277
- ifElseResetStatus(): void;
278
273
  userVarUserIf(_triggerPartsPosition: Coord, args: string[]): void;
279
274
  private compareUserVar;
280
275
  setPlayerSpeedIndex(speedIndex: number): void;
@@ -296,4 +291,3 @@ export declare class WWA {
296
291
  isCalledByMacro: boolean;
297
292
  }): boolean;
298
293
  }
299
- export declare const getJSONFile: (fileName: string, callback: (error: JsonRequestError, result: unknown) => void) => void;
@@ -22,7 +22,6 @@ 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
- isIFMacro(): boolean;
26
25
  execute(): void;
27
26
  private _concatEmptyArgs;
28
27
  private _parseInt;
@@ -52,9 +51,6 @@ export declare class Macro {
52
51
  private _executeVarSetRandMacro;
53
52
  private _executeGameSpeedMacro;
54
53
  private _executeIfMacro;
55
- private _executeIfElseMacro;
56
- private _executeElseMacro;
57
- private _executeEndIfMacro;
58
54
  private _executeSetSpeedMacro;
59
55
  private _executeCopyTimeToMacro;
60
56
  private _executeHideStatusMacro;
@@ -85,7 +81,6 @@ export declare class Macro {
85
81
  private _executeGamePadButtonMacro;
86
82
  private _executeOldMoveMacro;
87
83
  private _executeNoGameOverMacro;
88
- private _executeSetMacro;
89
84
  }
90
85
  export declare function parseMacro(wwa: WWA, partsID: number, partsType: PartsType, position: Coord, macroStr: string): Macro;
91
86
  export declare class TextWindow {
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wwawing/engine",
3
- "version": "3.8.0-alpha.2",
3
+ "version": "3.8.0",
4
4
  "description": "World Wide Adventure: an RPG Engine.",
5
5
  "main": "./lib/wwa.js",
6
6
  "files": [
@@ -45,13 +45,13 @@
45
45
  "@types/pug": "^2.0.4",
46
46
  "@types/terser-webpack-plugin": "^5.0.3",
47
47
  "@types/webpack": "^5.28.0",
48
- "@wwawing/assets": "^3.8.0-alpha.2",
49
- "@wwawing/common-interface": "^3.8.0-alpha.2",
50
- "@wwawing/debug-server": "^3.8.0-alpha.2",
51
- "@wwawing/event-emitter": "^3.8.0-alpha.2",
52
- "@wwawing/loader": "^3.8.0-alpha.2",
53
- "@wwawing/page-generator": "^3.8.0-alpha.2",
54
- "@wwawing/styles": "^3.8.0-alpha.2",
48
+ "@wwawing/assets": "^3.8.0",
49
+ "@wwawing/common-interface": "^3.8.0",
50
+ "@wwawing/debug-server": "^3.8.0",
51
+ "@wwawing/event-emitter": "^3.8.0",
52
+ "@wwawing/loader": "^3.8.0",
53
+ "@wwawing/page-generator": "^3.8.0",
54
+ "@wwawing/styles": "^3.8.0",
55
55
  "crypto-js": "4.0.0",
56
56
  "npm-run-all": "^4.1.5",
57
57
  "pug": "^3.0.2",
@@ -59,8 +59,8 @@
59
59
  "shx": "^0.3.3",
60
60
  "terser-webpack-plugin": "^5.3.0",
61
61
  "ts-loader": "^4.3.0",
62
- "ts-node": "^10.4.0",
63
- "typescript": "^4.5.4",
62
+ "ts-node": "^10.8.1",
63
+ "typescript": "^4.7.3",
64
64
  "webpack": "^5.65.0",
65
65
  "webpack-cli": "^4.9.1"
66
66
  },
@@ -71,5 +71,5 @@
71
71
  "node": ">=16",
72
72
  "npm": ">=8"
73
73
  },
74
- "gitHead": "992d9f5b020d04115551cb601abd5e3d93195efc"
74
+ "gitHead": "c652b5022ed532432f87b6b9011fcac0170e0999"
75
75
  }
@@ -1,9 +0,0 @@
1
- export default abstract class WWAAudio {
2
- protected idx: number;
3
- constructor(idx: number);
4
- play(): void;
5
- pause(): void;
6
- isBgm(): boolean;
7
- hasData(): boolean;
8
- isError(): boolean;
9
- }
@@ -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
- }
@@ -1,4 +0,0 @@
1
- import WWAAudio from './WWAAudio';
2
- import WWAAudioElement from './WWAAudioElement';
3
- import WWAWebAudio from './WWAWebAudio';
4
- export { WWAAudio, WWAAudioElement, WWAWebAudio };
@@ -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 {};