feat: 挑战详情支持挑战人数展示

This commit is contained in:
richarjiang
2026-05-14 17:01:56 +08:00
parent 40f7be5200
commit d78c29000d
3 changed files with 703 additions and 365 deletions

120
AGENTS.md
View File

@@ -40,62 +40,78 @@ Git 历史采用 Conventional Commits且摘要多为中文例如 `feat:
<claude-mem-context>
# Memory Context
# $CMEM mp-xieyingeng 2026-05-13 9:03am GMT+8
# [mp-xieyingeng] recent context, 2026-05-14 4:59pm GMT+8
Legend: 🎯session 🔴bugfix 🟣feature 🔄refactor ✅change 🔵discovery ⚖decision
Legend: 🎯session 🔴bugfix 🟣feature 🔄refactor ✅change 🔵discovery ⚖decision 🚨security_alert 🔐security_note
Format: ID TIME TYPE TITLE
Fetch details: get_observations([IDs]) | Search: mem-search skill
Stats: 47 obs (10,663t read) | 538,681t work | 98% savings
Stats: 50 obs (12,200t read) | 1,692,994t work | 99% savings
### Apr 24, 2026
101 8:46a 🟣 Live label display format updated to X/Y format
114 6:40p 🟣 Dynamic Input Layout Initialization in PageLevel Prefab
115 6:41p 🟣 Dynamic Punch Block Layout for PageLevel.prefab
116 " 🔵 Layout Component Configuration for Input and Punch Blocks
119 6:42p 🟣 Dynamic Input Blocks and Punch Layout System Implemented
121 " 🟣 PageLevel Prefab Updated with punchLayout Property
122 " 🔄 Cleanup After Dynamic Block Refactoring
124 " ✅ TypeScript Compilation Check in Progress
126 6:43p ✅ TypeScript Compilation Check Extended
127 " 🔄 Complete Diff of PageLevel.ts Dynamic Block System
128 " 🔵 PageLevel.prefab Changes Not Persisted
129 6:44p 🟣 PageLevel Prefab Correctly Updated with punchLayout
130 " ✅ TypeScript Compilation Blocked - Permission Required
133 6:45p 🔄 Extracted getPunchBlockLabel Helper Method
134 " 🔄 Template Node Hiding Logic Improved
136 6:48p ⚖️ TypeScript diagnostics disabled, using IDE/linter instead
138 " 🔄 PageLevel 输入方式从单框改为逐字格子
139 " 🔄 谐音梗展示从 Label 改为动态 Block 节点
140 " ✅ PageLevel.prefab 布局位置微调
165 8:08p 🟣 PageLevel input layout simplified to single-character boxes with auto-distribution
167 8:09p 🔵 PageLevel.ts input block structure and callback stubs discovered
168 " 🟣 Auto-distribute characters across input boxes and auto-submit on completion implemented
169 " 🔴 PageLevel.ts node cleanup now calls removeFromParent before destroy
170 8:10p 🔄 PageLevel.ts full diff: single EditBox replaced with per-character block system
171 " 🔴 distributeInputText() wrapped in try/finally to guarantee flag reset
179 8:23p ✅ Game011_3.ttf font relocated from resources/ to dedicated fonts/ bundle directory
180 " 🟣 PageLoading.ts now loads fonts as a dynamic bundle after level data, before UI
181 " 🔄 AssetManager import switched to type-only import in PageLoading.ts
182 8:31p 🟣 PageLevel input UX improvement: full-string editing support
183 " 🟣 PageLevel input UX: full-string editing implemented
186 8:34p 🔴 PageLevel: clear input text on wrong answer
187 8:35p 🟣 PageLevel: delay pass modal to show punchline
189 8:36p 🔄 PageLevel: level completion reporting made fire-and-forget
191 8:45p 🔴 PageLevel: punchline block cleanup improved
192 8:46p 🟣 PageLevel.ts TitleLevel Label variable reserved
193 8:47p 🔵 PageLevel.ts level number tracking mechanism discovered
195 " 🟣 PageLevel.ts TitleLevel dynamic label update implemented
196 8:53p 🔵 PageLevel punchline not updated from enterLevel API
198 " 🔴 LevelDataManager updateLevelDetails now includes punchline
199 " 🔴 PageLevel punchline flow and empty state layout fixed
200 8:54p 🔴 LevelDataManager preserves existing punchline when enter returns null
203 9:06p 🟣 PageLevel.ts 新增图片描述标签绑定字段
205 9:07p 🟣 PageLevel.ts 图片描述标签字段对接完成
206 9:09p ✅ PageLevel.ts 回退图片描述标签字段命名
208 9:11p 🟣 LevelDataManager 增加图片描述字段存储
214 9:40p 🟣 拼图游戏关卡内 Punch Layout 显隐控制
216 " 🟣 PageLevel.ts punchline 显隐控制逻辑对接完成
### Apr 26, 2026
S1309 移除 PageLevel.ts 进入关卡时弹出体力扣减 toast (Apr 26 at 5:16 PM)
### Apr 27, 2026
1346 9:21a 🔴 移除进入游戏后的体力扣减 toast 提示
1347 " 🔴 移除进入游戏后的体力扣减 toast 提示
1348 " 🟣 首页添加体力值显示功能
S1308 移除进入游戏关卡时弹出体力扣减的 toast 提示 (Apr 27 at 9:21 AM)
S1310 移除进入游戏体力扣减 toast 并在首页添加体力显示 (Apr 27 at 9:22 AM)
S1311 移除体力扣减 toast 并完善首页体验 (Apr 27 at 9:23 AM)
1349 9:25a ✅ PageHome.ts 添加 ToastManager 导入
1350 " ✅ PK按钮点击改为提示"功能开发中"
S1313 Implement object-fit: cover image scaling in Cocos Creator to prevent downloaded images from being distorted (Apr 27 at 9:26 AM)
1351 9:32a 🟣 Stamina animation system for level entry
1352 " 🔵 Cocos Creator game project structure discovered
1354 " 🟣 StarGame 按钮点击动画需求
1356 " 🔵 体力系统架构发现
1353 9:33a 🔵 StaminaManager API confirmed for stamina operations
1355 9:37a 🔵 项目结构和现有代码发现
1357 9:38a 🔵 EnterLevelData 结构分析
1359 9:39a 🟣 Stamina animation system implemented for game entry flow
1358 9:41a ⚖️ 体力值飞行动画实现计划制定完成
1362 9:45a 🟣 Image Cover Mode Scaling in Cocos Creator
S1312 Fix image distortion in PageLevel.ts by implementing object-fit: cover behavior for downloaded images (Apr 27 at 9:45 AM)
1360 " ✅ Cocos Creator animation imports added to PageHome.ts
1361 " ✅ Animation constants added to PageHome class
1363 " ✅ Start game button integrated with stamina check and animation flow
1364 " 🟣 Stamina consumption animation fully implemented in PageHome
S1314 Implement stamina consumption animation in Cocos Creator game - when clicking StarGame button, IconLive node flies to button with floating "-1" text, then navigates to level (Apr 27 at 9:45 AM)
1365 9:46a 🔴 Animation completes but navigation to PageLevel fails
S1315 为 PageLevel.ts 的 mainImage 和 mainImage2 节点实现 CSS cover 模式图片缩放 (Apr 27 at 9:46 AM)
1366 9:50a 🔴 Cocos Creator tween chain broken by premature node destroy
1367 9:55a 🔴 Navigation still failing after first tween chain fix - further debugging needed
1368 " 🔴 Decoupled fly animation from float text timing using setTimeout
1369 9:56a 🔴 Cocos Creator tween chain broken by any node state change mid-animation
1370 9:59a 🟣 CSS cover-style image scaling for PageLevel images
1371 10:01a ✅ PageLevel.ts imports extended for cover-style image scaling
1372 " 🟣 CSS cover-mode image scaling implemented for PageLevel images
S1316 Debug cover mode image overflow in PageLevel.ts - image exceeds container bounds despite Mask applied (Apr 27 at 10:02 AM)
1373 10:02a 🔴 Cover mode image overflows container bounds
1374 10:06a 🔵 GRAPHICS_RECT vs GRAPHICS_STENCIL for Mask in Cocos Creator
1375 10:08a 🔴 Mask.Type.RECT does not exist in Cocos Creator API
1376 " 🔵 MaskType enum found in Cocos Creator 3.8 engine declarations
1378 " 🔵 MaskType enum values confirmed - GRAPHICS_RECT exists
1377 10:09a 🔵 MaskType enum definition found at line 46015
1379 10:10a 🔴 Reverted Mask.Type to GRAPHICS_RECT
S1317 Implement CSS cover-mode image scaling for PageLevel.ts mainImage nodes (Apr 27 at 10:10 AM)
### Apr 29, 2026
1481 6:33p 🟣 Implementing rounded corner images in PageLevel.ts
1482 " 🔵 RoundedRectMask component already exists for image corner rounding
1485 6:34p 🟣 Implemented rounded corners for PageLevel main images
1484 " 🔄 RoundedRectMask component improved with quality standards
1487 6:37p 🔵 TypeScript verification confirms no errors in new rounded corners implementation
### May 12, 2026
1542 4:39p 🟣 CommonModal prefab adds conditional dual-button support
1543 " 🔵 CommonModal prefab contains both button node variants
1544 4:40p 🟣 CommonModal prefab upgraded with dual-button support
1545 4:41p 🟣 CommonModal prefab restructured with dual-button ActionDouble container
1546 " 🔵 BaseModal provides modal animation infrastructure
1547 4:43p 🟣 CommonModal.ts upgraded with dual-button support and backward compatibility
1548 4:44p 🟣 CommonModal dual-button implementation completed
1549 " ✅ CommonModal dual-button feature ready for testing
1550 4:45p 🟣 CommonModal dual-button feature completed and validated
1551 4:46p 🔄 CommonModal API refactoring: remove buttonHint, clean button logic
1552 4:47p 🔄 CommonModal dual-button refactor complete with cleaner API
Access 539k tokens of past work via get_observations([IDs]) or mem-search skill.
Access 1693k tokens of past work via get_observations([IDs]) or mem-search skill.
</claude-mem-context>

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@ import { ViewManager } from 'db://assets/scripts/core/ViewManager';
import { CreatedShareItem, ShareDetailData, ShareParticipantRankSummary } from 'db://assets/scripts/types/ApiTypes';
import { ShareManager } from 'db://assets/scripts/utils/ShareManager';
import { ToastManager } from 'db://assets/scripts/utils/ToastManager';
const { ccclass } = _decorator;
const { ccclass, property } = _decorator;
interface PagePKDetailParams {
share?: CreatedShareItem | null;
@@ -18,6 +18,9 @@ export class PagePKDetail extends BaseView {
private static readonly RANK_ITEM_BOTTOM_PADDING = 16;
private static readonly RANK_ITEM_SPACING = 16;
@property({ type: Label, tooltip: '参与人数文案例如66 人参与' })
participateLabel: Label | null = null;
private _backButton: Node | null = null;
private _titleLabel: Label | null = null;
private _championPanel: Node | null = null;
@@ -54,6 +57,7 @@ export class PagePKDetail extends BaseView {
this._titleLabel = this._titleLabel
?? this.node.getChildByName('Title')?.getChildByName('Label')?.getComponent(Label)
?? null;
this.participateLabel = this.participateLabel ?? this._findLabelIn(this.node, 'ParticipateLabel');
this._championPanel = this._championPanel ?? this.node.getChildByName('ChampionPanel');
const rankList = this.node.getChildByName('RankList');
@@ -72,6 +76,9 @@ export class PagePKDetail extends BaseView {
if (!this._rankListItemTemplate) {
console.warn('[PagePKDetail] 未找到 RankListItem 模板节点');
}
if (!this.participateLabel) {
console.warn('[PagePKDetail] 未找到 ParticipateLabel 节点');
}
}
private _bindEvents(): void {
@@ -138,6 +145,7 @@ export class PagePKDetail extends BaseView {
private _renderShareSummary(share: CreatedShareItem | null, version: number): void {
this._clearRankItems();
this._setLabel(this._titleLabel, share?.title || '挑战详情');
this._renderParticipateCount(share);
this._renderChampion(share ? this._getFirstParticipant(share) : null, share, version);
this._layoutRankContent(0);
this._scrollRankListToTop();
@@ -151,10 +159,16 @@ export class PagePKDetail extends BaseView {
const restRankings = rankings.filter((participant) => participant !== champion);
this._setLabel(this._titleLabel, detail.title || '挑战详情');
this._renderParticipateCount(detail);
this._renderChampion(champion, detail, version);
this._renderRankList(restRankings, version);
}
private _renderParticipateCount(shareInfo: CreatedShareItem | ShareDetailData | null): void {
const participantCount = Math.max(0, shareInfo?.participantCount ?? 0);
this._setLabel(this.participateLabel, `${participantCount} 人参与`);
}
private _normalizeRankings(rankings: ShareParticipantRankSummary[]): ShareParticipantRankSummary[] {
return rankings
.map((participant, index) => ({