Little polishing of Unjustified Points module
This commit is contained in:
parent
ddec9627b8
commit
a8f2bb19db
|
@ -112,6 +112,16 @@ function onOpenPvpSituationsChange(amount)
|
||||||
openPvpSituationsLabel:setText(amount)
|
openPvpSituationsLabel:setText(amount)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function getColorByKills(kills)
|
||||||
|
if kills < 2 then
|
||||||
|
return 'red'
|
||||||
|
elseif kills < 3 then
|
||||||
|
return 'yellow'
|
||||||
|
end
|
||||||
|
|
||||||
|
return 'green'
|
||||||
|
end
|
||||||
|
|
||||||
function onUnjustifiedPointsChange(unjustifiedPoints)
|
function onUnjustifiedPointsChange(unjustifiedPoints)
|
||||||
if unjustifiedPoints.skullTime == 0 then
|
if unjustifiedPoints.skullTime == 0 then
|
||||||
skullTimeLabel:setText('No skull')
|
skullTimeLabel:setText('No skull')
|
||||||
|
@ -122,14 +132,17 @@ function onUnjustifiedPointsChange(unjustifiedPoints)
|
||||||
end
|
end
|
||||||
|
|
||||||
dayProgressBar:setValue(unjustifiedPoints.killsDay, 0, 100)
|
dayProgressBar:setValue(unjustifiedPoints.killsDay, 0, 100)
|
||||||
dayProgressBar:setTooltip(string.format('Unjustified points gained during the last 24 hours.\n%i kills left.', unjustifiedPoints.killsDayRemaining))
|
dayProgressBar:setBackgroundColor(getColorByKills(unjustifiedPoints.killsDayRemaining))
|
||||||
dayProgressBar:setText(unjustifiedPoints.killsDayRemaining .. ' kills left')
|
dayProgressBar:setTooltip(string.format('Unjustified points gained during the last 24 hours.\n%i kill%s left.', unjustifiedPoints.killsDayRemaining, (unjustifiedPoints.killsDayRemaining == 1 and '' or 's')))
|
||||||
|
dayProgressBar:setText(string.format('%i kill%s left', unjustifiedPoints.killsDayRemaining, (unjustifiedPoints.killsDayRemaining == 1 and '' or 's')))
|
||||||
|
|
||||||
weekProgressBar:setValue(unjustifiedPoints.killsWeek, 0, 100)
|
weekProgressBar:setValue(unjustifiedPoints.killsWeek, 0, 100)
|
||||||
weekProgressBar:setTooltip(string.format('Unjustified points gained during the last 7 days.\n%i kills left.', unjustifiedPoints.killsWeekRemaining))
|
weekProgressBar:setBackgroundColor(getColorByKills(unjustifiedPoints.killsWeekRemaining))
|
||||||
weekProgressBar:setText(unjustifiedPoints.killsWeekRemaining .. ' kills left')
|
weekProgressBar:setTooltip(string.format('Unjustified points gained during the last 7 days.\n%i kill%s left.', unjustifiedPoints.killsWeekRemaining, (unjustifiedPoints.killsWeekRemaining == 1 and '' or 's')))
|
||||||
|
weekProgressBar:setText(string.format('%i kill%s left', unjustifiedPoints.killsWeekRemaining, (unjustifiedPoints.killsWeekRemaining == 1 and '' or 's')))
|
||||||
|
|
||||||
monthProgressBar:setValue(unjustifiedPoints.killsMonth, 0, 100)
|
monthProgressBar:setValue(unjustifiedPoints.killsMonth, 0, 100)
|
||||||
monthProgressBar:setTooltip(string.format('Unjustified points gained during the last 30 days.\n%i kills left.', unjustifiedPoints.killsMonthRemaining))
|
monthProgressBar:setBackgroundColor(getColorByKills(unjustifiedPoints.killsMonthRemaining))
|
||||||
monthProgressBar:setText(unjustifiedPoints.killsMonthRemaining .. ' kills left')
|
monthProgressBar:setTooltip(string.format('Unjustified points gained during the last 30 days.\n%i kill%s left.', unjustifiedPoints.killsMonthRemaining, (unjustifiedPoints.killsMonthRemaining == 1 and '' or 's')))
|
||||||
|
monthProgressBar:setText(string.format('%i kill%s left', unjustifiedPoints.killsMonthRemaining, (unjustifiedPoints.killsMonthRemaining == 1 and '' or 's')))
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue