Add FoCAPI docus
This commit is contained in:
39
.luadefs/focapi-functions-emmyluadoc.lua
Normal file
39
.luadefs/focapi-functions-emmyluadoc.lua
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
---@diagnostic disable
|
||||||
|
|
||||||
|
-- ==================================================
|
||||||
|
-- I/O
|
||||||
|
-- ==================================================
|
||||||
|
|
||||||
|
---@public
|
||||||
|
---Appends the text to file.
|
||||||
|
---@param file string The file name.
|
||||||
|
---@param text string The text to append.
|
||||||
|
function WriteToFile(file, text) end
|
||||||
|
|
||||||
|
-- ==================================================
|
||||||
|
-- Finders
|
||||||
|
-- ==================================================
|
||||||
|
|
||||||
|
---Finds all Players in the game.
|
||||||
|
---@return PlayerObject[]
|
||||||
|
function Get_All_Players() end
|
||||||
|
|
||||||
|
-- ==================================================
|
||||||
|
-- UI
|
||||||
|
-- ==================================================
|
||||||
|
|
||||||
|
---@public
|
||||||
|
---Adds the specified text to the tutorial text box.
|
||||||
|
---@param key string The key to use.
|
||||||
|
---@param text string The text to add.
|
||||||
|
---@param duration number The duration to keep text on screen, defaults to -1 (infinite).
|
||||||
|
---@param r number The red color component.
|
||||||
|
---@param g number The green color component.
|
||||||
|
---@param b number The blue color component.
|
||||||
|
---@param a number The alpha channel component.
|
||||||
|
function Add_Tutorial_Text(key, text, duration, r, g, b, a) end
|
||||||
|
|
||||||
|
---@public
|
||||||
|
---Removes the specified text key from the tutorial text box.
|
||||||
|
---@param key string The key to remove.
|
||||||
|
function Remove_Tutorial_Text(key) end
|
||||||
@@ -4,6 +4,7 @@ require("PGBase")
|
|||||||
---@field R number The red component.
|
---@field R number The red component.
|
||||||
---@field G number The green component.
|
---@field G number The green component.
|
||||||
---@field B number The blue component.
|
---@field B number The blue component.
|
||||||
|
---@field A number The alpha component.
|
||||||
ColorStruct = {}
|
ColorStruct = {}
|
||||||
ColorStruct.__index = ColorStruct
|
ColorStruct.__index = ColorStruct
|
||||||
|
|
||||||
@@ -11,17 +12,19 @@ ColorStruct.__index = ColorStruct
|
|||||||
---@param r number The red component
|
---@param r number The red component
|
||||||
---@param g number The green component
|
---@param g number The green component
|
||||||
---@param b number The blue component
|
---@param b number The blue component
|
||||||
|
---@param a number The alpha component
|
||||||
---@return ColorStruct
|
---@return ColorStruct
|
||||||
function ColorStruct:New(r, g, b)
|
function ColorStruct:New(r, g, b, a)
|
||||||
local self = setmetatable({}, ColorStruct)
|
local self = setmetatable({}, ColorStruct)
|
||||||
|
|
||||||
self.R = Clamp(r, 0, 1)
|
self.R = Clamp(r, 0, 1)
|
||||||
self.G = Clamp(g, 0, 1)
|
self.G = Clamp(g, 0, 1)
|
||||||
self.B = Clamp(b, 0, 1)
|
self.B = Clamp(b, 0, 1)
|
||||||
|
self.A = Clamp(a, 0, 1)
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function ColorStruct:Debug()
|
function ColorStruct:Debug()
|
||||||
return string.format("RGB (%d, %d, %d)", self.R, self.G, self.B)
|
return string.format("RGB (%d, %d, %d, %d)", self.R, self.G, self.B, self.A)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ function DefineFactions()
|
|||||||
local RebelFaction = FactionStruct:New("REBEL")
|
local RebelFaction = FactionStruct:New("REBEL")
|
||||||
|
|
||||||
RebelFaction.DisplayName = "Rebellion"
|
RebelFaction.DisplayName = "Rebellion"
|
||||||
RebelFaction.Color = ColorStruct:New(1, 0, 0)
|
RebelFaction.Color = ColorStruct:New(1, 0, 0, 1)
|
||||||
RebelFaction.Icon = "I_ICON_SPECTATOR_REBEL.TGA"
|
RebelFaction.Icon = "I_ICON_SPECTATOR_REBEL.TGA"
|
||||||
RebelFaction.LandStartUnitName = "Rebel_Infantry_Squad"
|
RebelFaction.LandStartUnitName = "Rebel_Infantry_Squad"
|
||||||
RebelFaction.SpaceStartUnitName = "Rebel_X-Wing_Squadron"
|
RebelFaction.SpaceStartUnitName = "Rebel_X-Wing_Squadron"
|
||||||
@@ -26,7 +26,7 @@ function DefineFactions()
|
|||||||
local EmpireFaction = FactionStruct:New("EMPIRE")
|
local EmpireFaction = FactionStruct:New("EMPIRE")
|
||||||
|
|
||||||
EmpireFaction.DisplayName = "Empire"
|
EmpireFaction.DisplayName = "Empire"
|
||||||
EmpireFaction.Color = ColorStruct:New(0, 1, 1)
|
EmpireFaction.Color = ColorStruct:New(0, 1, 1, 1)
|
||||||
EmpireFaction.Icon = "I_ICON_SPECTATOR_EMPIRE.TGA"
|
EmpireFaction.Icon = "I_ICON_SPECTATOR_EMPIRE.TGA"
|
||||||
EmpireFaction.LandStartUnitName = "Imperial_Stormtrooper_Squad"
|
EmpireFaction.LandStartUnitName = "Imperial_Stormtrooper_Squad"
|
||||||
EmpireFaction.SpaceStartUnitName = "TIE_Interceptor_Squadron_Container"
|
EmpireFaction.SpaceStartUnitName = "TIE_Interceptor_Squadron_Container"
|
||||||
@@ -37,7 +37,7 @@ function DefineFactions()
|
|||||||
local UnderworldFaction = FactionStruct:New("UNDERWORLD")
|
local UnderworldFaction = FactionStruct:New("UNDERWORLD")
|
||||||
|
|
||||||
UnderworldFaction.DisplayName = "Zann Consortium"
|
UnderworldFaction.DisplayName = "Zann Consortium"
|
||||||
UnderworldFaction.Color = ColorStruct:New(1, 1, 0)
|
UnderworldFaction.Color = ColorStruct:New(1, 1, 0, 1)
|
||||||
UnderworldFaction.Icon = "I_ICON_SPECTATOR_UNDERWORLD.TGA"
|
UnderworldFaction.Icon = "I_ICON_SPECTATOR_UNDERWORLD.TGA"
|
||||||
UnderworldFaction.LandStartUnitName = "Underworld_Merc_Squad"
|
UnderworldFaction.LandStartUnitName = "Underworld_Merc_Squad"
|
||||||
UnderworldFaction.SpaceStartUnitName = "StarViper_Team"
|
UnderworldFaction.SpaceStartUnitName = "StarViper_Team"
|
||||||
@@ -47,7 +47,7 @@ function DefineFactions()
|
|||||||
local HuttFaction = FactionStruct:New("HUTTS")
|
local HuttFaction = FactionStruct:New("HUTTS")
|
||||||
|
|
||||||
HuttFaction.DisplayName = "Hutt Cartel"
|
HuttFaction.DisplayName = "Hutt Cartel"
|
||||||
HuttFaction.Color = ColorStruct:New(1, 0, 1)
|
HuttFaction.Color = ColorStruct:New(1, 0, 1, 1)
|
||||||
HuttFaction.Icon = "I_ICON_SPECTATOR_HUTTS.TGA"
|
HuttFaction.Icon = "I_ICON_SPECTATOR_HUTTS.TGA"
|
||||||
HuttFaction.LandStartUnitName = "Hutt_Soldier_Squad"
|
HuttFaction.LandStartUnitName = "Hutt_Soldier_Squad"
|
||||||
HuttFaction.SpaceStartUnitName = "V_Wing_Squadron_Container"
|
HuttFaction.SpaceStartUnitName = "V_Wing_Squadron_Container"
|
||||||
@@ -57,7 +57,7 @@ function DefineFactions()
|
|||||||
local PirateFaction = FactionStruct:New("PIRATES")
|
local PirateFaction = FactionStruct:New("PIRATES")
|
||||||
|
|
||||||
PirateFaction.DisplayName = "Pirates"
|
PirateFaction.DisplayName = "Pirates"
|
||||||
PirateFaction.Color = ColorStruct:New(0, 1, 0)
|
PirateFaction.Color = ColorStruct:New(0, 1, 0, 1)
|
||||||
PirateFaction.Icon = "I_ICON_SPECTATOR_PIRATES.TGA"
|
PirateFaction.Icon = "I_ICON_SPECTATOR_PIRATES.TGA"
|
||||||
PirateFaction.LandStartUnitName = "Pirate_Soldier_Squad"
|
PirateFaction.LandStartUnitName = "Pirate_Soldier_Squad"
|
||||||
PirateFaction.SpaceStartUnitName = "Pirate_Fighter_Squadron"
|
PirateFaction.SpaceStartUnitName = "Pirate_Fighter_Squadron"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ function FactionStruct:New(name)
|
|||||||
|
|
||||||
self.Name = name
|
self.Name = name
|
||||||
self.DisplayName = name
|
self.DisplayName = name
|
||||||
self.Color = ColorStruct:New(1, 1, 1)
|
self.Color = ColorStruct:New(1, 1, 1, 1)
|
||||||
self.Icon = ""
|
self.Icon = ""
|
||||||
self.LandStartUnitName = ""
|
self.LandStartUnitName = ""
|
||||||
self.SpaceStartUnitName = ""
|
self.SpaceStartUnitName = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user