Skip to content

Commit

Permalink
Merge pull request #450 from OpenWebGAL/dev
Browse files Browse the repository at this point in the history
4.4.10
  • Loading branch information
MakinoharaShoko committed Jan 21, 2024
2 parents 426d1ea + 1cf0d5d commit fb2cef0
Show file tree
Hide file tree
Showing 76 changed files with 733 additions and 476 deletions.
4 changes: 2 additions & 2 deletions packages/parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webgal-parser",
"version": "4.4.8",
"version": "4.4.9-fix1",
"description": "WebGAL script parser",
"scripts": {
"test": "vitest",
Expand All @@ -11,7 +11,7 @@
},
"types": "./build/types/index.d.ts",
"module": "./build/es/index.js",
"main": "./build/cjs/index.js",
"main": "./build/cjs/index.cjs",
"author": "Mahiru <Mahiru_@outlook.com>",
"license": "MPL-2.0",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default [
input: `./src/index.ts`,
output: [
{
file: "./build/cjs/index.js",
file: "./build/cjs/index.cjs",
exports: "named",
format: "cjs",
sourcemap: !isProd
Expand Down
6 changes: 3 additions & 3 deletions packages/webgal/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "webgal",
"private": true,
"version": "4.4.9",
"version": "4.4.10",
"scripts": {
"dev": "vite --host --port 3000",
"build": "cross-env NODE_ENV=production tsc && vite build --base=./",
Expand All @@ -14,22 +14,22 @@
"angular-expressions": "^1.1.5",
"axios": "^0.26.1",
"cloudlogjs": "^1.0.9",
"gsap": "^3.11.3",
"i18next": "^22.4.15",
"localforage": "^1.10.0",
"lodash": "^4.17.21",
"mitt": "^3.0.0",
"modern-css-reset": "^1.4.0",
"pixi-filters": "^4.2.0",
"pixi-live2d-display": "^0.4.0",
"pixi.js": "^6.3.0",
"popmotion": "^11.0.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-i18next": "^12.2.2",
"react-redux": "^8.0.1",
"sass": "^1.49.9",
"uuid": "^9.0.0",
"vite-plugin-package-version": "^1.0.2",
"pixi-live2d-display": "^0.4.0",
"webgal-parser": "latest"
},
"devDependencies": {
Expand Down
20 changes: 19 additions & 1 deletion packages/webgal/public/game/animation/animationTable.json
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
["enter-from-left","enter-from-bottom","enter-from-right","shake","move-front-and-back","enter","exit","blur","oldFilm","dotFilm","reflectionFilm","glitchFilm","rgbFilm","godrayFilm","removeFilm"]
[
"enter-from-left",
"enter-from-bottom",
"enter-from-right",
"shake",
"move-front-and-back",
"enter",
"exit",
"blur",
"oldFilm",
"dotFilm",
"reflectionFilm",
"glitchFilm",
"rgbFilm",
"godrayFilm",
"removeFilm",
"shockwaveIn",
"shockwaveOut"
]
12 changes: 12 additions & 0 deletions packages/webgal/public/game/animation/shockwaveIn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"shockwaveFilter": 0,
"alpha": 0,
"duration": 0
},
{
"shockwaveFilter": 3,
"alpha": 1,
"duration": 2000
}
]
12 changes: 12 additions & 0 deletions packages/webgal/public/game/animation/shockwaveOut.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"shockwaveFilter": 0,
"alpha": 1,
"duration": 0
},
{
"shockwaveFilter": 3,
"alpha": 0,
"duration": 2000
}
]
Binary file not shown.
Binary file modified packages/webgal/public/game/bgm/s_Title.mp3
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/webgal/public/game/scene/demo_animation.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bgm:ontama_piano1_youkoso.mp3 -volume=80 -enter=3000;
unlockBgm:ontama_piano1_youkoso.mp3 -name=ようこそ;
bgm:s_Title.mp3 -volume=80 -enter=3000;
unlockBgm:s_Title.mp3 -name=ようこそ;
intro:■初めに| このデモゲームで使用している画像素材は、AI生成画像です;
intro:■クレジット| 「VOICEVOX:小夜/SAYO」;
intro:まばたき、口パクのアニメーションテストです;
Expand Down
6 changes: 3 additions & 3 deletions packages/webgal/public/game/scene/demo_en.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bgm:ontama_piano1_youkoso.mp3 -volume=80 -enter=3000;
unlockBgm:ontama_piano1_youkoso.mp3 -name=welcome;
bgm:s_Title.mp3 -volume=80 -enter=3000;
unlockBgm:s_Title.mp3 -name=welcome;
intro:*Getting started| The image materials used in this demo game are AI-generated images;
intro:*Credit| Created By ondoku3.com;
changeBg:bg.png -next;
Expand Down Expand Up @@ -49,4 +49,4 @@ For developers who are developing games for the first time, we provide beautiful
So you can start making games quickly. -e023_So_you_can_ start_making_ games_quickly.mp3;
We hope that your work will be exhibited at WebGAL. -e024_We_hope_ that_your_work.mp3;
Thank you for your interest in the WebGAL project! -e025_Thank_you_ for_your_interest_in_the_WebGAL_project!.mp3;
end;
end;
6 changes: 3 additions & 3 deletions packages/webgal/public/game/scene/demo_ja.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bgm:ontama_piano1_youkoso.mp3 -volume=80 -enter=3000;
unlockBgm:ontama_piano1_youkoso.mp3 -name=ようこそ;
bgm:s_Title.mp3 -volume=80 -enter=3000;
unlockBgm:s_Title.mp3 -name=ようこそ;
intro:■初めに| このデモゲームで使用している画像素材は、AI生成画像です;
intro:■クレジット| 「VOICEVOX:小夜/SAYO」;
changeBg:bg.png -next;
Expand Down Expand Up @@ -61,4 +61,4 @@ setTempAnimation:[{"position": {"x": 500,"y": 0},"duration": 0},{"position": {"x
WebGALプロジェクトチームは、あなたの作品がWebGALで展示されることを期待しています! -030_小夜SAYO(ノーマル)_ウェブギャルプロジ….wav
リンクを1つ用意するだけで、無数のユーザーがあなたの作品をすぐに楽しめるようになります。 -031_小夜SAYO(ノーマル)_リンクを1つ用意す….wav;
WebGALプロジェクトへのご注目、ありがとうございます! -032_小夜SAYO(ノーマル)_ウェブギャルプロジ….wav;
end;
end;
5 changes: 4 additions & 1 deletion packages/webgal/public/game/scene/demo_zh_cn.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
bgm:s_Title.mp3 -volume=80 -enter=3000;
unlockBgm:s_Title.mp3 -name=雲を追いかけて;
intro:你好|欢迎来到 {egine} 的世界;
changeBg:WebGalEnter.png -next;
setTransition: -target=bg-main -exit=shockwaveOut;
:你好|欢迎来到 {egine} 的世界;
changeBg:bg.png -next;
setTransition: -target=bg-main -enter=shockwaveIn -next;
unlockCg:bg.png -name=良い夜; // 解锁CG并赋予名称
changeFigure:stand.png -left -enter=enter-from-left -next;
:你好|欢迎来到 {egine} 的世界;
miniAvatar:miniavatar.png;
{heroine}:欢迎使用 {egine}!这是一款全新的网页端视觉小说引擎。 -v1.wav;
changeFigure:stand2.png -right -next;
Expand Down
Binary file removed packages/webgal/public/game/tex/rain_2.png
Binary file not shown.
Binary file removed packages/webgal/public/game/tex/rain_min.png
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/webgal/src/Core/Modules/animationFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function getAnimationObject(animationName: string, target: string, durati
const targetSetEffect = webgalStore.getState().stage.effects.find((e) => e.target === target);
const newEffect = cloneDeep({ ...(targetSetEffect?.transform ?? baseTransform), duration: 0 });
Object.assign(newEffect, effect);
newEffect.duration = effect.duration / 1000;
newEffect.duration = effect.duration;
return newEffect;
});
logger.debug('装载自定义动画', mappedEffects);
Expand Down
35 changes: 21 additions & 14 deletions packages/webgal/src/Core/controller/gamePlay/scriptExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@ import { IBacklogItem } from '@/Core/Modules/backlog';
import { SYSTEM_CONFIG } from '@/config';
import { WebGAL } from '@/Core/WebGAL';

export const whenChecker = (whenValue: string | undefined): boolean => {
if (whenValue === undefined) {
return true;
}
// 先把变量解析出来
const valExpArr = whenValue.split(/([+\-*\/()><!]|>=|<=|==)/g);
const valExp = valExpArr
.map((e) => {
if (e.match(/[a-zA-Z]/)) {
if (e.match(/true/) || e.match(/false/)) {
return e;
}
return getValueFromState(e).toString();
} else return e;
})
.reduce((pre, curr) => pre + curr, '');
return !!strIf(valExp);
};

/**
* 语句执行器
* 执行语句,同步场景状态,并根据情况立即执行下一句或者加入backlog
Expand Down Expand Up @@ -64,7 +83,7 @@ export const scriptExecutor = () => {
variableInterpolation();

// 判断这个脚本要不要执行
let runThis: number | boolean = true;
let runThis = true;
let isHasWhenArg = false;
let whenValue = '';
currentScript.args.forEach((e) => {
Expand All @@ -75,19 +94,7 @@ export const scriptExecutor = () => {
});
// 如果语句有 when
if (isHasWhenArg) {
// 先把变量解析出来
const valExpArr = whenValue.split(/([+\-*\/()><!]|>=|<=|==)/g);
const valExp = valExpArr
.map((e) => {
if (e.match(/[a-zA-Z]/)) {
if (e.match(/true/) || e.match(/false/)) {
return e;
}
return getValueFromState(e).toString();
} else return e;
})
.reduce((pre, curr) => pre + curr, '');
runThis = strIf(valExp);
runThis = whenChecker(whenValue);
}

// 执行语句
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,8 @@ export default class PixiStage {
/**
* 加载器部分
*/
const resourses = Object.keys(loader.resources);
this.cacheGC();
if (!resourses.includes(url)) {
if (!loader.resources?.[url]?.texture) {
this.loadAsset(url, setup);
} else {
// 复用
Expand Down Expand Up @@ -504,9 +503,8 @@ export default class PixiStage {
/**
* 加载器部分
*/
const resourses = Object.keys(loader.resources);
this.cacheGC();
if (!resourses.includes(url)) {
if (!loader.resources?.[url]?.texture) {
this.loadAsset(url, setup);
} else {
// 复用
Expand Down
Loading

0 comments on commit fb2cef0

Please sign in to comment.