Skip to content

Commit

Permalink
Movers: Remove support for the vehicle seat, this will be supported b…
Browse files Browse the repository at this point in the history
…y Blizz in the upcoming 10.1.5 patch
  • Loading branch information
funkydude committed Jun 1, 2023
1 parent 619c962 commit 6480b36
Showing 1 changed file with 0 additions and 102 deletions.
102 changes: 0 additions & 102 deletions Movers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,54 +17,6 @@ local options = {
type = "description",
width = "full",
},
moveVehicle = {
order = 5,
name = L.enableObject:format(L["Vehicle Seat"]),
type = "toggle",
width = "full",
confirm = function(info, v)
if not v then
return L.disableWarning
end
end,
get = function()
return mod.db.moveVehicle
end,
set = function(info, v)
mod.db.moveVehicle = v
if v then
mod:EnableVehicleMover()
else
mod.db.lockVehicle = false
mod.db.moverPositions.vehicle = nil
ReloadUI()
end
end,
},
lockVehicle = {
order = 6,
name = L.lockObject:format(L["Vehicle Seat"]),
type = "toggle",
width = "full",
get = function()
return mod.db.lockVehicle
end,
set = function(info, v)
mod.db.lockVehicle = v
if v then
SexyMapVehicleMover:Hide()
else
SexyMapVehicleMover:Show()
end
end,
disabled = function() return not mod.db.moveVehicle end,
},
spacer2 = {
order = 7,
name = " ",
type = "description",
width = "full",
},
moveCaptureBar = {
order = 11,
name = L.enableObject:format(L.pvpCaptureBar),
Expand Down Expand Up @@ -161,8 +113,6 @@ local options = {
function mod:OnInitialize(profile)
if type(profile.movers) ~= "table" or not profile.movers.moverPositions then
profile.movers = {
moveVehicle = false,
lockVehicle = false,
moveCaptureBar = false,
lockCaptureBar = false,
moveTopWidget = false,
Expand All @@ -175,9 +125,6 @@ end

function mod:OnEnable()
sm.core:RegisterModuleOptions("Movers", options, L["Movers"])
if self.db.moveVehicle then
self:EnableVehicleMover()
end
if self.db.moveCaptureBar then
self:EnableCaptureBarMover()
end
Expand All @@ -186,55 +133,6 @@ function mod:OnEnable()
end
end

function mod:EnableVehicleMover()
if SexyMapVehicleMover then return end

local VehicleSeatIndicator = VehicleSeatIndicator

local frame = CreateFrame("Frame", "SexyMapVehicleMover")
if self.db.moverPositions.vehicle then
local tbl = self.db.moverPositions.vehicle
frame:SetPoint(tbl[1], UIParent, tbl[2], tbl[3], tbl[4])
else
frame:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
end
frame:SetSize(100, 100) -- defaults: 128, 128
if self.db.lockVehicle then
frame:Hide()
else
frame:Show()
end
frame:EnableMouse(true)
frame:RegisterForDrag("LeftButton")
frame:SetMovable(true)

local function SetNewPoint(self)
ClearAllPoints(self)
-- TOPRIGHT is our only choice or we'd create SetPoint errors in UIParent.lua
-- Where SetPoint is called by Blizz without performing a ClearAllPoints first
SetPoint(self, "TOPRIGHT", frame, "TOPRIGHT")
end
hooksecurefunc(VehicleSeatIndicator, "SetPoint", SetNewPoint)
SetNewPoint(VehicleSeatIndicator)

frame:SetScript("OnDragStart", function(self) self:StartMoving() end)
frame:SetScript("OnDragStop", function(self)
self:StopMovingOrSizing()
local a, _, b, c, d = self:GetPoint()
mod.db.moverPositions.vehicle = {a, b, c, d}
end)

local bg = frame:CreateTexture()
bg:SetAllPoints(frame)
bg:SetColorTexture(0, 1, 0, 0.3)
bg:Show()

local header = frame:CreateFontString(nil, "OVERLAY", "TextStatusBarText")
header:SetPoint("BOTTOM", frame, "TOP")
header:SetText(L["Vehicle Seat"])
header:Show()
end

function mod:EnableCaptureBarMover()
if SexyMapCaptureBarMover then return end
local UIWidgetBelowMinimapContainerFrame = UIWidgetBelowMinimapContainerFrame
Expand Down

0 comments on commit 6480b36

Please sign in to comment.