Update
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
-- luacheck: globals Character
|
-- luacheck: globals Character MyModGlobal
|
||||||
---@return Barotrauma.Item|nil, Barotrauma.Items.Components.Repairable|nil
|
---@return Barotrauma.Item|nil, Barotrauma.Items.Components.Repairable|nil
|
||||||
local function getRepairableObjectInFocus()
|
local function getRepairableObjectInFocus()
|
||||||
-- Make sure we have a controlled character
|
-- Make sure we have a controlled character
|
||||||
@@ -17,7 +17,7 @@ local function getRepairableObjectInFocus()
|
|||||||
|
|
||||||
-- Check if the selected item is in fact the repairable object itself
|
-- Check if the selected item is in fact the repairable object itself
|
||||||
for _, component in pairs(selectedItem.Components) do
|
for _, component in pairs(selectedItem.Components) do
|
||||||
if component.name == "Repairable" then
|
if component.Name == "Repairable" then
|
||||||
-- Check if repair interface should be shown
|
-- Check if repair interface should be shown
|
||||||
if component:ShouldDrawHUD(controlledCharacter) then
|
if component:ShouldDrawHUD(controlledCharacter) then
|
||||||
return selectedItem, component
|
return selectedItem, component
|
||||||
@@ -29,6 +29,7 @@ local function getRepairableObjectInFocus()
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- TODO: Character.HeldItems seems interesting
|
||||||
---@return boolean
|
---@return boolean
|
||||||
local function clickRepairButton()
|
local function clickRepairButton()
|
||||||
local item, repairableComponent = getRepairableObjectInFocus()
|
local item, repairableComponent = getRepairableObjectInFocus()
|
||||||
@@ -46,7 +47,12 @@ local function clickRepairButton()
|
|||||||
|
|
||||||
-- Call the StartRepairing method directly
|
-- Call the StartRepairing method directly
|
||||||
-- The second parameter (FixActions.Repair = 1) indicates a repair action
|
-- The second parameter (FixActions.Repair = 1) indicates a repair action
|
||||||
local result = repairableComponent:StartRepairing(controlledCharacter, 1)
|
local result = repairableComponent.StartRepairing(controlledCharacter, 1)
|
||||||
|
local button = repairableComponent.RepairButton
|
||||||
|
if button then
|
||||||
|
MyModGlobal.debugPrint("Clicking repair button")
|
||||||
|
button.OnClicked(button, repairableComponent)
|
||||||
|
end
|
||||||
-- MyModGlobal.debugPrint("StartRepairing result: " .. tostring(result))
|
-- MyModGlobal.debugPrint("StartRepairing result: " .. tostring(result))
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ local LOAD_MAP = {
|
|||||||
handheldsonar = { batterycell = 1 },
|
handheldsonar = { batterycell = 1 },
|
||||||
underwaterscooter = { batterycell = 1 },
|
underwaterscooter = { batterycell = 1 },
|
||||||
divingsuit = { oxygentank = 1, },
|
divingsuit = { oxygentank = 1, },
|
||||||
|
flashlight = { batterycell = 1 },
|
||||||
|
divingmask = { oxygentank = 1, },
|
||||||
}
|
}
|
||||||
|
|
||||||
return LOAD_MAP
|
return LOAD_MAP
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
-- luacheck: globals Character Timer Hook
|
-- luacheck: globals Character Timer Hook SERVER
|
||||||
|
if not SERVER then return end
|
||||||
local amountExperience = 6000
|
local amountExperience = 6000
|
||||||
local passiveExperienceDelay = 60
|
local passiveExperienceDelay = 60
|
||||||
local passiveExperienceTimer = 0
|
local passiveExperienceTimer = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user