优化英雄界面

This commit is contained in:
kawagiri 2026-05-17 22:22:09 +08:00
parent 23c2a54bef
commit 7060ba0ed6
9 changed files with 2707 additions and 2544 deletions

View File

@ -1655,11 +1655,11 @@
"id": 168,
"title": "射命丸文bug有概率才占一个村庄就直接可以升级了",
"description": "",
"status": "open",
"status": "fixed",
"priority": "medium",
"module": "",
"createdAt": 1778855035633,
"updatedAt": 1778855035633
"updatedAt": 1779026704449
},
{
"id": 169,
@ -1695,11 +1695,11 @@
"id": 172,
"title": "勇仪推人能进敌人港口??",
"description": "",
"status": "open",
"status": "fixed",
"priority": "medium",
"module": "",
"createdAt": 1778863887197,
"updatedAt": 1778863887197
"updatedAt": 1779025114908
},
{
"id": 173,
@ -1715,21 +1715,21 @@
"id": 174,
"title": "背景图片超框",
"description": "",
"status": "open",
"status": "fixed",
"priority": "medium",
"module": "",
"createdAt": 1778866153195,
"updatedAt": 1778866153195
"updatedAt": 1779026651841
},
{
"id": 175,
"title": "优化占领村庄的描述 (我方",
"description": "",
"status": "open",
"status": "fixed",
"priority": "medium",
"module": "",
"createdAt": 1778912834120,
"updatedAt": 1778912834120
"updatedAt": 1779026663073
},
{
"id": 176,
@ -1765,11 +1765,11 @@
"id": 179,
"title": "在百科界面滑动滚轮会同时滚动条目列和背景地图",
"description": "",
"status": "open",
"status": "fixed",
"priority": "medium",
"module": "",
"createdAt": 1778920907998,
"updatedAt": 1778920907998
"updatedAt": 1779026654548
},
{
"id": 180,
@ -1785,11 +1785,11 @@
"id": 181,
"title": "隐身的首次移动不能包含被动移动",
"description": "",
"status": "open",
"status": "fixed",
"priority": "medium",
"module": "",
"createdAt": 1778943513577,
"updatedAt": 1778943513577
"updatedAt": 1779026657007
},
{
"id": 182,

View File

@ -3574,7 +3574,7 @@ MonoBehaviour:
iconViewSizeType: 0
- TechAtom: 55
TechAtomName: "\u7A81\u51FB\u8247"
Desc: "\u5C06**<\u5E06\u8239>**\u8FDB\u9636\u4E3A**<\u7A81\u51FB\u8247>**\u3002\u6D77\u4E0A\u8FD1\u6218\u5355\u4F4D\u3002\u62E5\u67093\u79FB\u52A8\u529B3\u653B\u51FB\u529B3\u9632\u5FA1\u529B\u548C**<\u518D\u52A8>**\u6280\u80FD\u3002"
Desc: "\u5C06**<\u5E06\u8239>**\u8FDB\u9636\u4E3A**<\u7A81\u51FB\u8247>**\u3002\u6D77\u4E0A\u8FD1\u6218\u5355\u4F4D\u3002\u62E5\u67093\u79FB\u52A8\u529B3\u653B\u51FB\u529B3\u9632\u5FA1\u529B\u548C**<\u79FB\u52A8\u653B\u51FB>**\u6280\u80FD\u3002"
IsAddSkill: 0
AddSkillCondition: []
AddSkillType: 0

View File

@ -5636,7 +5636,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: -8.823425}
m_AnchoredPosition: {x: 0, y: -8.823486}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!222 &499662947918654676
@ -5830,7 +5830,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 289.93222, y: -241.52165}
m_AnchoredPosition: {x: 289.93222, y: -223.51164}
m_SizeDelta: {x: 519.8644, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &8375249223767260024

View File

@ -2711,7 +2711,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 1299.1426, y: -110}
m_AnchoredPosition: {x: 1299.1426, y: -40}
m_SizeDelta: {x: 762.0334, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3448114547893685357
@ -5941,13 +5941,14 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3406978621052864304, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
propertyPath: m_hasFontAssetChanged
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 8401098705935669092, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
insertIndex: -1
addedObject: {fileID: -1089824140262832538}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
--- !u!114 &319162252168891546 stripped
MonoBehaviour:
@ -5965,41 +5966,6 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 2297799915912419130, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
m_PrefabInstance: {fileID: 1386164598323822711}
m_PrefabAsset: {fileID: 0}
--- !u!1 &7469808876655367955 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 8401098705935669092, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
m_PrefabInstance: {fileID: 1386164598323822711}
m_PrefabAsset: {fileID: 0}
--- !u!114 &-1089824140262832538
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7469808876655367955}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6b27f832d22e4a8d916272b644937774, type: 3}
m_Name:
m_EditorClassIdentifier:
Ban: 0
NoExport: 0
FontBan: 0
Preset: 0
ID: 18820
FontID: 1
TextCfg:
- Type: 1
ApplyFontSize: 0
FontSize: 22
ApplyCharacterSpacing: 0
CharacterSpacing: 0
ApplyWordSpacing: 0
WordSpacing: 0
ApplyLineSpacing: 0
LineSpacing: 0
ApplyParagraphSpacing: 0
ParagraphSpacing: 0
--- !u!1001 &3559152577244099861
PrefabInstance:
m_ObjectHideFlags: 0
@ -6443,49 +6409,15 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3406978621052864304, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
propertyPath: m_hasFontAssetChanged
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 8401098705935669092, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
insertIndex: -1
addedObject: {fileID: 1210150727227228378}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
--- !u!1 &4339113435030663764 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 8401098705935669092, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
m_PrefabInstance: {fileID: 5233484509620118832}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1210150727227228378
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4339113435030663764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6b27f832d22e4a8d916272b644937774, type: 3}
m_Name:
m_EditorClassIdentifier:
Ban: 0
NoExport: 0
FontBan: 0
Preset: 0
ID: 18820
FontID: 1
TextCfg:
- Type: 1
ApplyFontSize: 0
FontSize: 22
ApplyCharacterSpacing: 0
CharacterSpacing: 0
ApplyWordSpacing: 0
WordSpacing: 0
ApplyLineSpacing: 0
LineSpacing: 0
ApplyParagraphSpacing: 0
ParagraphSpacing: 0
--- !u!224 &6287727356447257098 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 2297799915912419130, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
@ -6594,49 +6526,15 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3406978621052864304, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
propertyPath: m_hasFontAssetChanged
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 8401098705935669092, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
insertIndex: -1
addedObject: {fileID: 4302952944087247998}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
--- !u!1 &1672162377959962900 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 8401098705935669092, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}
m_PrefabInstance: {fileID: 7179305230723018352}
m_PrefabAsset: {fileID: 0}
--- !u!114 &4302952944087247998
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1672162377959962900}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6b27f832d22e4a8d916272b644937774, type: 3}
m_Name:
m_EditorClassIdentifier:
Ban: 0
NoExport: 0
FontBan: 0
Preset: 0
ID: 18820
FontID: 1
TextCfg:
- Type: 1
ApplyFontSize: 0
FontSize: 22
ApplyCharacterSpacing: 0
CharacterSpacing: 0
ApplyWordSpacing: 0
WordSpacing: 0
ApplyLineSpacing: 0
LineSpacing: 0
ApplyParagraphSpacing: 0
ParagraphSpacing: 0
--- !u!114 &8427155378226373277 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1680195858608278765, guid: 08691a9455a11ed4e86496ad244b552d, type: 3}

