/trunk
## Interface: 50400 |
## Interface: 60000 |
## Title: TipTop |
## Author: Seerah |
## Notes: Tooltip enhancement |
## Version: 2.13.3 |
## Version: 2.14 |
## SavedVariables: TipTopDB |
## SavedVariablesPerCharacter: TipTopPCDB |
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets |
-- f:AddChild(btn) |
-- @class file |
-- @name AceGUI-3.0 |
-- @release $Id: AceGUI-3.0.lua 924 2010-05-13 15:12:20Z nevcairiel $ |
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 33 |
-- @release $Id: AceGUI-3.0.lua 1102 2013-10-25 14:15:23Z nevcairiel $ |
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 34 |
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR) |
if not AceGUI then return end -- No upgrade needed |
end |
end) |
local layoutrecursionblock = nil |
local function safelayoutcall(object, func, ...) |
layoutrecursionblock = true |
object[func](object, ...) |
layoutrecursionblock = nil |
end |
AceGUI:RegisterLayout("Flow", |
function(content, children) |
if layoutrecursionblock then return end |
--used height so far |
local height = 0 |
--width used in the current row |
end |
if child.width == "fill" then |
child:SetWidth(width) |
safelayoutcall(child, "SetWidth", width) |
frame:SetPoint("RIGHT", content) |
usedwidth = 0 |
rowoffset = child.alignoffset or (rowheight / 2) |
rowstartoffset = rowoffset |
elseif child.width == "relative" then |
child:SetWidth(width * child.relWidth) |
safelayoutcall(child, "SetWidth", width * child.relWidth) |
if child.DoLayout then |
child:DoLayout() |
--[[ $Id: AceGUIWidget-DropDown.lua 1091 2013-09-13 14:42:34Z nevcairiel $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown.lua 1116 2014-10-12 08:15:46Z nevcairiel $ ]]-- |
local AceGUI = LibStub("AceGUI-3.0") |
-- Lua APIs |
do |
local widgetType = "Dropdown" |
local widgetVersion = 26 |
local widgetVersion = 30 |
--[[ Static data ]]-- |
AceGUI:ClearFocus() |
else |
self.open = true |
self.pullout:SetWidth(self.frame:GetWidth()) |
self.pullout:SetWidth(self.pulloutWidth or self.frame:GetWidth()) |
self.pullout:Open("TOPLEFT", self.frame, "BOTTOMLEFT", 0, self.label:IsShown() and -2 or 0) |
AceGUI:SetFocus(self) |
end |
end |
self.open = true |
self:Fire("OnOpened") |
end |
local function OnPulloutClose(this) |
self:SetHeight(44) |
self:SetWidth(200) |
self:SetLabel() |
self:SetPulloutWidth(nil) |
end |
-- exported, AceGUI callback |
if disabled then |
self.text:SetTextColor(0.5,0.5,0.5) |
self.button:Disable() |
self.button_cover:Disable() |
self.label:SetTextColor(0.5,0.5,0.5) |
else |
self.button:Enable() |
self.button_cover:Enable() |
self.label:SetTextColor(1,.82,0) |
self.text:SetTextColor(1,1,1) |
end |
if text and text ~= "" then |
self.label:SetText(text) |
self.label:Show() |
self.dropdown:SetPoint("TOPLEFT",self.frame,"TOPLEFT",-15,-18) |
self:SetHeight(44) |
self.alignoffset = 30 |
self.dropdown:SetPoint("TOPLEFT",self.frame,"TOPLEFT",-15,-14) |
self:SetHeight(40) |
self.alignoffset = 26 |
else |
self.label:SetText("") |
self.label:Hide() |
return self.multiselect |
end |
local function SetPulloutWidth(self, width) |
self.pulloutWidth = width |
end |
--[[ Constructor ]]-- |
local function Constructor() |
self.GetMultiselect = GetMultiselect |
self.SetItemValue = SetItemValue |
self.SetItemDisabled = SetItemDisabled |
self.SetPulloutWidth = SetPulloutWidth |
self.alignoffset = 30 |
self.alignoffset = 26 |
frame:SetScript("OnHide",Dropdown_OnHide) |
button:SetScript("OnClick",Dropdown_TogglePullout) |
local button_cover = CreateFrame("BUTTON",nil,self.frame) |
self.button_cover = button_cover |
button_cover.obj = self |
button_cover:SetPoint("TOPLEFT",self.frame,"BOTTOMLEFT",0,25) |
button_cover:SetPoint("BOTTOMRIGHT",self.frame,"BOTTOMRIGHT") |
--[[----------------------------------------------------------------------------- |
ColorPicker Widget |
-------------------------------------------------------------------------------]] |
local Type, Version = "ColorPicker", 21 |
local Type, Version = "ColorPicker", 22 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local self = frame.obj |
if not self.disabled then |
ColorPickerFrame:SetFrameStrata("FULLSCREEN_DIALOG") |
ColorPickerFrame:SetFrameLevel(frame:GetFrameLevel() + 10) |
ColorPickerFrame:SetClampedToScreen(true) |
ColorPickerFrame.func = function() |
--[[ |
Name: LibSharedMedia-3.0 |
Revision: $Revision: 74 $ |
Revision: $Revision: 89 $ |
Author: Elkano (elkano@gmx.de) |
Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com) |
Website: http://www.wowace.com/projects/libsharedmedia-3-0/ |
License: LGPL v2.1 |
]] |
local MAJOR, MINOR = "LibSharedMedia-3.0", 5000402 -- 5.0.4 v2 / increase manually on changes |
local MAJOR, MINOR = "LibSharedMedia-3.0", 6000201 -- 6.0.2 v1 / increase manually on changes |
local lib = LibStub:NewLibrary(MAJOR, MINOR) |
if not lib then return end |
-- BACKGROUND |
if not lib.MediaTable.background then lib.MediaTable.background = {} end |
lib.MediaTable.background["None"] = [[]] |
lib.MediaTable.background["Blizzard Collections Background"] = [[Interface\Collections\CollectionsBackgroundTile]] |
lib.MediaTable.background["Blizzard Dialog Background"] = [[Interface\DialogFrame\UI-DialogBox-Background]] |
lib.MediaTable.background["Blizzard Dialog Background Dark"] = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]] |
lib.MediaTable.background["Blizzard Dialog Background Gold"] = [[Interface\DialogFrame\UI-DialogBox-Gold-Background]] |
lib.MediaTable.background["Blizzard Garrison Background"] = [[Interface\Garrison\GarrisonUIBackground]] |
lib.MediaTable.background["Blizzard Garrison Background 2"] = [[Interface\Garrison\GarrisonUIBackground2]] |
lib.MediaTable.background["Blizzard Garrison Background 3"] = [[Interface\Garrison\GarrisonMissionUIInfoBoxBackgroundTile]] |
lib.MediaTable.background["Blizzard Low Health"] = [[Interface\FullScreenTextures\LowHealth]] |
lib.MediaTable.background["Blizzard Marble"] = [[Interface\FrameGeneral\UI-Background-Marble]] |
lib.MediaTable.background["Blizzard Out of Control"] = [[Interface\FullScreenTextures\OutOfControl]] |
if not lib.MediaTable.font then lib.MediaTable.font = {} end |
local SML_MT_font = lib.MediaTable.font |
--[[ |
All font files are currently in all clients, the following table depicts which font supports which charset as of 5.0.4 |
Fonts were checked using langcover.pl from DejaVu fonts (http://sourceforge.net/projects/dejavu/) and FontForge (http://fontforge.org/) |
latin means check for: de, en, es, fr, it, pt |
file name latin koKR ruRU zhCN zhTW |
2002.ttf 2002 X X X - - |
2002B.ttf 2002 Bold X X X - - |
bKAI00M.ttf AR Kaiti Medium B5 - - - - X |
bLEI00D.ttf AR Leisu Demi B5 - - - - X |
FRIZQT__.TTF Friz Quadrata TT X - - - - |
FRIZQT___CYR.TTF FrizQuadrataCTT - - X - - |
FRIZQT___CYR.TTF FrizQuadrataCTT x - X - - |
K_Damage.TTF YDIWingsM - X X - - |
K_Pagetext.TTF MoK X X X - - |
MORPHEUS.TTF Morpheus X - - - - |
NIM_____.ttf Nimrod MT X - X - - |
SKURRI.TTF Skurri X - - - - |
SKURRI_CYR.TTF Skurri X - X - - |
WARNING: Although FRIZQT___CYR is available on western clients, it doesn't support special European characters e.g. é, ï, ö |
Due to this, we cannot use it as a replacement for FRIZQT__.TTF |
]] |
if locale == "koKR" then |
error(MAJOR..":Register(mediatype, key, data, langmask) - key must be string, got "..type(key)) |
end |
mediatype = mediatype:lower() |
if mediatype == lib.MediaType.FONT and ((langmask and band(langmask, LOCALE_MASK) == 0) or not (langmask or locale_is_western)) then return false end |
if mediatype == lib.MediaType.FONT and ((langmask and band(langmask, LOCALE_MASK) == 0) or not (langmask or locale_is_western)) then return false end |
if not mediaTable[mediatype] then mediaTable[mediatype] = {} end |
local mtable = mediaTable[mediatype] |
if mtable[key] then return false end |
-- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName". |
-- @class file |
-- @name AceConfigRegistry-3.0 |
-- @release $Id: AceConfigRegistry-3.0.lua 1045 2011-12-09 17:58:40Z nevcairiel $ |
local MAJOR, MINOR = "AceConfigRegistry-3.0", 14 |
-- @release $Id: AceConfigRegistry-3.0.lua 1105 2013-12-08 22:11:58Z nevcairiel $ |
local MAJOR, MINOR = "AceConfigRegistry-3.0", 15 |
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigRegistry then return end |
-- @param appName The application name as given to `:RegisterOptionsTable()` |
-- @param options The options table, OR a function reference that generates it on demand. \\ |
-- See the top of the page for info on arguments passed to such functions. |
function AceConfigRegistry:RegisterOptionsTable(appName, options) |
-- @param skipValidation Skip options table validation (primarily useful for extremely huge options, with a noticeable slowdown) |
function AceConfigRegistry:RegisterOptionsTable(appName, options, skipValidation) |
if type(options)=="table" then |
if options.type~="group" then -- quick sanity checker |
error(MAJOR..": RegisterOptionsTable(appName, options): 'options' - missing type='group' member in root group", 2) |
AceConfigRegistry.tables[appName] = function(uiType, uiName, errlvl) |
errlvl=(errlvl or 0)+1 |
validateGetterArgs(uiType, uiName, errlvl) |
if not AceConfigRegistry.validated[uiType][appName] then |
if not AceConfigRegistry.validated[uiType][appName] and not skipValidation then |
AceConfigRegistry:ValidateOptionsTable(options, appName, errlvl) -- upgradable |
AceConfigRegistry.validated[uiType][appName] = true |
end |
errlvl=(errlvl or 0)+1 |
validateGetterArgs(uiType, uiName, errlvl) |
local tab = assert(options(uiType, uiName, appName)) |
if not AceConfigRegistry.validated[uiType][appName] then |
if not AceConfigRegistry.validated[uiType][appName] and not skipValidation then |
AceConfigRegistry:ValidateOptionsTable(tab, appName, errlvl) -- upgradable |
AceConfigRegistry.validated[uiType][appName] = true |
end |
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables. |
-- @class file |
-- @name AceConfigDialog-3.0 |
-- @release $Id: AceConfigDialog-3.0.lua 1089 2013-09-13 14:32:35Z nevcairiel $ |
-- @release $Id: AceConfigDialog-3.0.lua 1113 2014-09-11 20:18:16Z nevcairiel $ |
local LibStub = LibStub |
local MAJOR, MINOR = "AceConfigDialog-3.0", 58 |
local MAJOR, MINOR = "AceConfigDialog-3.0", 59 |
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigDialog then return end |
tinsert(path, (select(n, ...))) |
end |
local option = options |
if type(container) == "table" and container.type == "BlizOptionsGroup" and #path > 0 then |
for i = 1, #path do |
option = options.args[path[i]] |
end |
name = format("%s - %s", name, GetOptionsMemberValue("name", option, options, path, appName)) |
end |
--if a container is given feed into that |
if container then |
f = container |
TipTop.optionsFrame.extraopts = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("TipTop", "Extra Stuff", "TipTop", "extraopts") |
TipTop.optionsFrame.profile = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("TipTop", "Profile", "TipTop", "profile") |
SlashCmdList["TIPTOP"] = function() InterfaceOptionsFrame_OpenToCategory("TipTop") end |
SlashCmdList["TIPTOP"] = function() |
InterfaceOptionsFrame_OpenToCategory("TipTop") |
InterfaceOptionsFrame_OpenToCategory("TipTop") |
end |
SLASH_TIPTOP1 = "/tiptop" |
SLASH_TIPTOP2 = "/tip" |
end |
ItemRefTooltip, |
ShoppingTooltip1, |
ShoppingTooltip2, |
ShoppingTooltip3, |
ItemRefShoppingTooltip1, |
ItemRefShoppingTooltip2, |
ItemRefShoppingTooltip3, |
WorldMapTooltip} |
--UPVALUES-- |
ShoppingTooltip2TextLeft1:SetFont(font, 12 -2, db.fontFlag) |
ShoppingTooltip2TextLeft2:SetFont(font, 12, db.fontFlag) |
ShoppingTooltip2TextLeft3:SetFont(font, 12 -2, db.fontFlag) |
ShoppingTooltip3TextLeft1:SetFont(font, 12 -2, db.fontFlag) |
ShoppingTooltip3TextLeft2:SetFont(font, 12, db.fontFlag) |
ShoppingTooltip3TextLeft3:SetFont(font, 12 -2, db.fontFlag) |
--these were in the tips' onshow before - need to check later |
for i = 1, ShoppingTooltip1:NumLines() do |
_G["ShoppingTooltip1TextRight"..i]:SetFont(font, 12 -2, db.fontFlag) |
for i = 1, ShoppingTooltip2:NumLines() do |
_G["ShoppingTooltip2TextRight"..i]:SetFont(font, 12 -2, db.fontFlag) |
end |
for i = 1, ShoppingTooltip3:NumLines() do |
_G["ShoppingTooltip3TextRight"..i]:SetFont(font, 12 -2, db.fontFlag) |
end |
if GameTooltipMoneyFrame1 then |
GameTooltipMoneyFrame1PrefixText:SetFont(font, 12, db.fontFlag) |
GameTooltipMoneyFrame1SuffixText:SetFont(font, 12, db.fontFlag) |
tt:SetOwner(parent, "ANCHOR_CURSOR") |
else |
tt:SetOwner(parent, "ANCHOR_NONE") |
tt:ClearAllPoints() |
tt:SetPoint(db.anchor, UIParent, db.anchor, db.offsetX, db.offsetY) |
end |
end) |