WoWInterface SVN StellarBars

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 22 to Rev 23
    Reverse comparison

Rev 22 → Rev 23

trunk/StellarBars/StellarBars.toc
2,7 → 2,7
## 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
 
trunk/StellarBars/StellarBars.lua
12,10 → 12,10
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
83,18 → 83,36
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
112,7 → 130,7
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
308,7 → 326,7
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
450,11 → 468,9
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)
 
481,7 → 497,7
self.ADDON_LOADED = nil
end
 
local StellarBarsDD, mainmover, sidemover
local StellarBarsDD, mainmover, sidemover, Set
local info = { }
local offsetvalue, offsetcount, lastb
function StellarBars.ShowOptions(a1)
500,7 → 516,7
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
537,7 → 553,7
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
551,7 → 567,7
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.")
734,4 → 750,19
end
end
ToggleDropDownMenu(1, nil, StellarBarsDD, "cursor")
end
\ No newline at end of file +end + +CONFIGMODE_CALLBACKS = CONFIGMODE_CALLBACKS or {} +CONFIGMODE_CALLBACKS.StellarBars = function(action, mode) + if action == "ON" then + if not StellarBarsDD then + StellarBars.ShowOptions() + ToggleDropDownMenu(1, nil, StellarBarsDD, "cursor") + end + if StellarBarsDD and not StellarBars.unlock then + Set(nil, "unlock") + end + elseif action == "OFF" and StellarBarsDD and StellarBars.unlock then + Set(nil, "unlock") + end +end