fix(ui): show target marker only while dragging

This commit is contained in:
2026-06-15 00:51:50 +09:00
parent d5318ac86b
commit b65d4af1eb
2 changed files with 11 additions and 11 deletions

View File

@@ -2429,7 +2429,7 @@
"Name": null
},
"Arguments": [],
"Code": "local shownTarget = self.TargetIndex\nif self.DragTargetIndex ~= nil and self.DragTargetIndex > 0 then\n\tshownTarget = self.DragTargetIndex\nend\nfor i = 1, #self.Monsters do\n\tlocal m = self.Monsters[i]\n\tlocal active = false\n\tif m ~= nil and m.alive == true and i == shownTarget then active = true end\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(i) .. \"/TargetFrame\", active)\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(i) .. \"/TargetMarker\", active)\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(i) .. \"/TargetMarker/Label\", active)\nend",
"Code": "local dragActive = self.DragTargetIndex ~= nil and self.DragTargetIndex > 0\nlocal shownTarget = self.TargetIndex\nif dragActive == true then shownTarget = self.DragTargetIndex end\nfor i = 1, #self.Monsters do\n\tlocal m = self.Monsters[i]\n\tlocal active = false\n\tif m ~= nil and m.alive == true and i == shownTarget then active = true end\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(i) .. \"/TargetFrame\", active)\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(i) .. \"/TargetMarker\", active and dragActive)\n\tself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(i) .. \"/TargetMarker/Label\", active and dragActive)\nend",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
@@ -3031,7 +3031,7 @@
"Name": null
},
"Arguments": [],
"Code": "for i = 1, 4 do\n\tlocal base = \"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(i)\n\tlocal m = self.Monsters[i]\n\tif m ~= nil and m.alive == true then\n\t\tself:SetEntityEnabled(base, true)\n\t\tself:SetText(base .. \"/Name\", m.name)\n\t\tself:SetText(base .. \"/Hp\", string.format(\"%d\", m.hp) .. \"/\" .. string.format(\"%d\", m.maxHp))\n\t\tlocal intent = m.intents[m.intentIdx]\n\t\tlocal t = \"\"\n\t\tif intent ~= nil then\n\t\t\tif intent.kind == \"Attack\" then\n\t\t\t\tlocal atk = intent.value + m.str\n\t\t\t\tif m.weak > 0 then atk = math.floor(atk * 0.75) end\n\t\t\t\tif self.PlayerVuln > 0 then atk = math.floor(atk * 1.5) end\n\t\t\t\tt = \"공격 \" .. tostring(atk)\n\t\t\telseif intent.kind == \"Defend\" then t = \"방어 \" .. tostring(intent.value)\n\t\t\telseif intent.kind == \"Debuff\" then\n\t\t\t\tif intent.effect == \"weak\" then t = \"약화 \" .. tostring(intent.value) .. \" 부여\"\n\t\t\t\telse t = \"취약 \" .. tostring(intent.value) .. \" 부여\" end\n\t\t\telseif intent.kind == \"AddCard\" then\n\t\t\t\tt = \"저주 카드 추가\"\n\t\t\tend\n\t\tend\n\t\tself:SetText(base .. \"/Intent\", t)\n\t\tlocal shownTarget = self.TargetIndex\n\t\tif self.DragTargetIndex ~= nil and self.DragTargetIndex > 0 then shownTarget = self.DragTargetIndex end\n\t\tself:SetEntityEnabled(base .. \"/TargetFrame\", i == shownTarget)\n\t\tself:SetEntityEnabled(base .. \"/TargetMarker\", i == shownTarget)\n\t\tself:SetEntityEnabled(base .. \"/TargetMarker/Label\", i == shownTarget)\n\t\tlocal intentEntity = _EntityService:GetEntityByPath(base .. \"/Intent\")\n\t\tif intentEntity ~= nil and intentEntity.TextComponent ~= nil and intent ~= nil then\n\t\t\tif intent.kind == \"Attack\" then\n\t\t\t\tintentEntity.TextComponent.FontColor = Color(1, 0.45, 0.35, 1)\n\t\t\telseif intent.kind == \"Debuff\" then\n\t\t\t\tintentEntity.TextComponent.FontColor = Color(0.8, 0.5, 1, 1)\n\t\t\telseif intent.kind == \"AddCard\" then\n\t\t\t\tintentEntity.TextComponent.FontColor = Color(0.6, 0.85, 0.4, 1)\n\t\t\telse\n\t\t\t\tintentEntity.TextComponent.FontColor = Color(0.5, 0.75, 1, 1)\n\t\t\tend\n\t\tend\n\t\tself:SetHpBar(base .. \"/HpBarFill\", m.hp, m.maxHp, 140)\n\t\tself:SetEntityEnabled(base .. \"/BlockBadge\", m.block > 0)\n\t\tself:SetText(base .. \"/BlockBadge/Value\", string.format(\"%d\", m.block))\n\t\tself:SetText(base .. \"/Buffs\", self:BuffsLabel(m.str, m.weak, m.vuln, m.poison or 0))\n\telse\n\t\tself:SetEntityEnabled(base, false)\n\tend\nend\nself:SetText(\"/ui/DefaultGroup/CombatHud/PlayerPanel/HpText\", string.format(\"%d\", self.PlayerHp) .. \"/\" .. string.format(\"%d\", self.PlayerMaxHp))\nself:SetHpBar(\"/ui/DefaultGroup/CombatHud/PlayerPanel/HpBarFill\", self.PlayerHp, self.PlayerMaxHp, 220)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/PlayerPanel/BlockBadge\", self.PlayerBlock > 0)\nself:SetText(\"/ui/DefaultGroup/CombatHud/PlayerPanel/BlockBadge/Value\", string.format(\"%d\", self.PlayerBlock))\nlocal pb = self:BuffsLabel(self.PlayerStr, self.PlayerWeak, self.PlayerVuln, 0)\nif self.PlayerPowers ~= nil and #self.PlayerPowers > 0 then\n\tlocal names = {}\n\tfor i = 1, #self.PlayerPowers do\n\t\tlocal pc = self.Cards[self.PlayerPowers[i]]\n\t\tif pc ~= nil then table.insert(names, pc.name) end\n\tend\n\tif pb ~= \"\" then pb = pb .. \" · \" end\n\tpb = pb .. table.concat(names, \" \")\nend\nself:SetText(\"/ui/DefaultGroup/CombatHud/PlayerPanel/Buffs\", pb)\nself:RenderRun()",
"Code": "for i = 1, 4 do\n\tlocal base = \"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(i)\n\tlocal m = self.Monsters[i]\n\tif m ~= nil and m.alive == true then\n\t\tself:SetEntityEnabled(base, true)\n\t\tself:SetText(base .. \"/Name\", m.name)\n\t\tself:SetText(base .. \"/Hp\", string.format(\"%d\", m.hp) .. \"/\" .. string.format(\"%d\", m.maxHp))\n\t\tlocal intent = m.intents[m.intentIdx]\n\t\tlocal t = \"\"\n\t\tif intent ~= nil then\n\t\t\tif intent.kind == \"Attack\" then\n\t\t\t\tlocal atk = intent.value + m.str\n\t\t\t\tif m.weak > 0 then atk = math.floor(atk * 0.75) end\n\t\t\t\tif self.PlayerVuln > 0 then atk = math.floor(atk * 1.5) end\n\t\t\t\tt = \"공격 \" .. tostring(atk)\n\t\t\telseif intent.kind == \"Defend\" then t = \"방어 \" .. tostring(intent.value)\n\t\t\telseif intent.kind == \"Debuff\" then\n\t\t\t\tif intent.effect == \"weak\" then t = \"약화 \" .. tostring(intent.value) .. \" 부여\"\n\t\t\t\telse t = \"취약 \" .. tostring(intent.value) .. \" 부여\" end\n\t\t\telseif intent.kind == \"AddCard\" then\n\t\t\t\tt = \"저주 카드 추가\"\n\t\t\tend\n\t\tend\n\t\tself:SetText(base .. \"/Intent\", t)\n\t\tlocal dragActive = self.DragTargetIndex ~= nil and self.DragTargetIndex > 0\n\t\tlocal shownTarget = self.TargetIndex\n\t\tif dragActive == true then shownTarget = self.DragTargetIndex end\n\t\tself:SetEntityEnabled(base .. \"/TargetFrame\", i == shownTarget)\n\t\tself:SetEntityEnabled(base .. \"/TargetMarker\", i == shownTarget and dragActive)\n\t\tself:SetEntityEnabled(base .. \"/TargetMarker/Label\", i == shownTarget and dragActive)\n\t\tlocal intentEntity = _EntityService:GetEntityByPath(base .. \"/Intent\")\n\t\tif intentEntity ~= nil and intentEntity.TextComponent ~= nil and intent ~= nil then\n\t\t\tif intent.kind == \"Attack\" then\n\t\t\t\tintentEntity.TextComponent.FontColor = Color(1, 0.45, 0.35, 1)\n\t\t\telseif intent.kind == \"Debuff\" then\n\t\t\t\tintentEntity.TextComponent.FontColor = Color(0.8, 0.5, 1, 1)\n\t\t\telseif intent.kind == \"AddCard\" then\n\t\t\t\tintentEntity.TextComponent.FontColor = Color(0.6, 0.85, 0.4, 1)\n\t\t\telse\n\t\t\t\tintentEntity.TextComponent.FontColor = Color(0.5, 0.75, 1, 1)\n\t\t\tend\n\t\tend\n\t\tself:SetHpBar(base .. \"/HpBarFill\", m.hp, m.maxHp, 140)\n\t\tself:SetEntityEnabled(base .. \"/BlockBadge\", m.block > 0)\n\t\tself:SetText(base .. \"/BlockBadge/Value\", string.format(\"%d\", m.block))\n\t\tself:SetText(base .. \"/Buffs\", self:BuffsLabel(m.str, m.weak, m.vuln, m.poison or 0))\n\telse\n\t\tself:SetEntityEnabled(base, false)\n\tend\nend\nself:SetText(\"/ui/DefaultGroup/CombatHud/PlayerPanel/HpText\", string.format(\"%d\", self.PlayerHp) .. \"/\" .. string.format(\"%d\", self.PlayerMaxHp))\nself:SetHpBar(\"/ui/DefaultGroup/CombatHud/PlayerPanel/HpBarFill\", self.PlayerHp, self.PlayerMaxHp, 220)\nself:SetEntityEnabled(\"/ui/DefaultGroup/CombatHud/PlayerPanel/BlockBadge\", self.PlayerBlock > 0)\nself:SetText(\"/ui/DefaultGroup/CombatHud/PlayerPanel/BlockBadge/Value\", string.format(\"%d\", self.PlayerBlock))\nlocal pb = self:BuffsLabel(self.PlayerStr, self.PlayerWeak, self.PlayerVuln, 0)\nif self.PlayerPowers ~= nil and #self.PlayerPowers > 0 then\n\tlocal names = {}\n\tfor i = 1, #self.PlayerPowers do\n\t\tlocal pc = self.Cards[self.PlayerPowers[i]]\n\t\tif pc ~= nil then table.insert(names, pc.name) end\n\tend\n\tif pb ~= \"\" then pb = pb .. \" · \" end\n\tpb = pb .. table.concat(names, \" \")\nend\nself:SetText(\"/ui/DefaultGroup/CombatHud/PlayerPanel/Buffs\", pb)\nself:RenderRun()",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],

