Skip to content

Commit b91329f

Browse files
authored
重构历史记录界面,增加分页和高级查询功能 (#85)
* fix(plugin): 修复事件处理器返回类型检查及上下文处理问题 修复BasePlugin中事件处理器返回类型不一致的问题,添加类型检查 修正PluginManager和PluginManagerUI中的上下文处理逻辑 优化History插件的事件处理器返回 * feat(history): 实现游戏历史记录功能及GUI界面 新增历史记录数据库存储功能,完善GameEndEvent数据结构,添加历史记录查看GUI界面,支持播放和导出历史记录 * feat(History): 添加历史记录保存模式配置选项 * refactor(plugin): 将插件初始化逻辑移到服务器连接之后 将插件管理器和应用上下文的初始化代码从主程序入口移动到本地服务连接建立之后,确保插件加载在正确的上下文中执行 * feat(history_gui): 添加历史记录过滤功能组件 新增逻辑符号和比较符号枚举类,实现历史记录表格的过滤功能,支持通过组合条件筛选历史记录数据 * style(utils): 清理代码格式和冗余代码 删除重复代码行,调整代码缩进和空格格式,移除无用空行和注释 * feat(history_gui): 重构历史记录界面,增加分页和高级查询功能 - 使用QAbstractTableModel重构历史记录表格,提升性能 - 增加高级查询功能,支持多种条件组合和括号优先级 - 实现分页功能,支持自定义每页显示数量 - 新增GameLevel枚举类型,完善游戏难度显示 - 优化字段类型处理,根据字段类型自动生成合适的输入控件
1 parent 46bfb51 commit b91329f

File tree

8 files changed

+1172
-349
lines changed

8 files changed

+1172
-349
lines changed

src/history_gui.py

Lines changed: 485 additions & 49 deletions
Large diffs are not rendered by default.

src/mp_plugins/events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ class GameEndEvent(BaseEvent):
3939
is_fair: int = 0
4040
op: int = 0
4141
isl: int = 0
42+
pluck: float = 0
4243
raw_data: str = ''

src/plugins/History/History.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def initialize(self) -> None:
9292
is_fair INTEGER,
9393
op INTEGER,
9494
isl INTEGER,
95+
pluck REAL,
9596
raw_data BLOB
9697
);
9798
"""
@@ -150,6 +151,7 @@ def on_game_end(self, event: GameEndEvent):
150151
is_fair,
151152
op,
152153
isl,
154+
pluck,
153155
raw_data
154156
)
155157
values
@@ -191,6 +193,7 @@ def on_game_end(self, event: GameEndEvent):
191193
:is_fair,
192194
:op,
193195
:isl,
196+
:pluck,
194197
:raw_data
195198
)
196199
""",

src/ui/de_DE.ts

Lines changed: 200 additions & 92 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)