WoWInterface SVN StellarBars

Compare Revisions

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

Rev 23 → Rev 22

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.004
## Version: 3.2.003
 
## 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, PetActionButton1 = ShapeshiftBarFrame, PetActionBarFrame, PetActionButton1
local ShapeshiftBarFrame, PetActionBarFrame = ShapeshiftBarFrame, PetActionBarFrame
local MainMenuExpBar = MainMenuExpBar
local ReputationWatchBar, ReputationWatchStatusBar, ReputationWatchStatusBarText = ReputationWatchBar, ReputationWatchStatusBar, ReputationWatchStatusBarText
local GetNumShapeshiftForms, InCombatLockdown = GetNumShapeshiftForms, InCombatLockdown
local GetNumShapeshiftForms, InCombatLockdown, PetActionBar_UpdatePositionValues = GetNumShapeshiftForms, InCombatLockdown, PetActionBar_UpdatePositionValues
local IsUsableAction, IsActionInRange, HasAction = IsUsableAction, IsActionInRange, HasAction
local oSetPoint, oSetVertexColor = MainMenuBar.SetPoint, ActionButton1Icon.SetVertexColor
local MainMenuBarArtFrame = MainMenuBarArtFrame
83,36 → 83,18
end
self.stelap = e
end
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
local function updatepetbar(fromconfig)
if InCombatLockdown() or db.mainx == 0 then return end
if fromconfig == 3 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 - MainMenuBar:GetLeft(), 2)
PetActionButton1:SetPoint("BOTTOMLEFT", PetActionBarFrame, "BOTTOMLEFT", 36 + PETACTIONBAR_XPOS - PetActionBarFrame:GetLeft(), 2)
else
PetActionButton1:SetPoint("BOTTOMLEFT", PetActionBarFrame, "BOTTOMLEFT", 36, 2)
end
end
local function UpdatePositions()
local function UpdatePositions(fromconfig)
if InCombatLockdown() then
return self:RegisterEvent("PLAYER_REGEN_ENABLED")
else
130,7 → 112,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()
updatepetbar(fromconfig)
end
local function UpdateLook()
if InCombatLockdown() then return end
326,7 → 308,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
468,9 → 450,11
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)
 
497,7 → 481,7
self.ADDON_LOADED = nil
end
 
local StellarBarsDD, mainmover, sidemover, Set
local StellarBarsDD, mainmover, sidemover
local info = { }
local offsetvalue, offsetcount, lastb
function StellarBars.ShowOptions(a1)
516,7 → 500,7
CloseDropDownMenus(b:GetParent():GetID())
ToggleDropDownMenu(b:GetParent():GetID(), tb.value, nil, nil, nil, nil, tb.menuList, tb)
end
Set = function(b, a1, a2)
local function Set(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
553,7 → 537,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()
UpdatePositions(3)
end)
return mm
end
567,7 → 551,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()
UpdatePositions(3)
else
db[a1] = not db[a1]
print("|cff00ff00StellarBars|r: This setting may require a reload to take effect.")
750,19 → 734,4
end
end
ToggleDropDownMenu(1, nil, StellarBarsDD, "cursor")
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
end
\ No newline at end of file