Skip to content

[O] 针对曲目伪装术的一些小改进#116

Open
WUGqnwvMQPzl wants to merge 3 commits intoMuNET-OSS:mainfrom
WUGqnwvMQPzl:CamouflageFeat
Open

[O] 针对曲目伪装术的一些小改进#116
WUGqnwvMQPzl wants to merge 3 commits intoMuNET-OSS:mainfrom
WUGqnwvMQPzl:CamouflageFeat

Conversation

@WUGqnwvMQPzl
Copy link
Contributor

Screenshot 2026-03-05 170614

另外新增了无视玩家游玩记录强制显示曲目伪装的开关

@gemini-code-assist
Copy link

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!

此拉取请求通过引入一个新配置选项来增强曲目伪装功能,该选项允许用户强制显示伪装,而不受玩家游玩历史的限制。同时,它改进了伪装信息的数据结构,使其能够更灵活地管理和加载自定义曲目数据,并确保自定义的音符设计师信息能在游戏界面中正确呈现,从而提升了用户体验和功能的定制性。

Highlights

  • 新增配置选项: 引入了一个新的配置选项,允许用户选择始终显示曲目伪装,无论玩家是否已游玩过该曲目,从而绕过玩家游玩记录的检测。
  • 重构伪装信息处理: 重构了 CamouflageInfo 类,使其能够更好地封装数据加载逻辑,并支持自定义音符设计师(Note Designer)信息,提高了代码的可维护性和扩展性。
  • 扩展音符设计师显示: 新增了一个 Harmony 补丁,确保自定义的音符设计师文本能够在游戏界面的时间轴(Timeline)中正确显示。
Changelog
  • AquaMai.Mods/Fancy/TrackCamouflage.cs
    • 添加了 Tomlet.ModelsManager.MaiStudio 的引用。
    • 新增了 AlwaysShowCamouflage 配置项,用于控制是否无视玩家游玩记录强制显示伪装。
    • 重构了 CamouflageInfo 类,使其构造函数接受 TomlDocument,并封装了数据加载方法。
    • CamouflageInfo 中增加了对自定义音符设计师名称(Note Designer)的支持。
    • 修改了 ApplyCamouflageOnMusicChainCard 方法,使其能够应用自定义的音符设计师名称。
    • 新增了 InjectTimelineRootInitialise Harmony 补丁,用于在时间轴界面显示自定义音符设计师名称。
    • 更新了 CamouflageCheck 方法,以根据 AlwaysShowCamouflage 配置项决定是否跳过玩家游玩记录检查。
Activity
  • 没有检测到任何拉取请求活动。
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

@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

此拉取请求对曲目伪装术功能进行了一些改进,包括引入了一个新配置选项,允许在任何情况下都显示伪装信息,以及对 CamouflageInfo 类进行了重构,使其能够更好地封装数据加载逻辑,并支持伪装音符设计师名称。这些更改提高了代码的可维护性和功能性。

Comment on lines +404 to +421
private string _name;
private string _artist;
private bool _hideNoteDesigner;
private string _noteDesigner;
private Texture2D _jacket;

public string Name => _name;
public string Artist => _artist;
public string NoteDesigner => _hideNoteDesigner ? _noteDesigner : null;
public Texture2D JacketTexture => _jacket;

public void Load()
{
_name = LoadString("Name") ?? "???";
_artist = LoadString("Artist") ?? "???";
_hideNoteDesigner = LoadBoolean("HideNoteDesigner");
_noteDesigner = LoadString("NoteDesigner") ?? "-";
}

Choose a reason for hiding this comment

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

medium

为了确保 CamouflageInfo 对象在创建后始终处于完全初始化状态,建议将 Load() 方法中的逻辑直接合并到字段初始化器或构造函数中。这样可以避免在实例化对象后忘记调用 Load() 方法而导致对象状态不一致的问题。

        private string _name = LoadString("Name") ?? "???";
        private string _artist = LoadString("Artist") ?? "???";
        private bool _hideNoteDesigner = LoadBoolean("HideNoteDesigner");
        private string _noteDesigner = LoadString("NoteDesigner") ?? "-";
        private Texture2D _jacket;

        public string Name => _name;
        public string Artist => _artist;
        public string NoteDesigner => _hideNoteDesigner ? _noteDesigner : null;
        public Texture2D JacketTexture => _jacket;

        // Load() 方法已移除,其逻辑已合并到字段初始化器中。

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.

1 participant