View File

@ -19,7 +19,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &747101445380428393
RectTransform:
m_ObjectHideFlags: 0
@ -391,6 +391,7 @@ MonoBehaviour:
MissionDesc: {fileID: 73251682999977897}
ForceFinishCost: {fileID: 6983700364404550226}
ForceFinishButton: {fileID: 4908834122378262994}
BuyButtonMono: {fileID: 758300530644923363}
NormalCircle: {fileID: 21300000, guid: a5214bedf49739d49acd55ef154273c9, type: 3}
LockedCircle: {fileID: 21300000, guid: c22f6fb050d6cd74db9d9ee18e85c890, type: 3}
RowBGNormal: {r: 1, g: 1, b: 1, a: 0.627451}
@ -738,7 +739,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &6986520482583646820
RectTransform:
m_ObjectHideFlags: 0
@ -1791,7 +1792,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &3891470974600315340
RectTransform:
m_ObjectHideFlags: 0
@ -1803,7 +1804,8 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Children:
- {fileID: 1778954800764508990}
m_Father: {fileID: 2297799915912419130}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
@ -1842,7 +1844,7 @@ MonoBehaviour:
m_text: "\u62E5\u6709\u6CD5\u5178<color=orange>{param}</color>\u540E\u89E3\u9501"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8e119f168f1a6b745be02ef19f51610f, type: 2}
m_sharedMaterial: {fileID: -8836383360333263746, guid: ca3ea612c29dc5f49a32dffc195e45fe, type: 2}
m_sharedMaterial: {fileID: -8081454072124122709, guid: 8e119f168f1a6b745be02ef19f51610f, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
@ -2605,3 +2607,120 @@ MonoBehaviour:
LineSpacing: 0
ApplyParagraphSpacing: 0
ParagraphSpacing: 0
--- !u!1001 &1854230040789655539
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 3891470974600315340}
m_Modifications:
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_AnchorMax.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_AnchorMax.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_AnchorMin.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_AnchorMin.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_SizeDelta.x
value: 86.2172
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_SizeDelta.y
value: 36.113
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 196.8
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_AnchoredPosition.y
value: -0.1
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5003183159614252387, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_Name
value: UIInfoCultureCardBuyButtonMono
objectReference: {fileID: 0}
- target: {fileID: 5003183159614252387, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
--- !u!114 &758300530644923363 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1386416221665405968, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
m_PrefabInstance: {fileID: 1854230040789655539}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6569dad8c3ddb59469d2152747766aa1, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &1778954800764508990 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 75313877887960269, guid: c145903b3c1bd82419d8805e36e1c8a6, type: 3}
m_PrefabInstance: {fileID: 1854230040789655539}
m_PrefabAsset: {fileID: 0}

