chore: 调整UI边框数值并移除英雄长按详情逻辑

1. 将多处UI的左右边框从68.5修正为68
2. 移除英雄节点长按打开信息面板的相关事件绑定和逻辑代码
This commit is contained in:
pan
2026-07-31 09:17:06 +08:00
parent d9575599b3
commit 7683a5c6c0
2 changed files with 13 additions and 61 deletions

View File

@@ -7018,8 +7018,8 @@
"rawHeight": 58,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 68.5,
"borderRight": 68.5,
"borderLeft": 68,
"borderRight": 68,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -7064,8 +7064,8 @@
"rawHeight": 58,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 68.5,
"borderRight": 68.5,
"borderLeft": 68,
"borderRight": 68,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -7110,8 +7110,8 @@
"rawHeight": 58,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 68.5,
"borderRight": 68.5,
"borderLeft": 68,
"borderRight": 68,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -7156,8 +7156,8 @@
"rawHeight": 58,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 68.5,
"borderRight": 68.5,
"borderLeft": 68,
"borderRight": 68,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -7202,8 +7202,8 @@
"rawHeight": 58,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 68.5,
"borderRight": 68.5,
"borderLeft": 68,
"borderRight": 68,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -7248,8 +7248,8 @@
"rawHeight": 58,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 68.5,
"borderRight": 68.5,
"borderLeft": 68,
"borderRight": 68,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,

View File

@@ -1,4 +1,4 @@
import { Vec3, _decorator, v3, Collider2D, Contact2DType, Label, Node, Prefab, instantiate, ProgressBar, Component, Material, Sprite, math, clamp, Game, tween, Tween, Color, BoxCollider2D, UITransform, UIOpacity, NodeEventType } from "cc";
import { Vec3, _decorator, v3, Collider2D, Contact2DType, Label, Node, Prefab, instantiate, ProgressBar, Component, Material, Sprite, math, clamp, Game, tween, Tween, Color, BoxCollider2D, UITransform, UIOpacity } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { mLogger } from "../common/Logger";
@@ -8,7 +8,6 @@ import { smc } from "../common/SingletonModuleComp";
import { SkillSet, } from "../common/config/SkillSet";
import { HeroInfo } from "../common/config/heroSet";
import { oops } from "db://oops-framework/core/Oops";
import { UIID } from "../common/config/GameUIConfig";
import { GameEvent } from "../common/config/GameEvent";
import { HeroAttrsComp } from "./HeroAttrsComp";
import { Tooltip } from "../skill/Tooltip";
@@ -83,48 +82,6 @@ export class HeroViewComp extends CCComp {
}, 0.1)
// let anm = this.node.getChildByName("anm")
// anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8);
// 绑定长按事件,长按打开英雄信息面板,放开关闭
this.node.on(NodeEventType.TOUCH_START, this.onInfoTouchStart, this);
this.node.on(NodeEventType.TOUCH_END, this.onInfoTouchEnd, this);
this.node.on(NodeEventType.TOUCH_CANCEL, this.onInfoTouchEnd, this);
}
/** 长按时长(秒) */
private static readonly LONG_PRESS_TIME: number = 0.5;
/** 信息框是否已弹出(区分长按完成与短按取消) */
private info_shown: boolean = false;
/** 按下:启动长按计时(仅英雄阵营响应) */
private onInfoTouchStart() {
if (!this.model) return;
if (this.model.fac !== FacSet.HERO) return;
this.info_shown = false;
this.scheduleOnce(this.showInfo, HeroViewComp.LONG_PRESS_TIME);
}
/** 放开/取消:已弹出则关闭信息框,未弹出则取消长按计时 */
private onInfoTouchEnd() {
this.unschedule(this.showInfo);
if (this.info_shown) {
this.info_shown = false;
// oops.gui 移除信息框
oops.gui.remove(UIID.HInfo);
}
}
/** 长按到点:弹出英雄信息面板(实体数据模式,随战场属性实时刷新) */
private showInfo() {
if (!this.model) return;
if (this.model.fac !== FacSet.HERO) return;
const eid = this.ent?.eid;
if (!eid) return;
this.info_shown = true;
oops.audio.playEffect("music/button");
// oops.gui 打开 HInfo 英雄信息面板
oops.gui.remove(UIID.HInfo);
oops.gui.open(UIID.HInfo, { eid: eid });
}
/** 视图层逻辑代码分离演示 */
@@ -706,11 +663,6 @@ export class HeroViewComp extends CCComp {
this.damageQueue.length = 0;
this.isProcessingDamage = false;
// 解绑长按事件
this.node.off(NodeEventType.TOUCH_START, this.onInfoTouchStart, this);
this.node.off(NodeEventType.TOUCH_END, this.onInfoTouchEnd, this);
this.node.off(NodeEventType.TOUCH_CANCEL, this.onInfoTouchEnd, this);
// 节点生命周期由 Monster 对象池管理,此处不再销毁
// if (this.node && this.node.isValid) {
// this.node.destroy();