View File

@@ -4431,17 +4431,16 @@ for i = 1, #self.Monsters do
end
end
return best`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'touchPoint' }], 0, 'number'),
method('RenderTargetFrames', `local shownTarget = self.TargetIndex
if self.DragTargetIndex ~= nil and self.DragTargetIndex > 0 then
shownTarget = self.DragTargetIndex
end
method('RenderTargetFrames', `local dragActive = self.DragTargetIndex ~= nil and self.DragTargetIndex > 0
local shownTarget = self.TargetIndex
if dragActive == true then shownTarget = self.DragTargetIndex end
for i = 1, #self.Monsters do
local m = self.Monsters[i]
local active = false
if m ~= nil and m.alive == true and i == shownTarget then active = true end
self:SetEntityEnabled("/ui/DefaultGroup/CombatHud/MonsterSlot" .. tostring(i) .. "/TargetFrame", active)
self:SetEntityEnabled("/ui/DefaultGroup/CombatHud/MonsterSlot" .. tostring(i) .. "/TargetMarker", active)
self:SetEntityEnabled("/ui/DefaultGroup/CombatHud/MonsterSlot" .. tostring(i) .. "/TargetMarker/Label", active)
self:SetEntityEnabled("/ui/DefaultGroup/CombatHud/MonsterSlot" .. tostring(i) .. "/TargetMarker", active and dragActive)
self:SetEntityEnabled("/ui/DefaultGroup/CombatHud/MonsterSlot" .. tostring(i) .. "/TargetMarker/Label", active and dragActive)
end`),
method('OnCardDragBegin', `if self.CombatOver == true or self.FxBusy == true or self.TurnBusy == true then
return
@@ -4971,11 +4970,12 @@ return table.concat(parts, " ")`, [
end
end
self:SetText(base .. "/Intent", t)
local dragActive = self.DragTargetIndex ~= nil and self.DragTargetIndex > 0
local shownTarget = self.TargetIndex
if self.DragTargetIndex ~= nil and self.DragTargetIndex > 0 then shownTarget = self.DragTargetIndex end
if dragActive == true then shownTarget = self.DragTargetIndex end
self:SetEntityEnabled(base .. "/TargetFrame", i == shownTarget)
self:SetEntityEnabled(base .. "/TargetMarker", i == shownTarget)
self:SetEntityEnabled(base .. "/TargetMarker/Label", i == shownTarget)
self:SetEntityEnabled(base .. "/TargetMarker", i == shownTarget and dragActive)
self:SetEntityEnabled(base .. "/TargetMarker/Label", i == shownTarget and dragActive)
local intentEntity = _EntityService:GetEntityByPath(base .. "/Intent")
if intentEntity ~= nil and intentEntity.TextComponent ~= nil and intent ~= nil then
if intent.kind == "Attack" then