diff --git a/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua b/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua index da37c9f..8e38b43 100644 --- a/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua +++ b/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua @@ -1,5 +1,7 @@ local ProsthesisHandler = require("TOC/Handlers/ProsthesisHandler") -- declared in common local OverridenMethodsArchive = require("TOC/OverridenMethodsArchive") +local CommonMethods = require("TOC/CommonMethods") +local CachedDataHandler = require("TOC/Handlers/CachedDataHandler") -- FIX in B42 for some reason unequipping prosthesis doesn't work. Still not sure why @@ -23,10 +25,19 @@ end local og_ISUnequipAction_complete = ISUnequipAction.complete function ISUnequipAction:complete() - TOC_DEBUG.print("ISUnequipAction:complete") - TOC_DEBUG.print(self.item:getFullType()) - self.character:removeWornItem(self.item) + local isProst = ProsthesisHandler.SearchAndSetupProsthesis(self.item, false) + local group + if isProst then + group = BodyLocations.getGroup("Human") + group:setMultiItem("TOC_ArmProst", false) + end og_ISUnequipAction_complete(self) + if isProst then + group:setMultiItem("TOC_ArmProst", true) + end + + -- TODO RUN WORKAROUND FOR MULTI ITEM HERE!!!! + end \ No newline at end of file diff --git a/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua b/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua index d23c7ca..1787794 100644 --- a/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua +++ b/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua @@ -177,7 +177,6 @@ function ISUnequipAction:perform() -- This could break if amputated limbs aren't cached for some reason triggerEvent("OnProsthesisUnequipped", hal) end - end end end diff --git a/common/media/lua/client/TOC/UI/HealthPanel.lua b/common/media/lua/client/TOC/UI/HealthPanel.lua index 4df7d72..3a7e5dd 100644 --- a/common/media/lua/client/TOC/UI/HealthPanel.lua +++ b/common/media/lua/client/TOC/UI/HealthPanel.lua @@ -10,10 +10,21 @@ local WoundCleaningInteractionHandler = require("TOC/UI/Interactions/WoundCleani local isReady = false + +local xMod, yMod + +if luautils.stringStarts(StaticData.GAME_VERSION, "41") then + xMod = 0 + yMod = 0 +else + xMod = 5 + yMod = 9 +end + + function SetHealthPanelTOC() -- depending on compatibility - isReady = true end @@ -101,19 +112,6 @@ function ISHealthPanel:tryDrawAmputation(highestAmputations, side, username) local sexPl = self.character:isFemale() and "Female" or "Male" texture = StaticData.HEALTH_PANEL_TEXTURES[sexPl][limbName] end - - - - local xMod, yMod - - if luautils.stringStarts(StaticData.GAME_VERSION, "41") then - xMod = 0 - yMod = 0 - else - xMod = 5 - yMod = 9 - end - -- B42, for some reason the positioning of the texture changed. Realigned it manually with those fixed values self:drawTexture(texture, self.healthPanel.x - xMod, self.healthPanel.y - yMod, 1, redColor, 0, 0) end @@ -121,7 +119,7 @@ function ISHealthPanel:tryDrawProsthesis(highestAmputations, side, username) local dc = DataController.GetInstance(username) -- TODO CACHE PROSTHESIS!!! Don't use DC here local limbName = highestAmputations[side] if limbName and dc:getIsProstEquipped(limbName) then - self:drawTexture(StaticData.HEALTH_PANEL_TEXTURES.ProstArm[side], self.healthPanel.x, self.healthPanel.y, 1, 1, 1, 1) + self:drawTexture(StaticData.HEALTH_PANEL_TEXTURES.ProstArm[side], self.healthPanel.x - xMod, self.healthPanel.y - yMod, 1, 1, 1, 1) end end