mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 12:16:37 +09:00
Ldoc compliant
This commit is contained in:
@@ -63,7 +63,7 @@ Event.on_nth_tick(config.message_cycle, circle_messages)
|
||||
|
||||
--- This will add a compilatron to the global and start his message cycle
|
||||
-- @tparam entity LuaEntity the compilatron entity that moves around
|
||||
-- @tparam name string the name of the location that the complitron is at
|
||||
-- @tparam string name the name of the location that the complitron is at
|
||||
function Public.add_compilatron(entity, name)
|
||||
if not entity and not entity.valid then
|
||||
return
|
||||
@@ -80,8 +80,8 @@ function Public.add_compilatron(entity, name)
|
||||
end
|
||||
|
||||
--- This spawns a new compilatron on a surface with the given location tag (not a position)
|
||||
-- @tparam surface LuaSurface the surface to spawn the compilatron on
|
||||
-- @tparam location string the location tag that is in the config file
|
||||
-- @tparam LuaSurface surface the surface to spawn the compilatron on
|
||||
-- @tparam string location the location tag that is in the config file
|
||||
function Public.spawn_compilatron(surface,location)
|
||||
local position = locations[location]
|
||||
local pos = surface.find_non_colliding_position('compilatron', position, 1.5, 0.5)
|
||||
|
||||
@@ -31,8 +31,8 @@ local function event_emit(event,player,by_player_name,reason)
|
||||
end
|
||||
|
||||
--- Jails a player, this is only the logic there is no output to players
|
||||
-- @tparam player LuaPlayer the player that will be jailed, must not be in jail
|
||||
-- @tparam[opt='<server>'] by_player_name string the name of the player doing the action used in logs
|
||||
-- @tparam LuaPlayer player the player that will be jailed, must not be in jail
|
||||
-- @tparam[opt='<server>'] string by_player_name the name of the player doing the action used in logs
|
||||
-- @treturn the number of roles that were removed, nil if there was an error
|
||||
function Public.jail_player(player,by_player_name)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -47,8 +47,8 @@ function Public.jail_player(player,by_player_name)
|
||||
end
|
||||
|
||||
--- Unjails a player, this is only the logic there is no output to players
|
||||
-- @tparam player LuaPlayer the player that will be unjailed, must be in jail
|
||||
-- @tparam[opt='<server>'] by_player_name string string the name of the player who is doing the action
|
||||
-- @tparam LuaPlayer player the player that will be unjailed, must be in jail
|
||||
-- @tparam[opt='<server>'] string string by_player_name the name of the player who is doing the action
|
||||
-- @treturn the number of roles that were added, nil if there was an error
|
||||
function Public.unjail_player(player,by_player_name)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -62,9 +62,9 @@ function Public.unjail_player(player,by_player_name)
|
||||
end
|
||||
|
||||
--- Temp bans a player which is similar to jail but will store the reason for the action and clears items
|
||||
-- @tparam player LuaPlayer the player that will be temp baned, must not be temp banned
|
||||
-- @tparam[opt='<server>'] by_player_name string the name of the player that is doing the action
|
||||
-- @tparam[opt='None Given.'] reason string the reason that will be stored for this temp ban
|
||||
-- @tparam LuaPlayer player the player that will be temp baned, must not be temp banned
|
||||
-- @tparam[opt='<server>'] string by_player_name the name of the player that is doing the action
|
||||
-- @tparam[opt='None string Given.'] reason the reason that will be stored for this temp ban
|
||||
-- @treturn boolean true if successful else will return nil
|
||||
function Public.temp_ban_player(player,by_player_name,reason)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -81,8 +81,8 @@ function Public.temp_ban_player(player,by_player_name,reason)
|
||||
end
|
||||
|
||||
--- Removes temp ban from a player, note this does not restore the items
|
||||
-- @tparam player LuaPlayer the player that will be cleared from temp baned, must be temp banned
|
||||
-- @tparam[opt='<server>'] by_player_name string the name of the player that is doing the action
|
||||
-- @tparam LuaPlayer player the player that will be cleared from temp baned, must be temp banned
|
||||
-- @tparam[opt='<server>'] string by_player_name the name of the player that is doing the action
|
||||
-- @treturn boolean true if successful else will return nil
|
||||
function Public.clear_temp_ban_player(player,by_player_name)
|
||||
player = Game.get_player_from_any(player)
|
||||
|
||||
@@ -24,9 +24,9 @@ local function event_emit(event,player,by_player_name)
|
||||
end
|
||||
|
||||
--- Adds a report to a player, reports are stored in global table and can be accessed later
|
||||
-- @tparam player LuaPlayer the player that will be reported
|
||||
-- @tparam[opt='Non Given.'] reason string the reason that the player is being reported
|
||||
-- @tparam[opt='<server>'] by_player_name string the name of the player doing the action
|
||||
-- @tparam LuaPlayer player the player that will be reported
|
||||
-- @tparam[opt='Non string Given.'] reason the reason that the player is being reported
|
||||
-- @tparam[opt='<server>'] string by_player_name the name of the player doing the action
|
||||
-- @treturn boolean true if the report was added, nil if there is an error
|
||||
function Public.report_player(player,reason,by_player_name)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -46,8 +46,8 @@ function Public.report_player(player,reason,by_player_name)
|
||||
end
|
||||
|
||||
--- Removes a report from a player by the given player, see clear_player_reports to remove all
|
||||
-- @tparam player LuaPlayer the player that will have the report removed
|
||||
-- @tparam[opt='<server>'] by_player_name string the name of the player doing the action
|
||||
-- @tparam LuaPlayer player the player that will have the report removed
|
||||
-- @tparam[opt='<server>'] string by_player_name the name of the player doing the action
|
||||
-- @treturn boolean true if the report was removed, nil if there was an error
|
||||
function Public.remove_player_report(player,by_player_name)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -66,7 +66,7 @@ function Public.remove_player_report(player,by_player_name)
|
||||
end
|
||||
|
||||
--- Clears all reports from a player, will emit an event for each individual report as if remove_player_report was used
|
||||
-- @tparam player LuaPlayer the player to clear the reports of
|
||||
-- @tparam LuaPlayer player the player to clear the reports of
|
||||
-- @treturn boolean true if the reports were cleared, nil if error
|
||||
function Public.clear_player_reports(player)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -83,9 +83,9 @@ function Public.clear_player_reports(player)
|
||||
end
|
||||
|
||||
--- Test for if a player has been reported by another player, can also return the reason from that player
|
||||
-- @tparam player LuaPlayer the player to check the reports of
|
||||
-- @tparam by_player_name string the player that made if the report if present (note server is not default here)
|
||||
-- @tparam[opt=false] rtn_reason boolean true will return the reason for the report rather than a boolean
|
||||
-- @tparam LuaPlayer player the player to check the reports of
|
||||
-- @tparam string by_player_name the player that made if the report if present (note server is not default here)
|
||||
-- @tparam[opt=false] boolean rtn_reason true will return the reason for the report rather than a boolean
|
||||
-- @treturn boolean true if a report from the player is present unless rtn_reason is true when a string is returned (or false)
|
||||
function Public.player_is_reported_by(player,by_player_name,rtn_reason)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -98,7 +98,7 @@ function Public.player_is_reported_by(player,by_player_name,rtn_reason)
|
||||
end
|
||||
|
||||
--- Gets all the reports that are on a player
|
||||
-- @tparam player LuaPlayer the player to get the reports of
|
||||
-- @tparam LuaPlayer player the player to get the reports of
|
||||
-- @treturn table a table of all the reports for this player, empty table if no reports
|
||||
function Public.get_player_reports(player)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -107,8 +107,8 @@ function Public.get_player_reports(player)
|
||||
end
|
||||
|
||||
--- Counts all reports on a player returning a number, a custom count function can be given which should return a number
|
||||
-- @tparam player LuaPlayer the player to count the reports of
|
||||
-- @tparam[opt] count_callback function should return a number or true (for 1) this will be passed every report on the player
|
||||
-- @tparam LuaPlayer player the player to count the reports of
|
||||
-- @tparam[opt] number function count_callback should return a or true (for 1) this will be passed every report on the player
|
||||
-- count_callback param - player_name string - the name of the player who made the report
|
||||
-- count_callback param - reason string - the reason the reason was made
|
||||
-- count_callback return - number or boolean - if number then this will be added to the count, if boolean then false = 0 and true = 1
|
||||
|
||||
@@ -36,9 +36,9 @@ local function event_emit(event,player,by_player_name)
|
||||
end
|
||||
|
||||
--- Adds X number (default 1) of warnings to a player from the given player
|
||||
-- @tparam player LuaPlayer the player to add the warning to
|
||||
-- @tparam[opt='<server>'] by_player_name string the name of the player doing the action
|
||||
-- @tparam[opt=1] count number the number of warnings to add
|
||||
-- @tparam LuaPlayer player the player to add the warning to
|
||||
-- @tparam[opt='<server>'] string by_player_name the name of the player doing the action
|
||||
-- @tparam[opt=1] number count the number of warnings to add
|
||||
-- @treturn number the new number of warnings
|
||||
function Public.add_warnings(player,by_player_name,count)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -58,9 +58,9 @@ function Public.add_warnings(player,by_player_name,count)
|
||||
end
|
||||
|
||||
--- Removes X number (default 1) of warnings from a player, removes in order fifo
|
||||
-- @tparam player LuaPlayer the player to remove the warnings from
|
||||
-- @tparam[opt='<server>'] by_playey_name string the name of the player doing the action
|
||||
-- @tparam[opt=1] count number the number of warnings to remove (if greater than current warning count then all are removed)
|
||||
-- @tparam LuaPlayer player the player to remove the warnings from
|
||||
-- @tparam[opt='<server>'] string by_playey_name the name of the player doing the action
|
||||
-- @tparam[opt=1] number count the number of warnings to remove (if greater than current warning count then all are removed)
|
||||
-- @treturn number the new number of warnings
|
||||
function Public.remove_warnings(player,by_player_name,count)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -82,8 +82,8 @@ function Public.remove_warnings(player,by_player_name,count)
|
||||
end
|
||||
|
||||
--- Clears all warnings from a player, emits event multiple times as if remove_warnings was used
|
||||
-- @tparam player LuaPlayer the player to clear the warnings of
|
||||
-- @tparam[oot='<server>'] by_player_name string the name of the player who is doing the action
|
||||
-- @tparam LuaPlayer player the player to clear the warnings of
|
||||
-- @tparam[oot='<server>'] string by_player_name the name of the player who is doing the action
|
||||
-- @treturn boolean true if the warnings were cleared, nil if error
|
||||
function Public.clear_warnings(player,by_player_name)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -99,8 +99,8 @@ function Public.clear_warnings(player,by_player_name)
|
||||
end
|
||||
|
||||
--- Gets the number of warnings that a player has, raw table will contain the names of who gave warnings
|
||||
-- @tparam player LuaPlayer the player to get the warnings of
|
||||
-- @tparam[opt=false] raw_table when true will return a table which contains who gave warnings (the table stored in global)
|
||||
-- @tparam LuaPlayer player the player to get the warnings of
|
||||
-- @tparam[opt=false] table table raw_table when true will return a which contains who gave warnings (the stored in global)
|
||||
-- @treturn number the number of warnings a player has, a table if raw_table is true
|
||||
function Public.get_warnings(player,raw_table)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -114,8 +114,8 @@ function Public.get_warnings(player,raw_table)
|
||||
end
|
||||
|
||||
--- Adds a temp warning to a player that will timeout after some time, used for script given warnings (ie silent to outside players as a buffer)
|
||||
-- @tparam player LuaPlayer the player to give the warnings to
|
||||
-- @tparam[opt=1] count number the number of warnings to give to the player
|
||||
-- @tparam LuaPlayer player the player to give the warnings to
|
||||
-- @tparam[opt=1] number count the number of warnings to give to the player
|
||||
-- @treturn number the new number of warnings
|
||||
function Public.add_temp_warnings(player,count)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -153,8 +153,8 @@ Event.on_nth_tick(temp_warning_cool_down/4,function()
|
||||
end)
|
||||
|
||||
--- Clears all temp warnings from a player, emits events as if the warnings had been removed due to time
|
||||
-- @tparam player LuaPlayer the player to clear the warnings of
|
||||
-- @tparam[opt='<server>'] by_player_name string the name of the player doing the action
|
||||
-- @tparam LuaPlayer player the player to clear the warnings of
|
||||
-- @tparam[opt='<server>'] string by_player_name the name of the player doing the action
|
||||
-- @treturn boolean true if the warnings were cleared, nil for error
|
||||
function Public.clear_temp_warnings(player,by_player_name)
|
||||
player = Game.get_player_from_any(player)
|
||||
@@ -170,8 +170,8 @@ function Public.clear_temp_warnings(player,by_player_name)
|
||||
end
|
||||
|
||||
--- Gets the number of temp warnings, raw table is a table of when temp warnings were given
|
||||
-- @tparam player LuaPlayer the player to get the warnings of
|
||||
-- @tparam[opt=false] raw_table if true will return a table of ticks when warnings were added (the global table)
|
||||
-- @tparam LuaPlayer player the player to get the warnings of
|
||||
-- @tparam[opt=false] table raw_table if true will return a of ticks when warnings were added (the global table)
|
||||
-- @treturn number the number of warnings which the player has, a table if raw_table is true
|
||||
function Public.get_temp_warnings(player,raw_table)
|
||||
player = Game.get_player_from_any(player)
|
||||
|
||||
@@ -33,8 +33,8 @@ end)
|
||||
|
||||
--- Adds a callback function when the interface command is used
|
||||
-- nb: returned value is saved in the env that the interface uses
|
||||
-- @tparam name string the name that the value is loaded under, cant use upvalues
|
||||
-- @tparam callback function the function that will run whent he command is used
|
||||
-- @tparam string name the name that the value is loaded under, cant use upvalues
|
||||
-- @tparam function callback the function that will run whent he command is used
|
||||
-- callback param - player: LuaPlayer - the player who used the command
|
||||
local function add_interface_callback(name,callback)
|
||||
if type(callback) == 'function' then
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
--non-luadoc=true
|
||||
local Gui = require 'utils.gui'
|
||||
local Model = require 'modules.gui.debug.model'
|
||||
local Color = require 'resources.color_presets'
|
||||
|
||||
Reference in New Issue
Block a user