View File

@ -1538,7 +1538,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 73, y: -12}
m_AnchoredPosition: {x: 73, y: -11.999939}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!222 &8330926481832495458
@ -2861,7 +2861,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 422417801502647100, guid: e880e5b986f49d242911f0320df9536d, type: 3}
propertyPath: m_AnchoredPosition.y
value: -303.675
value: -158.65
objectReference: {fileID: 0}
- target: {fileID: 422417801502647100, guid: e880e5b986f49d242911f0320df9536d, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -3010,7 +3010,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 422417801502647100, guid: e880e5b986f49d242911f0320df9536d, type: 3}
propertyPath: m_AnchoredPosition.y
value: -188.205
value: -101.19
objectReference: {fileID: 0}
- target: {fileID: 422417801502647100, guid: e880e5b986f49d242911f0320df9536d, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -3159,7 +3159,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 422417801502647100, guid: e880e5b986f49d242911f0320df9536d, type: 3}
propertyPath: m_AnchoredPosition.y
value: -72.735
value: -43.73
objectReference: {fileID: 0}
- target: {fileID: 422417801502647100, guid: e880e5b986f49d242911f0320df9536d, type: 3}
propertyPath: m_LocalEulerAnglesHint.x

View File

@ -50,6 +50,8 @@ namespace Logic.Skill
if (self.GetAllAttackValue(map, target) <= target.GetAllDefenseValue(map, self)) return false;
var player = self.Player(map);
if (player == null) return false;
var targetPlayer = target.Player(map);
if (targetPlayer == null) return false;
map.GetCapitalCityDataByPlayerId(player.Id, out var city);
var targetCity = target.City(map);
if (city == null || targetCity == null) return false;
@ -59,10 +61,13 @@ namespace Logic.Skill
var nextGrid = map.GridMap.GetNextGrid(selfGrid, targetGrid);
var dmg = Table.Instance.CalcDamage(map, self, target);
// 判断能否推动
// 使用 CheckUnitAbleForGrid_OfflineStatus 而非 CheckLandTypeForGrid:
// 前者会对 LandAndPort 单位检查港口归属(必须同联盟),后者只看地形 LandType。
// 之前用纯 LandType 判定会让勇仪(LandAndPort)合法走进敌方港口。
bool canPush = nextGrid != null && !nextGrid.RealUnit(map, out _)
&& map.CheckLandTypeForGrid(target.UnitFullType, nextGrid)
&& map.CheckLandTypeForGrid(self.UnitFullType, targetGrid)
&& map.CheckLandTypeForGrid(self.UnitFullType, nextGrid);
&& Main.UnitLogic.CheckUnitAbleForGrid_OfflineStatus(map, targetPlayer, target, nextGrid)
&& Main.UnitLogic.CheckUnitAbleForGrid_OfflineStatus(map, player, self, targetGrid)
&& Main.UnitLogic.CheckUnitAbleForGrid_OfflineStatus(map, player, self, nextGrid);
// 能推→无额外伤害;不能推→+2伤害
int actualDmg = canPush ? dmg : dmg + 2;

