refactor(map): 移除废弃的英雄信息面板HInfoComp相关代码
1. 删除HInfoComp组件文件及其元数据 2. 移除UIConfig中HInfo配置项 3. 移除CardComp中打开HInfo面板的逻辑 4. 清理注释和代码中对HInfoComp的引用 5. 更新MissionCardComp的文档注释
This commit is contained in:
@@ -30,8 +30,6 @@ import { SkillSet } from "../common/config/SkillSet";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
||||
import { MissionEconomy } from "./MissionEconomy";
|
||||
|
||||
@@ -509,7 +507,7 @@ export class CardComp extends CCComp {
|
||||
}
|
||||
|
||||
/**
|
||||
* 触摸结束:视为点击,触发 onCardTap(显示召唤按钮 / 打开信息面板 / 通知其他卡牌联动)。
|
||||
* 触摸结束:视为点击,触发 onCardTap(显示召唤按钮 / 通知其他卡牌联动)。
|
||||
*/
|
||||
private onCardTouchEnd(event: EventTouch) {
|
||||
if (!this.isDragging || !this.cardData || this.isUsing) return;
|
||||
@@ -526,25 +524,12 @@ export class CardComp extends CCComp {
|
||||
* 卡牌被点击(非拖拽):
|
||||
* 1. 显示本卡的召唤按钮 call_btn。
|
||||
* 2. 派发 CardSelected 事件,其他卡牌收到后隐藏各自的 call_btn。
|
||||
* 3. 英雄卡打开 HInfo 信息面板(点击查看,替代原长按)。
|
||||
* 注:不重置位置。applyCardUI 中 widget.updateAlignment() 会让节点脱离 restPosition,
|
||||
* 这里若强制 setPosition(restPosition) 会导致可见的跳位。
|
||||
*/
|
||||
private onCardTap() {
|
||||
this.showCallBtn();
|
||||
oops.message.dispatchEvent(GameEvent.CardSelected, this);
|
||||
// 英雄卡 / 升级卡打开信息面板(点击替代长按)
|
||||
const isUpgradeCard = this.card_type === CardType.SpecialUpgrade && !!this.cardData?.target_hero_eid;
|
||||
if (this.card_type === CardType.Hero || isUpgradeCard) {
|
||||
// 升级卡通过 eid 反查实体得到 hero_uuid;若实体已不存在则降级为本卡 uuid
|
||||
const heroUuid = isUpgradeCard
|
||||
? (this.queryHeroUuidByEid(this.cardData!.target_hero_eid as number) ?? this.card_uuid)
|
||||
: this.card_uuid;
|
||||
const heroLv = Math.max(1, smc.getHeroOuterLv(heroUuid));
|
||||
const poolLv = Math.max(1, this.cardData?.base_card_lv ?? this.cardData?.card_lv ?? 1);
|
||||
oops.gui.remove(UIID.HInfo);
|
||||
oops.gui.open(UIID.HInfo, { heroUuid, heroLv, poolLv });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -591,7 +576,7 @@ export class CardComp extends CCComp {
|
||||
|
||||
/**
|
||||
* 全局触摸结束:点击落点不在召唤按钮 / 卡牌本体包围盒内时隐藏召唤按钮。
|
||||
* Why: 复用 HInfoComp 的"点击外部关闭"交互模式,避免 call_btn 长期滞留。
|
||||
* Why: "点击外部关闭"交互模式,避免 call_btn 长期滞留。
|
||||
* 排除卡牌本体是防止与 onCardTap 的"点击卡牌显示 call_btn"交互相互冲突。
|
||||
* @param event 全局触摸事件
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user