feat(inferium-gui): add basic titleFn
This commit is contained in:
parent
69b31f24a9
commit
8d4768813b
@ -1,7 +1,20 @@
|
|||||||
local CountersSelector = require('libs/ui/CountersSelector')
|
local CountersSelector = require('libs/ui/CountersSelector')
|
||||||
|
|
||||||
|
local counterMax = 8
|
||||||
|
|
||||||
local config = {
|
local config = {
|
||||||
counterMax = 8
|
counterMax = counterMax,
|
||||||
|
titleFn = function(countersMap)
|
||||||
|
local total = 0;
|
||||||
|
|
||||||
|
for _, counterPayload in pairs(countersMap) do
|
||||||
|
if counterPayload and counterPayload.count then
|
||||||
|
total = total + counterPayload.count
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return "| " .. total .. '/' .. counterMax .. ' used farmlands' .. " |"
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
local countersMap = {
|
local countersMap = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user