2 Commits

Author SHA1 Message Date
panFD
6cfe734724 fix(hero prefab & gui): 调整多个英雄预制体和阴影UI的位置参数
1. 修正mb1到mb6共6个英雄预制体的节点Y轴偏移与坐标数值
2. 精简shadow.prefab的冗余节点组件,调整缩放、尺寸和填充模式参数
2026-08-07 23:18:36 +08:00
panFD
4caf20d4b2 feat(ibox): 实现信息弹窗背景自适应高度功能
1. 重构IBoxComp组件,移除旧的标题名称渲染逻辑
2. 添加动态背景节点,根据RichText内容自动调整高度
3. 优化cardbg和herobox预制体样式,调整尺寸与透明度
4. 新增通用背景预制体hbg,支持多配色快速复用
5. 重写ibox预制体结构,适配新的组件逻辑
2026-08-07 21:51:48 +08:00
15 changed files with 6156 additions and 2600 deletions

View File

@@ -20,22 +20,19 @@
"_children": [ "_children": [
{ {
"__id__": 2 "__id__": 2
},
{
"__id__": 8
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 16 "__id__": 8
}, },
{ {
"__id__": 18 "__id__": 10
} }
], ],
"_prefab": { "_prefab": {
"__id__": 20 "__id__": 12
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -52,8 +49,8 @@
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 1.6, "x": 1,
"y": 0.2, "y": 1,
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,
@@ -103,7 +100,7 @@
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.1, "x": 0.1,
"y": 1, "y": 0.1,
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,
@@ -130,8 +127,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 200, "width": 284,
"height": 20 "height": 39
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -172,7 +169,7 @@
}, },
"_type": 0, "_type": 0,
"_fillType": 0, "_fillType": 0,
"_sizeMode": 0, "_sizeMode": 1,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0, "x": 0,
@@ -202,174 +199,6 @@
"targetOverrides": null, "targetOverrides": null,
"nestedPrefabInstanceRoots": null "nestedPrefabInstanceRoots": null
}, },
{
"__type__": "cc.Node",
"_name": "blue",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 11
},
{
"__id__": 13
}
],
"_prefab": {
"__id__": 15
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 0.2,
"y": 0.2,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"_contentSize": {
"__type__": "cc.Size",
"width": 179,
"height": 179
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "50Zpp1+w1EWJcur+0brRim"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "2842dc10-d89e-4ff6-8a11-6d09bf48cf20@d02e0",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "542qw+uwVGFYHfIPm7FYB9"
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 14
},
"playOnLoad": true,
"_clips": [
{
"__uuid__": "8b2e64e9-6ac7-43ad-b955-aabe2c3a5b67",
"__expectedType__": "cc.AnimationClip"
}
],
"_defaultClip": {
"__uuid__": "8b2e64e9-6ac7-43ad-b955-aabe2c3a5b67",
"__expectedType__": "cc.AnimationClip"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "14hRfhjw9DR4jCS9aULrGW"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "eefnd533NBxL19tpkpDQLz",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{ {
"__type__": "cc.UITransform", "__type__": "cc.UITransform",
"_name": "", "_name": "",
@@ -380,7 +209,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 17 "__id__": 9
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -408,7 +237,7 @@
}, },
"_enabled": false, "_enabled": false,
"__prefab": { "__prefab": {
"__id__": 19 "__id__": 11
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,

View File

@@ -167,7 +167,7 @@
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 5, "y": 0.034,
"z": 0 "z": 0
} }
}, },
@@ -212,8 +212,8 @@
], ],
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.25, "x": 2,
"y": 0.7, "y": 2,
"z": 1 "z": 1
} }
}, },

View File

@@ -167,7 +167,7 @@
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 5, "y": 2.253,
"z": 0 "z": 0
} }
}, },
@@ -212,8 +212,8 @@
], ],
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.25, "x": 2,
"y": 0.7, "y": 2,
"z": 1 "z": 1
} }
}, },

View File

@@ -167,7 +167,7 @@
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 5, "y": 1.196,
"z": 0 "z": 0
} }
}, },
@@ -212,8 +212,8 @@
], ],
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.25, "x": 2,
"y": 0.7, "y": 2,
"z": 1 "z": 1
} }
}, },

View File

@@ -167,7 +167,7 @@
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 5, "y": 1.196,
"z": 0 "z": 0
} }
}, },
@@ -212,8 +212,8 @@
], ],
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.25, "x": 2,
"y": 0.6, "y": 2,
"z": 1 "z": 1
} }
}, },

View File

@@ -167,7 +167,7 @@
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 5, "y": 1.196,
"z": 0 "z": 0
} }
}, },
@@ -212,8 +212,8 @@
], ],
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.26, "x": 2,
"y": 0.7, "y": 2,
"z": 1 "z": 1
} }
}, },

View File

@@ -167,7 +167,7 @@
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 5, "y": 2.253,
"z": 0 "z": 0
} }
}, },
@@ -212,8 +212,8 @@
], ],
"value": { "value": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.4, "x": 3,
"y": 0.9, "y": 3,
"z": 1 "z": 1
} }
}, },

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "57e33de6-9b39-4744-90ac-987944a47da8",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "hbg"
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -420,7 +420,7 @@
"r": 255, "r": 255,
"g": 255, "g": 255,
"b": 255, "b": 255,
"a": 120 "a": 255
}, },
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@6c895", "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@6c895",
@@ -615,8 +615,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 280, "width": 300,
"height": 280 "height": 300
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -737,8 +737,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 140, "width": 150,
"height": 140 "height": 150
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -765,9 +765,9 @@
}, },
"_alignFlags": 41, "_alignFlags": 41,
"_target": null, "_target": null,
"_left": 15, "_left": 10,
"_right": 15, "_right": 10,
"_top": 15, "_top": 10,
"_bottom": 115, "_bottom": 115,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
@@ -938,7 +938,7 @@
"__id__": 57 "__id__": 57
} }
], ],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 71 "__id__": 71
@@ -1258,7 +1258,7 @@
"r": 255, "r": 255,
"g": 255, "g": 255,
"b": 255, "b": 255,
"a": 120 "a": 255
}, },
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@6c895", "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@6c895",
@@ -1453,8 +1453,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 280, "width": 300,
"height": 280 "height": 300
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -1575,8 +1575,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 140, "width": 150,
"height": 140 "height": 150
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -1603,9 +1603,9 @@
}, },
"_alignFlags": 41, "_alignFlags": 41,
"_target": null, "_target": null,
"_left": 15, "_left": 10,
"_right": 15, "_right": 10,
"_top": 15, "_top": 10,
"_bottom": 115, "_bottom": 115,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
@@ -1776,7 +1776,7 @@
"__id__": 95 "__id__": 95
} }
], ],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 109 "__id__": 109
@@ -2096,7 +2096,7 @@
"r": 255, "r": 255,
"g": 255, "g": 255,
"b": 255, "b": 255,
"a": 120 "a": 255
}, },
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@6c895", "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@6c895",
@@ -2291,8 +2291,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 280, "width": 300,
"height": 280 "height": 300
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -2413,8 +2413,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 140, "width": 150,
"height": 140 "height": 150
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -2441,9 +2441,9 @@
}, },
"_alignFlags": 41, "_alignFlags": 41,
"_target": null, "_target": null,
"_left": 15, "_left": 10,
"_right": 15, "_right": 10,
"_top": 15, "_top": 10,
"_bottom": 115, "_bottom": 115,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
@@ -2614,7 +2614,7 @@
"__id__": 133 "__id__": 133
} }
], ],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 147 "__id__": 147
@@ -2934,7 +2934,7 @@
"r": 255, "r": 255,
"g": 255, "g": 255,
"b": 255, "b": 255,
"a": 120 "a": 255
}, },
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@6c895", "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@6c895",
@@ -3129,8 +3129,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 280, "width": 300,
"height": 280 "height": 300
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -3251,8 +3251,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 140, "width": 150,
"height": 140 "height": 150
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -3279,9 +3279,9 @@
}, },
"_alignFlags": 41, "_alignFlags": 41,
"_target": null, "_target": null,
"_left": 15, "_left": 10,
"_right": 15, "_right": 10,
"_top": 15, "_top": 10,
"_bottom": 115, "_bottom": 115,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
@@ -3452,7 +3452,7 @@
"__id__": 171 "__id__": 171
} }
], ],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 185 "__id__": 185
@@ -3772,7 +3772,7 @@
"r": 255, "r": 255,
"g": 255, "g": 255,
"b": 255, "b": 255,
"a": 120 "a": 255
}, },
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@6c895", "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@6c895",
@@ -3967,8 +3967,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 280, "width": 300,
"height": 280 "height": 300
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -4089,8 +4089,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 140, "width": 150,
"height": 140 "height": 150
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -4117,9 +4117,9 @@
}, },
"_alignFlags": 41, "_alignFlags": 41,
"_target": null, "_target": null,
"_left": 15, "_left": 10,
"_right": 15, "_right": 10,
"_top": 15, "_top": 10,
"_bottom": 115, "_bottom": 115,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,

