mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Production GUI 1dp (#333)
* Update production.lua * Update production.lua * Removed repetitive call to string format --------- Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
This commit is contained in:
@@ -23,7 +23,7 @@ local font_color = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local function format_n(n)
|
local function format_n(n)
|
||||||
local _i, _j, m, i, f = tostring(n):find('([-]?)(%d+)([.]?%d*)')
|
local _i, _j, m, i, f = string.format('%.1f', n):find('([-]?)(%d+)([.]?%d*)')
|
||||||
i = i:reverse():gsub('(%d%d%d)', '%1,')
|
i = i:reverse():gsub('(%d%d%d)', '%1,')
|
||||||
|
|
||||||
if f ~= '' then
|
if f ~= '' then
|
||||||
@@ -139,8 +139,8 @@ Event.on_nth_tick(60, function()
|
|||||||
local item = table[production_prefix .. '_e'].elem_value
|
local item = table[production_prefix .. '_e'].elem_value
|
||||||
|
|
||||||
if item then
|
if item then
|
||||||
local add = math.floor(stat.get_flow_count{name=item, input=true, precision_index=precision_value, count=false} / 6) / 10
|
local add = stat.get_flow_count{name=item, input=true, precision_index=precision_value, count=false} / 60
|
||||||
local minus = math.floor(stat.get_flow_count{name=item, input=false, precision_index=precision_value, count=false} / 6) / 10
|
local minus = stat.get_flow_count{name=item, input=false, precision_index=precision_value, count=false} / 60
|
||||||
local sum = add - minus
|
local sum = add - minus
|
||||||
|
|
||||||
table[production_prefix .. '_1'].caption = format_n(add)
|
table[production_prefix .. '_1'].caption = format_n(add)
|
||||||
|
|||||||
Reference in New Issue
Block a user