Conversation
- 在 `ModelListManager` 中添加 `OnModelChanged` 静态事件,用于订阅模型切换通知 - 新增 `ModelChangedEventArgs` 类,包含模型切换的详细信息 - 在模型切换、恢复等操作中自动触发事件,支持成功和失败的情况 - 支持为角色、宠物和AI角色分别监听模型切换事件 - 更新版本号至 v1.8.10
There was a problem hiding this comment.
Pull request overview
This PR merges the develop branch into main, introducing a new model change event subscription feature that allows external code to subscribe to model switching notifications.
Key changes:
- Added
OnModelChangedevent toModelListManagerfor real-time model change notifications - Created
ModelChangedEventArgsclass to encapsulate event data including target type, model ID, success status, and handler count - Event invocations added to all model application and restoration code paths, covering both success and failure scenarios
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| DuckovCustomModel/Managers/ModelListManager.cs | Added OnModelChanged event declaration and invocations in ApplyModelToTarget, RestoreOriginalModelForTarget, and ApplyModelToAICharacter methods for both success and failure cases |
| DuckovCustomModel.Core/Data/ModelChangedEventArgs.cs | New event arguments class containing model change information including target, model ID/name, restoration status, success flag, and handler count |
| CHANGELOG.md | Added v1.8.10 release notes documenting the new model change event subscription feature in Chinese |
| CHANGELOG_EN.md | Added v1.8.10 release notes documenting the new model change event subscription feature in English |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更内容
本次更新新增了模型切换事件订阅功能,允许其他模块监听并响应模型切换操作。
主要变更
新增
ModelChangedEventArgs事件参数类 (DuckovCustomModel.Core/Data/ModelChangedEventArgs.cs)ModelTarget)在
ModelListManager中添加OnModelChanged静态事件在以下方法中触发事件:
ApplyModelToTarget- 应用模型到目标时ApplyModelToAICharacter- 应用模型到AI角色时RestoreOriginalModelForTarget- 恢复原始模型时使用示例
版本信息