This commit is contained in:
ZioPao
2024-03-21 03:37:50 +01:00
parent 3fb22a9b1e
commit 7a7e90dd7d
4 changed files with 43 additions and 48 deletions

View File

@@ -35,14 +35,14 @@ end
---Main function to delete a clothing item
---@param playerObj IsoPlayer
---@param clothingItem InventoryItem?
---@param clothingItem InventoryItem
---@return boolean
---@private
function ItemsController.Player.RemoveClothingItem(playerObj, clothingItem)
if clothingItem and instanceof(clothingItem, "InventoryItem") then
playerObj:removeWornItem(clothingItem)
playerObj:getInventory():Remove(clothingItem) -- Can be a InventoryItem too.. I guess? todo check it
playerObj:getInventory():Remove(clothingItem) -- Umbrella is wrong, can be an InventoryItem too
TOC_DEBUG.print("found and deleted" .. tostring(clothingItem))
-- Reset model
@@ -76,6 +76,12 @@ end
---@param playerObj IsoPlayer
function ItemsController.Player.DeleteAllOldAmputationItems(playerObj)
-- This part is a workaround for a pretty shitty implementation on the java side. Check ProsthesisHandler for more infos
-- FIX This doesn't really help in this case.
local group = BodyLocations.getGroup("Human")
group:setMultiItem("TOC_Arm", false)
group:setMultiItem("TOC_ArmProst", false)
for i=1, #StaticData.LIMBS_STR do
local limbName = StaticData.LIMBS_STR[i]
local clothItemName = StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. limbName
@@ -84,6 +90,8 @@ function ItemsController.Player.DeleteAllOldAmputationItems(playerObj)
ItemsController.Player.RemoveClothingItem(playerObj, clothItem)
end
group:setMultiItem("TOC_Arm", true)
group:setMultiItem("TOC_ArmProst", true)
-- Reset model just in case
playerObj:resetModelNextFrame()
end

View File

@@ -225,37 +225,4 @@ function ISInventoryPaneContextMenu.doEquipOption(context, playerObj, isWeapon,
end
end
end
-- local og_ISInventoryPaneContextMenu_doClothingItemExtraMenu = ISInventoryPaneContextMenu.doClothingItemExtraMenu
-- ---@param context ISContextMenu
-- ---@param clothingItemExtra any
-- ---@param playerObj IsoPlayer
-- function ISInventoryPaneContextMenu.doClothingItemExtraMenu(context, clothingItemExtra, playerObj)
-- og_ISInventoryPaneContextMenu_doClothingItemExtraMenu(context, clothingItemExtra, playerObj)
-- -- local dc = DataController.GetInstance(playerObj:getUsername())
-- -- local text = getText("ContextMenu_InstallProstRight")
-- -- local rightOpt = context:getOptionFromName(text)
-- -- if rightOpt then
-- -- -- check if can be equipped
-- -- rightOpt.notAvailable = dc:getIsAnyLimbCut() and not dc:getIsCut("UpperArm_R")
-- -- end
-- -- text = getText("ContextMenu_InstallProstLeft")
-- -- local leftOpt = context:getOptionFromName(text)
-- -- if leftOpt then
-- -- leftOpt.notAvailable = dc:getIsAnyLimbCut() and not dc:getIsCut("UpperArm_L")
-- -- end
-- -- Check if in context there are the options for the prosts
-- end
-- -- TODO IMPORTANT!!!! ADD LIMIT FOR UPPER ARM AND WHEN YOU DON'T HAVE AMPUTATIONS FOR PROSTHETITCSmhh
end