narrat 2.3.1 → 2.3.2

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🚀 Narrat
2
2
 
3
- ![example workflow](https://github.com/nialna/narrat/actions/workflows/main.yml/badge.svg)
3
+ ![example workflow](https://github.com/liana-p/narrat-engine/actions/workflows/main.yml/badge.svg)
4
4
 
5
5
  Narrat is a game engine for making interactive narrative RPGs packed with features.. Create your game by editing with a Simple scripting syntax. It supports Skills with skill check rolls, an Items inventory, and has a Quests System. The script system is very powerful and allows branching choices, functions, variables and conditions.
6
6
 
package/dist/app.vue.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  import { PropType } from 'vue';
2
- import { GameConfig } from './types/app-types';
3
- import { AppOptions } from './config';
2
+ import { AppOptions } from './types/app-types';
4
3
  declare const _default: import("vue").DefineComponent<{
5
- config: PropType<GameConfig>;
6
4
  options: PropType<AppOptions>;
7
5
  }, {
8
6
  dialog: import("vue").ComputedRef<{
@@ -88,7 +86,6 @@ declare const _default: import("vue").DefineComponent<{
88
86
  engineSplashDone(): void;
89
87
  updateScreenSize(): void;
90
88
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
91
- config: PropType<GameConfig>;
92
89
  options: PropType<AppOptions>;
93
90
  }>>, {}>;
94
91
  export default _default;
@@ -3,7 +3,9 @@ declare const _default: import("vue").DefineComponent<{
3
3
  }, unknown, unknown, {
4
4
  boxStyle(): any;
5
5
  layoutMode: () => "horizontal" | "vertical";
6
- }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
6
+ }, {
7
+ getAssetUrl(url: string): string;
8
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
9
  pictureUrl: StringConstructor;
8
10
  }>>, {}>;
9
11
  export default _default;
@@ -6,21 +6,49 @@ export interface ButtonConf {
6
6
  cssClass?: string;
7
7
  text: string;
8
8
  }
9
- declare const _default: import("vue").DefineComponent<{}, {}, {
10
- buttons: ButtonConf[];
11
- activeMenu: string | false;
12
- }, {
13
- buttonsToShow(): ButtonConf[];
14
- showSkills(): boolean;
15
- showInventory(): boolean;
16
- showQuests(): boolean;
17
- }, {
18
- buttonClick(button: ButtonConf): void;
19
- openMenu(): void;
20
- openSkills(): void;
21
- openInventory(): void;
22
- openQuests(): void;
23
- closeMenu(): void;
24
- toggleMenu(): void;
25
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
9
+ declare const _default: {
10
+ new (...args: any[]): {
11
+ $: import("vue").ComponentInternalInstance;
12
+ $data: {};
13
+ $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
14
+ $attrs: {
15
+ [x: string]: unknown;
16
+ };
17
+ $refs: {
18
+ [x: string]: unknown;
19
+ };
20
+ $slots: Readonly<{
21
+ [name: string]: import("vue").Slot | undefined;
22
+ }>;
23
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
24
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
25
+ $emit: ((event: string, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
26
+ $el: any;
27
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {}> & {
28
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
29
+ created?: ((() => void) | (() => void)[]) | undefined;
30
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
31
+ mounted?: ((() => void) | (() => void)[]) | undefined;
32
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
33
+ updated?: ((() => void) | (() => void)[]) | undefined;
34
+ activated?: ((() => void) | (() => void)[]) | undefined;
35
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
36
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
37
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
38
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
39
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
40
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
41
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
42
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
43
+ };
44
+ $forceUpdate: () => void;
45
+ $nextTick: typeof import("vue").nextTick;
46
+ $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
47
+ } & Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
48
+ __isFragment?: undefined;
49
+ __isTeleport?: undefined;
50
+ __isSuspense?: undefined;
51
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
52
+ $slots: {};
53
+ });
26
54
  export default _default;
@@ -1,4 +1,4 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, void, {
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {
2
2
  notifications: () => {
3
3
  [key: string]: import("../stores/notification-store").NotificationState;
4
4
  };
package/dist/config.d.ts CHANGED
@@ -4,17 +4,18 @@ export declare function getConfig(): Config;
4
4
  export declare function getSkillConfig(id: string): SkillData;
5
5
  export declare function getImageUrl(imageKeyOrUrl: string): string;
6
6
  export declare function getAssetUrl(assetPath: string): string;
7
+ export declare function getDataUrl(dataPath: string): string;
7
8
  export declare function getButtonConfig(button: string): ButtonConfig;
8
9
  export declare function getItemConfig(id: string): ItemData;
9
10
  export declare function getQuestConfig(questId: string): QuestData;
10
11
  export declare function getObjectiveConfig(quest: string, objectiveId: string): ObjectiveData;
11
- export interface AppOptions {
12
- baseAssetsPath?: string;
12
+ export interface AppOptionsDeprecated {
13
13
  logging: boolean;
14
14
  debug: boolean;
15
15
  }
16
16
  export interface Config {
17
17
  baseAssetsPath?: string;
18
+ baseDataPath?: string;
18
19
  gameTitle: string;
19
20
  images: {
20
21
  [key: string]: string;
@@ -36,6 +37,18 @@ export interface Config {
36
37
  gameFlow: {
37
38
  labelToJumpOnScriptEnd?: string;
38
39
  };
40
+ splashScreens: {
41
+ engineSplashScreen?: {
42
+ skip?: boolean;
43
+ fadeDuration?: number;
44
+ timeBeforeFadeout?: number;
45
+ overrideText?: string;
46
+ overrideLogo?: string;
47
+ };
48
+ gameSplashScreen?: {
49
+ startButtonText?: string;
50
+ };
51
+ };
39
52
  screens: {
40
53
  [key: string]: ScreenConfig;
41
54
  };
@@ -6,3 +6,5 @@ export declare const OK_SIGNAL = "###_--_~=:;_OK";
6
6
  export declare const STOP_SIGNAL = "###_--_~=:;_STOP";
7
7
  export declare type ReturnSignal = typeof JUMP_SIGNAL | typeof RETURN_SIGNAL | typeof OK_SIGNAL | typeof STOP_SIGNAL;
8
8
  export declare function isReturnSignal(s: string): s is ReturnSignal;
9
+ export declare const VERSION: string;
10
+ export declare const BUILD_DATE: Date;
@@ -0,0 +1,2 @@
1
+ import ModalWindow from '../components/utils/modal-window.vue';
2
+ export { ModalWindow };
@@ -0,0 +1 @@
1
+ export { inputEvents } from '../utils/InputsListener';
@@ -0,0 +1 @@
1
+ export { registerMenuButton } from '../menu-buttons/menu-buttons';
@@ -1,8 +1,25 @@
1
1
  import { NarratPlugin } from '../plugins/NarratPlugin';
2
2
  import { CommandPlugin, generateParser } from '../vm/commands/command-plugin';
3
3
  import type { CommandRunner } from '../vm/commands/command-plugin';
4
+ import { StoreDefinition } from 'pinia';
5
+ import { MenuButtonState } from '../stores/menu-store';
4
6
  export declare type NarratLifecycleHook = <T extends [...any[]]>(...args: T) => void;
5
- declare type NarratPluginObject<T> = {
7
+ export interface NarratCustomStoreActions {
8
+ save?: () => any;
9
+ load?: (data: any) => void;
10
+ setup?: () => Promise<void>;
11
+ start?: () => void;
12
+ reset: () => void;
13
+ }
14
+ export declare type UseCustomStore = StoreDefinition<string, any, any, NarratCustomStoreActions>;
15
+ export interface CustomStores {
16
+ [key: string]: UseCustomStore;
17
+ }
18
+ export interface CustomMenuButton {
19
+ config: MenuButtonState;
20
+ component: any;
21
+ }
22
+ export declare type NarratPluginObject<T> = {
6
23
  onPageLoaded?: NarratLifecycleHook;
7
24
  onNarratSetup?: NarratLifecycleHook;
8
25
  onAppMounted?: NarratLifecycleHook;
@@ -12,9 +29,10 @@ declare type NarratPluginObject<T> = {
12
29
  onGameMounted?: NarratLifecycleHook;
13
30
  onGameUnmounted?: NarratLifecycleHook;
14
31
  customCommands?: CommandPlugin<T>[];
32
+ customStores?: CustomStores;
33
+ customMenuButtons?: CustomMenuButton[];
15
34
  };
16
35
  declare function registerPlugin<T>(plugin: NarratPluginObject<T>): void;
17
36
  declare function addCommand<T>(command: CommandPlugin<T>): void;
18
37
  export { CommandRunner };
19
38
  export { CommandPlugin, NarratPlugin, registerPlugin, addCommand, generateParser, };
20
- export type { NarratPluginObject };
@@ -0,0 +1,11 @@
1
+ export { useMain } from '../stores/main-store';
2
+ export { useAudio } from '../stores/audio-store';
3
+ export { useDialogStore } from '../stores/dialog-store';
4
+ export { useHud } from '../stores/hud-stats-store';
5
+ export { useInventory } from '../stores/inventory-store';
6
+ export { useNotifications } from '../stores/notification-store';
7
+ export { useQuests } from '../stores/quest-log';
8
+ export { useRenderingStore } from '../stores/rendering-store';
9
+ export { useScreens } from '../stores/screens-store';
10
+ export { useSkills } from '../stores/skills';
11
+ export { useVM } from '../stores/vm-store';
package/dist/lib.d.ts CHANGED
@@ -12,3 +12,7 @@ declare global {
12
12
  export * from './exports/plugins';
13
13
  export * from './exports/display';
14
14
  export * from './exports/config';
15
+ export * from './exports/events';
16
+ export * from './exports/stores';
17
+ export * from './exports/others';
18
+ export * from './exports/components';
package/dist/main.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import 'es6-promise/auto';
2
2
  import 'virtual:windi.css';
3
3
  import './css/main.css';
4
- import { GameConfig } from './types/app-types';
5
- import { AppOptions } from './config';
6
- export declare function startApp(config: GameConfig, options: AppOptions): Promise<void>;
4
+ import { AppOptionsInput } from './types/app-types';
5
+ import { AppOptionsDeprecated } from './config';
6
+ export declare function startApp(optionsInput: AppOptionsInput, optionsOld?: AppOptionsDeprecated): Promise<any>;
7
+ export declare function registerComponent(name: string, component: any): void;
@@ -0,0 +1,4 @@
1
+ import { MenuButtonState } from '../stores/menu-store';
2
+ export declare function registerDefaultMenuButtons(app: any): void;
3
+ export declare function registerMenuButton(config: MenuButtonState, component: any): void;
4
+ export declare function addMenuButtonsFromPlugins(): void;