/
## Interface: 30200 |
## Interface: 30300 |
## Title: StellarBars |
## Notes: Adds a new look and some options to the default action bars. |
## Author: TotalPackage |
## Version: 3.2.004 |
## Version: 3.3.001 |
## SavedVariables: StellarBarsDB |
## SavedVariablesPerCharacter: StellarBarsCharDB |
## OptionalDeps: LibSharedMedia-3.0, ButtonFacade, LibButtonFacade |
## X-Embeds: LibSharedMedia-3.0 |
self:UnregisterEvent("ADDON_LOADED") |
StellarBarsDB = StellarBarsDB or {} |
db = (StellarBarsDB.profiles and StellarBarsDB.profiles.Default) or StellarBarsDB |
db = StellarBarsCharDB or (StellarBarsDB.profiles and StellarBarsDB.profiles.Default) or StellarBarsDB |
if db.dbinit ~= 1 then |
db.dbinit = nil |
for k,v in pairs({ |
UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarBottomLeft"] = nil |
UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarRight"] = nil |
if select(4, GetAddOnInfo("Titan")) then |
local function SetUserPlaced() return true end |
MainMenuBar.SetUserPlaced = SetUserPlaced |
MultiBarRight.SetUserPlaced = SetUserPlaced |
VehicleMenuBar.SetUserPlaced = SetUserPlaced |
end |
FullAdjust(MainMenuExpBar, "TOP", MainMenuBarArtFrame, "BOTTOM") |
FullAdjust(MultiBarBottomLeft, "BOTTOMLEFT", MainMenuBarArtFrame, "TOPLEFT", 8, -7) |
FullAdjust(MultiBarBottomRight, "BOTTOMRIGHT", MainMenuBarArtFrame, "TOPRIGHT", -4, -7) |
-- hack vehicle bar so that it is positioned relative to MainMenuBar |
VehicleMenuBar:SetPoint("BOTTOMLEFT", MainMenuBar, "BOTTOMLEFT", 27, 0) |
VehicleMenuBar:SetPoint("BOTTOMRIGHT", MainMenuBar, "BOTTOMRIGHT", -27, 0) |
local vskin, vskinpitch = "", "" |
local function adjvehicleskin(this) |
if not this then return end |
local p, rt, rp, x, y = this:GetPoint() |
oSetPoint(this, p, rt, rp, x + (970 - VehicleMenuBar:GetWidth()), y) |
end |
end |
local function UpdateVehicleSkins() |
local function UpdateVehicleSkins(skinName, pitchVisible) |
if vskin == skinName and vskinpitch == pitchVisible then return end |
vskin, vskinpitch = skinName, pitchVisible |
for i = 1, 4, 1 do |
adjvehicleskin(_G["VehicleMenuBarArtFrameBACKGROUND"..i]) |
end |
elseif a1 == "resetpos" then |
db.mainx, db.mainy, db.sidex, db.sidey = 0, 0, 0, 0 |
UpdatePositions() |
elseif a1 == "perchar" then |
if StellarBarsCharDB then |
StellarBarsCharDB = nil |
else |
StellarBarsCharDB = db |
end |
ReloadUI() |
else |
db[a1] = not db[a1] |
print("|cff00ff00StellarBars|r: This setting may require a reload to take effect.") |
info.func = Set |
if value == "unlock" then |
info.checked = StellarBars.unlock |
elseif value == "perchar" then |
info.checked = StellarBarsCharDB and true |
else |
info.checked = db[value] |
end |
if lbf then |
AddList(level, "Skin", "skin") |
end |
info.hasColorSwatch = true |
info.hasOpacity = 1 |
info.r, info.g, info.b, info.opacity = db.r, db.g, db.b, 1 - (db.a or 1) |
info.value = "bgcolor" |
info.func = UIDropDownMenuButton_OpenColorPicker |
AddButton(level, "Backdrop Color", nil) |
AddList(level, "Exp. Texture", "texture") |
AddList(level, "Button Font", "font") |
AddToggle(level, "Out-of-Range Coloring", "oor") |
AddToggle(level, "Right-Click Self-Cast", "selfcast") |
AddToggle(level, "Reset Positions", "resetpos") |
AddList(level, "More", "more") |
AddToggle(level, "Unlock", "unlock") |
elseif level == 2 then |
local sub = UIDROPDOWNMENU_MENU_VALUE |
AddFakeSlider(level, sub, 0.3, 2, 0.02) |
elseif sub == "alpha" then |
AddFakeSlider(level, sub, 0, 1, 0.1) |
elseif sub == "more" then |
AddToggle(level, "Out-of-Range Coloring", "oor") |
AddToggle(level, "Right-Click Self-Cast", "selfcast") |
AddToggle(level, "Reset Positions", "resetpos") |
AddToggle(level, "Save Per Character", "perchar") |
end |
end |
end |