From f7bd45420b181fe4ed7489c1b8203f75ea3a01b6 Mon Sep 17 00:00:00 2001 From: ZioPao Date: Wed, 15 Nov 2023 19:43:59 +0100 Subject: [PATCH] Fixes --- .../lua/client/TOC/Handlers/PlayerHandler.lua | 21 ++++++++++++++----- .../lua/client/TOC/UI/CutLimbInteractions.lua | 13 ++++++++++-- .../shared/Translate/EN/ContextMenu_EN.txt | 2 +- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/media/lua/client/TOC/Handlers/PlayerHandler.lua b/media/lua/client/TOC/Handlers/PlayerHandler.lua index e0c3010..0b9871c 100644 --- a/media/lua/client/TOC/Handlers/PlayerHandler.lua +++ b/media/lua/client/TOC/Handlers/PlayerHandler.lua @@ -180,22 +180,26 @@ function ISEquipWeaponAction:isValid() -- Both hands are cut off - if not(isPrimaryHandValid and isSecondaryHandValid) then - return false + if not isPrimaryHandValid and not isSecondaryHandValid then + TOC_DEBUG.print("Both hands invalid") + isValid = false end -- Equip primary and no right hand (with no prost) if self.jobType:contains(equipPrimaryText) and not isPrimaryHandValid then TOC_DEBUG.print("Equip primary, no right hand, not valid") - return false + isValid = false end -- Equip secondary and no left hand (with no prost) if self.jobType:contains(equipSecondaryText) and not isSecondaryHandValid then TOC_DEBUG.print("Equip secondary, no left hand, not valid") - return false + isValid = false end end + + TOC_DEBUG.print("isValid to return -> " .. tostring(isValid)) + --print("_________________________________") return isValid end @@ -270,7 +274,14 @@ function ISEquipWeaponAction:performWithAmputation(modDataHandler) local isFirstValid = not modDataHandler:getIsCut(hand) or modDataHandler:getIsProstEquipped(prostGroup) local isSecondValid = not modDataHandler:getIsCut(otherHand) or modDataHandler:getIsProstEquipped(otherProstGroup) - + TOC_DEBUG.print("First Hand: " .. tostring(hand)) + TOC_DEBUG.print("Prost Group: " .. tostring(prostGroup)) + TOC_DEBUG.print("Other Hand: " .. tostring(otherHand)) + TOC_DEBUG.print("Other Prost Group: " .. tostring(otherProstGroup)) + + TOC_DEBUG.print("isPrimaryHandValid: " .. tostring(isFirstValid)) + TOC_DEBUG.print("isSecondaryHandValid: " .. tostring(isSecondValid)) + if isFirstValid then setMethodSecond(self.character, self.item) diff --git a/media/lua/client/TOC/UI/CutLimbInteractions.lua b/media/lua/client/TOC/UI/CutLimbInteractions.lua index d21d066..be8f997 100644 --- a/media/lua/client/TOC/UI/CutLimbInteractions.lua +++ b/media/lua/client/TOC/UI/CutLimbInteractions.lua @@ -78,15 +78,19 @@ local function AddInvAmputationOptions(player, context, sawItem, stitchesItem, b -- Set the correct text option if stitchesItem and bandageItem then + TOC_DEBUG.print("stitches and bandage") text = textAmpStitchBandage - elseif stitchesItem and not bandageItem then + elseif not bandageItem and stitchesItem then + TOC_DEBUG.print("only stitches") text = textAmpStitch - elseif bandageItem and not stitchesItem then + elseif not stitchesItem and bandageItem then + TOC_DEBUG.print("only bandages") text = textAmpBandage else text = textAmp end + TOC_DEBUG.print("Current text " .. tostring(text)) local option = context:addOption(text, nil) local subMenu = context:getNew(context) context:addSubMenu(option, subMenu) @@ -125,6 +129,11 @@ local function AddInventoryAmputationMenu(playerNum, context, items) local stitchesItem = GetStitchesItem(player) local bandageItem = GetBandageItem(player) + + TOC_DEBUG.print("Stitches item: " .. tostring(stitchesItem)) + TOC_DEBUG.print("Bandage item: " .. tostring(bandageItem)) + + --if bandageItem then AddInvAmputationOptions(player, context, sawItem, stitchesItem, bandageItem) --end diff --git a/media/lua/shared/Translate/EN/ContextMenu_EN.txt b/media/lua/shared/Translate/EN/ContextMenu_EN.txt index c6c45d7..8c8af0e 100644 --- a/media/lua/shared/Translate/EN/ContextMenu_EN.txt +++ b/media/lua/shared/Translate/EN/ContextMenu_EN.txt @@ -1,7 +1,7 @@ ContextMenu_EN = { ContextMenu_Amputate = "Amputate", ContextMenu_Amputate_Bandage = "Amputate and bandage", - ContextMenu_Amputate_Stitch_Bandage = "Amputate and stitches", + ContextMenu_Amputate_Stitch = "Amputate and stitches", ContextMenu_Amputate_Stitch_Bandage = "Amputate, stitches and bandage", ContextMenu_Cauterize = "Cauterize",