Commit f1526a59 authored by nwwdles's avatar nwwdles

combattextnames: add skill icons

original changes by Fox on 14.06.2019
parent 10d177ce
......@@ -25,6 +25,9 @@ CombatTextNames = {}
CombatTextNames.Settings = {
ResetPositionOnLOS = false,
EnableIcons = true,
EnableAbilityNames = false,
EnableNamesOnMissText = true, -- only works if names are enabled
Colors = {
INCOMING_DAMAGE = {r = 255, g = 0, b = 0},
OUTGOING_DAMAGE = {r = 235, g = 235, b = 235},
......@@ -43,7 +46,6 @@ CombatTextNames.Settings = {
PointGainScaleFactor = 1.3,
CriticalScaleFactor = 1.5,
OwnEventScaleFactor = 1,
EnableNamesOnMissText = true,
Animation = {
Default = {
start = {x = -280, y = 100},
......@@ -54,9 +56,9 @@ CombatTextNames.Settings = {
fadeDuration = 0.75
},
Hostile = {
start = {x = -130, y = 0},
target = {x = -130, y = -80},
current = {x = -130, y = 0},
start = {x = 0, y = -100},
target = {x = 0, y = -180},
current = {x = 0, y = -100},
maximumDisplayTime = 4,
fadeDelay = 2,
fadeDuration = 0.75
......@@ -224,18 +226,21 @@ end
function CombatTextNames.SetupText(self, hitTargetObjectNumber, hitAmount,
textType)
local text = L""
local name = towstring(hitAmount.name)
if name ~= L"" then
name = L" (" .. name .. L")"
if hitAmount.iconNum ~= 0 and CombatTextNames.Settings.EnableIcons then
local texture, x, y = GetIconData(hitAmount.iconNum)
DynamicImageSetTexture(self:GetName() .. "Icon", texture, x, y)
end
-- here's code to add an icon (but it won't be animated correctly):
--
-- name= L"<icon"..towstring(hitAmount.iconNum)..L"> "..name
-- LabelSetIgnoreFormattingTags(self:GetName(), false)
--
-- todo: look into modifying "EA_Window_EventTextAnchor" window
local text = L""
local name = L""
if CombatTextNames.Settings.EnableAbilityNames then
name = towstring(hitAmount.name)
if name ~= L"" then
name = L" (" .. name .. L")"
-- here's code to add an icon as a text icon (but it won't be animated correctly):
-- name = L"<icon" .. towstring(hitAmount.iconNum) .. L"> " .. name
-- LabelSetIgnoreFormattingTags(self:GetName(), false)
end
end
local amount = hitAmount.hit
......
<Interface xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Windows>
<Label name="CombatTextNames_Window_EventTextLabel" font="font_clear_large_bold" maxchars="32" textalign="center" layer="default" autoresize="false" sticky="false" handleinput="false" wordwrap="false" ignoreFormattingTags="true">
<Label name="CombatTextNames_Window_EventTextLabel" font="font_clear_large_bold" maxchars="32" textalign="left" layer="default" autoresize="true" sticky="false" handleinput="false" wordwrap="true" ignoreFormattingTags="true">
<Size>
<AbsPoint x="400" y="100" />
<AbsPoint x="200" y="10" />
</Size>
<Color r="255" g="255" b="255" a="255" />
<Windows>
<DynamicImage name="$parentIcon" texture="" layer="default" popable="false" sticky="false" handleinput="false" texturescale=".5">
<Size>
<AbsPoint x="32" y="32" />
</Size>
<Anchors>
<Anchor point="left" relativePoint="right" relativeTo="$parent">
<AbsPoint x="-10" y="0" />
</Anchor>
</Anchors>
</DynamicImage>
</Windows>
</Label>
</Windows>
</Interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment