refactor(ui): 优化卡牌等级显示逻辑和布局更新

- 移除HInfoComp中品质边框切换逻辑,专注卡牌等级显示
- 简化CardComp中等级节点的布局更新逻辑,仅使用Widget组件
- 调整card.prefab的布局参数和原始宽度
- 禁用role_controller.prefab的_active属性
This commit is contained in:
walkpan
2026-04-21 21:05:21 +08:00
parent 9363f8f1d7
commit e24d169161
6 changed files with 2279 additions and 2001 deletions

View File

@@ -729,19 +729,12 @@ export class CardComp extends CCComp {
}
if (this.lv_node) {
const lvTrans = this.lv_node.getComponent(UITransform);
if (lvTrans) {
lvTrans.setContentSize(this.isEnlarged ? 230 : 170, this.isEnlarged ? 300 : 230);
const widget = this.lv_node.getComponent(Widget);
if (widget) widget.updateAlignment();
}
const widget = this.lv_node.getComponent(Widget);
if (widget) widget.updateAlignment();
this.lv_node.children.forEach(child => {
const childTrans = child.getComponent(UITransform);
if (childTrans) {
childTrans.setContentSize(this.isEnlarged ? 230 : 170, this.isEnlarged ? 300 : 230);
const widget = child.getComponent(Widget);
if (widget) widget.updateAlignment();
}
const childWidget = child.getComponent(Widget);
if (childWidget) childWidget.updateAlignment();
});
}
@@ -981,19 +974,12 @@ export class CardComp extends CCComp {
});
}
if (this.lv_node) {
const lvTrans = this.lv_node.getComponent(UITransform);
if (lvTrans) {
lvTrans.setContentSize(170, 230);
const widget = this.lv_node.getComponent(Widget);
if (widget) widget.updateAlignment();
}
const widget = this.lv_node.getComponent(Widget);
if (widget) widget.updateAlignment();
this.lv_node.children.forEach(child => {
const childTrans = child.getComponent(UITransform);
if (childTrans) {
childTrans.setContentSize(170, 230);
const widget = child.getComponent(Widget);
if (widget) widget.updateAlignment();
}
const childWidget = child.getComponent(Widget);
if (childWidget) childWidget.updateAlignment();
});
}
if (this.HF_node) {