diff --git a/media/lua/client/UI/TOC_SurgeryInteractions.lua b/media/lua/client/UI/TOC_SurgeryInteractions.lua new file mode 100644 index 0000000..c3e0092 --- /dev/null +++ b/media/lua/client/UI/TOC_SurgeryInteractions.lua @@ -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? \ No newline at end of file diff --git a/media/lua/shared/Translate/EN/ContextMenu_EN.txt b/media/lua/shared/Translate/EN/ContextMenu_EN.txt index 1f83731..8f9ec91 100644 --- a/media/lua/shared/Translate/EN/ContextMenu_EN.txt +++ b/media/lua/shared/Translate/EN/ContextMenu_EN.txt @@ -1,5 +1,7 @@ ContextMenu_EN = { ContextMenu_Amputate = "Amputate", + + ContextMenu_Cauterize = "Cauterize", ContextMenu_Limb_Hand_L = "Left Hand", ContextMenu_Limb_ForeArm_L = "Left forearm",