fix duplicate in docs
This commit is contained in:
@@ -401,7 +401,7 @@ namespace Barotrauma
|
|||||||
lua.Globals["SERVER"] = isServer;
|
lua.Globals["SERVER"] = isServer;
|
||||||
lua.Globals["CLIENT"] = !isServer;
|
lua.Globals["CLIENT"] = !isServer;
|
||||||
|
|
||||||
// LuaDocs.GenerateDocsAll();
|
LuaDocs.GenerateDocsAll();
|
||||||
|
|
||||||
if (File.Exists("Lua/LuaSetup.lua")) // try the default loader
|
if (File.Exists("Lua/LuaSetup.lua")) // try the default loader
|
||||||
DoFile("Lua/LuaSetup.lua");
|
DoFile("Lua/LuaSetup.lua");
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ Barotrauma source code: [Client.cs](https://github.com/evilfactory/Barotrauma-lu
|
|||||||
|
|
||||||
local Client = {}
|
local Client = {}
|
||||||
|
|
||||||
|
-- @remove function SetClientCharacter(character) end
|
||||||
|
-- @remove function Kick(reason) end
|
||||||
|
-- @remove function Ban(reason, range, seconds) end
|
||||||
|
-- @remove function Client.Unban(player, endpoint) end
|
||||||
|
-- @remove function CheckPermission(permissions) end
|
||||||
|
|
||||||
--- Sets the client character.
|
--- Sets the client character.
|
||||||
-- @realm server
|
-- @realm server
|
||||||
function SetClientCharacter(character) end
|
function SetClientCharacter(character) end
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ local Character = {}
|
|||||||
|
|
||||||
-- @remove function Character.Create(characterInfo, position, seed, id, isRemotePlayer, hasAi, ragdoll) end
|
-- @remove function Character.Create(characterInfo, position, seed, id, isRemotePlayer, hasAi, ragdoll) end
|
||||||
-- @remove function TeleportTo(worldPos) end
|
-- @remove function TeleportTo(worldPos) end
|
||||||
|
-- @remove Character.CharacterList
|
||||||
-- @remove function TeleportTo(worldPos) end
|
|
||||||
|
|
||||||
--- Creates a Character using CharacterInfo.
|
--- Creates a Character using CharacterInfo.
|
||||||
-- @realm server
|
-- @realm server
|
||||||
@@ -1611,11 +1610,6 @@ function GetHashCode() end
|
|||||||
-- @realm shared
|
-- @realm shared
|
||||||
-- @Character Character.Controlled
|
-- @Character Character.Controlled
|
||||||
|
|
||||||
---
|
|
||||||
-- Character.CharacterList, Field of type table
|
|
||||||
-- @realm shared
|
|
||||||
-- @table Character.CharacterList
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Character.KnockbackCooldown, Field of type number
|
-- Character.KnockbackCooldown, Field of type number
|
||||||
-- @realm shared
|
-- @realm shared
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ Barotrauma source code: [Client.cs](https://github.com/evilfactory/Barotrauma-lu
|
|||||||
|
|
||||||
local Client = {}
|
local Client = {}
|
||||||
|
|
||||||
|
-- @remove function SetClientCharacter(character) end
|
||||||
|
-- @remove function Kick(reason) end
|
||||||
|
-- @remove function Ban(reason, range, seconds) end
|
||||||
|
-- @remove function Client.Unban(player, endpoint) end
|
||||||
|
-- @remove function CheckPermission(permissions) end
|
||||||
|
|
||||||
--- Sets the client character.
|
--- Sets the client character.
|
||||||
-- @realm server
|
-- @realm server
|
||||||
function SetClientCharacter(character) end
|
function SetClientCharacter(character) end
|
||||||
@@ -31,35 +37,6 @@ function CheckPermission(permissions) end
|
|||||||
function Client.Unban(player, endpoint) end
|
function Client.Unban(player, endpoint) end
|
||||||
|
|
||||||
|
|
||||||
--- SetClientCharacter
|
|
||||||
-- @realm shared
|
|
||||||
-- @tparam Character character
|
|
||||||
function SetClientCharacter(character) end
|
|
||||||
|
|
||||||
--- Kick
|
|
||||||
-- @realm shared
|
|
||||||
-- @tparam string reason
|
|
||||||
function Kick(reason) end
|
|
||||||
|
|
||||||
--- Ban
|
|
||||||
-- @realm shared
|
|
||||||
-- @tparam string reason
|
|
||||||
-- @tparam bool range
|
|
||||||
-- @tparam number seconds
|
|
||||||
function Ban(reason, range, seconds) end
|
|
||||||
|
|
||||||
--- Unban
|
|
||||||
-- @realm shared
|
|
||||||
-- @tparam string player
|
|
||||||
-- @tparam string endpoint
|
|
||||||
function Client.Unban(player, endpoint) end
|
|
||||||
|
|
||||||
--- CheckPermission
|
|
||||||
-- @realm shared
|
|
||||||
-- @tparam ClientPermissions permissions
|
|
||||||
-- @treturn bool
|
|
||||||
function CheckPermission(permissions) end
|
|
||||||
|
|
||||||
--- InitClientSync
|
--- InitClientSync
|
||||||
-- @realm shared
|
-- @realm shared
|
||||||
function InitClientSync() end
|
function InitClientSync() end
|
||||||
|
|||||||
@@ -47,9 +47,25 @@ end
|
|||||||
## Running pairs() on an enumerator doesn't work!
|
## Running pairs() on an enumerator doesn't work!
|
||||||
pairs() Returns an enumerator that iterates through the entire table keys, if you already have an enumerator, you can just pass it in directly.
|
pairs() Returns an enumerator that iterates through the entire table keys, if you already have an enumerator, you can just pass it in directly.
|
||||||
```lua
|
```lua
|
||||||
-- get first item ever created and loop through all the values
|
-- get first item ever created and loop through all the items stored inside it.
|
||||||
for item in Item.ItemList[1].OwnInventory.AllItems do
|
for item in Item.ItemList[1].OwnInventory.AllItems do
|
||||||
|
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## How do i spawn an item?
|
||||||
|
```lua
|
||||||
|
local prefab = ItemPrefab.GetItemPrefab("screwdriver")
|
||||||
|
local firstPlayerCharacter = Client.ClientList[1].Character
|
||||||
|
|
||||||
|
-- Spawn on the world
|
||||||
|
Entity.Spawner.AddToSpawnQueue(prefab, firstPlayerCharacter.WorldPosition, nil, nil, function(item)
|
||||||
|
print(item .. " Has been spawned.")
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Spawn inside an inventory
|
||||||
|
Entity.Spawner.AddToSpawnQueue(prefab, firstPlayerCharacter.Inventory, nil, nil, function(item)
|
||||||
|
print(item .. " Has been spawned.")
|
||||||
|
end)
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user