View File

@ -5,6 +5,8 @@ using System.Collections.Generic;
using Logic.Action;
using Logic.Multilingual;
using RuntimeData;
using TH1_Core.Events;
using TH1_Core.Managers;
using TH1_Logic.Action;
using TH1_Logic.Core;
using TH1_Logic.HeroTask;
@ -45,9 +47,12 @@ namespace TH1_UI.View.Info
public TextMeshProUGUI MissionDesc;
public TextMeshProUGUI ForceFinishCost;
[Header("会响应玩家交互的模块")]
[Header("会响应玩家交互的模块")]
public Button ForceFinishButton;
[Header("解锁购买按钮位于LockHint子对象下")]
public UIInfoCultureCardBuyButtonMono BuyButtonMono;
[Header("可选值的缓存")]
public Sprite NormalCircle;
public Sprite LockedCircle;
@ -102,16 +107,62 @@ namespace TH1_UI.View.Info
HintTrigger.DataProvider.UnitFullType.GiantType = GiantType.None;
// 根据行索引设置LockHint的文字参数第2行→SecondHero第3行→ThirdHero
var cardType = rowIndex == 1 ? CultureCardType.SecondHero : CultureCardType.ThirdHero;
var hasCardInfo = Table.Instance.CultureCardDataAssets.GetCultureCardInfo(cardType, out var cardInfo);
var lockTmp = LockHint.GetComponent<TextMeshProUGUI>();
if (lockTmp != null)
if (lockTmp != null && hasCardInfo)
{
var cardType = rowIndex == 1 ? CultureCardType.SecondHero : CultureCardType.ThirdHero;
if (Table.Instance.CultureCardDataAssets.GetCultureCardInfo(cardType, out var cardInfo))
{
var cardName = MultilingualManager.Instance.GetMultilingualTextSafe(cardInfo.Name);
MultilingualManager.Instance.SetUIText(lockTmp, new List<string> { cardName });
}
var cardName = MultilingualManager.Instance.GetMultilingualTextSafe(cardInfo.Name);
MultilingualManager.Instance.SetUIText(lockTmp, new List<string> { cardName });
}
SetupBuyButton(rowIndex, hasCardInfo ? cardInfo : null, cardType);
}
// 解锁购买按钮:仅在 rowIndex>=1 且前置法典已满足时显示。
// 点击行为CheckCan 通过则购买并广播刷新事件;文化值不够会被 CheckCan 拦住,静默无反应。
private void SetupBuyButton(int rowIndex, CultureCardInfo cardInfo, CultureCardType cardType)
{
if (BuyButtonMono == null) return;
// 首行不显示购买按钮(避免异常进入锁定态时误导玩家)
if (rowIndex == 0 || cardInfo == null)
{
BuyButtonMono.gameObject.SetActive(false);
return;
}
var player = Main.MapData?.PlayerMap?.SelfPlayerData;
if (player == null || !cardInfo.CheckPrerequisiteCardsOwned(player))
{
BuyButtonMono.gameObject.SetActive(false);
return;
}
BuyButtonMono.gameObject.SetActive(true);
BuyButtonMono.UpdateVisual(cardInfo.Cost, player.PlayerCultureInfo.PlayerCulture);
if (BuyButtonMono.BuyButton == null) return;
BuyButtonMono.BuyButton.onClick.RemoveAllListeners();
BuyButtonMono.BuyButton.onClick.AddListener(() =>
{
var self = Main.MapData?.PlayerMap?.SelfPlayerData;
if (self == null) return;
var actionId = new CommonActionId
{
ActionType = CommonActionType.BuyCultureCard,
CultureCardType = cardType,
};
var action = ActionLogicFactory.GetActionLogic(actionId);
var param = new CommonActionParams(Main.MapData, playerData: self,
mainObjectType: MainObjectType.Player);
param.RefreshParams();
if (!action.CheckCan(param)) return; // 文化不够或其他原因不可购买,静默
action.CompleteExecute(param);
EventManager.Publish(new UpdateUIInfoHeroCultureCards());
EventManager.Publish(new UpdateUITopTopBar { UpdateType = UpdateTopBarType.UpdateCulture });
EventManager.Publish(new UpdateUITopTopBar { UpdateType = UpdateTopBarType.UpdateCoinPerTurn });
});
}
public void SetBlank()

File diff suppressed because it is too large Load Diff