Add card keyword hover tooltips

This commit is contained in:
2026-06-15 23:15:04 +09:00
parent 72370aab23
commit 7c776864e2
3 changed files with 165 additions and 31 deletions

View File

@@ -3588,6 +3588,29 @@
"Attributes": [],
"Name": "RenderRelics"
},
{
"Return": {
"Type": "string",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": null
},
"Arguments": [
{
"Type": "any",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": "c"
}
],
"Code": "if c == nil then\n\treturn \"\"\nend\nlocal lines = {}\nlocal function add(name, desc)\n\tfor i = 1, #lines do\n\t\tif string.find(lines[i], name .. \":\", 1, true) == 1 then\n\t\t\treturn\n\t\tend\n\tend\n\ttable.insert(lines, name .. \": \" .. desc)\nend\nlocal cardDesc = c.desc or \"\"\nif c.sly == true or string.find(cardDesc, \"교활\", 1, true) ~= nil then\n\tadd(\"교활\", \"버려지면 비용 없이 사용됩니다.\")\nend\nif c.retain == true or string.find(cardDesc, \"보존\", 1, true) ~= nil then\n\tadd(\"보존\", \"턴 종료 시 버려지지 않고 손에 남습니다.\")\nend\nif string.find(cardDesc, \"소멸\", 1, true) ~= nil then\n\tadd(\"소멸\", \"사용 후 이번 전투 동안 제거됩니다.\")\nend\nif string.find(cardDesc, \"선천성\", 1, true) ~= nil then\n\tadd(\"선천성\", \"전투 시작 시 손패에 들어옵니다.\")\nend\nif c.vuln ~= nil and c.vuln > 0 then\n\tadd(\"취약\", \"받는 공격 피해가 50% 증가합니다.\")\nend\nif c.weak ~= nil and c.weak > 0 then\n\tadd(\"약화\", \"주는 공격 피해가 25% 감소합니다.\")\nend\nif c.poison ~= nil and c.poison > 0 then\n\tadd(\"중독\", \"턴 시작 시 체력을 잃고 수치가 1 감소합니다.\")\nend\nif c.pierce == true then\n\tadd(\"관통\", \"방어도를 무시하고 피해를 줍니다.\")\nend\nif c.aoe == true then\n\tadd(\"전체\", \"모든 적에게 적용됩니다.\")\nend\nif c.kind == \"Power\" then\n\tadd(\"파워\", \"사용하면 전투 동안 지속 효과로 남습니다.\")\nend\nif c.unplayable == true then\n\tadd(\"저주\", \"사용할 수 없고 손패를 방해합니다.\")\nend\nlocal out = \"\"\nfor i = 1, #lines do\n\tif i > 1 then out = out .. \"\\n\" end\n\tout = out .. lines[i]\nend\nreturn out",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "BuildCardKeywordTooltip"
},
{
"Return": {
"Type": "void",
@@ -3605,7 +3628,7 @@
"Name": "slot"
}
],
"Code": "if self.DragSlot ~= nil and self.DragSlot > 0 then\n\treturn\nend\nlocal cardId = self.Hand[slot]\nif cardId == nil then\n\treturn\nend\nlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot))\nlocal tx = 0\nif e ~= nil and e.UITransformComponent ~= nil then\n\ttx = e.UITransformComponent.anchoredPosition.x\n\te.UITransformComponent.UIScale = Vector3(1.3, 1.3, 1)\nend\nlocal c = self.Cards[cardId]\nif c ~= nil then\n\tself:ShowTooltip(c.name, c.desc, tx)\nend",
"Code": "if self.DragSlot ~= nil and self.DragSlot > 0 then\n\treturn\nend\nlocal cardId = self.Hand[slot]\nif cardId == nil then\n\treturn\nend\nlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CardHand/Card\" .. tostring(slot))\nlocal tx = 0\nif e ~= nil and e.UITransformComponent ~= nil then\n\ttx = e.UITransformComponent.anchoredPosition.x\n\te.UITransformComponent.UIScale = Vector3(1.3, 1.3, 1)\nend\nlocal c = self.Cards[cardId]\nif c ~= nil then\n\tlocal tip = self:BuildCardKeywordTooltip(c)\n\tif tip ~= \"\" then\n\t\tlocal tipX = tx + 270\n\t\tif tx > 180 then tipX = tx - 270 end\n\t\tif tipX > 760 then tipX = tx - 270 end\n\t\tif tipX < -760 then tipX = tx + 270 end\n\t\tself:ShowTooltipAt(\"키워드\", tip, tipX, 90)\n\telse\n\t\tself:HideTooltip()\n\tend\nend",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
@@ -3665,12 +3688,56 @@
"Name": "x"
}
],
"Code": "self:SetText(\"/ui/DefaultGroup/CombatHud/TooltipBox/Name\", name)\nself:SetText(\"/ui/DefaultGroup/CombatHud/TooltipBox/Desc\", desc)\nlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/TooltipBox\")\nif e ~= nil then\n\tif e.UITransformComponent ~= nil then\n\t\te.UITransformComponent.anchoredPosition = Vector2(x, 400)\n\tend\n\te.Enable = true\nend",
"Code": "self:ShowTooltipAt(name, desc, x, 400)",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "ShowTooltip"
},
{
"Return": {
"Type": "void",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": null
},
"Arguments": [
{
"Type": "string",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": "name"
},
{
"Type": "string",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": "desc"
},
{
"Type": "number",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": "x"
},
{
"Type": "number",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": "y"
}
],
"Code": "self:SetText(\"/ui/DefaultGroup/CombatHud/TooltipBox/Name\", name)\nself:SetText(\"/ui/DefaultGroup/CombatHud/TooltipBox/Desc\", desc)\nlocal e = _EntityService:GetEntityByPath(\"/ui/DefaultGroup/CombatHud/TooltipBox\")\nif e ~= nil then\n\tif e.UITransformComponent ~= nil then\n\t\te.UITransformComponent.anchoredPosition = Vector2(x, y)\n\tend\n\te.Enable = true\nend",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "ShowTooltipAt"
},
{
"Return": {
"Type": "void",