Commit Graph

53 Commits

Author SHA1 Message Date
xiaji
70050b68e6 fix(ui): add 30px top spacer to HandArea so card lift isn't clipped 2026-06-05 21:13:52 +08:00
xiaji
60b3856a23 fix(ui): connect _gui_input to receive card clicks (was dead handler) 2026-06-05 20:03:27 +08:00
xiaji
c6aa60a5cd docs: rewrite README to reflect current state (training mode + recent features) 2026-06-05 19:55:26 +08:00
xiaji
ae89194ecd fix(core): type get_hand as Array[Card] and use for-loop copy for dict reads 2026-06-02 21:57:47 +08:00
xiaji
85d2f63466 feat(ui): lift selected card 25px with tween animation 2026-06-02 21:45:57 +08:00
xiaji
24ee21f24c fix(ui): use float division for table card start_x 2026-06-02 21:34:35 +08:00
xiaji
15fbe7ee08 fix(core): use for-loop copy in _make_result to avoid Array.duplicate type loss 2026-06-02 21:22:33 +08:00
xiaji
deeb2088d1 fix(ui): use for-loop copy in _show_table_cards to avoid Array.duplicate type loss 2026-06-02 21:21:43 +08:00
xiaji
edbbb64421 refactor(ui): table cards parent from TableLabel to TableCardRoot 2026-06-02 20:54:50 +08:00
xiaji
4fa4207f8c feat(ui): flight animation + commentary on card play 2026-06-02 20:48:46 +08:00
xiaji
8f21f4dbab feat(ui): add commentary helpers and constants 2026-06-02 20:04:31 +08:00
xiaji
9ef3d61139 docs: add mouse_filter=2 to CommentaryLabel in Task 3 plan 2026-06-02 20:01:46 +08:00
xiaji
76a1306477 feat(ui): add CommentaryLabel and TableCardRoot nodes 2026-06-02 20:00:51 +08:00
xiaji
e54bc91fc5 feat(ui): sort hand by rank+suit before render 2026-06-02 19:48:05 +08:00
xiaji
885befab81 docs: document Buttons reposition step in Task 1 (layout follow-on) 2026-06-02 19:46:30 +08:00
xiaji
b5d403e850 feat(ui): migrate hand area to FlowContainer for auto-wrap 2026-06-02 19:39:30 +08:00
xiaji
9108d69e18 docs: add implementation plan for hand wrap + play animation 2026-06-02 19:33:21 +08:00
xiaji
2b2b76c867 docs: add design spec for hand wrap + play animation + commentary 2026-06-02 19:28:54 +08:00
xiaji
8c81e0d14b feat: 添加出牌动画和牌型排序显示
- 修复 AI decide 方法参数类型为 Array[Card]
- 添加 cards_played 和 player_passed 信号
- 出牌时在桌面中央显示排序后的卡牌
- 过牌时清除桌面牌
- 添加延迟动画效果(0.8秒显示,0.5秒清除)
- 添加 TableLabel 作为出牌显示区域
- 出牌按 rank 排序显示

