Fix unequip prosthesis for b42
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user