572
edits
No edit summary |
No edit summary |
||
Line 926: | Line 926: | ||
function p.GetWorshipTable() | function p.GetWorshipTable() | ||
local function GetCheckpointCell(checkpoint) | local function GetCheckpointCell(checkpoint) | ||
return '\r\n|-\r\n! | return '\r\n|-\r\n!'..Icons.Icon({'Worship', type='township', notext=true})..'<br>'..checkpoint..'%<br>'..(checkpoint*Township.maxWorship/100)..'/'..Township.maxWorship | ||
end | end | ||
Line 959: | Line 959: | ||
-- Total sum | -- Total sum | ||
table.insert(ret, '\r\n|-\r\n!Total') | table.insert(ret, '\r\n|-\r\n!Total') | ||
for _, worship in ipairs(Township.worships) do | |||
if worship.isHidden == false then | |||
local modifiers = Shared.clone(worship.modifiers) | |||
for _, checkpoint in ipairs(worship.checkpoints) do | |||
for modifier, magnitude in pairs(checkpoint) do | |||
if modifiers[modifier] == nil then | |||
modifiers[modifier] = magnitude | |||
else | |||
modifiers[modifier] = modifiers[modifier] + magnitude | |||
end | end | ||
end | end |
edits