🤖 Generated with [Qoder][https://qoder.com]
2026-06-01 23:12:35 +08:00
xiaji
ce84fa75a0 fix: 修复 hand_area 节点路径错误
- HandArea 现在在 ScrollContainer 下,路径改为 $ScrollContainer/HandArea
- 添加按钮空值检查,防止连接信号时出错

🤖 Generated with [Qoder][https://qoder.com]
2026-06-01 23:08:37 +08:00
xiaji
d51dc2e6f9 fix: 修复 Array[Card] 类型不匹配错误
- selected_cards 声明为 Array[Card] 而不是 Array
- handle_human_play 参数类型改为 Array[Card]
- 解决 HandEvaluator.evaluate 参数类型不匹配问题

🤖 Generated with [Qoder][https://qoder.com]
2026-06-01 23:07:37 +08:00
xiaji
69cdd5703b fix: 修复训练模式手牌显示不完整的问题
- 添加 ScrollContainer 包裹 HandArea,支持横向滚动查看所有27张牌
- HandArea 设置最小宽度 2200px 确保所有卡牌有足够空间
- 调整布局适配 1280x720 视口
- 按钮居中排列
- 清除调试 print 语句

🤖 Generated with [Qoder][https://qoder.com]
2026-06-01 23:04:07 +08:00
xiaji
297a68d096 fix: 修复 GDScript 4 类型推断错误
- rank_str 和 suit_str 需要显式声明 String 类型
- Godot 4 无法从数组值自动推断类型

🤖 Generated with [Qoder][https://qoder.com]
2026-06-01 23:01:59 +08:00
xiaji
fdc8aed7af fix: 使用 assets/cards/ 图片显示卡牌
- 移除文字显示方式(RankLabel/SuitLabel)
- 添加 TextureRect 节点显示卡牌图片
- 根据卡牌 suit 和 rank 动态加载对应图片
- 图片命名映射:S=黑桃, H=红桃, C=梅花, D=方块, SJ=小王, BJ=大王

🤖 Generated with [Qoder][https://qoder.com]
2026-06-01 22:59:52 +08:00
xiaji
b3fe03f229 feat: 优化开始训练指引并修复AI递归问题
- 修复 GameController._trigger_ai 中AI决策递归调用问题,增加 _is_processing 锁
- 修复 TrainingController 未加入场景树导致信号无法触发的问题
- 主菜单添加"游戏说明"按钮和详细指引对话框
- 训练室添加引导提示标签和操作状态反馈
- 优化提示功能显示中文牌型名称(单张、对子、顺子等)
- 优化错误信息显示,提供更具体的失败原因
- 清除调试 print 语句

🤖 Generated with [Qoder][https://qoder.com]
2026-06-01 22:55:18 +08:00
xiaji
cef2cba7a5 fix: resolve 43 GDScript warnings and fix card display
- Rename shadowed variables (round->_round, seed->_seed, is_processing->_is_processing)
- Prefix unused parameters with underscore throughout
- Add @warning_ignore for false positive integer_division warnings
- Fix unused_signal warnings in event_bus.gd
- Fix CardNode display: move setup() after add_child() so @onready works
- Redesign CardNode with Panel background, suit symbols, red/black colors
- Delete unused _current_hint in TrainingController
2026-05-30 22:38:52 +08:00
xiaji
bad46b0109 fix: revert // to / in deck.gd (GDScript 4 does not support // operator)
The INTEGER_DIVISION warning in deck.gd:19 is a false positive - both
operands are int, so / performs integer division correctly in GDScript 4.
Using // caused a parse error (Expected expression after '/' operator),
which cascaded to GameController/TrainingController resolution failure.
2026-05-30 08:01:07 +08:00
xiaji
f4a2686810 fix: resolve GDScript type errors and warnings
- Fix Array[Card] type mismatch in move_generator.gd (rank_counts arrays)
- Fix shadowed variables in card.gd (create, from_packed parameters)
- Fix integer division warning in deck.gd (/ → //)
- Fix unused_signal warnings in event_bus.gd (per-signal annotations)
- Fix unused_parameter warning in audio_manager.gd
- Normalize whitespace in training_controller.gd
2026-05-30 07:55:38 +08:00
xiaji
3ca5dbba99 fix: strip all remaining tab characters from all .gd files 2026-05-29 22:54:01 +08:00
xiaji
b7e734576a fix: suppress unused_signal warning on event_bus signals 2026-05-29 22:46:44 +08:00
xiaji
7fbf33b92c fix: remove 3 unused signals from event_bus 2026-05-29 22:40:27 +08:00
xiaji
a1476b7df3 fix: connect EventBus signals in game_controller to eliminate unused signal warnings 2026-05-29 22:31:21 +08:00
xiaji
c6e806a155 fix: add null guards for status_label, hand_area, and label throughout UI 2026-05-29 21:39:06 +08:00
xiaji
08f0a9f4f8 fix: attach hand_area.gd script to HandArea node in training_room.tscn 2026-05-29 21:22:52 +08:00
xiaji
65315be868 fix: remove remaining tab characters in training_room.gd 2026-05-29 21:21:37 +08:00
xiaji
951634656e fix: call start_training in _ready, set training_controller after creation 2026-05-29 21:04:53 +08:00
xiaji
b6363f8310 fix: use as cast for HandArea in training_room @onready 2026-05-29 21:02:21 +08:00
xiaji
3bed27076f fix: resolve tab chars, typing, and parse errors in UI and game controller 2026-05-29 21:01:03 +08:00
xiaji
3573cc66b6 fix: add class_name to HandArea and CardNode, fix type inference in training_room 2026-05-29 20:57:37 +08:00
xiaji
8337a37dfe docs: add README with setup and run instructions 2026-05-29 20:46:53 +08:00
xiaji
cb4afe0aaa fix: resolve pass keyword conflict in move_generator and game_controller 2026-05-29 10:09:55 +08:00
xiaji
c1350a3d7b fix: resolve GDScript parse errors (pass keyword, array type inference, tabs) 2026-05-29 10:03:55 +08:00
xiaji
09953c98f7 fix: add missing constants preload in HandEvaluator 2026-05-29 09:47:42 +08:00
xiaji
07fc763413 chore: add GUT test framework 2026-05-29 09:16:10 +08:00
xiaji
5741ba1dc0 test: add GUT test files for core modules (Card, Deck, HandEvaluator, RuleEngine, GameState) 2026-05-29 09:15:59 +08:00
xiaji
3272e3dc0a feat: add basic UI scenes (card, hand, training room, main menu) 2026-05-29 09:14:42 +08:00
xiaji
6886af1de7 feat: add autoloads, GameController, TrainingController, and ReplayRecorder 2026-05-29 09:13:25 +08:00
xiaji
016bb1a95e feat: add L1 Basic AI and L2 Rule AI with heuristic scoring 2026-05-29 09:11:43 +08:00
xiaji
42d59fcbae feat: add RuleEngine, GameState, Round, and Action system 2026-05-29 09:10:35 +08:00
xiaji
e19bb0d631 feat: add HandEvaluator and MoveGenerator with pruning 2026-05-29 09:08:42 +08:00