Added science info

This commit is contained in:
Cooldude2606
2019-05-28 19:39:13 +01:00
parent 3bb11941d9
commit 53ebc00631
6 changed files with 357 additions and 5 deletions

View File

@@ -171,7 +171,8 @@ function Public.format_time(ticks,options)
seconds=false,
long=false,
time=false,
string=false
string=false,
null=false
}
-- Basic numbers that are used in calculations
local max_days, max_hours, max_minutes, max_seconds = ticks/5184000, ticks/216000, ticks/3600, ticks/60
@@ -188,6 +189,13 @@ function Public.format_time(ticks,options)
if not options.minutes then
rtn_seconds = rtn_seconds + rtn_minutes*60
end
-- Creates the null time format, does not work with long
if options.null and not options.long then
rtn_days='--'
rtn_hours='--'
rtn_minutes='--'
rtn_seconds='--'
end
-- Format options
local suffix = 'time-symbol-'
local suffix_2 = '-short'
@@ -215,7 +223,7 @@ function Public.format_time(ticks,options)
rtn_minutes = {suffix..'minutes'..suffix_2,rtn_minutes}
rtn_seconds = {suffix..'seconds'..suffix_2,rtn_seconds}
end
else
elseif not options.null then
-- weather string or not it has same format
rtn_days = string.format('%02d',rtn_days)
rtn_hours = string.format('%02d',rtn_hours)

View File

@@ -154,6 +154,8 @@ end
function LeftFrames._prototype:set_open_by_default(state)
if state == false then
self.open_by_default = false
elseif state == nil then
self.open_by_default = true
else
self.open_by_default = state
end
@@ -282,7 +284,7 @@ Event.add(defines.events.on_player_created,function(event)
define.events.on_draw(player,frame)
end
if define.open_by_default == false then
if not define.open_by_default then
frame.visible = false
elseif type(define.open_by_default) == 'function' then
if not define.open_by_default(player,define.name) then