/
## Title: StellarBars |
## Notes: Adds a new look and some options to the default action bars. |
## Author: TotalPackage |
## Version: 3.2.003 |
## Version: 3.2.004 |
## SavedVariables: StellarBarsDB |
local _G = getfenv(0) |
local MainMenuBar, VehicleMenuBar = MainMenuBar, VehicleMenuBar |
local MultiBarBottomLeft, MultiBarBottomRight, MultiBarLeft, MultiBarRight = MultiBarBottomLeft, MultiBarBottomRight, MultiBarLeft, MultiBarRight |
local ShapeshiftBarFrame, PetActionBarFrame = ShapeshiftBarFrame, PetActionBarFrame |
local ShapeshiftBarFrame, PetActionBarFrame, PetActionButton1 = ShapeshiftBarFrame, PetActionBarFrame, PetActionButton1 |
local MainMenuExpBar = MainMenuExpBar |
local ReputationWatchBar, ReputationWatchStatusBar, ReputationWatchStatusBarText = ReputationWatchBar, ReputationWatchStatusBar, ReputationWatchStatusBarText |
local GetNumShapeshiftForms, InCombatLockdown, PetActionBar_UpdatePositionValues = GetNumShapeshiftForms, InCombatLockdown, PetActionBar_UpdatePositionValues |
local GetNumShapeshiftForms, InCombatLockdown = GetNumShapeshiftForms, InCombatLockdown |
local IsUsableAction, IsActionInRange, HasAction = IsUsableAction, IsActionInRange, HasAction |
local oSetPoint, oSetVertexColor = MainMenuBar.SetPoint, ActionButton1Icon.SetVertexColor |
local MainMenuBarArtFrame = MainMenuBarArtFrame |
end |
self.stelap = e |
end |
local function updatepetbar(fromconfig) |
if InCombatLockdown() or db.mainx == 0 then return end |
if fromconfig == 3 then |
local PETACTIONBAR_XPOS = 36 |
local function updatepetbar() |
if InCombatLockdown() then |
return self:RegisterEvent("PLAYER_REGEN_ENABLED") |
elseif db.mainx == 0 then |
return |
end |
if PetActionBarFrame:IsShown() then |
UIParent_ManageFramePositions() |
PETACTIONBAR_XPOS = _G.PETACTIONBAR_XPOS |
else |
if PetActionBarFrame_IsAboveShapeshift(true) then |
PETACTIONBAR_XPOS = 36 |
elseif MainMenuBarVehicleLeaveButton and MainMenuBarVehicleLeaveButton:IsShown() then |
PETACTIONBAR_XPOS = MainMenuBarVehicleLeaveButton:GetRight() + 20 |
elseif ShapeshiftBarFrame and GetNumShapeshiftForms() > 0 then |
PETACTIONBAR_XPOS = _G["ShapeshiftButton"..GetNumShapeshiftForms()]:GetRight() + 20 |
elseif MultiCastActionBarFrame and HasMultiCastActionBar() then |
PETACTIONBAR_XPOS = MultiCastActionBarFrame:GetRight() + 20 |
else |
PETACTIONBAR_XPOS = 36 |
end |
end |
if PETACTIONBAR_XPOS ~= 36 then |
PetActionButton1:SetPoint("BOTTOMLEFT", PetActionBarFrame, "BOTTOMLEFT", 36 + PETACTIONBAR_XPOS - PetActionBarFrame:GetLeft(), 2) |
PetActionButton1:SetPoint("BOTTOMLEFT", PetActionBarFrame, "BOTTOMLEFT", 36 - MainMenuBar:GetLeft(), 2) |
else |
PetActionButton1:SetPoint("BOTTOMLEFT", PetActionBarFrame, "BOTTOMLEFT", 36, 2) |
end |
end |
local function UpdatePositions(fromconfig) |
local function UpdatePositions() |
if InCombatLockdown() then |
return self:RegisterEvent("PLAYER_REGEN_ENABLED") |
else |
local adj = ((mainexpshown and repshown) and 22) or (((mainexpshown or repshown) and 13)) or 8 |
MainMenuBarArtFrame:SetPoint("TOPLEFT", MainMenuBar, "TOPLEFT", 0, adj) |
MainMenuBarArtFrame:SetPoint("BOTTOMRIGHT", MainMenuBar, "BOTTOMRIGHT", 0, adj) |
updatepetbar(fromconfig) |
updatepetbar() |
end |
local function UpdateLook() |
if InCombatLockdown() then return end |
end |
handlebag = nil |
for _,value in pairs(buttons) do |
for _, value in pairs(buttons) do |
for i = 0, 12, 1 do |
local butt = _G[format(value, i)] |
if butt then |
hooksecurefunc(MainMenuBar, "SetPoint", UpdatePositions) |
hooksecurefunc(MultiBarRight, "SetPoint", UpdatePositions) |
hooksecurefunc("InterfaceOptionsFrameOkay_OnClick", UpdatePositions) |
PetActionBarFrame:EnableMouse(false) |
hooksecurefunc(PetActionBarFrame, "SetPoint", updatepetbar) |
StellarMiscBG:RegisterForClicks("RightButtonUp") |
StellarMiscBG:SetScript("OnClick", self.ShowOptions) |
self.ADDON_LOADED = nil |
end |
local StellarBarsDD, mainmover, sidemover |
local StellarBarsDD, mainmover, sidemover, Set |
local info = { } |
local offsetvalue, offsetcount, lastb |
function StellarBars.ShowOptions(a1) |
CloseDropDownMenus(b:GetParent():GetID()) |
ToggleDropDownMenu(b:GetParent():GetID(), tb.value, nil, nil, nil, nil, tb.menuList, tb) |
end |
local function Set(b, a1, a2) |
Set = function(b, a1, a2) |
if not a1 then return end |
if (a1 == "less" or a1 == "more") and lastb then |
local off = (a1 == "less" and -8) or 8 |
local nx, ny = this.p:GetCenter() |
db[this.which.."x"] = floor(0.5 + db[this.which.."x"] + (nx - this.px)*db.scale) |
db[this.which.."y"] = floor(0.5 + db[this.which.."y"] + (ny - this.py)*db.scale) |
UpdatePositions(3) |
UpdatePositions() |
end) |
return mm |
end |
sidemover[StellarBars.unlock and "Show" or "Hide"](sidemover) |
elseif a1 == "resetpos" then |
db.mainx, db.mainy, db.sidex, db.sidey = 0, 0, 0, 0 |
UpdatePositions(3) |
UpdatePositions() |
else |
db[a1] = not db[a1] |
print("|cff00ff00StellarBars|r: This setting may require a reload to take effect.") |
end |
end |
ToggleDropDownMenu(1, nil, StellarBarsDD, "cursor") |
end |