mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- maybe fix some vehicle issues in ulduar
This commit is contained in:
14
IceHUD.lua
14
IceHUD.lua
@ -851,3 +851,17 @@ function IceHUD:Clamp(value, min, max)
|
|||||||
|
|
||||||
return value
|
return value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function IceHUD:ShouldSwapToVehicle(...)
|
||||||
|
local arg1, arg2 = ...
|
||||||
|
|
||||||
|
if (arg1 == "player") then
|
||||||
|
if (arg2) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if (UnitHasVehicleUI("player")) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@ -309,8 +309,8 @@ function CastBar.prototype:Enable(core)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function CastBar.prototype:EnteringVehicle(unit)
|
function CastBar.prototype:EnteringVehicle(unit, arg2)
|
||||||
if (unit == "player") then
|
if (self.unit == "player" and IceHUD:ShouldSwapToVehicle(unit, arg2)) then
|
||||||
self.unit = "vehicle"
|
self.unit = "vehicle"
|
||||||
self:Update(self.unit)
|
self:Update(self.unit)
|
||||||
end
|
end
|
||||||
@ -318,7 +318,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function CastBar.prototype:ExitingVehicle(unit)
|
function CastBar.prototype:ExitingVehicle(unit)
|
||||||
if (unit == "player") then
|
if (unit == "player" and self.unit == "vehicle") then
|
||||||
self.unit = "player"
|
self.unit = "player"
|
||||||
self:Update(self.unit)
|
self:Update(self.unit)
|
||||||
end
|
end
|
||||||
|
@ -673,8 +673,8 @@ function PlayerHealth.prototype:GetOptions()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function PlayerHealth.prototype:EnteringVehicle(unit)
|
function PlayerHealth.prototype:EnteringVehicle(unit, arg2)
|
||||||
if (unit == "player") then
|
if (self.unit == "player" and IceHUD:ShouldSwapToVehicle(unit, arg2)) then
|
||||||
self.unit = "vehicle"
|
self.unit = "vehicle"
|
||||||
self:RegisterFontStrings()
|
self:RegisterFontStrings()
|
||||||
self:Update(self.unit)
|
self:Update(self.unit)
|
||||||
@ -683,7 +683,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function PlayerHealth.prototype:ExitingVehicle(unit)
|
function PlayerHealth.prototype:ExitingVehicle(unit)
|
||||||
if (unit == "player") then
|
if (unit == "player" and self.unit == "vehicle") then
|
||||||
self.unit = "player"
|
self.unit = "player"
|
||||||
self:RegisterFontStrings()
|
self:RegisterFontStrings()
|
||||||
self:Update(self.unit)
|
self:Update(self.unit)
|
||||||
|
@ -142,8 +142,8 @@ function PlayerMana.prototype:SetupOnUpdate(enable)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function PlayerMana.prototype:EnteringVehicle(unit)
|
function PlayerMana.prototype:EnteringVehicle(unit, arg2)
|
||||||
if (unit == "player") then
|
if (self.unit == "player" and IceHUD:ShouldSwapToVehicle(unit, arg2)) then
|
||||||
self.unit = "vehicle"
|
self.unit = "vehicle"
|
||||||
self:RegisterFontStrings()
|
self:RegisterFontStrings()
|
||||||
self:Update(self.unit)
|
self:Update(self.unit)
|
||||||
@ -152,7 +152,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function PlayerMana.prototype:ExitingVehicle(unit)
|
function PlayerMana.prototype:ExitingVehicle(unit)
|
||||||
if (unit == "player") then
|
if (unit == "player" and self.unit == "vehicle") then
|
||||||
self.unit = "player"
|
self.unit = "player"
|
||||||
self:RegisterFontStrings()
|
self:RegisterFontStrings()
|
||||||
self:Update(self.unit)
|
self:Update(self.unit)
|
||||||
|
Reference in New Issue
Block a user