Skip to content

feat: add vconsole#909

Open
xiaoxustudio wants to merge 2 commits intoOpenWebGAL:devfrom
xiaoxustudio:feat/add-vconsole
Open

feat: add vconsole#909
xiaoxustudio wants to merge 2 commits intoOpenWebGAL:devfrom
xiaoxustudio:feat/add-vconsole

Conversation

@xiaoxustudio
Copy link
Member

close #904

config.txt增加配置选项:Show_Console: true | false;

默认关闭

image image

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 introduces a new debugging console, vconsole, into the application. This enhancement provides developers with an on-screen console for debugging purposes, which can be conveniently toggled on or off via a new Show_Console setting in the config.txt file. This improves the development and testing experience by offering immediate access to console logs and other debugging functionalities directly within the application's interface.

Highlights

  • Dependency Added: The vconsole library was added to package.json to provide an in-browser debugging console.
  • Console Integration: vconsole was integrated into WebgalCore, allowing it to be controlled programmatically.
  • Configurable Visibility: A new configuration option, Show_Console, was introduced to enable or disable the display of the vconsole instance via config.txt.
  • Type Definition: A TypeScript interface IVConsole was defined for the vconsole integration.
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.

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

本次 PR 引入了 vconsole 用于移动端调试,并添加了 Show_Console 配置项来控制其显示,这是一个实用的功能增强。

代码审查中,我发现了一个高危问题:在 webgalCore.ts 中,vconsoleshow/hide 方法直接操作 DOM 并依赖了 vconsole 库的内部实现,这可能导致在库版本更新后代码失效,并且存在潜在的运行时错误。我已经提出了修改建议,以使用库提供的 API 来提高代码的健壮性和可维护性。

此外,我还对 infoFetcher.ts 中的一处逻辑提出了简化建议,以提高代码的简洁性。

请查看具体的审查评论。

@MakinoharaShoko
Copy link
Member

可以把打开 vConsole的开关,放在 webgal dev panel 里面。因为现在本来就有这个东西。

@xiaoxustudio
Copy link
Member Author

xiaoxustudio commented Mar 22, 2026

可以把打开 vConsole的开关,放在 webgal dev panel 里面。因为现在本来就有这个东西。

如果放那里,感觉很多输出拦截不到(因为现在的位置,就已经有些输出没有拦截到了),其实我更想直接放在index.html中的,但想了下,这样管理不太方便。

抱歉,理解错你的意思了,webgal dev panel 移动端有办法打开吗?看了下代码,似乎只能通过修改url开启,移动端好像做不到。

@MakinoharaShoko
Copy link
Member

我认为可以在一个很早的时候就加载vconsole,但是先隐藏,在panel里面控制显隐。
使用配置文件来控制,在url不改变的情况下打开dev panel,也许可以。但是在游戏正式发布后,那个配置肯定是关的,那么如果遇到问题还是难以打开,所以也许需要在 Android模板上做些什么。

@xiaoxustudio
Copy link
Member Author

xiaoxustudio commented Mar 23, 2026

我认为可以在一个很早的时候就加载vconsole,但是先隐藏,在panel里面控制显隐。 使用配置文件来控制,在url不改变的情况下打开dev panel,也许可以。但是在游戏正式发布后,那个配置肯定是关的,那么如果遇到问题还是难以打开,所以也许需要在 Android模板上做些什么。

目前就是这样做的,但放在panel里我并不赞成,比如游戏一开始打开就黑屏,这时panel是否还能打开?能打开那么你的方案可行;vconsole 我看它是可以自定义插件的,比如添加 顶部按钮什么的,后续我们可以将目前的webgal dev panel 移植成插件装在vconsole中,这样能够获得vconsole的大部分能力。

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.

2 participants