This commit is contained in:
ZioPao
2023-11-15 19:43:59 +01:00
parent c4f6890dd0
commit f7bd45420b
3 changed files with 28 additions and 8 deletions

View File

@@ -180,22 +180,26 @@ function ISEquipWeaponAction:isValid()
-- Both hands are cut off -- Both hands are cut off
if not(isPrimaryHandValid and isSecondaryHandValid) then if not isPrimaryHandValid and not isSecondaryHandValid then
return false TOC_DEBUG.print("Both hands invalid")
isValid = false
end end
-- Equip primary and no right hand (with no prost) -- Equip primary and no right hand (with no prost)
if self.jobType:contains(equipPrimaryText) and not isPrimaryHandValid then if self.jobType:contains(equipPrimaryText) and not isPrimaryHandValid then
TOC_DEBUG.print("Equip primary, no right hand, not valid") TOC_DEBUG.print("Equip primary, no right hand, not valid")
return false isValid = false
end end
-- Equip secondary and no left hand (with no prost) -- Equip secondary and no left hand (with no prost)
if self.jobType:contains(equipSecondaryText) and not isSecondaryHandValid then if self.jobType:contains(equipSecondaryText) and not isSecondaryHandValid then
TOC_DEBUG.print("Equip secondary, no left hand, not valid") TOC_DEBUG.print("Equip secondary, no left hand, not valid")
return false isValid = false
end end
end end
TOC_DEBUG.print("isValid to return -> " .. tostring(isValid))
--print("_________________________________")
return isValid return isValid
end end
@@ -270,7 +274,14 @@ function ISEquipWeaponAction:performWithAmputation(modDataHandler)
local isFirstValid = not modDataHandler:getIsCut(hand) or modDataHandler:getIsProstEquipped(prostGroup) local isFirstValid = not modDataHandler:getIsCut(hand) or modDataHandler:getIsProstEquipped(prostGroup)
local isSecondValid = not modDataHandler:getIsCut(otherHand) or modDataHandler:getIsProstEquipped(otherProstGroup) 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 if isFirstValid then
setMethodSecond(self.character, self.item) setMethodSecond(self.character, self.item)

View File

@@ -78,15 +78,19 @@ local function AddInvAmputationOptions(player, context, sawItem, stitchesItem, b
-- Set the correct text option -- Set the correct text option
if stitchesItem and bandageItem then if stitchesItem and bandageItem then
TOC_DEBUG.print("stitches and bandage")
text = textAmpStitchBandage text = textAmpStitchBandage
elseif stitchesItem and not bandageItem then elseif not bandageItem and stitchesItem then
TOC_DEBUG.print("only stitches")
text = textAmpStitch text = textAmpStitch
elseif bandageItem and not stitchesItem then elseif not stitchesItem and bandageItem then
TOC_DEBUG.print("only bandages")
text = textAmpBandage text = textAmpBandage
else else
text = textAmp text = textAmp
end end
TOC_DEBUG.print("Current text " .. tostring(text))
local option = context:addOption(text, nil) local option = context:addOption(text, nil)
local subMenu = context:getNew(context) local subMenu = context:getNew(context)
context:addSubMenu(option, subMenu) context:addSubMenu(option, subMenu)
@@ -125,6 +129,11 @@ local function AddInventoryAmputationMenu(playerNum, context, items)
local stitchesItem = GetStitchesItem(player) local stitchesItem = GetStitchesItem(player)
local bandageItem = GetBandageItem(player) local bandageItem = GetBandageItem(player)
TOC_DEBUG.print("Stitches item: " .. tostring(stitchesItem))
TOC_DEBUG.print("Bandage item: " .. tostring(bandageItem))
--if bandageItem then --if bandageItem then
AddInvAmputationOptions(player, context, sawItem, stitchesItem, bandageItem) AddInvAmputationOptions(player, context, sawItem, stitchesItem, bandageItem)
--end --end

View File

@@ -1,7 +1,7 @@
ContextMenu_EN = { ContextMenu_EN = {
ContextMenu_Amputate = "Amputate", ContextMenu_Amputate = "Amputate",
ContextMenu_Amputate_Bandage = "Amputate and bandage", 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_Amputate_Stitch_Bandage = "Amputate, stitches and bandage",
ContextMenu_Cauterize = "Cauterize", ContextMenu_Cauterize = "Cauterize",