Skip to content

Commit

Permalink
Merge pull request #405 from MakinoharaShoko/dev
Browse files Browse the repository at this point in the history
4.4.7
  • Loading branch information
MakinoharaShoko authored Nov 23, 2023
2 parents c456d21 + a3bfa77 commit 98fcca6
Show file tree
Hide file tree
Showing 164 changed files with 564 additions and 228 deletions.
2 changes: 1 addition & 1 deletion packages/parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webgal-parser",
"version": "4.4.5-fix2",
"version": "4.4.7",
"description": "WebGAL script parser",
"scripts": {
"test": "vitest",
Expand Down
1 change: 1 addition & 0 deletions packages/parser/src/interface/sceneInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export enum commandType {
comment,
setTransform,
setTransition,
getUserInput
}

/**
Expand Down
2 changes: 1 addition & 1 deletion 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.6",
"version": "4.4.7",
"scripts": {
"dev": "vite --host --port 3000",
"build": "cross-env NODE_ENV=production tsc && vite build --base=./",
Expand Down
13 changes: 12 additions & 1 deletion packages/webgal/public/game/scene/demo_zh_cn.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,19 @@ pixiInit;
pixiPerform:snow;
比如,这个下起小雪的特效。 -v6.wav;
除此以外,分支选择的功能也必不可少。 -v7.wav;
你可以通过以下两个分支了解 {egine} 的更多故事。 -v8.wav;
pixiInit;
WebGAL:接下来介绍一些新版本功能!
WebGAL:比如这个[注](zhù)[音](yīn)功能,可以为游戏带来更好的体验!
WebGAL:新版本添加了特性:获取用户输入,你要尝试一下吗?
choose:尝试一下:userInput|算了吧:toNextPart;

label:userInput;
getUserInput:name -title=如何称呼你 -buttonText=确认;
WebGAL:很高兴遇见你,{name}!
jumpLabel:toNextPart;

label:toNextPart;
你可以通过以下两个分支了解 {egine} 的更多故事。 -v8.wav;
choose:{egine} 发展历程:choose1|{egine} 冷知识:choose2;

;分支1
Expand Down
24 changes: 12 additions & 12 deletions packages/webgal/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import Title from './Components/UI/Title/Title';
import Logo from './Components/UI/Logo/Logo';
import Title from '@/UI/Title/Title';
import Logo from '@/UI/Logo/Logo';
import { useEffect } from 'react';
import { initializeScript } from './Core/initializeScript';
import Menu from './Components/UI/Menu/Menu';
import { Stage } from './Components/Stage/Stage';
import { BottomControlPanel } from './Components/UI/BottomControlPanel/BottomControlPanel';
import { Backlog } from './Components/UI/Backlog/Backlog';
import Menu from '@/UI/Menu/Menu';
import { Stage } from '@/Stage/Stage';
import { BottomControlPanel } from '@/UI/BottomControlPanel/BottomControlPanel';
import { Backlog } from '@/UI/Backlog/Backlog';
import { Provider } from 'react-redux';
import { webgalStore } from './store/store';
import { Extra } from '@/Components/UI/Extra/Extra';
import { BottomControlPanelFilm } from './Components/UI/BottomControlPanel/BottomControlPanelFilm';
import GlobalDialog from '@/Components/UI/GlobalDialog/GlobalDialog';
import DevPanel from '@/Components/UI/DevPanel/DevPanel';
import Translation from '@/Components/UI/Translation/Translation';
import { PanicOverlay } from '@/Components/UI/PanicOverlay/PanicOverlay';
import { Extra } from '@/UI/Extra/Extra';
import { BottomControlPanelFilm } from '@/UI/BottomControlPanel/BottomControlPanelFilm';
import GlobalDialog from '@/UI/GlobalDialog/GlobalDialog';
import DevPanel from '@/UI/DevPanel/DevPanel';
import Translation from '@/UI/Translation/Translation';
import { PanicOverlay } from '@/UI/PanicOverlay/PanicOverlay';

function App() {
useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/webgal/src/Core/Modules/animationFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { generateUniversalSoftInAnimationObj } from '@/Core/controller/stage/pixi/animations/universalSoftIn';
import { logger } from '@/Core/util/etc/logger';
import { logger } from '@/Core/util/logger';
import { generateUniversalSoftOffAnimationObj } from '@/Core/controller/stage/pixi/animations/universalSoftOff';
import { webgalStore } from '@/store/store';
import cloneDeep from 'lodash/cloneDeep';
Expand Down
2 changes: 1 addition & 1 deletion packages/webgal/src/Core/Modules/backlog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { webgalStore } from '@/store/store';
import { ISaveScene } from '@/store/userDataInterface';
import cloneDeep from 'lodash/cloneDeep';

import { SYSTEM_CONFIG } from '@/Core/config/config';
import { SYSTEM_CONFIG } from '@/config';
import { SceneManager } from '@/Core/Modules/scene';

export interface IBacklogItem {
Expand Down
2 changes: 1 addition & 1 deletion packages/webgal/src/Core/controller/gamePlay/autoPlay.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// import {logger} from '../../util/logger';
import styles from '../../../Components/UI/BottomControlPanel/bottomControlPanel.module.scss';
import styles from '@/UI/BottomControlPanel/bottomControlPanel.module.scss';
import { webgalStore } from '@/store/store';
import { nextSentence } from '@/Core/controller/gamePlay/nextSentence';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { setVisibility } from '@/store/GUIReducer';
import { stopAllPerform } from '@/Core/controller/gamePlay/stopAllPerform';
import { stopAuto } from '@/Core/controller/gamePlay/autoPlay';
import { stopFast } from '@/Core/controller/gamePlay/fastSkip';
import { setEbg } from '@/Core/util/setEbg';
import { setEbg } from '@/Core/gameScripts/changeBg/setEbg';

export const backToTitle = () => {
const dispatch = webgalStore.dispatch;
Expand Down
5 changes: 3 additions & 2 deletions packages/webgal/src/Core/controller/gamePlay/fastSkip.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// 切换自动播放状态
import { stopAuto } from './autoPlay';
import styles from '../../../Components/UI/BottomControlPanel/bottomControlPanel.module.scss';
import styles from '@/UI/BottomControlPanel/bottomControlPanel.module.scss';
import { nextSentence } from '@/Core/controller/gamePlay/nextSentence';

import { WebGAL } from '@/Core/WebGAL';
import { SYSTEM_CONFIG } from '@/config';

/**
* 设置 fast 按钮的激活与否
Expand Down Expand Up @@ -44,7 +45,7 @@ export const startFast = () => {
setButton(true);
WebGAL.gameplay.fastInterval = setInterval(() => {
nextSentence();
}, 100);
}, SYSTEM_CONFIG.fast_timeout);
};

// 判断是否是快进模式
Expand Down
4 changes: 2 additions & 2 deletions packages/webgal/src/Core/controller/gamePlay/nextSentence.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { scriptExecutor } from './scriptExecutor';
import { logger } from '../../util/etc/logger';
import { logger } from '../../util/logger';
import { webgalStore } from '@/store/store';
import { resetStageState } from '@/store/stageReducer';
import cloneDeep from 'lodash/cloneDeep';
import { IBacklogItem } from '@/Core/Modules/backlog';

import { SYSTEM_CONFIG } from '@/Core/config/config';
import { SYSTEM_CONFIG } from '@/config';
import { WebGAL } from '@/Core/WebGAL';
import { IRunPerform } from '@/store/stageInterface';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { commandType, ISentence } from '@/Core/controller/scene/sceneInterface';
import { runScript } from './runScript';
import { logger } from '../../util/etc/logger';
import { logger } from '../../util/logger';
import { IStageState } from '@/store/stageInterface';
import { restoreScene } from '../scene/restoreScene';
import { webgalStore } from '@/store/store';
import { getValueFromState } from '@/Core/gameScripts/setVar';
import { strIf } from '@/Core/gameScripts/function/strIf';
import { strIf } from '@/Core/controller/gamePlay/strIf';
import { nextSentence } from '@/Core/controller/gamePlay/nextSentence';
import cloneDeep from 'lodash/cloneDeep';
import { ISceneEntry } from '@/Core/Modules/scene';
import { IBacklogItem } from '@/Core/Modules/backlog';
import { SYSTEM_CONFIG } from '@/Core/config/config';
import { SYSTEM_CONFIG } from '@/config';
import { WebGAL } from '@/Core/WebGAL';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { resetStage } from '@/Core/controller/stage/resetStage';
import { webgalStore } from '@/store/store';
import { setVisibility } from '@/store/GUIReducer';
import { nextSentence } from '@/Core/controller/gamePlay/nextSentence';
import { setEbg } from '@/Core/util/setEbg';
import { setEbg } from '@/Core/gameScripts/changeBg/setEbg';
import { restorePerform } from '@/Core/controller/storage/jumpFromBacklog';

import { hasFastSaveRecord, loadFastSaveGame } from '@/Core/controller/storage/fastSaveLoad';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger } from '@/Core/util/etc/logger';
import { logger } from '@/Core/util/logger';

import { WebGAL } from '@/Core/WebGAL';

Expand Down
2 changes: 1 addition & 1 deletion packages/webgal/src/Core/controller/scene/callScene.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { sceneFetcher } from './sceneFetcher';
import { sceneParser } from '../../parser/sceneParser';
import { logger } from '../../util/etc/logger';
import { logger } from '../../util/logger';
import { nextSentence } from '@/Core/controller/gamePlay/nextSentence';
import uniqWith from 'lodash/uniqWith';
import { scenePrefetcher } from '@/Core/util/prefetcher/scenePrefetcher';
Expand Down
2 changes: 1 addition & 1 deletion packages/webgal/src/Core/controller/scene/changeScene.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { sceneFetcher } from './sceneFetcher';
import { sceneParser } from '../../parser/sceneParser';
import { logger } from '../../util/etc/logger';
import { logger } from '../../util/logger';
import { nextSentence } from '@/Core/controller/gamePlay/nextSentence';
import uniqWith from 'lodash/uniqWith';
import { scenePrefetcher } from '@/Core/util/prefetcher/scenePrefetcher';
Expand Down
2 changes: 1 addition & 1 deletion packages/webgal/src/Core/controller/scene/restoreScene.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { sceneFetcher } from './sceneFetcher';
import { sceneParser } from '../../parser/sceneParser';
import { logger } from '../../util/etc/logger';
import { logger } from '../../util/logger';
import { nextSentence } from '@/Core/controller/gamePlay/nextSentence';
import { ISceneEntry } from '@/Core/Modules/scene';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export enum commandType {
comment,
setTransform,
setTransition,
getUserInput,
}

/**
Expand Down
45 changes: 40 additions & 5 deletions packages/webgal/src/Core/controller/stage/pixi/PixiController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { webgalStore } from '@/store/store';
import { setStage, stageActions } from '@/store/stageReducer';
import cloneDeep from 'lodash/cloneDeep';
import { IEffect, IFigureAssociatedAnimation } from '@/store/stageInterface';
import { logger } from '@/Core/util/etc/logger';
import { logger } from '@/Core/util/logger';
import { isIOS } from '@/Core/initializeScript';
import { WebGALPixiContainer } from '@/Core/controller/stage/pixi/WebGALPixiContainer';
import { WebGAL } from '@/Core/WebGAL';
// import { figureCash } from '@/Core/gameScripts/function/conentsCash'; // 如果要使用 Live2D,取消这里的注释
// import { figureCash } from '@/Core/gameScripts/vocal/conentsCash'; // 如果要使用 Live2D,取消这里的注释
// import { Live2DModel, SoundManager } from 'pixi-live2d-display'; // 如果要使用 Live2D,取消这里的注释

export interface IAnimationObject {
Expand Down Expand Up @@ -519,7 +519,7 @@ export default class PixiStage {
* @param jsonPath
*/
// eslint-disable-next-line max-params
// public addLive2dFigure(key: string, jsonPath: string, pos: string, motion: string) {
// public addLive2dFigure(key: string, jsonPath: string, pos: string, motion: string, expression: string) {
// let stageWidth = this.stageWidth;
// let stageHeight = this.stageHeight;
// logger.debug('Using motion:', motion);
Expand Down Expand Up @@ -547,6 +547,8 @@ export default class PixiStage {
// pixiContainer: thisFigureContainer,
// sourceUrl: jsonPath,
// });
// // eslint-disable-next-line @typescript-eslint/no-this-alias
// const instance = this;
//
// const setup = () => {
// if (thisFigureContainer) {
Expand All @@ -572,13 +574,28 @@ export default class PixiStage {
// model.position.x = stageWidth - targetWidth / 2;
// }
//
// let category_name = motion;
// let motionToSet = motion;
// let animation_index = 0;
// let priority_number = 3;
// // var audio_link = voiceCash.pop();
//
// // model.motion(category_name, animation_index, priority_number,location.href + audio_link);
// model.motion(category_name, animation_index, priority_number);
// /**
// * 检查 Motion 和 Expression
// */
// const motionFromState = webgalStore.getState().stage.live2dMotion.find((e) => e.target === key);
// const expressionFromState = webgalStore.getState().stage.live2dExpression.find((e) => e.target === key);
// if (motionFromState) {
// motionToSet = motionFromState.motion;
// }
// instance.updateL2dMotionByKey(key, motionToSet);
// model.motion(motionToSet, animation_index, priority_number);
// let expressionToSet = expression;
// if (expressionFromState) {
// expressionToSet = expressionFromState.expression;
// }
// instance.updateL2dExpressionByKey(key, expressionToSet);
// model.expression(expressionToSet);
//
// // lip-sync is still a problem and you can not.
// SoundManager.volume = 0;
Expand Down Expand Up @@ -636,6 +653,24 @@ export default class PixiStage {
}
}

public setModelMouthY(key: string, y: number) {
function mapToZeroOne(value: number) {
return value < 50 ? 0 : (value - 50) / 50;
}
const paramY = mapToZeroOne(y);
const target = this.figureObjects.find((e) => e.key === key);
if (target) {
const container = target.pixiContainer;
const children = container.children;
for (const model of children) {
// @ts-ignore
if (model?.internalModel)
// @ts-ignore
model?.internalModel?.coreModel?.setParamFloat?.('PARAM_MOUTH_OPEN_Y', paramY);
}
}
}

/**
* 根据 key 获取舞台上的对象
* @param key
Expand Down
2 changes: 1 addition & 1 deletion packages/webgal/src/Core/controller/stage/playBgm.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { webgalStore } from '@/store/store';
import { setStage } from '@/store/stageReducer';
import { logger } from '@/Core/util/etc/logger';
import { logger } from '@/Core/util/logger';

// /**
// * 停止bgm
Expand Down
2 changes: 1 addition & 1 deletion packages/webgal/src/Core/controller/stage/setVolume.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger } from '../../util/etc/logger';
import { logger } from '../../util/logger';
import { webgalStore } from '@/store/store';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger } from '../../util/etc/logger';
import { logger } from '../../util/logger';
import { sceneFetcher } from '../scene/sceneFetcher';
import { sceneParser } from '../../parser/sceneParser';
import { IStageState } from '@/store/stageInterface';
Expand Down
4 changes: 2 additions & 2 deletions packages/webgal/src/Core/controller/storage/loadGame.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ISaveData } from '@/store/userDataInterface';
import { logger } from '../../util/etc/logger';
import { logger } from '../../util/logger';
import { sceneFetcher } from '../scene/sceneFetcher';
import { sceneParser } from '../../parser/sceneParser';
import { webgalStore } from '@/store/store';
Expand All @@ -10,7 +10,7 @@ import { stopAllPerform } from '@/Core/controller/gamePlay/stopAllPerform';
import cloneDeep from 'lodash/cloneDeep';
import uniqWith from 'lodash/uniqWith';
import { scenePrefetcher } from '@/Core/util/prefetcher/scenePrefetcher';
import { setEbg } from '@/Core/util/setEbg';
import { setEbg } from '@/Core/gameScripts/changeBg/setEbg';

import { WebGAL } from '@/Core/WebGAL';

Expand Down
2 changes: 1 addition & 1 deletion packages/webgal/src/Core/controller/storage/saveGame.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger } from '../../util/etc/logger';
import { logger } from '../../util/logger';
import { ISaveData } from '@/store/userDataInterface';
import { syncStorageFast } from './storageController';
import { webgalStore } from '@/store/store';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as localforage from 'localforage';
import { IUserData } from '@/store/userDataInterface';
import { logger } from '../../util/etc/logger';
import { logger } from '../../util/logger';
import { webgalStore } from '@/store/store';
import { initState, resetUserData } from '@/store/userDataReducer';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { ISentence } from '@/Core/controller/scene/sceneInterface';
import { IPerform } from '@/Core/Modules/perform/performInterface';
// import {getRandomPerformName} from '../../../util/getRandomPerformName';
import styles from '../../Components/Stage/stage.module.scss';
import styles from '@/Stage/stage.module.scss';
import { webgalStore } from '@/store/store';
import { setStage, stageActions } from '@/store/stageReducer';
import { getSentenceArgByKey } from '@/Core/util/getSentenceArg';
import { unlockCgInUserData } from '@/store/userDataReducer';
import { logger } from '@/Core/util/etc/logger';
import { logger } from '@/Core/util/logger';
import { ITransform } from '@/store/stageInterface';
import { generateTransformAnimationObj } from '@/Core/gameScripts/function/generateTransformAnimationObj';
import { generateTransformAnimationObj } from '@/Core/controller/stage/pixi/animations/generateTransformAnimationObj';
import { IUserAnimation } from '@/Core/Modules/animations';
import cloneDeep from 'lodash/cloneDeep';
import { getAnimateDuration } from '@/Core/Modules/animationFunctions';
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/webgal/src/Core/gameScripts/changeFigure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import cloneDeep from 'lodash/cloneDeep';
import { getSentenceArgByKey } from '@/Core/util/getSentenceArg';
import { IFreeFigure, IStageState, ITransform } from '@/store/stageInterface';
import { IUserAnimation } from '@/Core/Modules/animations';
import { generateTransformAnimationObj } from '@/Core/gameScripts/function/generateTransformAnimationObj';
import { generateTransformAnimationObj } from '@/Core/controller/stage/pixi/animations/generateTransformAnimationObj';
import { assetSetter, fileType } from '@/Core/util/gameAssetsAccess/assetSetter';
import { logger } from '@/Core/util/etc/logger';
import { logger } from '@/Core/util/logger';
import { getAnimateDuration } from '@/Core/Modules/animationFunctions';
import { WebGAL } from '@/Core/WebGAL';
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ISentence } from '@/Core/controller/scene/sceneInterface';
import { IPerform } from '@/Core/Modules/perform/performInterface';
import { changeScene } from '@/Core/controller/scene/changeScene';
import { jmp } from '@/Core/gameScripts/function/jmp';
import { jmp } from '@/Core/gameScripts/label/jmp';
import ReactDOM from 'react-dom';
import React from 'react';
import styles from './performStyles/choose.module.scss';
import styles from './choose.module.scss';
import { webgalStore } from '@/store/store';
import { textFont } from '@/store/userDataInterface';
import { PerformController } from '@/Core/Modules/perform/performController';
Expand Down
Loading

0 comments on commit 98fcca6

Please sign in to comment.