feat(combat): render monster damage popups with digit skins
This commit is contained in:
@@ -3061,7 +3061,7 @@
|
||||
"Name": "amount"
|
||||
}
|
||||
],
|
||||
"Code": "local base = \"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(slot) .. \"/DmgPop\"\nlocal pop = _EntityService:GetEntityByPath(base)\nself:SetText(base, string.format(\"%d\", amount))\nself:SetEntityEnabled(base, true)\nself:SetEntityEnabled(base .. \"/Accent\", true)\nif pop ~= nil and pop.UITransformComponent ~= nil then\n\tpop.UITransformComponent.anchoredPosition = Vector2(0, 76)\nend\nlocal startY = 76\nfor i = 1, 6 do\n\t_TimerService:SetTimerOnce(function()\n\t\tlocal p = _EntityService:GetEntityByPath(base)\n\t\tif p ~= nil and p.UITransformComponent ~= nil then\n\t\t\tp.UITransformComponent.anchoredPosition = Vector2(0, startY + i * 7)\n\t\tend\n\tend, 0.045 * i)\nend\n_TimerService:SetTimerOnce(function()\n\tself:SetEntityEnabled(base, false)\n\tself:SetEntityEnabled(base .. \"/Accent\", false)\nend, 0.48)",
|
||||
"Code": "local base = \"/ui/DefaultGroup/CombatHud/MonsterSlot\" .. tostring(slot) .. \"/DmgPop\"\nlocal pop = _EntityService:GetEntityByPath(base)\nself:SetText(base, \"\")\nself:SetEntityEnabled(base, true)\nlocal damageDigitRuids = { \"b94c19830538447f81617035d89bcc05\", \"01b023122a6f4a5789e1d4c61ff8f430\", \"57ff71d1b9eb471b9feb1c15348770c9\", \"cab92837798a42ad9143c67e93f999e1\", \"366f271f9ca94a0684083aad9298efad\", \"5c7a6ad38491466aa84bf450e0fdcf25\", \"7d82a6838e1b4f4a8a0f7420db34c985\", \"c0765bb1e47d46ffbe1df4ac19ea9b1b\", \"6ea0bfed61e149f88a9b3f22dd79774f\", \"82ad2acaae4e4b3fb87bf73635250d22\" }\nlocal shown = tostring(math.max(0, math.floor(amount)))\nif string.len(shown) > 5 then\n shown = string.sub(shown, 1, 5)\nend\nlocal digits = {}\nfor i = 1, string.len(shown) do\n table.insert(digits, tonumber(string.sub(shown, i, i)) or 0)\nend\nlocal totalW = #digits * 22 + math.max(0, #digits - 1) * 18\nlocal startX = -totalW / 2 + 22 / 2\nfor i = 1, 5 do\n local digitPath = base .. \"/Digit\" .. tostring(i)\n local digitEntity = _EntityService:GetEntityByPath(digitPath)\n if digitEntity ~= nil and digitEntity.SpriteGUIRendererComponent ~= nil then\n if digits[i] ~= nil then\n digitEntity.SpriteGUIRendererComponent.ImageRUID = damageDigitRuids[digits[i] + 1]\n digitEntity.SpriteGUIRendererComponent.Color = Color(1, 1, 1, 1)\n if digitEntity.UITransformComponent ~= nil then\n digitEntity.UITransformComponent.anchoredPosition = Vector2(startX + (i - 1) * (22 + 18), 0)\n end\n self:SetEntityEnabled(digitPath, true)\n else\n self:SetEntityEnabled(digitPath, false)\n end\n end\nend\nif pop ~= nil and pop.UITransformComponent ~= nil then\n pop.UITransformComponent.anchoredPosition = Vector2(0, 76)\nend\nlocal startY = 76\nfor i = 1, 6 do\n _TimerService:SetTimerOnce(function()\n local p = _EntityService:GetEntityByPath(base)\n if p ~= nil and p.UITransformComponent ~= nil then\n p.UITransformComponent.anchoredPosition = Vector2(0, startY + i * 7)\n end\n end, 0.045 * i)\nend\n_TimerService:SetTimerOnce(function()\n self:SetEntityEnabled(base, false)\nend, 0.48)",
|
||||
"Scope": 2,
|
||||
"ExecSpace": 6,
|
||||
"Attributes": [],
|
||||
|
||||
Reference in New Issue
Block a user