create-pixi-vn 2.0.2 → 2.0.4
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/index.js +1 -1
- package/package.json +5 -4
- package/template-react-vite-muijoy/package-lock.json +4 -4
- package/template-react-vite-muijoy/package.json +1 -1
- package/template-react-vite-muijoy/src/assets/ink-manifest.gen.json +1 -0
- package/template-react-vite-muijoy/src/components/menus/main-menu.tsx +1 -2
- package/template-react-vite-muijoy/src/components/menus/save-menu/save-slots.tsx +2 -2
- package/template-react-vite-muijoy/src/components/scrrens/narration/narration-cards.tsx +1 -1
- package/template-react-vite-muijoy/src/components/ui/image.tsx +7 -38
- package/template-react-vite-muijoy/src/content/labels/start.label.ts +2 -4
- package/template-react-vite-muijoy/src/pixi-vn-keys.gen.d.ts +20 -0
- package/template-react-vite-muijoy/vite.config.ts +1 -0
- package/template-react-vite-muijoy-ink/package-lock.json +3 -3
- package/template-react-vite-muijoy-ink/package.json +2 -2
- package/template-react-vite-muijoy-ink/src/components/menus/save-menu/save-slots.tsx +2 -2
- package/template-react-vite-muijoy-ink/src/components/scrrens/narration/narration-cards.tsx +1 -1
- package/template-react-vite-muijoy-ink/src/components/ui/image.tsx +7 -38
- package/template-react-vite-muijoy-ink/src/pixi-vn-keys.gen.d.ts +22 -0
- package/template-react-vite-muijoy-ink/vite.config.ts +1 -0
- package/template-react-vite-muijoy-ink-tauri/package-lock.json +3 -3
- package/template-react-vite-muijoy-ink-tauri/package.json +2 -2
- package/template-react-vite-muijoy-ink-tauri/src/components/menus/save-menu/save-slots.tsx +2 -2
- package/template-react-vite-muijoy-ink-tauri/src/components/scrrens/narration/narration-cards.tsx +1 -1
- package/template-react-vite-muijoy-ink-tauri/src/components/ui/image.tsx +7 -38
- package/template-react-vite-muijoy-ink-tauri/src/pixi-vn-keys.gen.d.ts +22 -0
- package/template-react-vite-muijoy-ink-tauri/vite.config.ts +1 -0
- package/template-react-vite-muijoy-tauri/package-lock.json +4 -4
- package/template-react-vite-muijoy-tauri/package.json +1 -1
- package/template-react-vite-muijoy-tauri/src/assets/ink-manifest.gen.json +1 -0
- package/template-react-vite-muijoy-tauri/src/components/menus/main-menu.tsx +1 -2
- package/template-react-vite-muijoy-tauri/src/components/menus/save-menu/save-slots.tsx +2 -2
- package/template-react-vite-muijoy-tauri/src/components/scrrens/narration/narration-cards.tsx +1 -1
- package/template-react-vite-muijoy-tauri/src/components/ui/image.tsx +7 -38
- package/template-react-vite-muijoy-tauri/src/content/labels/start.label.ts +2 -4
- package/template-react-vite-muijoy-tauri/src/pixi-vn-keys.gen.d.ts +20 -0
- package/template-react-vite-muijoy-tauri/vite.config.ts +1 -0
- package/template-react-vite-muijoy-electron/.eslintrc.cjs +0 -29
- package/template-react-vite-muijoy-electron/.vscode/extensions.json +0 -9
- package/template-react-vite-muijoy-electron/.vscode/launch.json +0 -32
- package/template-react-vite-muijoy-electron/.vscode/settings.json +0 -49
- package/template-react-vite-muijoy-electron/README.md +0 -207
- package/template-react-vite-muijoy-electron/_gitignore +0 -107
- package/template-react-vite-muijoy-electron/forge.config.cts +0 -73
- package/template-react-vite-muijoy-electron/forge.env.d.ts +0 -1
- package/template-react-vite-muijoy-electron/index.html +0 -13
- package/template-react-vite-muijoy-electron/ionic.config.json +0 -7
- package/template-react-vite-muijoy-electron/package-lock.json +0 -16984
- package/template-react-vite-muijoy-electron/package.json +0 -85
- package/template-react-vite-muijoy-electron/public/apple-touch-icon.png +0 -0
- package/template-react-vite-muijoy-electron/public/favicon.ico +0 -0
- package/template-react-vite-muijoy-electron/public/mask-icon.svg +0 -890
- package/template-react-vite-muijoy-electron/public/pixi-vn.svg +0 -23
- package/template-react-vite-muijoy-electron/public/pwa-192x192.png +0 -0
- package/template-react-vite-muijoy-electron/public/pwa-512x512.png +0 -0
- package/template-react-vite-muijoy-electron/public/robots.txt +0 -3
- package/template-react-vite-muijoy-electron/src/App.css +0 -42
- package/template-react-vite-muijoy-electron/src/App.tsx +0 -16
- package/template-react-vite-muijoy-electron/src/AppRoutes.tsx +0 -66
- package/template-react-vite-muijoy-electron/src/Home.tsx +0 -27
- package/template-react-vite-muijoy-electron/src/Imports.tsx +0 -34
- package/template-react-vite-muijoy-electron/src/atoms/autoInfoState.ts +0 -50
- package/template-react-vite-muijoy-electron/src/atoms/dialogueCardHeightState.ts +0 -23
- package/template-react-vite-muijoy-electron/src/atoms/dialogueCardImageWidthState.ts +0 -23
- package/template-react-vite-muijoy-electron/src/atoms/hideInterfaceState.ts +0 -6
- package/template-react-vite-muijoy-electron/src/atoms/nextStepLoadingState.ts +0 -6
- package/template-react-vite-muijoy-electron/src/atoms/openGameSaveScreenState.ts +0 -6
- package/template-react-vite-muijoy-electron/src/atoms/openHistoryScreenState.ts +0 -6
- package/template-react-vite-muijoy-electron/src/atoms/openSettingsState.ts +0 -6
- package/template-react-vite-muijoy-electron/src/atoms/saveLoadAlertState.ts +0 -26
- package/template-react-vite-muijoy-electron/src/atoms/saveScreenPageState.ts +0 -23
- package/template-react-vite-muijoy-electron/src/atoms/skipEnabledState.ts +0 -6
- package/template-react-vite-muijoy-electron/src/atoms/typewriterDelayState.ts +0 -23
- package/template-react-vite-muijoy-electron/src/atoms/typewriterIsAnimatedState.ts +0 -6
- package/template-react-vite-muijoy-electron/src/components/ChoiceButton.tsx +0 -19
- package/template-react-vite-muijoy-electron/src/components/DragHandleDivider.tsx +0 -40
- package/template-react-vite-muijoy-electron/src/components/MenuButton.tsx +0 -37
- package/template-react-vite-muijoy-electron/src/components/ModalConfirmation.tsx +0 -70
- package/template-react-vite-muijoy-electron/src/components/ModalDialog.tsx +0 -103
- package/template-react-vite-muijoy-electron/src/components/NextButton.tsx +0 -94
- package/template-react-vite-muijoy-electron/src/components/SettingButton.tsx +0 -44
- package/template-react-vite-muijoy-electron/src/components/SliderResizer.tsx +0 -53
- package/template-react-vite-muijoy-electron/src/components/TextMenuButton.tsx +0 -41
- package/template-react-vite-muijoy-electron/src/components/Typewriter.tsx +0 -335
- package/template-react-vite-muijoy-electron/src/components/TypographyShadow.tsx +0 -15
- package/template-react-vite-muijoy-electron/src/i18n.ts +0 -29
- package/template-react-vite-muijoy-electron/src/index.css +0 -9
- package/template-react-vite-muijoy-electron/src/interceptors/EventInterceptor.tsx +0 -49
- package/template-react-vite-muijoy-electron/src/interceptors/SkipAutoInterceptor.tsx +0 -67
- package/template-react-vite-muijoy-electron/src/main.tsx +0 -39
- package/template-react-vite-muijoy-electron/src/models/Character.ts +0 -86
- package/template-react-vite-muijoy-electron/src/models/GameSaveData.ts +0 -9
- package/template-react-vite-muijoy-electron/src/pixi-vn.d.ts +0 -36
- package/template-react-vite-muijoy-electron/src/providers/ThemeProvider.tsx +0 -165
- package/template-react-vite-muijoy-electron/src/screens/ChoiceMenu.tsx +0 -130
- package/template-react-vite-muijoy-electron/src/screens/GameSaveScreen.tsx +0 -274
- package/template-react-vite-muijoy-electron/src/screens/HistoryScreen.tsx +0 -155
- package/template-react-vite-muijoy-electron/src/screens/LoadingScreen.tsx +0 -40
- package/template-react-vite-muijoy-electron/src/screens/MainMenu.tsx +0 -98
- package/template-react-vite-muijoy-electron/src/screens/NarrationScreen.tsx +0 -220
- package/template-react-vite-muijoy-electron/src/screens/QuickTools.tsx +0 -168
- package/template-react-vite-muijoy-electron/src/screens/Settings.tsx +0 -536
- package/template-react-vite-muijoy-electron/src/screens/modals/SaveLoadAlert.tsx +0 -135
- package/template-react-vite-muijoy-electron/src/screens/modals/TextInput.tsx +0 -61
- package/template-react-vite-muijoy-electron/src/use_query/useQueryInterface.ts +0 -73
- package/template-react-vite-muijoy-electron/src/use_query/useQueryLastSave.ts +0 -18
- package/template-react-vite-muijoy-electron/src/use_query/useQuerySaves.ts +0 -18
- package/template-react-vite-muijoy-electron/src/utilities/actions-utility.ts +0 -10
- package/template-react-vite-muijoy-electron/src/utilities/component-utility.ts +0 -25
- package/template-react-vite-muijoy-electron/src/utilities/indexedDB-utility.ts +0 -196
- package/template-react-vite-muijoy-electron/src/utilities/navigate-utility.ts +0 -18
- package/template-react-vite-muijoy-electron/src/utilities/save-utility.ts +0 -125
- package/template-react-vite-muijoy-electron/src/values/characters.ts +0 -11
- package/template-react-vite-muijoy-electron/src/values/translations/strings_en.json +0 -60
- package/template-react-vite-muijoy-electron/src/vite-env.d.ts +0 -4
- package/template-react-vite-muijoy-electron/src-electron/icons/icon.icns +0 -0
- package/template-react-vite-muijoy-electron/src-electron/icons/icon.ico +0 -0
- package/template-react-vite-muijoy-electron/src-electron/icons/icon.png +0 -0
- package/template-react-vite-muijoy-electron/src-electron/index.css +0 -7
- package/template-react-vite-muijoy-electron/src-electron/main.ts +0 -59
- package/template-react-vite-muijoy-electron/src-electron/preload.ts +0 -2
- package/template-react-vite-muijoy-electron/src-electron/renderer.ts +0 -31
- package/template-react-vite-muijoy-electron/tsconfig.json +0 -32
- package/template-react-vite-muijoy-electron/tsconfig.node.json +0 -11
- package/template-react-vite-muijoy-electron/vite.base.config.ts +0 -93
- package/template-react-vite-muijoy-electron/vite.config.ts +0 -54
- package/template-react-vite-muijoy-electron/vite.main.config.ts +0 -9
- package/template-react-vite-muijoy-electron/vite.preload.config.ts +0 -9
- package/template-react-vite-muijoy-electron/vite.renderer.config.ts +0 -9
|
@@ -1,50 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Image as UnpicImage } from "@unpic/react";
|
|
3
|
-
import
|
|
4
|
-
import { useMemo } from "react";
|
|
1
|
+
import { useImageSrc } from "@/lib/hooks/image-hooks";
|
|
2
|
+
import { Image as UnpicImage, type ImageProps } from "@unpic/react";
|
|
3
|
+
import { ImageOff } from "lucide-react";
|
|
5
4
|
|
|
6
5
|
export function Image({
|
|
7
6
|
src,
|
|
8
7
|
loading = "lazy",
|
|
9
|
-
width,
|
|
10
|
-
height,
|
|
11
8
|
...props
|
|
12
|
-
}:
|
|
13
|
-
const resolvedSrc =
|
|
14
|
-
if (!src) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
return getPixiJSAsset(src);
|
|
18
|
-
}, [src]);
|
|
9
|
+
}: Omit<ImageProps, "src"> & { src?: ImageProps["src"] | null }) {
|
|
10
|
+
const resolvedSrc = useImageSrc(src);
|
|
19
11
|
|
|
20
12
|
if (!resolvedSrc) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const parsedWidth =
|
|
25
|
-
typeof width === "number" ? width : width ? Number.parseFloat(width) : undefined;
|
|
26
|
-
const parsedHeight =
|
|
27
|
-
typeof height === "number" ? height : height ? Number.parseFloat(height) : undefined;
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
parsedWidth !== undefined &&
|
|
31
|
-
parsedHeight !== undefined &&
|
|
32
|
-
Number.isFinite(parsedWidth) &&
|
|
33
|
-
Number.isFinite(parsedHeight) &&
|
|
34
|
-
parsedWidth > 0 &&
|
|
35
|
-
parsedHeight > 0
|
|
36
|
-
) {
|
|
37
13
|
return (
|
|
38
|
-
<
|
|
39
|
-
src={resolvedSrc}
|
|
40
|
-
width={parsedWidth}
|
|
41
|
-
height={parsedHeight}
|
|
42
|
-
layout="constrained"
|
|
43
|
-
loading={loading}
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
14
|
+
<ImageOff aria-label={props.alt ?? "Image unavailable"} className={props.className} />
|
|
46
15
|
);
|
|
47
16
|
}
|
|
48
17
|
|
|
49
|
-
return <UnpicImage src
|
|
18
|
+
return <UnpicImage {...({ src: resolvedSrc, loading, ...props } as ImageProps)} />;
|
|
50
19
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { BGM_CHANNEL_NAME } from "@/constants";
|
|
2
2
|
import { james, mc, sly, steph, steph_fullname } from "@/content/characters";
|
|
3
|
-
import { animation01 } from "@/content/labels/animations.label";
|
|
4
|
-
import { secondPart } from "@/content/labels/second.label";
|
|
5
3
|
import {
|
|
6
4
|
Assets,
|
|
7
5
|
moveIn,
|
|
@@ -489,7 +487,7 @@ export const startLabel = newLabel(
|
|
|
489
487
|
narration.dialogGlue = true;
|
|
490
488
|
narration.dialogue = `and returns with a HUGE tinfoil-covered platter.`;
|
|
491
489
|
await sound.play("sfx_whoosh", { delay: 0.1 });
|
|
492
|
-
await narration.call(
|
|
490
|
+
await narration.call("animation_01", props);
|
|
493
491
|
},
|
|
494
492
|
async () => {
|
|
495
493
|
await showImageContainer("james", [
|
|
@@ -555,7 +553,7 @@ export const startLabel = newLabel(
|
|
|
555
553
|
moveOut("steph", { direction: "left", ease: "easeInOut", duration: 0.5, delay: 0.1 });
|
|
556
554
|
narration.dialogue = `You want continue to the next part?`;
|
|
557
555
|
narration.choices = [
|
|
558
|
-
newChoiceOption("Yes, I want to continue",
|
|
556
|
+
newChoiceOption("Yes, I want to continue", "second_part", {}, { type: "jump" }),
|
|
559
557
|
newCloseChoiceOption("No, I want to stop here"),
|
|
560
558
|
];
|
|
561
559
|
},
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// noinspection JSUnusedGlobalSymbols
|
|
4
|
+
// This file is auto-generated by @drincs/pixi-vn vite plugin. Do not edit manually.
|
|
5
|
+
declare module "@drincs/pixi-vn/characters" {
|
|
6
|
+
interface PixivnCharacterIds {
|
|
7
|
+
"mc": never;
|
|
8
|
+
"james": never;
|
|
9
|
+
"steph": never;
|
|
10
|
+
"sly": never;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
declare module "@drincs/pixi-vn/narration" {
|
|
14
|
+
interface PixivnLabelIds {
|
|
15
|
+
"animation_01": never;
|
|
16
|
+
"second_part": never;
|
|
17
|
+
"start": never;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -37,6 +37,7 @@ export default defineConfig({
|
|
|
37
37
|
content: "./src/content/index.ts",
|
|
38
38
|
characters: "./src/content/characters.ts",
|
|
39
39
|
labels: "./src/content/labels/*.label.ts",
|
|
40
|
+
typeFilePath: "./src/pixi-vn-keys.gen.d.ts",
|
|
40
41
|
}),
|
|
41
42
|
VitePWA({
|
|
42
43
|
// generate icons with: npm run icon
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: { browser: true, es2020: true, "node": true },
|
|
4
|
-
extends: [
|
|
5
|
-
'eslint:recommended',
|
|
6
|
-
'plugin:@typescript-eslint/eslint-recommended',
|
|
7
|
-
'plugin:@typescript-eslint/recommended',
|
|
8
|
-
'plugin:import/recommended',
|
|
9
|
-
'plugin:import/electron',
|
|
10
|
-
'plugin:import/typescript',
|
|
11
|
-
'plugin:react-hooks/recommended',
|
|
12
|
-
],
|
|
13
|
-
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
|
14
|
-
parser: '@typescript-eslint/parser',
|
|
15
|
-
plugins: ['react-refresh'],
|
|
16
|
-
rules: {
|
|
17
|
-
'react-refresh/only-export-components': [
|
|
18
|
-
'warn',
|
|
19
|
-
{ allowConstantExport: true },
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
"prefer-const": ["error", {
|
|
23
|
-
"destructuring": "all",
|
|
24
|
-
"ignoreReadBeforeAssign": true
|
|
25
|
-
}],
|
|
26
|
-
packagerConfig: {
|
|
27
|
-
icon: 'src-electron/icons/icon' // no file extension required
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
|
3
|
-
// Hover to view descriptions of existing attributes.
|
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
// bash: https://docs.microsoft.com/it-it/windows/dev-environment/javascript/nodejs-on-wsl
|
|
6
|
-
"version": "0.2.0",
|
|
7
|
-
"configurations": [
|
|
8
|
-
{
|
|
9
|
-
"name": "Launch Chrome localhost 5173",
|
|
10
|
-
"request": "launch",
|
|
11
|
-
"type": "chrome",
|
|
12
|
-
"url": "http://localhost:5173",
|
|
13
|
-
"webRoot": "${workspaceFolder}",
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "Launch Desktop Program",
|
|
17
|
-
"type": "node",
|
|
18
|
-
"request": "launch",
|
|
19
|
-
"runtimeExecutable": "${workspaceFolder}/node_modules/@electron-forge/cli/script/vscode.sh",
|
|
20
|
-
"windows": {
|
|
21
|
-
"runtimeExecutable": "${workspaceFolder}/node_modules/@electron-forge/cli/script/vscode.cmd"
|
|
22
|
-
},
|
|
23
|
-
// runtimeArgs will be passed directly to your Electron application
|
|
24
|
-
"runtimeArgs": [
|
|
25
|
-
"foo",
|
|
26
|
-
"bar"
|
|
27
|
-
],
|
|
28
|
-
"cwd": "${workspaceFolder}",
|
|
29
|
-
"console": "integratedTerminal"
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Formatter
|
|
3
|
-
"[javascript]": {
|
|
4
|
-
"editor.defaultFormatter": "vscode.typescript-language-features",
|
|
5
|
-
"editor.formatOnSave": true
|
|
6
|
-
},
|
|
7
|
-
"[javascriptreact]": {
|
|
8
|
-
"editor.defaultFormatter": "vscode.typescript-language-features",
|
|
9
|
-
"editor.formatOnSave": true
|
|
10
|
-
},
|
|
11
|
-
"[typescript]": {
|
|
12
|
-
"editor.defaultFormatter": "vscode.typescript-language-features",
|
|
13
|
-
"editor.formatOnSave": true
|
|
14
|
-
},
|
|
15
|
-
"[typescriptreact]": {
|
|
16
|
-
"editor.defaultFormatter": "vscode.typescript-language-features",
|
|
17
|
-
"editor.formatOnSave": true
|
|
18
|
-
},
|
|
19
|
-
"[css]": {
|
|
20
|
-
"editor.defaultFormatter": "vscode.css-language-features",
|
|
21
|
-
"editor.formatOnSave": true
|
|
22
|
-
},
|
|
23
|
-
"[html]": {
|
|
24
|
-
"editor.defaultFormatter": "vscode.html-language-features"
|
|
25
|
-
},
|
|
26
|
-
// reorganise imports
|
|
27
|
-
"editor.codeActionsOnSave": {
|
|
28
|
-
"source.organizeImports": "explicit"
|
|
29
|
-
},
|
|
30
|
-
// references
|
|
31
|
-
"javascript.referencesCodeLens.enabled": true,
|
|
32
|
-
"javascript.referencesCodeLens.showOnAllFunctions": true,
|
|
33
|
-
"typescript.referencesCodeLens.enabled": true,
|
|
34
|
-
"typescript.referencesCodeLens.showOnAllFunctions": true,
|
|
35
|
-
// does fetch when he does Pull
|
|
36
|
-
"git.fetchOnPull": true,
|
|
37
|
-
// move file
|
|
38
|
-
"javascript.updateImportsOnFileMove.enabled": "always",
|
|
39
|
-
"typescript.updateImportsOnFileMove.enabled": "always",
|
|
40
|
-
// color
|
|
41
|
-
"vscode-color-picker.languages": [
|
|
42
|
-
"javascript",
|
|
43
|
-
"typescript",
|
|
44
|
-
"javascriptreact",
|
|
45
|
-
"typescriptreact",
|
|
46
|
-
],
|
|
47
|
-
// olther
|
|
48
|
-
"extensions.ignoreRecommendations": false,
|
|
49
|
-
}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
# Pixi’VN template (React + Vite + MUI joy)
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
This is a template for creating visual novels in React. It uses the Pixi’VN library and Vite as a build tool.
|
|
6
|
-
This Template contains basic functionality inspired by the widespread Visual Noval engine Ren'Py.
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
The first page that appears is the main menu. From there, you can start the game, load a saved game, or go to the settings.
|
|
11
|
-
|
|
12
|
-
The game page is in `/narration` route. It contains the text box, character avatar, and canvas for the background image. The text box displays the text of the current dialogue. The character avatar displays the character speaking the dialogue. The background image is the background of the scene.
|
|
13
|
-
When a choice has to be made, the choices are displayed at the top of the screen.
|
|
14
|
-
|
|
15
|
-
When you are in the game page, you can access with many features through a list of buttons located at the bottom. In this list you can save the game, load a saved game, skip the dialogue, auto play the dialogue, access to the history modal, and access to the settings modal.
|
|
16
|
-
|
|
17
|
-
The history modal is a list of all the dialogues and choices that have been displayed.
|
|
18
|
-
|
|
19
|
-
The settings modal allows you to change the text speed, go to full screen, edit theme colors, and change go to main menu. The settings for the audio have not been added nor the libraries to manage it, but I recommend adding them.
|
|
20
|
-
|
|
21
|
-
## How to use
|
|
22
|
-
|
|
23
|
-
Before starting, you need to have Node.js installed on your computer. If you don't have it, you can download it [here](https://nodejs.org/).
|
|
24
|
-
|
|
25
|
-
### Installation
|
|
26
|
-
|
|
27
|
-
First, is necessary install the dependencies. To do this, open a terminal in the root folder of the project and run the following command:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm install
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Start the web application
|
|
34
|
-
|
|
35
|
-
To start the web application, run the following command:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npm start
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
This command will start the development server. Open [http://localhost:5173](http://localhost:5173) to view it in the browser.
|
|
42
|
-
|
|
43
|
-
#### Debugging the web application
|
|
44
|
-
|
|
45
|
-
If you use Visual Studio Code, you can use the debug configuration that comes with the template. To do this, go to the debug section and select the `Launch Chrome` configuration.
|
|
46
|
-
|
|
47
|
-
### Start the Desktop Program (Electron)
|
|
48
|
-
|
|
49
|
-
To start the Electron application, run the following command:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npm run electron:start
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
This command will start the Electron application. The application will open in a window on your computer.
|
|
56
|
-
|
|
57
|
-
#### Debugging the Desktop Program
|
|
58
|
-
|
|
59
|
-
If you use Visual Studio Code, you can use the debug configuration that comes with the template. To do this, go to the debug section and select the `Launch Desktop Program` configuration.
|
|
60
|
-
|
|
61
|
-
### Mobile development
|
|
62
|
-
|
|
63
|
-
This project gives the possibility to introduce the Ionic Framework to develop a mobile application. To do this I recommend following [this tutorial](https://pixi-vn.web.app/distribution%E2%80%90mobile.html).
|
|
64
|
-
|
|
65
|
-
## Keyboard shortcuts (hotkeys)
|
|
66
|
-
|
|
67
|
-
* `Space` or `Enter`: Continue the dialogue.
|
|
68
|
-
* `Keep Space` or `Keep Enter`: Skip the dialogue.
|
|
69
|
-
* `Shift` + `S`: Quick save the game.
|
|
70
|
-
* `Shift` + `L`: Quick load the game.
|
|
71
|
-
* `Shift` + `H`: Open the history modal.
|
|
72
|
-
* `Esc`: Open the settings modal.
|
|
73
|
-
* `Shift` + `V`: Hide the UI (Show only the canvas).
|
|
74
|
-
|
|
75
|
-
## Used libraries
|
|
76
|
-
|
|
77
|
-
This template uses the following libraries:
|
|
78
|
-
|
|
79
|
-
Core libraries:
|
|
80
|
-
|
|
81
|
-
* [Pixi’VN](https://www.npmjs.com/package/@drincs/pixi-vn): A visual novel library for PixiJS.
|
|
82
|
-
* [Vite](https://vitejs.dev/): A build tool that aims to provide a faster and leaner development experience for modern web projects.
|
|
83
|
-
* [Vite Checker](https://www.npmjs.com/package/vite-plugin-checker): A Vite plugin that checks TypeScript types and ESLint on each build.
|
|
84
|
-
* [PWA Vite Plugin](https://vite-pwa-org.netlify.app): A Vite plugin that provides PWA support. This allows the possibility of installing the game as a Progressive Web App.
|
|
85
|
-
* [Recoil](https://recoiljs.org/): A state management library for React.
|
|
86
|
-
* [React Router](https://reactrouter.com/): A library that provides routing for React applications.
|
|
87
|
-
* [Tanstack Query](https://tanstack.com/tanstack-query/): A library that provides a set of tools for getting, caching, and updating game data.
|
|
88
|
-
<img width="44" alt="image" src="https://github.com/user-attachments/assets/bf70dddc-68c0-48f4-9c41-74c22f54e3d1">
|
|
89
|
-
You can use the following button to show Tanstack Query interactions with the game. (the button will be automatically hidden when released)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
UI libraries:
|
|
93
|
-
|
|
94
|
-
* [Mui Joy](https://mui.com/joy-ui/getting-started/): A React UI framework that provides a set of components and styles for building a website.
|
|
95
|
-
* [Framer Motion](https://motion.dev/): A simple yet powerful motion library for React.
|
|
96
|
-
* [Notistack](https://iamhosseindhv.com/notistack): A library that provides snackbar notifications for React.
|
|
97
|
-
* [React Color Palette](https://www.npmjs.com/package/react-color-palette): A library that provides a color picker for React.
|
|
98
|
-
|
|
99
|
-
Text libraries:
|
|
100
|
-
|
|
101
|
-
* [i18next](https://www.i18next.com/): A library that gives the possibility to manage multiple translations in the application.
|
|
102
|
-
* [Reacr Markdown](https://www.npmjs.com/package/react-markdown): A library that allows you to render markdown in React components.
|
|
103
|
-
|
|
104
|
-
## Distribution
|
|
105
|
-
|
|
106
|
-
### Web application distribution
|
|
107
|
-
|
|
108
|
-
To build the project, run the following command:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
npm run build
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
This command will create a `dist` folder with the files necessary to run the application. You can deploy this folder to a web server.
|
|
115
|
-
|
|
116
|
-
You can read more about the possibilities of hosting in the [Pixi’VN documentation](https://pixi-vn.web.app/advanced/distribution.html#hosting).
|
|
117
|
-
|
|
118
|
-
### Desktop application distribution
|
|
119
|
-
|
|
120
|
-
To generate packages to install desktop devices we will use [Electron Forge Maker](https://www.electronforge.io/config/makers). Add more distribution settings to the `forge.config.cts` file.
|
|
121
|
-
|
|
122
|
-
Basically it can run the following commands, installing the necessary libraries. You can reparse the generated packages from the `out` folder.
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
# Windows
|
|
126
|
-
npm run electron:make -- --platform win32
|
|
127
|
-
# Linux
|
|
128
|
-
npm run electron:make -- --platform linux
|
|
129
|
-
# MacOS
|
|
130
|
-
npm run electron:make -- --platform darwin
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Below is a more detailed explanation of the steps to take. (Not having an Apple Mac, I was unable to test this process)
|
|
134
|
-
|
|
135
|
-
### Windows Distribution
|
|
136
|
-
|
|
137
|
-
#### From Windows to Windows
|
|
138
|
-
|
|
139
|
-
You can run the following commands to generate the distribution package.
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
npm i @rollup/rollup-win32-x64-msvc
|
|
143
|
-
npm run electron:make -- --platform win32
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
#### From Linux to Windows
|
|
147
|
-
|
|
148
|
-
You can run the following commands to generate the distribution package.
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
sudo apt install wine
|
|
152
|
-
sudo apt install mono-complete
|
|
153
|
-
sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install wine32
|
|
154
|
-
npm run electron:make -- --platform win32
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### Linux Distribution
|
|
158
|
-
|
|
159
|
-
#### From Windows to Linux
|
|
160
|
-
|
|
161
|
-
You can run the following commands to generate the distribution package.
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
npm i @rollup/rollup-win32-x64-msvc
|
|
165
|
-
npm run electron:make -- --platform linux
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
If you get the following error `the maker declared that it cannot run on win32.` then you will need to [install WSL](https://learn.microsoft.com/en-us/windows/wsl/install) and after that run the following command.
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
bash
|
|
172
|
-
npm run electron:make -- --platform linux
|
|
173
|
-
exit
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
#### Fom Linux to Linux
|
|
177
|
-
|
|
178
|
-
You can run the following commands to generate the distribution package.
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
sudo apt install rpm dpkg fakeroot
|
|
182
|
-
npm run electron:make -- --platform linux
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### MacOS Distribution
|
|
186
|
-
|
|
187
|
-
#### From Windows to MacOS
|
|
188
|
-
|
|
189
|
-
You can run the following commands to generate the distribution package.
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
npm i @rollup/rollup-win32-x64-msvc
|
|
193
|
-
npm run electron:make -- --platform darwin
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
#### From Linux to MacOS
|
|
197
|
-
|
|
198
|
-
You can run the following commands to generate the distribution package.
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
sudo apt install zip
|
|
202
|
-
npm run electron:make -- --platform darwin
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
## Custom App Icons
|
|
206
|
-
|
|
207
|
-
Read the [Electron Forge documentation](https://www.electronforge.io/guides/create-and-add-icons).
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# Logs
|
|
2
|
-
logs
|
|
3
|
-
*.log
|
|
4
|
-
npm-debug.log*
|
|
5
|
-
yarn-debug.log*
|
|
6
|
-
yarn-error.log*
|
|
7
|
-
pnpm-debug.log*
|
|
8
|
-
lerna-debug.log*
|
|
9
|
-
|
|
10
|
-
node_modules
|
|
11
|
-
dist
|
|
12
|
-
dist-ssr
|
|
13
|
-
*.local
|
|
14
|
-
|
|
15
|
-
# Editor directories and files
|
|
16
|
-
.idea
|
|
17
|
-
.DS_Store
|
|
18
|
-
*.suo
|
|
19
|
-
*.ntvs*
|
|
20
|
-
*.njsproj
|
|
21
|
-
*.sln
|
|
22
|
-
*.sw?
|
|
23
|
-
|
|
24
|
-
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
25
|
-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
26
|
-
|
|
27
|
-
# Runtime data
|
|
28
|
-
pids
|
|
29
|
-
*.pid
|
|
30
|
-
*.seed
|
|
31
|
-
*.pid.lock
|
|
32
|
-
.DS_Store
|
|
33
|
-
|
|
34
|
-
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
35
|
-
lib-cov
|
|
36
|
-
|
|
37
|
-
# Coverage directory used by tools like istanbul
|
|
38
|
-
coverage
|
|
39
|
-
*.lcov
|
|
40
|
-
|
|
41
|
-
# nyc test coverage
|
|
42
|
-
.nyc_output
|
|
43
|
-
|
|
44
|
-
# node-waf configuration
|
|
45
|
-
.lock-wscript
|
|
46
|
-
|
|
47
|
-
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
48
|
-
build/Release
|
|
49
|
-
|
|
50
|
-
# Dependency directories
|
|
51
|
-
node_modules/
|
|
52
|
-
jspm_packages/
|
|
53
|
-
|
|
54
|
-
# TypeScript v1 declaration files
|
|
55
|
-
typings/
|
|
56
|
-
|
|
57
|
-
# TypeScript cache
|
|
58
|
-
*.tsbuildinfo
|
|
59
|
-
|
|
60
|
-
# Optional npm cache directory
|
|
61
|
-
.npm
|
|
62
|
-
|
|
63
|
-
# Optional eslint cache
|
|
64
|
-
.eslintcache
|
|
65
|
-
|
|
66
|
-
# Optional REPL history
|
|
67
|
-
.node_repl_history
|
|
68
|
-
|
|
69
|
-
# Output of 'npm pack'
|
|
70
|
-
*.tgz
|
|
71
|
-
|
|
72
|
-
# Yarn Integrity file
|
|
73
|
-
.yarn-integrity
|
|
74
|
-
|
|
75
|
-
# dotenv environment variables file
|
|
76
|
-
.env
|
|
77
|
-
.env.test
|
|
78
|
-
|
|
79
|
-
# parcel-bundler cache (https://parceljs.org/)
|
|
80
|
-
.cache
|
|
81
|
-
|
|
82
|
-
# next.js build output
|
|
83
|
-
.next
|
|
84
|
-
|
|
85
|
-
# nuxt.js build output
|
|
86
|
-
.nuxt
|
|
87
|
-
|
|
88
|
-
# vuepress build output
|
|
89
|
-
.vuepress/dist
|
|
90
|
-
|
|
91
|
-
# Serverless directories
|
|
92
|
-
.serverless/
|
|
93
|
-
|
|
94
|
-
# FuseBox cache
|
|
95
|
-
.fusebox/
|
|
96
|
-
|
|
97
|
-
# DynamoDB Local files
|
|
98
|
-
.dynamodb/
|
|
99
|
-
|
|
100
|
-
# Webpack
|
|
101
|
-
.webpack/
|
|
102
|
-
|
|
103
|
-
# Vite
|
|
104
|
-
.vite/
|
|
105
|
-
|
|
106
|
-
# Electron-Forge
|
|
107
|
-
out/
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { MakerDeb } from '@electron-forge/maker-deb';
|
|
2
|
-
import { MakerRpm } from '@electron-forge/maker-rpm';
|
|
3
|
-
import { MakerSquirrel } from '@electron-forge/maker-squirrel';
|
|
4
|
-
import { MakerZIP } from '@electron-forge/maker-zip';
|
|
5
|
-
import { FusesPlugin } from '@electron-forge/plugin-fuses';
|
|
6
|
-
import { VitePlugin } from '@electron-forge/plugin-vite';
|
|
7
|
-
import type { ForgeConfig } from '@electron-forge/shared-types';
|
|
8
|
-
import { FuseV1Options, FuseVersion } from '@electron/fuses';
|
|
9
|
-
|
|
10
|
-
const config: ForgeConfig = {
|
|
11
|
-
packagerConfig: {
|
|
12
|
-
asar: true,
|
|
13
|
-
},
|
|
14
|
-
rebuildConfig: {},
|
|
15
|
-
makers: [
|
|
16
|
-
// The `MakerSquirrel` maker is only supported on Windows
|
|
17
|
-
new MakerSquirrel({
|
|
18
|
-
setupIcon: "src-electron/icons/icon.ico",
|
|
19
|
-
setupExe: "game.exe",
|
|
20
|
-
}),
|
|
21
|
-
// The `MakerZIP` maker is only supported on macOS
|
|
22
|
-
new MakerZIP({}, ['darwin']),
|
|
23
|
-
// The `MakerRpm` and `MakerDeb` makers are only supported on Linux
|
|
24
|
-
new MakerRpm({
|
|
25
|
-
options: {
|
|
26
|
-
categories: ["Game"],
|
|
27
|
-
icon: "src-electron/icons/icon.png",
|
|
28
|
-
}
|
|
29
|
-
}),
|
|
30
|
-
new MakerDeb({
|
|
31
|
-
options: {
|
|
32
|
-
categories: ["Game"],
|
|
33
|
-
icon: "src-electron/icons/icon.png",
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
],
|
|
37
|
-
plugins: [
|
|
38
|
-
new VitePlugin({
|
|
39
|
-
// `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.
|
|
40
|
-
// If you are familiar with Vite configuration, it will look really familiar.
|
|
41
|
-
build: [
|
|
42
|
-
{
|
|
43
|
-
// `entry` is just an alias for `build.lib.entry` in the corresponding file of `config`.
|
|
44
|
-
entry: 'src-electron/main.ts',
|
|
45
|
-
config: 'vite.main.config.ts',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
entry: 'src-electron/preload.ts',
|
|
49
|
-
config: 'vite.preload.config.ts',
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
renderer: [
|
|
53
|
-
{
|
|
54
|
-
name: 'main_window',
|
|
55
|
-
config: 'vite.renderer.config.ts',
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
}),
|
|
59
|
-
// Fuses are used to enable/disable various Electron functionality
|
|
60
|
-
// at package time, before code signing the application
|
|
61
|
-
new FusesPlugin({
|
|
62
|
-
version: FuseVersion.V1,
|
|
63
|
-
[FuseV1Options.RunAsNode]: false,
|
|
64
|
-
[FuseV1Options.EnableCookieEncryption]: true,
|
|
65
|
-
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
|
|
66
|
-
[FuseV1Options.EnableNodeCliInspectArguments]: false,
|
|
67
|
-
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
|
|
68
|
-
[FuseV1Options.OnlyLoadAppFromAsar]: true,
|
|
69
|
-
}),
|
|
70
|
-
],
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export default config;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="@electron-forge/plugin-vite/forge-vite-env" />
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/pixi-vn.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>My App</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="root"></div>
|
|
11
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|