Skip to content

Commit 48652f7

Browse files
committed
Add texture creation from path
1 parent 2a188e6 commit 48652f7

File tree

1 file changed

+8
-0
lines changed
  • [gameplay]/killmessages/scripts/client

1 file changed

+8
-0
lines changed

[gameplay]/killmessages/scripts/client/c.ui.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ function outputMessage(new)
1313

1414
new.initTick = getTickCount()
1515

16+
if new.icon.path and fileExists(new.icon.path) then
17+
new.icon.texture = dxCreateTexture(new.icon.path)
18+
end
19+
1620
table.insert(messages, new)
1721

1822
local displayLines = tonumber(getSetting('displayLines')) or 5
@@ -103,6 +107,10 @@ function renderMessages()
103107

104108
y = y - lineHeight - padding
105109
else
110+
if v.icon.path and v.icon.texture and isElement(v.icon.texture) then
111+
destroyElement(v.icon.texture)
112+
end
113+
106114
table.remove(messages, k)
107115

108116
if (#messages == 0) then

0 commit comments

Comments
 (0)