Eddit To ExpGamingCore.Gui and Added ExpGamingPlayer.Polls

This commit is contained in:
Cooldude2606
2018-10-09 18:49:40 +01:00
parent 8dffc99642
commit 6df973eb5c
42 changed files with 205 additions and 163 deletions

View File

@@ -1,21 +1,21 @@
--- A full ranking system for factorio.
-- @module ExpGamingPlayer.playerInfo
-- @module ExpGamingPlayer.afkKick@4.0.0
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
local Game = require('FactorioStdLib.Game')
local Gui = require('ExpGamingCore.Gui')
local Role -- hanndled on load
local Sync -- hanndled on load
local Game = require('FactorioStdLib.Game@^0.8.0')
local Gui = require('ExpGamingCore.Gui@^4.0.0')
local Role -- ExpGamingCore.Role@^4.0.0
local Sync -- ExpGamingCore.Sync@^4.0.0
function get_allowed_afk_time(player)
local function get_allowed_afk_time(player)
local role
if Role then role = Role.get_highest(player)
else if player.admin then return else rank = Role.meta.default end end
else if player.admin then return else role = Role.meta.default end end
local count = #game.connected_players
local base = role.index or false
if not base then return false end
return (10/base)*count
return (Role.meta.count/base)*count
end
script.on_event(defines.events.on_tick,function(event)
@@ -28,11 +28,11 @@ script.on_event(defines.events.on_tick,function(event)
end
end)
return {
return setmetatable({
get_allowed_afk_time=get_allowed_afk_time,
on_init=function(self)
if loaded_modules['ExpGamingCore.Role'] then Role = require('ExpGamingCore.Role') end
if loaded_modules['ExpGamingCore.Sync'] then Sync = require('ExpGamingCore.Sync') end
if loaded_modules['ExpGamingCore.Server'] then require(module_path..'/src/server',Sync) end
if loaded_modules['ExpGamingCore.Role@^4.0.0'] then Role = require('ExpGamingCore.Role@^4.0.0') end
if loaded_modules['ExpGamingCore.Sync@^4.0.0'] then Sync = require('ExpGamingCore.Sync@^4.0.0') end
if loaded_modules['ExpGamingCore.Server@^4.0.0'] then require(module_path..'/src/server',Sync,self) end
end
}
},{__call=function(self,...) self.get_allowed_afk_time(...) end})