update docs

This commit is contained in:
Evil Factory
2022-03-05 23:12:56 -03:00
parent 422edc7fa4
commit a2dc2c5ed0
19 changed files with 752 additions and 73 deletions
+14 -3
View File
@@ -18,7 +18,7 @@ local Hook = {}
-- Hook.Add("characterDeath", "characterDeathExample", function(character) -- Hook.Add("characterDeath", "characterDeathExample", function(character)
-- print(character) -- print(character)
-- end) -- end)
function Hook.Add(eventname, hookname, func) end function Hook.Add(eventName, hookName, func) end
--- Removes a hook. --- Removes a hook.
-- @tparam string eventname event name -- @tparam string eventname event name
@@ -26,7 +26,7 @@ function Hook.Add(eventname, hookname, func) end
-- @realm shared -- @realm shared
-- @usage -- @usage
-- Hook.Remove("characterDeath", "characterDeathExample") -- Hook.Remove("characterDeath", "characterDeathExample")
function Hook.Remove(eventname, hookname) end function Hook.Remove(eventName, hookName) end
--- Calls a hook. --- Calls a hook.
-- @tparam string eventname event name -- @tparam string eventname event name
@@ -36,7 +36,18 @@ function Hook.Remove(eventname, hookname) end
-- Hook.Add("think", "happyDebuggingSuckers", function() -- Hook.Add("think", "happyDebuggingSuckers", function()
-- Hook.Call("characterDead", {}) -- ruin someone's day -- Hook.Call("characterDead", {}) -- ruin someone's day
-- end) -- end)
function Hook.Call(eventname, parameters) end function Hook.Call(eventName, parameters) end
--- Patches a method, the callback is called with an instance variable and a ptable variable, ptable contains dictionary of parameter name -> parameter
-- @tparam string className
-- @tparam string methodName
-- @tparam function callback
-- @realm shared
-- @usage
-- Hook.HookMethod("Barotrauma.CharacterInfo", "IncreaseSkillLevel", function (instance, ptable)
-- print(string.format("%s gained % xp", instance.Character.Name, ptable.increase))
-- end, Hook.HookMethodType.After)
function Hook.HookMethod(className, methodName, callback) end
--- Game's fixed update rate, gets called normally 60 times a second. --- Game's fixed update rate, gets called normally 60 times a second.
-- @realm shared -- @realm shared
+14
View File
@@ -0,0 +1,14 @@
--[[--
Hook.HookMethodType enum.
]]
-- @enum Hook.HookMethodType
---
-- Hook.HookMethodType.Before = 0
-- @realm shared
-- @number Hook.HookMethodType.Before
---
-- Hook.HookMethodType.After = 1
-- @realm shared
-- @number Hook.HookMethodType.After
+15
View File
@@ -151,6 +151,21 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @bool IsBuff -- @bool IsBuff
---
-- HealableInMedicalClinic, Field of type bool
-- @realm shared
-- @bool HealableInMedicalClinic
---
-- HealCostMultiplier, Field of type number
-- @realm shared
-- @number HealCostMultiplier
---
-- BaseHealCost, Field of type number
-- @realm shared
-- @number BaseHealCost
--- ---
-- CauseOfDeathDescription, Field of type string -- CauseOfDeathDescription, Field of type string
-- @realm shared -- @realm shared
+10
View File
@@ -36,6 +36,11 @@ function GetCurrentSpeed(useMaxSpeed) end
-- @treturn AnimationParams -- @treturn AnimationParams
function GetAnimationParamsFromType(type) end function GetAnimationParamsFromType(type) end
--- GetHeightFromFloor
-- @realm shared
-- @treturn number
function GetHeightFromFloor() end
--- UpdateUseItem --- UpdateUseItem
-- @realm shared -- @realm shared
-- @tparam bool allowMovement -- @tparam bool allowMovement
@@ -394,6 +399,11 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @number WalkPos -- @number WalkPos
---
-- IsAboveFloor, Field of type bool
-- @realm shared
-- @bool IsAboveFloor
--- ---
-- RagdollParams, Field of type RagdollParams -- RagdollParams, Field of type RagdollParams
-- @realm shared -- @realm shared
+18 -7
View File
@@ -44,6 +44,12 @@ function TeleportTo(worldPos) end
-- @table Character.CharacterList -- @table Character.CharacterList
--- ApplyStatusEffects
-- @realm shared
-- @tparam function actionType
-- @tparam number deltaTime
function ApplyStatusEffects(actionType, deltaTime) end
--- BreakJoints --- BreakJoints
-- @realm shared -- @realm shared
function BreakJoints() end function BreakJoints() end
@@ -140,6 +146,11 @@ function GiveTalent(talentPrefab, addingFirstTime) end
-- @treturn bool -- @treturn bool
function HasTalent(identifier) end function HasTalent(identifier) end
--- HasUnlockedAllTalents
-- @realm shared
-- @treturn bool
function HasUnlockedAllTalents() end
--- GetFriendlyCrew --- GetFriendlyCrew
-- @realm shared -- @realm shared
-- @tparam Character character -- @tparam Character character
@@ -573,7 +584,8 @@ function ApplyAttack(attacker, worldPosition, attack, deltaTime, playSound, targ
-- @tparam number severLimbsProbability -- @tparam number severLimbsProbability
-- @tparam number damage -- @tparam number damage
-- @tparam bool allowBeheading -- @tparam bool allowBeheading
function TrySeverLimbJoints(targetLimb, severLimbsProbability, damage, allowBeheading) end -- @tparam Character attacker
function TrySeverLimbJoints(targetLimb, severLimbsProbability, damage, allowBeheading, attacker) end
--- AddDamage --- AddDamage
-- @realm shared -- @realm shared
@@ -639,12 +651,6 @@ function TryAdjustAttackerSkill(attacker, healthChange) end
-- @tparam bool isNetworkMessage -- @tparam bool isNetworkMessage
function SetStun(newStun, allowStunDecrease, isNetworkMessage) end function SetStun(newStun, allowStunDecrease, isNetworkMessage) end
--- ApplyStatusEffects
-- @realm shared
-- @tparam function actionType
-- @tparam number deltaTime
function ApplyStatusEffects(actionType, deltaTime) end
--- Create --- Create
-- @realm shared -- @realm shared
-- @tparam string speciesName -- @tparam string speciesName
@@ -882,6 +888,11 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @Character SecondLastOrderedCharacter -- @Character SecondLastOrderedCharacter
---
-- ItemSelectedDurations, Field of type table
-- @realm shared
-- @table ItemSelectedDurations
--- ---
-- SpeciesName, Field of type string -- SpeciesName, Field of type string
-- @realm shared -- @realm shared
+10 -5
View File
@@ -243,6 +243,11 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @number CrushDepth -- @number CrushDepth
---
-- BloodlossAffliction, Field of type Affliction
-- @realm shared
-- @Affliction BloodlossAffliction
--- ---
-- IsUnconscious, Field of type bool -- IsUnconscious, Field of type bool
-- @realm shared -- @realm shared
@@ -308,11 +313,6 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @Affliction PressureAffliction -- @Affliction PressureAffliction
---
-- Character, Field of type Character
-- @realm shared
-- @Character Character
--- ---
-- Unkillable, Field of type bool -- Unkillable, Field of type bool
-- @realm shared -- @realm shared
@@ -323,6 +323,11 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @Color DefaultFaceTint -- @Color DefaultFaceTint
---
-- Character, Field of type Character
-- @realm shared
-- @Character Character
--- ---
-- CharacterHealth.InsufficientOxygenThreshold, Field of type number -- CharacterHealth.InsufficientOxygenThreshold, Field of type number
-- @realm shared -- @realm shared
+5 -5
View File
@@ -10,6 +10,11 @@ Barotrauma source code: [CharacterInfo.cs](https://github.com/evilfactory/Barotr
local CharacterInfo = {} local CharacterInfo = {}
--- RecreateHead
-- @realm shared
-- @tparam HeadInfo headInfo
function RecreateHead(headInfo) end
--- RecreateHead --- RecreateHead
-- @realm shared -- @realm shared
-- @tparam number headID -- @tparam number headID
@@ -315,11 +320,6 @@ function CharacterInfo.IsMatchingGender(gender, myGender) end
-- @treturn bool -- @treturn bool
function CharacterInfo.IsMatchingRace(race, myRace) end function CharacterInfo.IsMatchingRace(race, myRace) end
--- RecreateHead
-- @realm shared
-- @tparam HeadInfo headInfo
function RecreateHead(headInfo) end
--- GetType --- GetType
-- @realm shared -- @realm shared
-- @treturn Type -- @treturn Type
+15
View File
@@ -88,6 +88,11 @@ function GameSession.GetSessionCrewCharacters() end
-- @tparam TransitionType transitionType -- @tparam TransitionType transitionType
function EndRound(endMessage, traitorResults, transitionType) end function EndRound(endMessage, traitorResults, transitionType) end
--- LogEndRoundStats
-- @realm shared
-- @tparam string eventId
function LogEndRoundStats(eventId) end
--- KillCharacter --- KillCharacter
-- @realm shared -- @realm shared
-- @tparam Character character -- @tparam Character character
@@ -216,6 +221,16 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @number RoundStartTime -- @number RoundStartTime
---
-- TimeSpentCleaning, Field of type number
-- @realm shared
-- @number TimeSpentCleaning
---
-- TimeSpentPainting, Field of type number
-- @realm shared
-- @number TimeSpentPainting
--- ---
-- WinningTeam, Field of type Nullable`1 -- WinningTeam, Field of type Nullable`1
-- @realm shared -- @realm shared
+539
View File
@@ -0,0 +1,539 @@
-- luacheck: ignore 111
--[[--
Barotrauma.GameSettings
]]
-- @code Game.GameSettings
-- @pragma nostrip
local GameSettings = {}
--- SelectCorePackage
-- @realm shared
-- @tparam ContentPackage contentPackage
-- @tparam bool forceReloadAll
function SelectCorePackage(contentPackage, forceReloadAll) end
--- AutoSelectCorePackage
-- @realm shared
-- @tparam Enumerable toRemove
function AutoSelectCorePackage(toRemove) end
--- BackUpModOrder
-- @realm shared
function BackUpModOrder() end
--- SwapPackages
-- @realm shared
-- @tparam ContentPackage corePackage
-- @tparam table regularPackages
function SwapPackages(corePackage, regularPackages) end
--- RestoreBackupPackages
-- @realm shared
function RestoreBackupPackages() end
--- EnableRegularPackage
-- @realm shared
-- @tparam ContentPackage contentPackage
function EnableRegularPackage(contentPackage) end
--- DisableRegularPackage
-- @realm shared
-- @tparam ContentPackage contentPackage
function DisableRegularPackage(contentPackage) end
--- SortContentPackages
-- @realm shared
-- @tparam bool refreshAll
function SortContentPackages(refreshAll) end
--- EnableContentPackageItems
-- @realm shared
-- @tparam Enumerable unorderedFiles
function EnableContentPackageItems(unorderedFiles) end
--- DisableContentPackageItems
-- @realm shared
-- @tparam Enumerable unorderedFiles
function DisableContentPackageItems(unorderedFiles) end
--- RefreshContentPackageItems
-- @realm shared
-- @tparam Enumerable files
function RefreshContentPackageItems(files) end
--- LoadPlayerConfig
-- @realm shared
function LoadPlayerConfig() end
--- SaveNewPlayerConfig
-- @realm shared
-- @treturn bool
function SaveNewPlayerConfig() end
--- ResetToDefault
-- @realm shared
function ResetToDefault() end
--- AreJobPreferencesEqual
-- @realm shared
-- @tparam table compareTo
-- @treturn bool
function AreJobPreferencesEqual(compareTo) end
--- GetType
-- @realm shared
-- @treturn Type
function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals
-- @realm shared
-- @tparam Object obj
-- @treturn bool
function Equals(obj) end
--- GetHashCode
-- @realm shared
-- @treturn number
function GetHashCode() end
---
-- GraphicsWidth, Field of type number
-- @realm shared
-- @number GraphicsWidth
---
-- GraphicsHeight, Field of type number
-- @realm shared
-- @number GraphicsHeight
---
-- VSyncEnabled, Field of type bool
-- @realm shared
-- @bool VSyncEnabled
---
-- TextureCompressionEnabled, Field of type bool
-- @realm shared
-- @bool TextureCompressionEnabled
---
-- EnableSplashScreen, Field of type bool
-- @realm shared
-- @bool EnableSplashScreen
---
-- ParticleLimit, Field of type number
-- @realm shared
-- @number ParticleLimit
---
-- LightMapScale, Field of type number
-- @realm shared
-- @number LightMapScale
---
-- ChromaticAberrationEnabled, Field of type bool
-- @realm shared
-- @bool ChromaticAberrationEnabled
---
-- PauseOnFocusLost, Field of type bool
-- @realm shared
-- @bool PauseOnFocusLost
---
-- MuteOnFocusLost, Field of type bool
-- @realm shared
-- @bool MuteOnFocusLost
---
-- DynamicRangeCompressionEnabled, Field of type bool
-- @realm shared
-- @bool DynamicRangeCompressionEnabled
---
-- VoipAttenuationEnabled, Field of type bool
-- @realm shared
-- @bool VoipAttenuationEnabled
---
-- UseDirectionalVoiceChat, Field of type bool
-- @realm shared
-- @bool UseDirectionalVoiceChat
---
-- DisableVoiceChatFilters, Field of type bool
-- @realm shared
-- @bool DisableVoiceChatFilters
---
-- AudioOutputDevice, Field of type string
-- @realm shared
-- @string AudioOutputDevice
---
-- VoiceSetting, Field of type VoiceMode
-- @realm shared
-- @VoiceMode VoiceSetting
---
-- VoiceCaptureDevice, Field of type string
-- @realm shared
-- @string VoiceCaptureDevice
---
-- NoiseGateThreshold, Field of type number
-- @realm shared
-- @number NoiseGateThreshold
---
-- UseLocalVoiceByDefault, Field of type bool
-- @realm shared
-- @bool UseLocalVoiceByDefault
---
-- RequireSteamAuthentication, Field of type bool
-- @realm shared
-- @bool RequireSteamAuthentication
---
-- UseSteamMatchmaking, Field of type bool
-- @realm shared
-- @bool UseSteamMatchmaking
---
-- UseDualModeSockets, Field of type bool
-- @realm shared
-- @bool UseDualModeSockets
---
-- WindowMode, Field of type WindowMode
-- @realm shared
-- @WindowMode WindowMode
---
-- JobPreferences, Field of type table
-- @realm shared
-- @table JobPreferences
---
-- TeamPreference, Field of type CharacterTeamType
-- @realm shared
-- @CharacterTeamType TeamPreference
---
-- AimAssistAmount, Field of type number
-- @realm shared
-- @number AimAssistAmount
---
-- EnableMouseLook, Field of type bool
-- @realm shared
-- @bool EnableMouseLook
---
-- EnableRadialDistortion, Field of type bool
-- @realm shared
-- @bool EnableRadialDistortion
---
-- CrewMenuOpen, Field of type bool
-- @realm shared
-- @bool CrewMenuOpen
---
-- ChatOpen, Field of type bool
-- @realm shared
-- @bool ChatOpen
---
-- CorpseDespawnDelay, Field of type number
-- @realm shared
-- @number CorpseDespawnDelay
---
-- CorpsesPerSubDespawnThreshold, Field of type number
-- @realm shared
-- @number CorpsesPerSubDespawnThreshold
---
-- UnsavedSettings, Field of type bool
-- @realm shared
-- @bool UnsavedSettings
---
-- SoundVolume, Field of type number
-- @realm shared
-- @number SoundVolume
---
-- MusicVolume, Field of type number
-- @realm shared
-- @number MusicVolume
---
-- VoiceChatVolume, Field of type number
-- @realm shared
-- @number VoiceChatVolume
---
-- VoiceChatCutoffPrevention, Field of type number
-- @realm shared
-- @number VoiceChatCutoffPrevention
---
-- MicrophoneVolume, Field of type number
-- @realm shared
-- @number MicrophoneVolume
---
-- Language, Field of type string
-- @realm shared
-- @string Language
---
-- CurrentCorePackage, Field of type ContentPackage
-- @realm shared
-- @ContentPackage CurrentCorePackage
---
-- EnabledRegularPackages, Field of type IReadOnlyList`1
-- @realm shared
-- @IReadOnlyList`1 EnabledRegularPackages
---
-- AllEnabledPackages, Field of type Enumerable
-- @realm shared
-- @Enumerable AllEnabledPackages
---
-- ContentPackageSelectionDirtyNotification, Field of type bool
-- @realm shared
-- @bool ContentPackageSelectionDirtyNotification
---
-- ContentPackageSelectionDirty, Field of type bool
-- @realm shared
-- @bool ContentPackageSelectionDirty
---
-- ServerFilterElement, Field of type XElement
-- @realm shared
-- @XElement ServerFilterElement
---
-- DisableInGameHints, Field of type bool
-- @realm shared
-- @bool DisableInGameHints
---
-- AutomaticQuickStartEnabled, Field of type bool
-- @realm shared
-- @bool AutomaticQuickStartEnabled
---
-- AutomaticCampaignLoadEnabled, Field of type bool
-- @realm shared
-- @bool AutomaticCampaignLoadEnabled
---
-- TextManagerDebugModeEnabled, Field of type bool
-- @realm shared
-- @bool TextManagerDebugModeEnabled
---
-- TestScreenEnabled, Field of type bool
-- @realm shared
-- @bool TestScreenEnabled
---
-- ModBreakerMode, Field of type bool
-- @realm shared
-- @bool ModBreakerMode
---
-- MasterServerUrl, Field of type string
-- @realm shared
-- @string MasterServerUrl
---
-- RemoteContentUrl, Field of type string
-- @realm shared
-- @string RemoteContentUrl
---
-- AutoCheckUpdates, Field of type bool
-- @realm shared
-- @bool AutoCheckUpdates
---
-- PlayerName, Field of type string
-- @realm shared
-- @string PlayerName
---
-- LosMode, Field of type LosMode
-- @realm shared
-- @LosMode LosMode
---
-- GameSettings.HUDScale, Field of type number
-- @realm shared
-- @number GameSettings.HUDScale
---
-- GameSettings.InventoryScale, Field of type number
-- @realm shared
-- @number GameSettings.InventoryScale
---
-- GameSettings.TextScale, Field of type number
-- @realm shared
-- @number GameSettings.TextScale
---
-- CompletedTutorialNames, Field of type table
-- @realm shared
-- @table CompletedTutorialNames
---
-- IgnoredHints, Field of type HashSet`1
-- @realm shared
-- @HashSet`1 IgnoredHints
---
-- EncounteredCreatures, Field of type HashSet`1
-- @realm shared
-- @HashSet`1 EncounteredCreatures
---
-- KilledCreatures, Field of type HashSet`1
-- @realm shared
-- @HashSet`1 KilledCreatures
---
-- GameSettings.VerboseLogging, Field of type bool
-- @realm shared
-- @bool GameSettings.VerboseLogging
---
-- GameSettings.SaveDebugConsoleLogs, Field of type bool
-- @realm shared
-- @bool GameSettings.SaveDebugConsoleLogs
---
-- ShowLanguageSelectionPrompt, Field of type bool
-- @realm shared
-- @bool ShowLanguageSelectionPrompt
---
-- GameSettings.ShowOffensiveServerPrompt, Field of type bool
-- @realm shared
-- @bool GameSettings.ShowOffensiveServerPrompt
---
-- GameSettings.EnableSubmarineAutoSave, Field of type bool
-- @realm shared
-- @bool GameSettings.EnableSubmarineAutoSave
---
-- GameSettings.MaximumAutoSaves, Field of type number
-- @realm shared
-- @number GameSettings.MaximumAutoSaves
---
-- GameSettings.AutoSaveIntervalSeconds, Field of type number
-- @realm shared
-- @number GameSettings.AutoSaveIntervalSeconds
---
-- GameSettings.SubEditorBackgroundColor, Field of type Color
-- @realm shared
-- @Color GameSettings.SubEditorBackgroundColor
---
-- GameSettings.SubEditorMaxUndoBuffer, Field of type number
-- @realm shared
-- @number GameSettings.SubEditorMaxUndoBuffer
---
-- ShowTutorialSkipWarning, Field of type bool
-- @realm shared
-- @bool ShowTutorialSkipWarning
---
-- AudioDeviceNames, Field of type IList`1
-- @realm shared
-- @IList`1 AudioDeviceNames
---
-- CaptureDeviceNames, Field of type IList`1
-- @realm shared
-- @IList`1 CaptureDeviceNames
---
-- jobPreferences, Field of type table
-- @realm shared
-- @table jobPreferences
---
-- QuickStartSubmarineName, Field of type string
-- @realm shared
-- @string QuickStartSubmarineName
---
-- AutoUpdateWorkshopItems, Field of type bool
-- @realm shared
-- @bool AutoUpdateWorkshopItems
---
-- SuppressModFolderWatcher, Field of type bool
-- @realm shared
-- @bool SuppressModFolderWatcher
---
-- WaitingForAutoUpdate, Field of type bool
-- @realm shared
-- @bool WaitingForAutoUpdate
---
-- RecentlyEncounteredCreatures, Field of type HashSet`1
-- @realm shared
-- @HashSet`1 RecentlyEncounteredCreatures
---
-- CampaignDisclaimerShown, Field of type bool
-- @realm shared
-- @bool CampaignDisclaimerShown
---
-- EditorDisclaimerShown, Field of type bool
-- @realm shared
-- @bool EditorDisclaimerShown
---
-- GameSettings.SavePath, Field of type string
-- @realm shared
-- @string GameSettings.SavePath
---
-- GameSettings.PlayerSavePath, Field of type string
-- @realm shared
-- @string GameSettings.PlayerSavePath
---
-- GameSettings.VanillaContentPackagePath, Field of type string
-- @realm shared
-- @string GameSettings.VanillaContentPackagePath
---
-- GameSettings.MaxMicrophoneVolume, Field of type number
-- @realm shared
-- @number GameSettings.MaxMicrophoneVolume
+21 -21
View File
@@ -7,22 +7,6 @@ Barotrauma.Hull
-- @pragma nostrip -- @pragma nostrip
local Hull = {} local Hull = {}
--- IncreaseSectionColorOrStrength
-- @realm shared
-- @tparam BackgroundSection section
-- @tparam Nullable`1 color
-- @tparam Nullable`1 strength
-- @tparam bool requiresUpdate
-- @tparam bool isCleaning
function IncreaseSectionColorOrStrength(section, color, strength, requiresUpdate, isCleaning) end
--- SetSectionColorOrStrength
-- @realm shared
-- @tparam BackgroundSection section
-- @tparam Nullable`1 color
-- @tparam Nullable`1 strength
function SetSectionColorOrStrength(section, color, strength) end
--- DirtySections --- DirtySections
-- @realm shared -- @realm shared
-- @tparam table sections -- @tparam table sections
@@ -269,6 +253,22 @@ function RefreshSubmergedSections(waterArea) end
-- @treturn bool -- @treturn bool
function DoesSectionMatch(index, row) end function DoesSectionMatch(index, row) end
--- IncreaseSectionColorOrStrength
-- @realm shared
-- @tparam BackgroundSection section
-- @tparam Nullable`1 color
-- @tparam Nullable`1 strength
-- @tparam bool requiresUpdate
-- @tparam bool isCleaning
function IncreaseSectionColorOrStrength(section, color, strength, requiresUpdate, isCleaning) end
--- SetSectionColorOrStrength
-- @realm shared
-- @tparam BackgroundSection section
-- @tparam Nullable`1 color
-- @tparam Nullable`1 strength
function SetSectionColorOrStrength(section, color, strength) end
--- ResolveLinks --- ResolveLinks
-- @realm shared -- @realm shared
-- @tparam IdRemap childRemap -- @tparam IdRemap childRemap
@@ -417,11 +417,6 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @number Surface -- @number Surface
---
-- DrawSurface, Field of type number
-- @realm shared
-- @number DrawSurface
--- ---
-- WorldSurface, Field of type number -- WorldSurface, Field of type number
-- @realm shared -- @realm shared
@@ -617,6 +612,11 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @bool RemoveIfLinkedOutpostDoorInUse -- @bool RemoveIfLinkedOutpostDoorInUse
---
-- Layer, Field of type string
-- @realm shared
-- @string Layer
--- ---
-- Removed, Field of type bool -- Removed, Field of type bool
-- @realm shared -- @realm shared
+22 -11
View File
@@ -46,6 +46,10 @@ function SendSignal(signalOrString, connectionOrConnectionName) end
-- @Vector2 WorldPosition -- @Vector2 WorldPosition
--- UpdateTransform
-- @realm shared
function UpdateTransform() end
--- FlipX --- FlipX
-- @realm shared -- @realm shared
-- @tparam bool relativeToSub -- @tparam bool relativeToSub
@@ -65,8 +69,9 @@ function GetConnectedComponents(recursive) end
--- GetConnectedComponentsRecursive --- GetConnectedComponentsRecursive
-- @realm shared -- @realm shared
-- @tparam Connection c -- @tparam Connection c
-- @tparam bool ignoreInactiveRelays
-- @treturn table -- @treturn table
function GetConnectedComponentsRecursive(c) end function GetConnectedComponentsRecursive(c, ignoreInactiveRelays) end
--- FindController --- FindController
-- @realm shared -- @realm shared
@@ -451,10 +456,6 @@ function SendPendingNetworkUpdates() end
-- @tparam Camera cam -- @tparam Camera cam
function Update(deltaTime, cam) end function Update(deltaTime, cam) end
--- UpdateTransform
-- @realm shared
function UpdateTransform() end
--- ServerWrite --- ServerWrite
-- @realm shared -- @realm shared
-- @tparam IWriteMessage msg -- @tparam IWriteMessage msg
@@ -619,6 +620,11 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @InteractionType CampaignInteractionType -- @InteractionType CampaignInteractionType
---
-- DefaultRect, Field of type Rectangle
-- @realm shared
-- @Rectangle DefaultRect
--- ---
-- SerializableProperties, Field of type table -- SerializableProperties, Field of type table
-- @realm shared -- @realm shared
@@ -920,14 +926,14 @@ function GetHashCode() end
-- @bool DisplaySideBySideWhenLinked -- @bool DisplaySideBySideWhenLinked
--- ---
-- Repairables, Field of type Enumerable -- Repairables, Field of type table
-- @realm shared -- @realm shared
-- @Enumerable Repairables -- @table Repairables
--- ---
-- Components, Field of type Enumerable -- Components, Field of type table
-- @realm shared -- @realm shared
-- @Enumerable Components -- @table Components
--- ---
-- Linkable, Field of type bool -- Linkable, Field of type bool
@@ -955,9 +961,9 @@ function GetHashCode() end
-- @ItemPrefab PendingItemSwap -- @ItemPrefab PendingItemSwap
--- ---
-- AllPropertyObjects, Field of type Enumerable -- AllPropertyObjects, Field of type IReadOnlyList`1
-- @realm shared -- @realm shared
-- @Enumerable AllPropertyObjects -- @IReadOnlyList`1 AllPropertyObjects
--- ---
-- OrderedToBeIgnored, Field of type bool -- OrderedToBeIgnored, Field of type bool
@@ -1054,6 +1060,11 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @bool RemoveIfLinkedOutpostDoorInUse -- @bool RemoveIfLinkedOutpostDoorInUse
---
-- Layer, Field of type string
-- @realm shared
-- @string Layer
--- ---
-- Removed, Field of type bool -- Removed, Field of type bool
-- @realm shared -- @realm shared
+10 -5
View File
@@ -138,6 +138,11 @@ function ItemPrefab.IsContainerPreferred(preferences, c) end
-- @treturn bool -- @treturn bool
function ItemPrefab.IsContainerPreferred(preferences, ids) end function ItemPrefab.IsContainerPreferred(preferences, ids) end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- GetItemPrefab --- GetItemPrefab
-- @realm shared -- @realm shared
-- @tparam string itemNameOrId -- @tparam string itemNameOrId
@@ -212,11 +217,6 @@ function IsLinkAllowed(target) end
-- @treturn Type -- @treturn Type
function GetType() end function GetType() end
--- ToString
-- @realm shared
-- @treturn string
function ToString() end
--- Equals --- Equals
-- @realm shared -- @realm shared
-- @tparam Object obj -- @tparam Object obj
@@ -368,6 +368,11 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @number ImpactTolerance -- @number ImpactTolerance
---
-- OnDamagedThreshold, Field of type number
-- @realm shared
-- @number OnDamagedThreshold
--- ---
-- SonarSize, Field of type number -- SonarSize, Field of type number
-- @realm shared -- @realm shared
-7
View File
@@ -89,13 +89,6 @@ function GetCells(worldPos, searchDepth) end
-- @treturn VoronoiCell -- @treturn VoronoiCell
function GetClosestCell(worldPos) end function GetClosestCell(worldPos) end
--- GetWreckIDTag
-- @realm shared
-- @tparam string originalTag
-- @tparam Submarine wreck
-- @treturn string
function GetWreckIDTag(originalTag, wreck) end
--- IsCloseToStart --- IsCloseToStart
-- @realm shared -- @realm shared
-- @tparam Vector2 position -- @tparam Vector2 position
-5
View File
@@ -105,11 +105,6 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @SubmarineInfo SelectedShuttle -- @SubmarineInfo SelectedShuttle
---
-- CampaignSubmarines, Field of type table
-- @realm shared
-- @table CampaignSubmarines
--- ---
-- GameModes, Field of type GameModePreset[] -- GameModes, Field of type GameModePreset[]
-- @realm shared -- @realm shared
+2 -2
View File
@@ -43,12 +43,12 @@ function Submarine.RepositionEntities(moveAmount, entities) end
-- @tparam XElement element -- @tparam XElement element
function SaveToXElement(element) end function SaveToXElement(element) end
--- SaveAs --- TrySaveAs
-- @realm shared -- @realm shared
-- @tparam string filePath -- @tparam string filePath
-- @tparam MemoryStream previewImage -- @tparam MemoryStream previewImage
-- @treturn bool -- @treturn bool
function SaveAs(filePath, previewImage) end function TrySaveAs(filePath, previewImage) end
--- Unload --- Unload
-- @realm shared -- @realm shared
-1
View File
@@ -65,7 +65,6 @@ function GetRealWorldCrushDepthMultiplier() end
-- @realm shared -- @realm shared
-- @tparam string filePath -- @tparam string filePath
-- @tparam MemoryStream previewImage -- @tparam MemoryStream previewImage
-- @treturn bool
function SaveAs(filePath, previewImage) end function SaveAs(filePath, previewImage) end
--- AddToSavedSubs --- AddToSavedSubs
+5
View File
@@ -350,6 +350,11 @@ function GetHashCode() end
-- @realm shared -- @realm shared
-- @bool RemoveIfLinkedOutpostDoorInUse -- @bool RemoveIfLinkedOutpostDoorInUse
---
-- Layer, Field of type string
-- @realm shared
-- @string Layer
--- ---
-- Removed, Field of type bool -- Removed, Field of type bool
-- @realm shared -- @realm shared
+51
View File
@@ -0,0 +1,51 @@
# How to use hooks
Hooks are basically functions that get called when events happen in-game, like chat messages. They can be triggered either by Lua itself or the game code.
## Adding hooks
Hooks can be added like this:
```lua
Hook.Add("chatMessage", "test", function(message, client)
print(client.Name .. " has sent " .. message)
end)
```
The event name (first argument), is case-insensitive, so you can call it chatMessage, cHaTmEsSaGe, chatmessage, etc.
## Calling hooks
You can also call hooks with the following code:
```lua
Hook.Call("myCustomEvent", {"some", "arguments", 123})
```
## XML Status Effect Hooks
With Lua, a new XML tags is added, it can be used to call Lua hooks inside status effects:
```xml
<StatusEffect type="OnUse">
<LuaHook name="doSomething">
</StatusEffect>
```
```lua
Hook.Add("doSomething", "something", function (effect, deltaTime, item, targets, worldPosition)
print(effect, ' ', item)
end)
```
## Patching
Patching allows you to hook into existing methods in the game code, notice that it can be a little unstable depending on the method that you are patching, so be aware.
```lua
Hook.HookMethod("Barotrauma.CharacterInfo", "IncreaseSkillLevel", function (instance, ptable)
print(string.format("%s gained % xp", instance.Character.Name, ptable.increase))
end, Hook.HookMethodType.After)
```
If you return anything other than nil, it will stop the execution of the method, if the method has a return type, it will also return what you returned in the Lua function. (Only in Hook.HookMethodType.After)
+1 -1
View File
@@ -62,7 +62,7 @@ Hook.Add("chatMessage","controlhuskcommand",function(msg, client)
local suitablechars = {} local suitablechars = {}
for i = 1, #chars, 1 do for i = 1, #chars, 1 do
local charat = chars[i] local charat = chars[i]
if not charat.IsDead and string.match(string.lower(charat.SpeciesName), "husk") and not charat IsRemotelyControlled then if not charat.IsDead and string.match(string.lower(charat.SpeciesName), "husk") and not charat.IsRemotelyControlled then
table.insert(suitablechars, charat) table.insert(suitablechars, charat)
end end
end end