Added placeholder for Oven operations

This commit is contained in:
ZioPao
2023-11-11 03:22:05 +01:00
parent d82fce6f2f
commit e8269899b0
2 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
local PlayerHandler = require("Handlers/TOC_PlayerHandler")
local StaticData = require("TOC_StaticData")
local ModDataHandler = require("Handlers/TOC_ModDataHandler")
---------------
-- TODO Surgery Kits
local function AddInventorySurgeryMenu(playerNum, context, items)
end
Events.OnFillInventoryObjectContextMenu.Add(AddInventorySurgeryMenu)
-- TODO Oven
-- TODO We need a class to handle operations, this is just a placeholder
local function Cauterize(limbName)
end
local function AddOvenContextMenu(playerNum, context, worldObjects, test)
local pl = getSpecificPlayer(playerNum)
if not ModDataHandler.GetInstance():getIsAnyLimbCut() then return end
local amputatedLimbs = PlayerHandler.GetAmputatedLimbs()
local foundStove = false
for _, obj in pairs(worldObjects) do
if instanceof(obj, "IsoStove") and obj:getCurrentTemperature() > 250 then
foundStove = true
break
end
end
if foundStove == false then return end
local option = context:addOption(getText("ContextMenu_Cauterize"), nil)
local subMenu = context:getNew(context)
context:addSubMenu(option, subMenu)
if pl:HasTrait("Brave") or pl:getPerkLevel(Perks.Strength) > 5 then
for i=1, #amputatedLimbs do
local limbName = amputatedLimbs[i]
subMenu:addOption(getText("ContextMenu_Limb_" .. limbName), limbName, Cauterize)
end
end
end
Events.OnFillWorldObjectContextMenu.Add(AddOvenContextMenu)
-- TODO Other stuff?

View File

@@ -1,6 +1,8 @@
ContextMenu_EN = { ContextMenu_EN = {
ContextMenu_Amputate = "Amputate", ContextMenu_Amputate = "Amputate",
ContextMenu_Cauterize = "Cauterize",
ContextMenu_Limb_Hand_L = "Left Hand", ContextMenu_Limb_Hand_L = "Left Hand",
ContextMenu_Limb_ForeArm_L = "Left forearm", ContextMenu_Limb_ForeArm_L = "Left forearm",
ContextMenu_Limb_UpperArm_L = "Left UpperArm" ContextMenu_Limb_UpperArm_L = "Left UpperArm"