WoWInterface SVN TipTop

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/TipTop
    from Rev 41 to Rev 42
    Reverse comparison

Rev 41 → Rev 42

TipTop.toc
2,8 → 2,9
## Name: TipTop
## Author: Seerah
## Notes: Tooltip enhancement
## Version: 1.8.9
## Version: 1.9
## SavedVariables: TipTopDB
## SavedVariablesPerCharacter: TipTopPCDB
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets
 
Libs\LibStub\LibStub.lua
TipTopOptions.lua
9,38 → 9,72
local formats = {"100/100", "100%", "100/100 (100%)"}
 
local defaults = {
profile = {
alpha = 1,
scale = 1,
font = "Friz Quadrata TT",
bg = "brushed",
bgColor = {r=.09, g=.09, b=.19}, --TOOLTIP_DEFAULT_BACKGROUND_COLOR
border = "Seerah Solid",
borderWidth = 2.5,
inset = 0,
classColor = true,
itemColor = true,
borderColor = {r=.6, g=.6, b=.6, a=1},
healthBar = "TipTop Default",
sbarbg = "TipTop Default",
sbarbgcolor = {r=0, g=0, b=0, a=.4},
topBar = false,
raidIconSize = 16,
raidIconPosition = "TOP",
raidIconX = "0",
raidIconY = "0",
onCursor = false,
anchor = "BOTTOMRIGHT",
offsetX = "-2",
offsetY = "109",
showTargetText = true,
you = true,
showTalentText = true,
healthText = true,
textformat = "100%",
},
alpha = 1,
scale = 1,
font = "Friz Quadrata TT",
bg = "brushed",
bgColor = {r=.09, g=.09, b=.19}, --TOOLTIP_DEFAULT_BACKGROUND_COLOR
border = "Seerah Solid",
borderWidth = 2.5,
inset = 0,
classColor = true,
itemColor = true,
borderColor = {r=.6, g=.6, b=.6, a=1},
healthBar = "TipTop Default",
sbarbg = "TipTop Default",
sbarbgcolor = {r=0, g=0, b=0, a=.4},
topBar = false,
raidIconSize = 16,
raidIconPosition = "TOP",
raidIconX = "0",
raidIconY = "0",
onCursor = false,
anchor = "BOTTOMRIGHT",
offsetX = "-2",
offsetY = "109",
showTargetText = true,
you = true,
showTalentText = true,
healthText = true,
textformat = "100%",
}
 
 
local function SetUpDB()
if TipTopPCDB.charSpec then
--set defaults if new charSpec DB
for k,v in pairs(defaults) do
if type(TipTopPCDB[k]) == "nil" then
TipTopPCDB[k] = v
end
end
db = TipTopPCDB
else
db = TipTopDB
end
end
 
local function ConfirmProfilePopup()
if not StaticPopupDialogs["TIPTOP_PROFILE"] then
StaticPopupDialogs["TIPTOP_PROFILE"] = {
text = "Are you sure you want to change your profile and reload your UI?",
button1 = "Yes",
button2 = "No",
OnAccept = function() ReloadUI() end,
OnCancel = function()
TipTopPCDB.charSpec = not TipTopPCDB.charSpec
LibStub("AceConfigRegistry-3.0"):NotifyChange("TipTop")
print("Your profile switch has been cancelled.")
end,
timeout = 0,
whileDead = 1,
hideOnEscape = 1
}
end
StaticPopup_Show("TIPTOP_PROFILE")
end
 
 
local options = {
name = "TipTop Options",
type = "group",
474,14 → 508,50
end,
order = 33,
},
empty6 = {
name = " ",
type = "description",
order = 34,
},
header7 = {
name = "Profile",
type = "header",
order = 35,
},
charSpec = {
name = "Character specific settings",
desc = "Have this character use their own profile. If checked, any changes made will not affect other characters.\n\n|c00E30016WARNING:|r Your UI will be reloaded in the process!",
type = "toggle",
width = "full",
get = function() return TipTopPCDB.charSpec end,
set = function()
TipTopPCDB.charSpec = not TipTopPCDB.charSpec
ConfirmProfilePopup()
end,
order = 36,
},
},
}
 
local function OnInitialize()
TipTop.db = LibStub("AceDB-3.0"):New("TipTopDB", defaults, "Default")
db = TipTop.db.profile
TipTopDB = TipTopDB or {}
TipTopPCDB = TipTopPCDB or {}
if TipTopPCDB.charSpec == nil then
TipTopPCDB.charSpec = false
end
for k,v in pairs(defaults) do
if type(TipTopDB[k]) == "nil" then
TipTopDB[k] = v
end
end
SetUpDB()
 
LibStub("AceConfig-3.0"):RegisterOptionsTable("TipTop", options)
TipTop.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("TipTop", "TipTop")
 
SlashCmdList["TIPTOP"] = function() InterfaceOptionsFrame_OpenToCategory("TipTop") end
SLASH_TIPTOP1 = "/tiptop"
SLASH_TIPTOP2 = "/tt"
end
LSM:Register("statusbar", "TipTop Default", "Interface\\AddOns\\TipTop\\bar2.blp")
LSM:Register("statusbar", "TipTop Alt", "Interface\\AddOns\\TipTop\\bar1.blp")
tiptop.lua
401,7 → 401,11
end
 
local function PlayerLogin()
db = TipTopDB.profiles.Default
if TipTopPCDB.charSpec then
db = TipTopPCDB
else
db = TipTopDB
end
TipTop:SetUpTips()
 
color = CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS