Skip to content

4.5.18#876

Merged
MakinoharaShoko merged 53 commits intomainfrom
dev
Feb 16, 2026
Merged

4.5.18#876
MakinoharaShoko merged 53 commits intomainfrom
dev

Conversation

@MakinoharaShoko
Copy link
Member

No description provided.

HardyNLee and others added 30 commits December 29, 2025 21:58
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
fix: set logo background opaque when fade in
feat: preload template style files
feat: support conditional logic for string in -when command
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
fix: 修复 changeBg 与 changeFigure 的 exit 设置不能正常生效的问题
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
fix: init config data when clear all data
feat: preserve inline comment in ISentence
fix: failed to modify source transform
HardyNLee and others added 22 commits January 26, 2026 04:09
fix: update appreciation data properly
fix: ensure live2d blink focus in state is full
fix: 修复 exitDuration 未正常生效的问题(close #852)
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @MakinoharaShoko, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the WebGAL engine by expanding its script parsing capabilities to include inline comments, introducing a dynamic and event-driven system for UI style management, and enhancing the PixiJS rendering pipeline with blend mode support and refined animation controls. It also improves the robustness of variable evaluation, ensures better persistence for game configuration and unlocked content, and implements a more visually appealing background transition mechanism.

Highlights

  • Inline Comment Support: The script parser now fully supports inline comments, allowing them to be parsed and stored within the ISentence interface. This includes updates to the parser logic and corresponding test cases.
  • Dynamic UI Style Loading: Implemented a new system for dynamically loading and applying UI styles (SCSS converted to CSS-in-JS) from template files. This enhances customization capabilities and introduces styleUpdate and afterStyleUpdate events for better style management.
  • Enhanced PixiJS Stage Control: Added support for blendMode in figures on the PixiJS stage, allowing for more creative visual effects. The assignTransform method was refined to handle alpha conversion, and animation handling for keep animations was improved to prevent unintended state resets.
  • Robust Variable Handling: The whenChecker and getValueFromStateElseKey functions were updated to more accurately parse and quote string variables within conditional expressions, preventing evaluation errors.
  • Persistent Game Configuration & Unlocks: Initial game configuration from config.txt is now stored and used to restore settings when all user data is reset. Additionally, unlocked CGs and BGMs are now immediately saved to local storage for better persistence.
  • Smoother Background Transitions: A new overlay element (html-body__effect-background-overlay) has been introduced in index.html and utilized by setEbg to create smoother, animated transitions between background images.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • packages/parser/package.json
    • Updated package version to 4.5.18.
  • packages/parser/src/interface/sceneInterface.ts
    • Added 'inlineComment' field to the ISentence interface.
  • packages/parser/src/scriptParser/scriptParser.ts
    • Initialized 'inlineComment' field for new sentences.
    • Assigned parsed inline comments to the 'inlineComment' field.
  • packages/parser/test/parser.test.ts
    • Added 'inlineComment' field to expected sentence items in existing tests.
    • Added new test cases for preserving inline comments on normal statements.
    • Added new test cases for preserving escaped semicolons in content and inline comments.
    • Added new test cases for comment-only lines.
  • packages/webgal/index.html
    • Added a black background style to the 'body' element.
    • Introduced 'html-body__effect-background-overlay' for background transition effects.
    • Modified the 'html-body__effect-background' div to include the new overlay.
  • packages/webgal/src/Core/Modules/animationFunctions.ts
    • Imported 'stageActions' for Redux state management.
    • Modified 'PixiStage.assignTransform' call to include 'convertAlpha' parameter.
    • Refactored exit animation logic to remove animation settings after they are applied.
  • packages/webgal/src/Core/Modules/events.ts
    • Added 'afterStyleUpdate' event to the event bus.
  • packages/webgal/src/Core/controller/gamePlay/scriptExecutor.ts
    • Modified 'whenChecker' to trim variable names before evaluation.
    • Updated 'getValueFromStateElseKey' call to include 'quoteString' parameter for better variable handling.
  • packages/webgal/src/Core/controller/scene/sceneInterface.ts
    • Added 'inlineComment' field to the ISentence interface.
  • packages/webgal/src/Core/controller/stage/pixi/PixiController.ts
    • Modified 'assignTransform' method to accept a 'convertAlpha' parameter and handle alpha/blendMode properties.
    • Added support for 'blendMode' metadata when adding or updating figures.
  • packages/webgal/src/Core/controller/stage/pixi/WebGALPixiContainer.ts
    • Imported 'logger' for logging purposes.
    • Introduced an 'alphaFilter' and implemented getters/setters for 'alphaFilterVal' and 'blendMode'.
    • Adjusted filter insertion logic to prioritize the 'alphaFilter'.
  • packages/webgal/src/Core/controller/stage/pixi/animations/timeline.ts
    • Removed a redundant comment regarding alpha handling.
    • Modified animation condition to only run if 'duration' is greater than 0 AND 'timeline' length is greater than 1.
  • packages/webgal/src/Core/controller/stage/pixi/animations/universalSoftIn.ts
    • Changed references from 'alpha' to 'alphaFilterVal' for soft-in animations.
  • packages/webgal/src/Core/controller/stage/pixi/animations/universalSoftOff.ts
    • Changed references from 'alpha' to 'alphaFilterVal' for soft-off animations.
  • packages/webgal/src/Core/gameScripts/bgm.ts
    • Imported 'localforage' and 'WebGAL'.
    • Added logic to save user data to local storage immediately after unlocking a BGM.
  • packages/webgal/src/Core/gameScripts/changeBg/index.ts
    • Imported 'localforage'.
    • Added logic to save user data to local storage immediately after unlocking a CG.
  • packages/webgal/src/Core/gameScripts/changeBg/setEbg.ts
    • Modified 'setEbg' function to use the new overlay element for background transitions.
    • Updated 'setEbg' to accept an optional 'duration' parameter for the transition.
  • packages/webgal/src/Core/gameScripts/changeFigure.ts
    • Added 'blendMode' as a new argument for figure changes.
    • Added a return condition to 'setAnimationNames' if the content is empty.
    • Included 'blendMode' in the figure metadata dispatched to the stage actions.
  • packages/webgal/src/Core/gameScripts/choose/index.tsx
    • Simplified the argument passed to 'useApplyStyle' from a full path to a simple string identifier.
  • packages/webgal/src/Core/gameScripts/setAnimation.ts
    • Removed the 'startDialogKey' variable as it was no longer needed.
    • Introduced a 'keepAnimationStopped' flag and modified the stop function logic for 'keep' animations.
  • packages/webgal/src/Core/gameScripts/setTempAnimation.ts
    • Removed the 'startDialogKey' variable as it was no longer needed.
    • Introduced a 'keepAnimationStopped' flag and modified the stop function logic for 'keep' animations.
  • packages/webgal/src/Core/gameScripts/setTransform.ts
    • Removed the 'startDialogKey' variable as it was no longer needed.
  • packages/webgal/src/Core/gameScripts/setVar.ts
    • Added a 'quoteString' parameter to 'getValueFromStateElseKey' to handle string quoting for expressions.
    • Implemented logic to wrap string values in quotes and escape internal quotes when 'quoteString' is true.
  • packages/webgal/src/Core/gameScripts/vocal/index.ts
    • Modified vocal audio context source connection logic to properly handle existing media elements and disconnect old sources.
  • packages/webgal/src/Core/util/coreInitialFunction/infoFetcher.ts
    • Imported 'setUserData' and 'IGameVar' for managing user data.
    • Added logic to store the initial game configuration from 'config.txt' into 'gameConfigInit' in user data.
  • packages/webgal/src/Core/util/coreInitialFunction/templateLoader.ts
    • Imported 'scss2cssinjsParser' and 'injectGlobal' for dynamic style processing.
    • Introduced 'loadStyleFiles' function to fetch, parse, and inject SCSS styles from templates.
    • Registered 'loadStyleFiles' to run on 'styleUpdate' events and emit 'afterStyleUpdate' upon completion.
  • packages/webgal/src/Core/webgalCore.ts
    • Imported 'IWebGALStyleObj' type.
    • Added a 'styleObjects' Map to store parsed CSS-in-JS style objects.
  • packages/webgal/src/Stage/AudioContainer/AudioContainer.tsx
    • Adjusted vocal volume calculation for better precision.
    • Added 'stageStore.playVocal' to the dependency array of the vocal volume effect hook.
  • packages/webgal/src/Stage/MainStage/useSetBg.ts
    • Modified 'useSetBg' to pass the calculated duration to 'setEbg' for animated background transitions.
    • Removed direct 'setEbg' call, relying on the new animated version.
  • packages/webgal/src/Stage/MainStage/useSetFigure.ts
    • Added logic to update 'blendMode' for figure containers based on metadata.
  • packages/webgal/src/Stage/TextBox/IMSSTextbox.tsx
    • Simplified the argument passed to 'useApplyStyle' from a full path to a simple string identifier.
    • Updated the variable name for text line height from 'LineHeight' to 'Line_height' for consistency.
  • packages/webgal/src/UI/Extra/extra.module.scss
    • Modified 'cgShowDivWarpper' styles to enable horizontal scrolling and prevent wrapping.
    • Added 'flex-shrink: 0' to '.cgNav' for better layout control during scrolling.
  • packages/webgal/src/UI/Logo/logo.module.scss
    • Added an intermediate keyframe at 65% to the logo animation, keeping opacity at 1 for longer.
  • packages/webgal/src/UI/Title/Title.tsx
    • Simplified the argument passed to 'useApplyStyle' from a full path to a simple string identifier.
  • packages/webgal/src/hooks/useApplyStyle.ts
    • Modified 'useApplyStyle' to retrieve style objects from 'WebGAL.styleObjects' map.
    • Renamed 'useRigisterStyleUpdate' to 'useRegisterAfterStyleUpdate' and updated it to listen for 'afterStyleUpdate' events.
  • packages/webgal/src/store/stageInterface.ts
    • Added 'blendMode' (optional string) to the 'IFigureMetadata' interface.
  • packages/webgal/src/store/stageReducer.ts
    • Imported 'baseBlinkParam' and 'baseFocusParam' for Live2D settings.
    • Modified 'removeAnimationSettingsByTarget' to preserve exit animation settings by creating a '-off' entry.
    • Added 'removeAnimationSettingsByTargetOff' action to specifically remove '-off' animation settings.
    • Updated 'setLive2dBlink' and 'setLive2dFocus' to merge new parameters with base parameters for complete settings.
  • packages/webgal/src/store/userDataInterface.ts
    • Added 'gameConfigInit' to the 'IUserData' interface to store initial game configuration.
  • packages/webgal/src/store/userDataReducer.ts
    • Initialized 'gameConfigInit' in the initial state.
    • Updated 'unlockCgInUserData' and 'unlockBgmInUserData' to set the 'name' property instead of 'url' when updating existing entries.
    • Modified 'resetAllData' to preserve 'gameConfigInit' and restore 'globalGameVar' from it when resetting user data.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/pr-check.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a host of new features and improvements, including support for inline comments in scripts, blend modes for figures, and a more robust styling system. The background transitions are now smoother with a cross-fade effect, and the animation system has been enhanced. Several bugs have also been fixed, and the codebase has been refactored for better performance and maintainability. My review includes a couple of suggestions to improve error handling and ensure backward compatibility.

if (name !== '') {
webgalStore.dispatch(unlockBgmInUserData({ name, url, series }));
const userDataState = webgalStore.getState().userData;
localforage.setItem(WebGAL.gameKey, userDataState).then(() => {});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Saving user data is a critical operation, but the promise returned by localforage.setItem is not being handled for potential failures. If an error occurs during the save (e.g., storage is full or unavailable), it will be silently ignored. It's recommended to add a .catch() block to handle and log any potential errors.

Suggested change
localforage.setItem(WebGAL.gameKey, userDataState).then(() => {});
localforage.setItem(WebGAL.gameKey, userDataState).catch(err => logger.error('Failed to save user data:', err));

if (unlockName !== '') {
dispatch(unlockCgInUserData({ name: unlockName, url, series }));
const userDataState = webgalStore.getState().userData;
localforage.setItem(WebGAL.gameKey, userDataState).then(() => {});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the other file, saving user data here is a fire-and-forget operation. If localforage.setItem fails, the error will be swallowed. It's best practice to handle potential errors from storage operations.

Suggested change
localforage.setItem(WebGAL.gameKey, userDataState).then(() => {});
localforage.setItem(WebGAL.gameKey, userDataState).catch(err => logger.error('Failed to save user data:', err));

const userDataState = useSelector((state: RootState) => state.userData);
const lineHeightValue = textSizeState === textSize.medium ? 2.2 : 2;
const textLineHeight = userDataState.globalGameVar.LineHeight;
const textLineHeight = userDataState.globalGameVar.Line_height;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The global variable for text line height has been renamed from LineHeight to Line_height. This is a breaking change for existing projects that might have LineHeight defined in their config.txt. To maintain backward compatibility, you could consider supporting both names.

Suggested change
const textLineHeight = userDataState.globalGameVar.Line_height;
const textLineHeight = userDataState.globalGameVar.Line_height ?? userDataState.globalGameVar.LineHeight;

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 16, 2026

Deploying webgal-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1826529
Status: ✅  Deploy successful!
Preview URL: https://422f29ae.webgal-dev.pages.dev

View logs

@MakinoharaShoko MakinoharaShoko merged commit 65df686 into main Feb 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments