v 3 - works??? miracle
This commit is contained in:
+68
-27
@@ -12214,39 +12214,80 @@
|
|||||||
_G.TargetFrame_SetLocked = function()
|
_G.TargetFrame_SetLocked = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Prevent Blizzard from resetting the PlayerFrame position
|
-- Disable Blizzard animation functions
|
||||||
_G.PlayerFrame_ResetUserPlacedPosition = function() end
|
function PlayerFrame_AnimateOut(self)
|
||||||
_G.PlayerFrame_SetLocked = function() end
|
-- Instantly update art without animation
|
||||||
|
PlayerFrame_UpdateArt(self)
|
||||||
|
end
|
||||||
|
|
||||||
-- Function to restore the PlayerFrame position
|
function PlayerFrame_AnimFinished(self)
|
||||||
local function RestorePlayerFramePosition()
|
-- No need for animation sequences, update instantly
|
||||||
local vf = PlayerFrame:GetName()
|
PlayerFrame_UpdateArt(self)
|
||||||
if LeaPlusDB["Frames"] and LeaPlusDB["Frames"][vf] then
|
end
|
||||||
local db = LeaPlusDB["Frames"][vf]
|
|
||||||
if db["Point"] and db["Relative"] and db["XOffset"] and db["YOffset"] then
|
function PlayerFrame_UpdateArt(self)
|
||||||
PlayerFrame:ClearAllPoints()
|
if UnitHasVehicleUI("player") then
|
||||||
PlayerFrame:SetPoint(db["Point"], UIParent, db["Relative"], db["XOffset"], db["YOffset"])
|
PlayerFrame_ToVehicleArt(self, UnitVehicleSkin("player"))
|
||||||
end
|
else
|
||||||
|
PlayerFrame_ToPlayerArt(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Event handler function
|
function PlayerFrame_ToVehicleArt(self, vehicleType)
|
||||||
local function LeaPlus_VehicleFix(self, event, unit)
|
PlayerFrame.state = "vehicle"
|
||||||
if event == "PLAYER_ENTERING_WORLD" then
|
|
||||||
-- Delay 1.5s for entering world
|
UnitFrame_SetUnit(self, "vehicle", PlayerFrameHealthBar, PlayerFrameManaBar)
|
||||||
LibCompat.After(1.5, RestorePlayerFramePosition)
|
UnitFrame_SetUnit(PetFrame, "player", PetFrameHealthBar, PetFrameManaBar)
|
||||||
elseif unit == "player" then
|
PetFrame_Update(PetFrame)
|
||||||
-- Delay 0.3s for vehicle events
|
PlayerFrame_Update()
|
||||||
LibCompat.After(0.3, RestorePlayerFramePosition)
|
BuffFrame_Update()
|
||||||
end
|
ComboFrame_Update()
|
||||||
|
|
||||||
|
PlayerFrameTexture:Hide()
|
||||||
|
PlayerFrameVehicleTexture:SetTexture(
|
||||||
|
vehicleType == "Natural" and "Interface\\Vehicles\\UI-Vehicle-Frame-Organic" or "Interface\\Vehicles\\UI-Vehicle-Frame"
|
||||||
|
)
|
||||||
|
PlayerFrameVehicleTexture:Show()
|
||||||
|
|
||||||
|
PlayerFrameHealthBar:SetWidth(100)
|
||||||
|
PlayerFrameHealthBar:SetPoint("TOPLEFT", 119, -41)
|
||||||
|
PlayerFrameManaBar:SetWidth(100)
|
||||||
|
PlayerFrameManaBar:SetPoint("TOPLEFT", 119, -52)
|
||||||
|
|
||||||
|
PlayerName:SetPoint("CENTER", 50, 23)
|
||||||
|
PlayerLeaderIcon:SetPoint("TOPLEFT", 40, -12)
|
||||||
|
PlayerMasterIcon:SetPoint("TOPLEFT", 86, 0)
|
||||||
|
PlayerFrameGroupIndicator:SetPoint("BOTTOMLEFT", PlayerFrame, "TOPLEFT", 97, -13)
|
||||||
|
PlayerFrameBackground:SetWidth(114)
|
||||||
|
PlayerLevelText:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
function PlayerFrame_ToPlayerArt(self)
|
||||||
|
PlayerFrame.state = "player"
|
||||||
|
|
||||||
|
UnitFrame_SetUnit(self, "player", PlayerFrameHealthBar, PlayerFrameManaBar)
|
||||||
|
UnitFrame_SetUnit(PetFrame, "pet", PetFrameHealthBar, PetFrameManaBar)
|
||||||
|
PetFrame_Update(PetFrame)
|
||||||
|
PlayerFrame_Update()
|
||||||
|
BuffFrame_Update()
|
||||||
|
ComboFrame_Update()
|
||||||
|
|
||||||
|
PlayerFrameTexture:Show()
|
||||||
|
PlayerFrameVehicleTexture:Hide()
|
||||||
|
|
||||||
|
PlayerFrameHealthBar:SetWidth(119)
|
||||||
|
PlayerFrameHealthBar:SetPoint("TOPLEFT", 106, -41)
|
||||||
|
PlayerFrameManaBar:SetWidth(119)
|
||||||
|
PlayerFrameManaBar:SetPoint("TOPLEFT", 106, -52)
|
||||||
|
|
||||||
|
PlayerName:SetPoint("CENTER", 50, 19)
|
||||||
|
PlayerLeaderIcon:SetPoint("TOPLEFT", 40, -12)
|
||||||
|
PlayerMasterIcon:SetPoint("TOPLEFT", 80, -10)
|
||||||
|
PlayerFrameGroupIndicator:SetPoint("BOTTOMLEFT", PlayerFrame, "TOPLEFT", 97, -20)
|
||||||
|
PlayerFrameBackground:SetWidth(119)
|
||||||
|
PlayerLevelText:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Create a frame to listen for events
|
|
||||||
local LeaPlusVehicleFrame = CreateFrame("Frame")
|
|
||||||
LeaPlusVehicleFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
|
||||||
LeaPlusVehicleFrame:RegisterEvent("UNIT_ENTERED_VEHICLE")
|
|
||||||
LeaPlusVehicleFrame:RegisterEvent("UNIT_EXITED_VEHICLE")
|
|
||||||
LeaPlusVehicleFrame:SetScript("OnEvent", LeaPlus_VehicleFix)
|
|
||||||
|
|
||||||
|
|
||||||
-- Create frame table (used for local traversal)
|
-- Create frame table (used for local traversal)
|
||||||
|
|||||||
Reference in New Issue
Block a user