diff --git a/Barotrauma/BarotraumaShared/Lua/DefaultLib.lua b/Barotrauma/BarotraumaShared/Lua/DefaultLib.lua index 5aabdd596..ab88af8a1 100644 --- a/Barotrauma/BarotraumaShared/Lua/DefaultLib.lua +++ b/Barotrauma/BarotraumaShared/Lua/DefaultLib.lua @@ -111,6 +111,15 @@ defaultLib["AIObjectiveRescue"] = CreateStatic("Barotrauma.AIObjectiveRescue", t defaultLib["AIObjectiveRescueAll"] = CreateStatic("Barotrauma.AIObjectiveRescueAll", true) defaultLib["AIObjectiveReturn"] = CreateStatic("Barotrauma.AIObjectiveReturn", true) +local barotraumaComponentsToReference = { "DockingPort", "Door", "GeneticMaterial", "Growable", "Holdable", "LevelResource", "ItemComponent", "ItemLabel", "LightComponent", "Controller", "Deconstructor", "Engine", "Fabricator", "OutpostTerminal", "Pump", "Reactor", "Steering", "PowerContainer", "Projectile", "Repairable", "Rope", "Scanner", "ButtonTerminal", "ConnectionPanel", "CustomInterface", "MemoryComponent", "Terminal", "WifiComponent", "Wire", "TriggerComponent", "ElectricalDischarger", "EntitySpawnerComponent", "ProducedItem", "VineTile", "GrowthSideExtension", "IdCard", "MeleeWeapon", "Pickable", "Propulsion", "RangedWeapon", "RepairTool", "Sprayer", "Throwable", "ItemContainer", "Ladder", "LimbPos", "MiniMap", "OxygenGenerator", "Sonar", "SonarTransducer", "Vent", "NameTag", "Planter", "Powered", "PowerTransfer", "Quality", "RemoteController", "AdderComponent", "AndComponent", "ArithmeticComponent", "ColorComponent", "ConcatComponent", "Connection", "DelayComponent", "DivideComponent", "EqualsComponent", "ExponentiationComponent", "FunctionComponent", "GreaterComponent", "ModuloComponent", "MotionSensor", "MultiplyComponent", "NotComponent", "OrComponent", "OscillatorComponent", "OxygenDetector", "RegExFindComponent", "RelayComponent", "SignalCheckComponent", "SmokeDetector", "StringComponent", "SubtractComponent", "TrigonometricFunctionComponent", "WaterDetector", "XorComponent", "StatusHUD", "Turret", "Wearable", "CustomInterface" +} + +defaultLib["Components"] = {} + +for key, value in pairs(barotraumaComponentsToReference) do + defaultLib["Components"][value] = CreateStatic("Barotrauma.Items.Components." .. value, true) +end + defaultLib["Vector2"] = CreateStatic("Microsoft.Xna.Framework.Vector2", true) defaultLib["Vector3"] = CreateStatic("Microsoft.Xna.Framework.Vector3", true) defaultLib["Vector4"] = CreateStatic("Microsoft.Xna.Framework.Vector4", true) diff --git a/Barotrauma/BarotraumaShared/Lua/DefaultRegister.lua b/Barotrauma/BarotraumaShared/Lua/DefaultRegister.lua index 9752c50fa..58dcc75c8 100644 --- a/Barotrauma/BarotraumaShared/Lua/DefaultRegister.lua +++ b/Barotrauma/BarotraumaShared/Lua/DefaultRegister.lua @@ -80,57 +80,12 @@ RegisterBarotrauma("CharacterInventory") RegisterBarotrauma("Inventory+ItemSlot") RegisterBarotrauma("FireSource") -RegisterBarotrauma("Items.Components.Connection") -RegisterBarotrauma("Items.Components.Fabricator") -RegisterBarotrauma("Items.Components.ItemComponent") -RegisterBarotrauma("Items.Components.WifiComponent") -RegisterBarotrauma("Items.Components.LightComponent") -RegisterBarotrauma("Items.Components.Holdable") -RegisterBarotrauma("Items.Components.CustomInterface") -RegisterBarotrauma("Items.Components.CustomInterface+CustomInterfaceElement") -RegisterBarotrauma("Items.Components.ItemContainer") -RegisterBarotrauma("Items.Components.PowerContainer") -RegisterBarotrauma("Items.Components.Pickable") -RegisterBarotrauma("Items.Components.Reactor") -RegisterBarotrauma("Items.Components.RelayComponent") -RegisterBarotrauma("Items.Components.MemoryComponent") -RegisterBarotrauma("Items.Components.Engine") -RegisterBarotrauma("Items.Components.Growable") -RegisterBarotrauma("Items.Components.MeleeWeapon") -RegisterBarotrauma("Items.Components.IdCard") -RegisterBarotrauma("Items.Components.Steering") -RegisterBarotrauma("Items.Components.Wire") -RegisterBarotrauma("Items.Components.Turret") -RegisterBarotrauma("Items.Components.Sprayer") -RegisterBarotrauma("Items.Components.Sonar") -RegisterBarotrauma("Items.Components.SonarTransducer") -RegisterBarotrauma("Items.Components.Powered") -RegisterBarotrauma("Items.Components.PowerTransfer") -RegisterBarotrauma("Items.Components.Planter") -RegisterBarotrauma("Items.Components.OxygenGenerator") -RegisterBarotrauma("Items.Components.OutpostTerminal") -RegisterBarotrauma("Items.Components.Ladder") -RegisterBarotrauma("Items.Components.ElectricalDischarger") -RegisterBarotrauma("Items.Components.Door") -RegisterBarotrauma("Items.Components.DockingPort") -RegisterBarotrauma("Items.Components.Deconstructor") -RegisterBarotrauma("Items.Components.Connection") -RegisterBarotrauma("Items.Components.ConnectionPanel") -RegisterBarotrauma("Items.Components.GeneticMaterial") -RegisterBarotrauma("Items.Components.GrowthSideExtension") -RegisterBarotrauma("Items.Components.ButtonTerminal") -RegisterBarotrauma("Items.Components.Propulsion") -RegisterBarotrauma("Items.Components.Pump") -RegisterBarotrauma("Items.Components.RangedWeapon") -RegisterBarotrauma("Items.Components.Terminal") -RegisterBarotrauma("Items.Components.Throwable") -RegisterBarotrauma("Items.Components.Wearable") -RegisterBarotrauma("Items.Components.SmokeDetector") -RegisterBarotrauma("Items.Components.Repairable") -RegisterBarotrauma("Items.Components.RepairTool") -RegisterBarotrauma("Items.Components.NameTag") -RegisterBarotrauma("Items.Components.LevelResource") -RegisterBarotrauma("Items.Components.EntitySpawnerComponent") +local barotraumaComponentsToRegister = { "DockingPort", "Door", "GeneticMaterial", "Growable", "Holdable", "LevelResource", "ItemComponent", "ItemLabel", "LightComponent", "Controller", "Deconstructor", "Engine", "Fabricator", "OutpostTerminal", "Pump", "Reactor", "Steering", "PowerContainer", "Projectile", "Repairable", "Rope", "Scanner", "ButtonTerminal", "ConnectionPanel", "CustomInterface", "MemoryComponent", "Terminal", "WifiComponent", "Wire", "TriggerComponent", "ElectricalDischarger", "EntitySpawnerComponent", "ProducedItem", "VineTile", "GrowthSideExtension", "IdCard", "MeleeWeapon", "Pickable", "AbilityItemPickingTime", "Propulsion", "RangedWeapon", "AbilityRangedWeapon", "RepairTool", "Sprayer", "Throwable", "ItemContainer", "AbilityItemContainer", "Ladder", "LimbPos", "AbilityDeconstructedItem", "AbilityItemCreationMultiplier", "AbilityItemDeconstructedInventory", "MiniMap", "OxygenGenerator", "Sonar", "SonarTransducer", "Vent", "NameTag", "Planter", "Powered", "PowerTransfer", "Quality", "RemoteController", "AdderComponent", "AndComponent", "ArithmeticComponent", "ColorComponent", "ConcatComponent", "Connection", "DelayComponent", "DivideComponent", "EqualsComponent", "ExponentiationComponent", "FunctionComponent", "GreaterComponent", "ModuloComponent", "MotionSensor", "MultiplyComponent", "NotComponent", "OrComponent", "OscillatorComponent", "OxygenDetector", "RegExFindComponent", "RelayComponent", "SignalCheckComponent", "SmokeDetector", "StringComponent", "SubtractComponent", "TrigonometricFunctionComponent", "WaterDetector", "XorComponent", "StatusHUD", "Turret", "Wearable", "CustomInterface", "CustomInterface+CustomInterfaceElement" +} + +for key, value in pairs(barotraumaComponentsToRegister) do + RegisterBarotrauma("Items.Components." .. value) +end RegisterBarotrauma("AIController") RegisterBarotrauma("EnemyAIController")