|
|
|
@ -11,6 +11,7 @@ import { GemGrid } from '../../com/GemGrid'; |
|
|
|
import { FrameFlowHost } from '../../game/FrameFlowHost'; |
|
|
|
import { FrameFlowHost } from '../../game/FrameFlowHost'; |
|
|
|
import { GBundle, UIID } from '../../game/ConfigRes'; |
|
|
|
import { GBundle, UIID } from '../../game/ConfigRes'; |
|
|
|
import { GEM_SLOT_COUNT, IGemBagEntry } from '../../game/GameDataEnums'; |
|
|
|
import { GEM_SLOT_COUNT, IGemBagEntry } from '../../game/GameDataEnums'; |
|
|
|
|
|
|
|
import { BattleSpinePlayback } from '../../battle/presentation/BattleSpinePlayback'; |
|
|
|
import { Auto_PanelGemstone } from './Auto_PanelGemstone'; |
|
|
|
import { Auto_PanelGemstone } from './Auto_PanelGemstone'; |
|
|
|
const { ccclass } = _decorator; |
|
|
|
const { ccclass } = _decorator; |
|
|
|
|
|
|
|
|
|
|
|
@ -26,6 +27,8 @@ const BAG_PER_FRAME = 6; |
|
|
|
const DEFAULT_FILTER = 1; |
|
|
|
const DEFAULT_FILTER = 1; |
|
|
|
/** 默认展示五行:金 */ |
|
|
|
/** 默认展示五行:金 */ |
|
|
|
const DEFAULT_ELEMENT = 1; |
|
|
|
const DEFAULT_ELEMENT = 1; |
|
|
|
|
|
|
|
/** 镶嵌成功特效动画 */ |
|
|
|
|
|
|
|
const SOCKET_EFF_ANIM = '场景变换'; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 宝石页:左右切五行镶嵌 + 页签仓库 + 拖拽镶嵌/卸下 + 一键合成。 |
|
|
|
* 宝石页:左右切五行镶嵌 + 页签仓库 + 拖拽镶嵌/卸下 + 一键合成。 |
|
|
|
@ -74,7 +77,11 @@ export class UIPanelGemstone extends Auto_PanelGemstone { |
|
|
|
onLoad(): void { |
|
|
|
onLoad(): void { |
|
|
|
super.onLoad(); |
|
|
|
super.onLoad(); |
|
|
|
this._itemTpl = this.ui_list?.getChildByName('itemTemplate') ?? null; |
|
|
|
this._itemTpl = this.ui_list?.getChildByName('itemTemplate') ?? null; |
|
|
|
if (this._itemTpl) this._itemTpl.active = false; |
|
|
|
if (this._itemTpl) { |
|
|
|
|
|
|
|
this._itemTpl.active = false; |
|
|
|
|
|
|
|
const tplEff = this._itemTpl.getChildByName('eff'); |
|
|
|
|
|
|
|
if (tplEff?.isValid) tplEff.active = false; |
|
|
|
|
|
|
|
} |
|
|
|
this._bagTpl = this.ui_content?.getChildByName('bagItemTemplate') ?? null; |
|
|
|
this._bagTpl = this.ui_content?.getChildByName('bagItemTemplate') ?? null; |
|
|
|
if (this._bagTpl) this._bagTpl.active = false; |
|
|
|
if (this._bagTpl) this._bagTpl.active = false; |
|
|
|
this._skSkin = find('ui_center/top/sk_skin', this.node)?.getComponent(sp.Skeleton) ?? null; |
|
|
|
this._skSkin = find('ui_center/top/sk_skin', this.node)?.getComponent(sp.Skeleton) ?? null; |
|
|
|
@ -230,10 +237,43 @@ export class UIPanelGemstone extends Auto_PanelGemstone { |
|
|
|
node.active = true; |
|
|
|
node.active = true; |
|
|
|
node.name = `slot_${s}`; |
|
|
|
node.name = `slot_${s}`; |
|
|
|
(node as any)._slot = s; |
|
|
|
(node as any)._slot = s; |
|
|
|
|
|
|
|
const eff = node.getChildByName('eff'); |
|
|
|
|
|
|
|
if (eff?.isValid) eff.active = false; |
|
|
|
this._slotItems.push(node); |
|
|
|
this._slotItems.push(node); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 镶嵌成功:播 slot 上 eff(默认隐藏,播完再藏)。 |
|
|
|
|
|
|
|
* @param slotNode 目标镶嵌格 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private _playSocketEff(slotNode: Node): void { |
|
|
|
|
|
|
|
const eff = slotNode.getChildByName('eff'); |
|
|
|
|
|
|
|
if (!eff?.isValid) { |
|
|
|
|
|
|
|
console.warn(LOG, 'eff 缺失'); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const sk = eff.getComponent(sp.Skeleton); |
|
|
|
|
|
|
|
if (!sk?.isValid) { |
|
|
|
|
|
|
|
console.warn(LOG, 'eff Skeleton 缺失'); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (sk.skeletonData) ensureSpineSkeletonDataRuntime(sk.skeletonData); |
|
|
|
|
|
|
|
BattleSpinePlayback.clearPendingComplete(sk); |
|
|
|
|
|
|
|
eff.active = true; |
|
|
|
|
|
|
|
const ok = BattleSpinePlayback.play(sk, SOCKET_EFF_ANIM, { |
|
|
|
|
|
|
|
loop: false, |
|
|
|
|
|
|
|
ignoreBattleTimeScale: true, |
|
|
|
|
|
|
|
onComplete: () => { |
|
|
|
|
|
|
|
if (eff.isValid) eff.active = false; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (!ok) { |
|
|
|
|
|
|
|
console.warn(LOG, 'eff 动画播放失败', SOCKET_EFF_ANIM); |
|
|
|
|
|
|
|
eff.active = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 刷新当前五行 4 槽 */ |
|
|
|
/** 刷新当前五行 4 槽 */ |
|
|
|
private _refreshSlots(): void { |
|
|
|
private _refreshSlots(): void { |
|
|
|
this._ensureSlotItems(); |
|
|
|
this._ensureSlotItems(); |
|
|
|
@ -514,6 +554,7 @@ export class UIPanelGemstone extends Auto_PanelGemstone { |
|
|
|
const patch = [gemId]; |
|
|
|
const patch = [gemId]; |
|
|
|
if (before > 0 && before !== gemId) patch.push(before); |
|
|
|
if (before > 0 && before !== gemId) patch.push(before); |
|
|
|
this._patchBagGems(patch); |
|
|
|
this._patchBagGems(patch); |
|
|
|
|
|
|
|
this._playSocketEff(toSlot); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|