You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.0 KiB
Lua

-- Delete HUD and redo if already existent. This will reset the displayed values until the next update from the server
if D3stats.D3statsOverlay then
D3stats.D3statsOverlay:Remove()
D3stats.Overlay_Init()
8 years ago
end
-- HUD on the left top of the screen
function D3stats.Overlay_Init()
D3stats.D3statsOverlay = vgui.Create("D3statsOverlay")
D3stats.D3statsOverlay:SetPos(D3stats.Overlay_X, D3stats.Overlay_Y)
D3stats.D3statsOverlay:SetSize(350, 100)
8 years ago
end
-- Call this function from cl_targetid.lua in the gamemode. Works for ZS, needs adjustments for other gamemodes.
8 years ago
local colTemp = Color(255, 255, 255)
function D3stats.DrawTargetID(ent, fade, x, y)
8 years ago
colTemp.a = fade * 255
--util.ColorCopy(COLOR_FRIENDLY, colTemp)
local Level = ent:GetNWInt("D3stats_Level", 0)
if Level > 0 and D3stats.Levels[Level] then
draw.SimpleTextBlur("Level " .. tostring(Level) .. " \"" .. D3stats.Levels[Level].Name .. "\"", D3stats.Font_TargetID, x, y, colTemp, TEXT_ALIGN_CENTER)
y = y + draw.GetFontHeight(D3stats.Font_TargetID) + 4
8 years ago
end
return x, y
end