View File

@@ -2998,7 +2998,7 @@
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": -62.269, "y": -60.02,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -3010,8 +3010,8 @@
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.2, "x": 0.15,
"y": 0.3, "y": 0.15,
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,
@@ -3069,10 +3069,10 @@
"_dstBlendFactor": 4, "_dstBlendFactor": 4,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 61,
"g": 255, "g": 61,
"b": 255, "b": 61,
"a": 255 "a": 195
}, },
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@34d88", "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@34d88",
@@ -3627,7 +3627,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 84, "width": 92,
"height": 35.373999999999995 "height": 35.373999999999995
}, },
"_anchorPoint": { "_anchorPoint": {
@@ -3666,8 +3666,8 @@
"_string": "英雄名称", "_string": "英雄名称",
"_horizontalAlign": 1, "_horizontalAlign": 1,
"_verticalAlign": 1, "_verticalAlign": 1,
"_actualFontSize": 20, "_actualFontSize": 22,
"_fontSize": 20, "_fontSize": 22,
"_fontFamily": "Arial", "_fontFamily": "Arial",
"_lineHeight": 24.9, "_lineHeight": 24.9,
"_overflow": 0, "_overflow": 0,
@@ -3782,7 +3782,7 @@
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": -117.839, "y": -113.062,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -3822,7 +3822,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 47.1671468533978, "width": 51.483861538737585,
"height": 54.4 "height": 54.4
}, },
"_anchorPoint": { "_anchorPoint": {
@@ -3861,8 +3861,8 @@
"_string": "Lv.1", "_string": "Lv.1",
"_horizontalAlign": 1, "_horizontalAlign": 1,
"_verticalAlign": 1, "_verticalAlign": 1,
"_actualFontSize": 20, "_actualFontSize": 22,
"_fontSize": 20, "_fontSize": 22,
"_fontFamily": "Arial", "_fontFamily": "Arial",
"_lineHeight": 40, "_lineHeight": 40,
"_overflow": 0, "_overflow": 0,
@@ -4416,7 +4416,7 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -22.182, "x": -25.305,
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
@@ -4529,7 +4529,7 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -72.49951171875, "x": -69.669921875,
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
@@ -4570,8 +4570,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 45.0009765625, "width": 50.66015625,
"height": 27.814 "height": 30.46
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -4601,34 +4601,34 @@
"_dstBlendFactor": 4, "_dstBlendFactor": 4,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 32, "r": 255,
"g": 32, "g": 255,
"b": 32, "b": 255,
"a": 255 "a": 255
}, },
"_string": "攻击:", "_string": "攻击:",
"_horizontalAlign": 1, "_horizontalAlign": 1,
"_verticalAlign": 1, "_verticalAlign": 1,
"_actualFontSize": 18, "_actualFontSize": 20,
"_fontSize": 18, "_fontSize": 20,
"_fontFamily": "Arial", "_fontFamily": "Arial",
"_lineHeight": 18.9, "_lineHeight": 21,
"_overflow": 0, "_overflow": 0,
"_enableWrapText": true, "_enableWrapText": true,
"_font": null, "_font": null,
"_isSystemFontUsed": true, "_isSystemFontUsed": true,
"_spacingX": 0, "_spacingX": 0,
"_isItalic": false, "_isItalic": false,
"_isBold": false, "_isBold": true,
"_isUnderline": false, "_isUnderline": false,
"_underlineHeight": 2, "_underlineHeight": 2,
"_cacheMode": 0, "_cacheMode": 0,
"_enableOutline": true, "_enableOutline": true,
"_outlineColor": { "_outlineColor": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 0,
"g": 255, "g": 0,
"b": 255, "b": 0,
"a": 255 "a": 255
}, },
"_outlineWidth": 2, "_outlineWidth": 2,
@@ -4688,7 +4688,7 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -26.9775390625, "x": -19.09375,
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
@@ -4729,8 +4729,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 44.04296875, "width": 48.4921875,
"height": 27.94 "height": 30.46
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -4760,18 +4760,18 @@
"_dstBlendFactor": 4, "_dstBlendFactor": 4,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 0, "r": 255,
"g": 0, "g": 255,
"b": 0, "b": 255,
"a": 255 "a": 255
}, },
"_string": "9999", "_string": "9999",
"_horizontalAlign": 1, "_horizontalAlign": 1,
"_verticalAlign": 1, "_verticalAlign": 1,
"_actualFontSize": 18, "_actualFontSize": 20,
"_fontSize": 18, "_fontSize": 20,
"_fontFamily": "Arial", "_fontFamily": "Arial",
"_lineHeight": 19, "_lineHeight": 21,
"_overflow": 0, "_overflow": 0,
"_enableWrapText": true, "_enableWrapText": true,
"_font": null, "_font": null,
@@ -4785,9 +4785,9 @@
"_enableOutline": true, "_enableOutline": true,
"_outlineColor": { "_outlineColor": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 0,
"g": 255, "g": 0,
"b": 255, "b": 0,
"a": 255 "a": 255
}, },
"_outlineWidth": 2, "_outlineWidth": 2,
@@ -4847,7 +4847,7 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -3.9560546875, "x": 6.15234375,
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
@@ -4888,8 +4888,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 56.5322265625, "width": 62.369140625,
"height": 27.94 "height": 30.46
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -4927,17 +4927,17 @@
"_string": "(+999)", "_string": "(+999)",
"_horizontalAlign": 0, "_horizontalAlign": 0,
"_verticalAlign": 1, "_verticalAlign": 1,
"_actualFontSize": 18, "_actualFontSize": 20,
"_fontSize": 18, "_fontSize": 20,
"_fontFamily": "Arial", "_fontFamily": "Arial",
"_lineHeight": 19, "_lineHeight": 21,
"_overflow": 0, "_overflow": 0,
"_enableWrapText": true, "_enableWrapText": true,
"_font": null, "_font": null,
"_isSystemFontUsed": true, "_isSystemFontUsed": true,
"_spacingX": 0, "_spacingX": 0,
"_isItalic": false, "_isItalic": false,
"_isBold": false, "_isBold": true,
"_isUnderline": false, "_isUnderline": false,
"_underlineHeight": 2, "_underlineHeight": 2,
"_cacheMode": 0, "_cacheMode": 0,
@@ -5184,7 +5184,7 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -72.49951171875, "x": -69.669921875,
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
@@ -5225,8 +5225,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 45.0009765625, "width": 50.66015625,
"height": 27.814 "height": 30.46
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -5256,34 +5256,34 @@
"_dstBlendFactor": 4, "_dstBlendFactor": 4,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 32, "r": 255,
"g": 32, "g": 255,
"b": 32, "b": 255,
"a": 255 "a": 255
}, },
"_string": "生命:", "_string": "生命:",
"_horizontalAlign": 1, "_horizontalAlign": 1,
"_verticalAlign": 1, "_verticalAlign": 1,
"_actualFontSize": 18, "_actualFontSize": 20,
"_fontSize": 18, "_fontSize": 20,
"_fontFamily": "Arial", "_fontFamily": "Arial",
"_lineHeight": 18.9, "_lineHeight": 21,
"_overflow": 0, "_overflow": 0,
"_enableWrapText": true, "_enableWrapText": true,
"_font": null, "_font": null,
"_isSystemFontUsed": true, "_isSystemFontUsed": true,
"_spacingX": 0, "_spacingX": 0,
"_isItalic": false, "_isItalic": false,
"_isBold": false, "_isBold": true,
"_isUnderline": false, "_isUnderline": false,
"_underlineHeight": 2, "_underlineHeight": 2,
"_cacheMode": 0, "_cacheMode": 0,
"_enableOutline": true, "_enableOutline": true,
"_outlineColor": { "_outlineColor": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 0,
"g": 255, "g": 0,
"b": 255, "b": 0,
"a": 255 "a": 255
}, },
"_outlineWidth": 2, "_outlineWidth": 2,
@@ -5343,7 +5343,7 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -26.9775390625, "x": -19.09375,
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
@@ -5384,8 +5384,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 44.04296875, "width": 48.4921875,
"height": 27.94 "height": 30.46
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -5415,18 +5415,18 @@
"_dstBlendFactor": 4, "_dstBlendFactor": 4,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 0, "r": 255,
"g": 0, "g": 255,
"b": 0, "b": 255,
"a": 255 "a": 255
}, },
"_string": "9999", "_string": "9999",
"_horizontalAlign": 1, "_horizontalAlign": 1,
"_verticalAlign": 1, "_verticalAlign": 1,
"_actualFontSize": 18, "_actualFontSize": 20,
"_fontSize": 18, "_fontSize": 20,
"_fontFamily": "Arial", "_fontFamily": "Arial",
"_lineHeight": 19, "_lineHeight": 21,
"_overflow": 0, "_overflow": 0,
"_enableWrapText": true, "_enableWrapText": true,
"_font": null, "_font": null,
@@ -5440,9 +5440,9 @@
"_enableOutline": true, "_enableOutline": true,
"_outlineColor": { "_outlineColor": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 0,
"g": 255, "g": 0,
"b": 255, "b": 0,
"a": 255 "a": 255
}, },
"_outlineWidth": 2, "_outlineWidth": 2,
@@ -5502,7 +5502,7 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -3.9560546875, "x": 6.15234375,
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
@@ -5543,8 +5543,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 56.5322265625, "width": 62.369140625,
"height": 27.94 "height": 30.46
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -5582,17 +5582,17 @@
"_string": "(+999)", "_string": "(+999)",
"_horizontalAlign": 0, "_horizontalAlign": 0,
"_verticalAlign": 1, "_verticalAlign": 1,
"_actualFontSize": 18, "_actualFontSize": 20,
"_fontSize": 18, "_fontSize": 20,
"_fontFamily": "Arial", "_fontFamily": "Arial",
"_lineHeight": 19, "_lineHeight": 21,
"_overflow": 0, "_overflow": 0,
"_enableWrapText": true, "_enableWrapText": true,
"_font": null, "_font": null,
"_isSystemFontUsed": true, "_isSystemFontUsed": true,
"_spacingX": 0, "_spacingX": 0,
"_isItalic": false, "_isItalic": false,
"_isBold": false, "_isBold": true,
"_isUnderline": false, "_isUnderline": false,
"_underlineHeight": 2, "_underlineHeight": 2,
"_cacheMode": 0, "_cacheMode": 0,
@@ -5799,7 +5799,7 @@
"_right": 437.303, "_right": 437.303,
"_top": -2.5, "_top": -2.5,
"_bottom": -2.5, "_bottom": -2.5,
"_horizontalCenter": -22.182, "_horizontalCenter": -25.305,
"_verticalCenter": 0, "_verticalCenter": 0,
"_isAbsLeft": true, "_isAbsLeft": true,
"_isAbsRight": true, "_isAbsRight": true,

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,7 @@
* - SkillSet / FieldSkillSetSkillSet—— 技能/光环静态配置 * - SkillSet / FieldSkillSetSkillSet—— 技能/光环静态配置
* - EquipSetfindEquipByUuid—— 装备静态配置 * - EquipSetfindEquipByUuid—— 装备静态配置
*/ */
import { _decorator, Label, NodeEventType, RichText } from "cc"; import { _decorator, Node, NodeEventType, RichText, UITransform, Widget } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { SkillSet, SkillOverrides } from "../common/config/SkillSet"; import { SkillSet, SkillOverrides } from "../common/config/SkillSet";
@@ -57,6 +57,15 @@ export class IBoxComp extends CCComp {
@property(RichText) @property(RichText)
massage_node: RichText = null! massage_node: RichText = null!
/** 背景节点(高度随 RichText 内容动态调整) */
@property(Node)
bg_node: Node = null!
/** Bg 节点高度上下留白RichText 顶部间距 + 底部间距) */
private static readonly BG_PADDING_V: number = 24;
/** Bg 最小高度(防止内容过少时背景塌缩) */
private static readonly BG_MIN_HEIGHT: number = 60;
/** /**
* 初始化并渲染弹窗内容。 * 初始化并渲染弹窗内容。
* @param args 见 IBoxInitArgs * @param args 见 IBoxInitArgs
@@ -92,23 +101,49 @@ export class IBoxComp extends CCComp {
// 装备详情模式 // 装备详情模式
if (args?.equipUuid !== undefined) { if (args?.equipUuid !== undefined) {
this.renderEquip(args.equipUuid); this.renderEquip(args.equipUuid);
return; } else if (args?.skills) {
} // 运行时技能详情模式(取第一个技能)
// 运行时技能详情模式(取第一个技能)
if (args?.skills) {
const first = Object.values(args.skills)[0]; const first = Object.values(args.skills)[0];
if (first) { if (first) {
this.renderSkill(first.uuid, first.lv); this.renderSkill(first.uuid, first.lv);
return;
} }
} } else if (args?.skillUuid !== undefined) {
// 技能详情模式 // 技能详情模式
if (args?.skillUuid !== undefined) {
this.renderSkill(args.skillUuid, args.skillLv ?? 1, args.overrides); this.renderSkill(args.skillUuid, args.skillLv ?? 1, args.overrides);
return; } else {
this.setRichText("暂无信息");
} }
this.setHeroName(""); // RichText 排版需一帧完成,延迟同步 Bg 高度
this.setRichText("暂无信息"); this.scheduleOnce(() => this.syncBgHeight(), 0);
}
/**
* 根据 RichText 实际内容高度,动态调整 Bg 节点高度与位置。
* RichText 锚点已设为 (0.5, 1),从顶部向下生长;
* Bg 锚点 (0.5, 0.5),向上居中扩展,顶部对齐 RichText 顶。
*/
private syncBgHeight() {
if (!this.massage_node?.isValid) return;
const richUT = this.massage_node.getComponent(UITransform);
if (!richUT) return;
const contentH = Math.max(richUT.height, 0);
const bgH = Math.max(contentH + IBoxComp.BG_PADDING_V, IBoxComp.BG_MIN_HEIGHT);
const bgNode = this.bg_node ?? this.node.getChildByName("bg");
if (!bgNode?.isValid) return;
const bgUT = bgNode.getComponent(UITransform);
if (!bgUT) return;
// Bg 节点在 prefab 中挂了 Widget顶底对齐会覆盖代码设置的高度先禁用
const widget = bgNode.getComponent(Widget);
if (widget) widget.enabled = false;
bgUT.height = bgH;
// Bg 锚点在中心,高度为 bgH 时其中心应位于 RichText 顶部向下 bgH/2 处
// RichText 锚点 (0.5,1),其顶部 y = pos.yBg 中心 y = pos.y - bgH/2
const richPos = this.massage_node.node.position;
bgNode.setPosition(bgNode.position.x, richPos.y - bgH / 2, bgNode.position.z);
} }
/** /**
@@ -120,11 +155,9 @@ export class IBoxComp extends CCComp {
private renderSkill(skillUuid: number, lv: number, overrides?: SkillOverrides) { private renderSkill(skillUuid: number, lv: number, overrides?: SkillOverrides) {
const skill = SkillSet[skillUuid]; const skill = SkillSet[skillUuid];
if (!skill) { if (!skill) {
this.setHeroName("");
this.setRichText("未知技能"); this.setRichText("未知技能");
return; return;
} }
this.setHeroName(skill.name);
this.setRichText(buildSingleSkillRich(skillUuid, overrides, lv)); this.setRichText(buildSingleSkillRich(skillUuid, overrides, lv));
} }
@@ -135,11 +168,9 @@ export class IBoxComp extends CCComp {
private renderEquip(equipUuid: number) { private renderEquip(equipUuid: number) {
const equip = findEquipByUuid(equipUuid); const equip = findEquipByUuid(equipUuid);
if (!equip) { if (!equip) {
this.setHeroName("");
this.setRichText("未知装备"); this.setRichText("未知装备");
return; return;
} }
this.setHeroName(equip.name);
this.setRichText(buildEquipRich(equip.field ?? [])); this.setRichText(buildEquipRich(equip.field ?? []));
} }
@@ -150,20 +181,6 @@ export class IBoxComp extends CCComp {
} }
} }
/**
* 设置标题名称标签
* @param name 技能/装备名称
*/
private setHeroName(name: string) {
const bgNode = this.node.getChildByName("Bg");
const nameNode = bgNode?.getChildByName("name");
const valNode = nameNode?.getChildByName("val");
const label = valNode?.getComponent(Label) || valNode?.getComponentInChildren(Label);
if (label) {
label.string = name;
}
}
/** 点击弹窗任意区域关闭自身 */ /** 点击弹窗任意区域关闭自身 */
private onTapClose() { private onTapClose() {
if (this.node && this.node.isValid) { if (this.node && this.node.isValid) {