Merged
Conversation
新增功能: - ServiceRegistry: 线程安全的服务注册表 - HistoryService: 历史记录服务接口(Protocol + GameRecord) - BasePlugin 服务相关方法: - register_service(): 注册服务(自动验证 Protocol 实现) - has_service(): 检查服务存在 - get_service_proxy(): 获取服务代理(IDE 友好) - call_service_async(): 异步调用服务 设计特点: - 服务方法在服务提供者线程执行,线程安全 - 使用 Protocol 定义接口,IDE 可完整推断类型 - 返回 frozen dataclass,保证数据不可变 - shutdown 时自动注销服务 - GUI 回调添加异常保护 文档更新: - plugin-dev-tutorial.md: 添加服务通讯说明 - 目录结构: 添加 shared_types/services 目录
新增功能: - 添加 OtherInfoBase 配置容器基类 - 支持多种配置类型自动生成 UI 控件: - BoolConfig -> QCheckBox - IntConfig -> QSpinBox - FloatConfig -> QDoubleSpinBox - ChoiceConfig -> QComboBox - TextConfig -> QLineEdit - ColorConfig -> 颜色选择器 - FileConfig -> 文件选择器 - PathConfig -> 目录选择器 - LongTextConfig -> QTextEdit - RangeConfig -> 数值范围控件 - 配置自动持久化到 data/plugin_data/<name>/config.json - 配置变化信号 config_changed 支持实时响应 - 设置对话框中显示插件自定义配置 - 支持继承 BaseConfig 创建自定义配置类型 修复: - 修复 WindowMode/LogLevel 继承自 str 的比较问题 - 修复 set_plugin_log_level 的 Level 类型错误 - 修复配置加载时错误使用插件默认值的问题 - 修复窗口模式即时切换功能 文档: - 在 plugin-dev-tutorial.md 中添加完整的配置系统章节 - 更新快速参考卡片和 API 文档
修改: - BaseConfig.create_widget() 返回四个值: (控件, getter, setter, 信号) - 所有预定义配置类型更新返回值 - config_widget.py 使用信号对象连接变化,不再自动检测控件类型 - 修复 ColorConfig/RangeConfig 信号对象被垃圾回收的问题 - 更新 plugin-dev-tutorial.md 文档 优点: - 插件开发者可在自己插件中定义配置类型,无需修改插件管理器代码 - 配置类型完全控制自己的 UI 和信号连接方式
Contributor
Author
|
增加了插件自定义配置系统,大大简化了插件Config的处理难度,并提供了自定义配置控件的方法以满足不同的需求。
|
Contributor
Author
|
下一步开发计划 |
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.
新增功能:
设计特点:
文档更新: