feat: 支持分享模式二次确认弹窗;默认展示线索 1

This commit is contained in:
richarjiang
2026-05-11 23:05:49 +08:00
parent 37b9ab1cb6
commit 8b27dc7bc5
4 changed files with 355 additions and 28 deletions

View File

@@ -1,4 +1,4 @@
import { _decorator, Node, EditBox, instantiate, Vec3, Button, Label, Sprite, SpriteFrame, AudioClip, AudioSource, Prefab, EffectAsset, UITransform, UIOpacity, tween, Tween, Color } from 'cc';
import { _decorator, Node, EditBox, instantiate, Vec3, Button, Label, Sprite, SpriteFrame, AudioClip, AudioSource, Prefab, EffectAsset, UITransform, UIOpacity, tween, Tween, Color, Layout } from 'cc';
import { BaseView } from 'db://assets/scripts/core/BaseView';
import { ViewManager } from 'db://assets/scripts/core/ViewManager';
import { StaminaManager } from 'db://assets/scripts/utils/StaminaManager';
@@ -69,6 +69,9 @@ export class PageLevel extends BaseView {
/** 谐音梗揭示动画punchLayout 在 InputLayout 动起来后再出现的延迟(让动画有节奏) */
private static readonly PUNCH_REVEAL_DELAY = 0.1;
/** 分享模式只展示提示 1 时,固定放回 TipsLayout 顶部,避免 Layout 把它排到底部被下一题按钮遮挡 */
private static readonly SHARE_MODE_TIP1_Y = 120;
// ========== 节点引用 ==========
@property(Node)
inputLayout: Node | null = null;
@@ -1151,7 +1154,9 @@ export class PageLevel extends BaseView {
}
if (this._isShareMode) {
this._setTipsLayoutEnabled(false);
this.showClue(1);
this._placeShareModeTip1();
this.hideClue(2);
this.hideClue(3);
if (this.unLockTipsBtn) {
@@ -1160,6 +1165,7 @@ export class PageLevel extends BaseView {
return;
}
this._setTipsLayoutEnabled(true);
this.showClue(1);
this.showClue(2);
this.showClue(3);
@@ -1168,6 +1174,25 @@ export class PageLevel extends BaseView {
}
}
private _setTipsLayoutEnabled(enabled: boolean): void {
const layout = this.tipsLayout?.getComponent(Layout);
if (layout) {
layout.enabled = enabled;
}
}
private _placeShareModeTip1(): void {
if (!this.tipsItem1) {
return;
}
this.tipsItem1.setPosition(
this.tipsItem1.position.x,
PageLevel.SHARE_MODE_TIP1_Y,
this.tipsItem1.position.z,
);
}
/**
* 服务端 level 使用 sortOrder首关可能为 0页面展示统一转成从 1 开始的关卡序号
*/