Formatting

This commit is contained in:
Federico Cecchetto 2022-03-05 18:47:49 +01:00
parent 1af7a7811d
commit 0ae8414338
3 changed files with 250 additions and 248 deletions

View File

@ -1,10 +1,13 @@
local mphud = luiglobals.require("LUI.mp_hud.MPHud") local mphud = luiglobals.require("LUI.mp_hud.MPHud")
local barheight = 16
local textheight = 13
local textoffsety = barheight / 2 - textheight / 2
function createinfobar() function createinfobar()
local infobar = LUI.UIElement.new({ local infobar = LUI.UIElement.new({
left = luiglobals.GameX.IsHardcoreMode() and 160 or 228, left = luiglobals.GameX.IsHardcoreMode() and 160 or 228,
top = luiglobals.GameX.IsHardcoreMode() and 5 or 9, top = luiglobals.GameX.IsHardcoreMode() and 5 or 9,
height = 15, height = barheight,
width = 70, width = 70,
leftAnchor = true, leftAnchor = true,
topAnchor = true topAnchor = true
@ -69,11 +72,10 @@ function infoelement(data)
}) })
local labelfont = CoD.TextSettings.FontBold110 local labelfont = CoD.TextSettings.FontBold110
local textheight = 13
local label = LUI.UIText.new({ local label = LUI.UIText.new({
left = 5, left = 5,
top = 1, top = textoffsety,
font = labelfont.Font, font = labelfont.Font,
height = textheight, height = textheight,
leftAnchor = true, leftAnchor = true,
@ -90,7 +92,7 @@ function infoelement(data)
local _, _, left = luiglobals.GetTextDimensions(data.label, labelfont.Font, textheight) local _, _, left = luiglobals.GetTextDimensions(data.label, labelfont.Font, textheight)
local value = LUI.UIText.new({ local value = LUI.UIText.new({
left = left + 5, left = left + 5,
top = 1, top = textoffsety,
height = textheight, height = textheight,
leftAnchor = true, leftAnchor = true,
topAnchor = true, topAnchor = true,