572
edits
No edit summary |
(Tavern/Gardens production fix) |
||
Line 426: | Line 426: | ||
-- Sourced from township.js -> Township.computeTownResourceGain() | -- Sourced from township.js -> Township.computeTownResourceGain() | ||
local production = resource.quantity*100*(Township.tickLength/10) | local production = resource.quantity*100*(Township.tickLength/10) | ||
local color = production < 0 and 'red' or 'green' | |||
local resource_data = p._GetResourceByID(resource.id) | local resource_data = p._GetResourceByID(resource.id) | ||
table.insert(retProduction, '<span style="color: | table.insert(retProduction, '<span style="color:'..color..'">'..Icons.Icon({resource_data.name, type='resource', notext=true})..' '..Shared.numStrWithSign(production)..'</span>') | ||
if resource_data.requires ~= nil and #resource_data.requires > 0 then | if resource_data.requires ~= nil and #resource_data.requires > 0 then | ||
for _, required_resource in ipairs(resource_data.requires) do | for _, required_resource in ipairs(resource_data.requires) do |
edits