Change to sync docs

This commit is contained in:
Cooldude2606
2018-05-31 00:45:42 +01:00
parent 2dd50c8d9c
commit 153c6af18f
29 changed files with 1007 additions and 1769 deletions

View File

@@ -1,13 +1,9 @@
--[[
Explosive Gaming
--- Description - A small description that will be displayed on the doc
-- @module ExpGamingCore.Sync
-- @alias Sync
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
This file can be used with permission but this and the credit below must remain in the file.
Contact a member of management on our discord to seek permission to use our code.
Any changes that you may make to the code are yours but that does not make the script yours.
Discord: https://discord.gg/r6dC2uK
]]
--Please Only Edit Below This Line-----------------------------------------------------------
-- this file is used to allow easy syncing with out side programes
local Sync = {}
local Sync_updates = {}
@@ -45,16 +41,19 @@ function Sync.print(player_message,player_name,player_tag,player_colour,prefix)
game.print(prefix..player_name..tag..': '..player_message,colour)
end
--- Logs an embed to the json.data we use a js script to add things we cant here
-- @usage Sync.emit_embeded{title='BAN',color='0x0',description='A player was banned' ... }
-- @tparam table args a table which contains everything that the embeded will use
-- @table args
--- Outline of the paramaters accepted by Sync.emit_embeded
-- @table EmitEmbededParamaters
-- @field title the tile of the embed
-- @field color the color given in hex you can use Color.to_hex{r=0,g=0,b=0}
-- @field description the description of the embed
-- @field server_detail sting to add onto the pre-set server detail
-- @field fieldone the filed to add to the embed (key is name) (value is text) (start value with <<inline>> to make inline)
-- @field fieldtwo the filed to add to the embed (key is name) (value is text) (start value with <<inline>> to make inline)
-- @field fieldone the filed to add to the embed (key is name) (value is text) (start value with &lt;&lt;inline&gt;&gt; to make inline)
-- @field fieldtwo the filed to add to the embed (key is name) (value is text) (start value with &lt;&lt;inline&gt;&gt; to make inline)
--- Logs an embed to the json.data we use a js script to add things we cant here
-- @usage Sync.emit_embeded{title='BAN',color='0x0',description='A player was banned' ... }
-- @tparam table args a table which contains everything that the embeded will use
-- @see EmitEmbededParamaters
function Sync.emit_embeded(args)
if not is_type(args,'table') then error('Args table not given to Sync.emit_embeded',2) end
local title = is_type(args.title,'string') and args.title or ''
@@ -90,6 +89,7 @@ function Sync.emit_embeded(args)
end
--- The error handle setup by sync to emit a discord embed for any errors
-- @local here
-- @function errorHandler
-- @tparam string err the error passed by the err control
error.addHandler('Discord Emit',function(err)
@@ -241,7 +241,7 @@ function Sync.add_update(key,callback)
Sync_updates[key] = callback
end
--- outputs the curent server info into a file
--- Outputs the curent server info into a file
-- @usage Sync.emit_data()
function Sync.emit_data()
local info = Sync.info

View File

@@ -4,7 +4,9 @@
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- this file will be loaded when ExpGamingCore/Gui is present
--- This file will be loaded when ExpGamingCore/Gui is present
-- @function _comment
local Sync_gui_functions = {}
@@ -35,6 +37,7 @@ local function label_format(label,width)
end
--- Creates a center gui that will appear on join
-- @table server-info
-- @local call to Gui.Center
Gui.center.add{
name='server-info',

View File

@@ -4,11 +4,11 @@
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- this file will be loaded when ExpGamingCore/Ranking is present
--- This file will be loaded when ExpGamingCore/Ranking is present
-- @function _comment
--- Used as a redirect to Ranking._base_preset that will set the rank given to a player apon joining
-- @usage Sync.set_ranks{player_name=rank_name,...}
-- @see Ranking._base_preset
function Sync.set_ranks(...)
Ranking._base_preset(...)
end
@@ -30,8 +30,7 @@ function Sync.count_ranks()
return _ranks
end
--- Adds a caption to the info gui that shows the rank given to the player
-- @local callback for Sync.add_to_gui
-- Adds a caption to the info gui that shows the rank given to the player
if Sync.add_to_gui then
Sync.add_to_gui(function(player,frame)
return 'You have been assigned the rank \''..Ranking.get_rank(player).name..'\''

View File

@@ -1,6 +1,8 @@
-- not_luadoc=true
--- Redirect to factorio mod-gui
-- @module Factorio Mod Gui
-- @alias mod-gui
-- @alias mod_gui
-- @author Factorio Dev Team
-- redirect to normal require of mod gui
return require("mod-gui")

View File

@@ -1,3 +1,4 @@
-- not_luadoc=true
--- Used to index the files to be loaded
-- @script index.lua
return {