/
## Notes: Replacement for the default nameplates. |
## Author: mangeg |
## SavedVariables: mNameplatesDB |
## Version: 0.1 |
## Version: 1.11 |
## OptionalDeps: LibBackdrop-1.0 |
## X-Curse-Packaged-Version: r20101026053820 |
## X-Curse-Packaged-Version: 1.11 |
## X-Curse-Project-Name: mNameplates |
## X-Curse-Project-ID: mnameplates |
## X-Curse-Repository-ID: wow/mnameplates/mainline |
Background:SetPoint("CENTER") |
local back = CreateFrame("Frame", nil, Background) |
LibStub("LibBackdrop-1.0"):EnhanceBackdrop(back) |
--LibStub("LibBackdrop-1.0"):EnhanceBackdrop(back) |
back:SetFrameLevel(Background:GetFrameLevel() - 1 ) |
Background.backdrop = back |
end |
tag 1.11 |
a79e0019bb8c5fdb3c83ce0af6678fdf85cd3098 |
Mange <> |
2010-10-31 19:40:33 +0100 |
Tagging |
-------------------- |
Mange: |
- Still issues with LibBackdrop, so not using it for now. |
- Using LibBackdrop again, problem seems to be solved. |
- Using old backdrop function for now until LibBackdrop problems with Texture coords out of range are fixed. |
## X-Website: http://www.wowace.com |
## X-Category: Library |
## X-License: All Rights Reserved |
## X-Curse-Packaged-Version: 1.0.7 |
## X-Curse-Packaged-Version: 1.0.7-4-gc67fc1c |
## X-Curse-Project-Name: LibBackdrop-1.0 |
## X-Curse-Project-ID: libbackdrop-1-0 |
## X-Curse-Repository-ID: wow/libbackdrop-1-0/mainline |
and decorate a given frame with a backdrop. |
Credits to Lilsparky for doing the math for cutting up the quadrants |
--]] |
local MAJOR, MINOR = "LibBackdrop-1.0", 1 |
local MAJOR, MINOR = "LibBackdrop-1.0", 2 |
local Backdrop, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not Backdrop then return end -- No upgrade needed |
frame._backdrop["Edge"..k] = texture |
end |
frame._backdrop["bgTexture"] = frame:CreateTexture(nil,"BACKGROUND") |
frame.SetBackdrop = Backdrop.SetBackdrop -- Set the backdrop of the frame according to the specification provided. |
frame.SetBackdrop = Backdrop.SetBackdrop -- Set the backdrop of the frame according to the specification provided. |
frame.GetBackdrop = Backdrop.GetBackdrop -- Get the backdrop of the frame for use in SetBackdrop |
frame.SetBackdropBorderColor = Backdrop.SetBackdropBorderColor --(r, g, b[, a]) - Set the frame's backdrop's border's color. |
frame.SetBackdropBorderColor = Backdrop.SetBackdropBorderColor --(r, g, b[, a]) - Set the frame's backdrop's border's color. |
frame.GetBackdropBorderColor = Backdrop.GetBackdropBorderColor -- Get the frame's backdrop's border's color. |
frame.SetBackdropColor = Backdrop.SetBackdropColor --(r, g, b[, a]) - Set the frame's backdrop color. |
frame.GetBackdropColor = Backdrop.GetBackdropColor -- Get the backdrop color |
--]] |
--[[ |
{ |
bgFile = "bgFile", |
edgeFile = "edgeFile", tile = false, tileSize = 0, edgeSize = 32, |
insets = { left = 0, right = 0, top = 0, bottom = 0 |
{ |
bgFile = "bgFile", |
edgeFile = "edgeFile", tile = false, tileSize = 0, edgeSize = 32, |
insets = { left = 0, right = 0, top = 0, bottom = 0 |
} |
Alternatily you can use the new blizz style of borders |
where you have a corner file and 1 file for each side. To build those style of borders |
["LEFT"] = "Interface/DialogFrame/DialogFrame-Left", |
["TOP"] = "Interface/DialogFrame/DialogFrame-Top", |
["BOT"] = "Interface/DialogFrame/DialogFrame-Bot", |
["RIGHT"] = "Interface/DialogFrame/DialogFrame-Right", |
["RIGHT"] = "Interface/DialogFrame/DialogFrame-Right", |
} |
--]] |
} |
local hSides = { |
TOP = 2, |
BOT = 3, |
BOT = 3, |
} |
local NaN = { |
["nan"] = true, |
["-1.#IND"] = true, |
["-1.#INF"] = true, |
["nil"] = true, |
} |
-- Resizing hook to keep them aligned |
local function Resize(frame) |
if not frame then |
return |
end |
local w,h = frame:GetWidth()-frame.bgEdgeSize*2, frame:GetHeight()-frame.bgEdgeSize*2 |
if NaN[tostring(w)] or NaN[tostring(h)] then |
-- frame was resized to nothing. |
return |
end |
for k,v in pairs(vSides) do |
local t = frame["Edge"..k] |
local y = h/frame.bgEdgeSize |
texture:SetWidth(frame.bgEdgeSize) |
texture:SetHeight(frame.bgEdgeSize) |
texture:SetTexCoord(nk[k].l,nk[k].r,nk[k].t,nk[k].b) |
end |
end |
end |
-- Attach new style sdes |
local function AttachNewSides(frame,w,h) |
if k == "TOP" then -- Flip |
x1,x2 = x2, x1 |
end |
texture:SetTexCoord(x1,0, x2,0, x1,y, x2, y) |
texture:SetTexCoord(x1,0, x2,0, x1,y, x2, y) |
end |
end |
self._backdrop.bgTexture:SetPoint("TOPLEFT", self._backdrop, "TOPLEFT", options.insets.left, -options.insets.top) |
self._backdrop.bgTexture:SetPoint("BOTTOMRIGHT", self._backdrop, "BOTTOMRIGHT", -options.insets.right, options.insets.bottom) |
if options.tile then |
self._backdrop.bgTexture:SetTexCoord(0,w/options.tileSize, 0,h/options.tileSize) |
self._backdrop.bgTexture:SetTexCoord(0,w/options.tileSize, 0,h/options.tileSize) |
end |
self._backdrop:SetScript("OnSizeChanged", Resize) |
end |
self._backdrop["EdgeTOP"]:SetGradient(orientation,minR,minG,minB,maxR,maxG,maxB) |
self._backdrop["EdgeTOPRIGHTCORNER"]:SetGradient(orientation,maxR,maxG,maxB,maxR,maxG,maxB) |
self._backdrop["EdgeBOTRIGHTCORNER"]:SetGradient(orientation,maxR,maxG,maxB,maxR,maxG,maxB) |
self._backdrop["EdgeRIGHT"]:SetGradient(orientation,maxR,maxG,maxB,maxR,maxG,maxB) |
self._backdrop["EdgeRIGHT"]:SetGradient(orientation,maxR,maxG,maxB,maxR,maxG,maxB) |
else |
self._backdrop["EdgeTOPLEFTCORNER"]:SetGradient(orientation,maxR,maxG,maxB,maxR,maxG,maxB) |
self._backdrop["EdgeBOTLEFTCORNER"]:SetGradient(orientation,minR,minG,minB,minR,minG,minB) |
self._backdrop["EdgeTOP"]:SetGradient(orientation,maxR,maxG,maxB,maxR,maxG,maxB) |
self._backdrop["EdgeTOPRIGHTCORNER"]:SetGradient(orientation,maxR,maxG,maxB,maxR,maxG,maxB) |
self._backdrop["EdgeBOTRIGHTCORNER"]:SetGradient(orientation,minR,minG,minB,minR,minG,minB) |
self._backdrop["EdgeRIGHT"]:SetGradient(orientation,minR,minG,minB,maxR,maxG,maxB) |
self._backdrop["EdgeRIGHT"]:SetGradient(orientation,minR,minG,minB,maxR,maxG,maxB) |
end |
end |
self._backdrop["EdgeTOP"]:SetGradientAlpha(orientation,minR,minG,minB,minA,maxR,maxG,maxB,maxA) |
self._backdrop["EdgeTOPRIGHTCORNER"]:SetGradientAlpha(orientation,maxR,maxG,maxB,maxA,maxR,maxG,maxB,maxA) |
self._backdrop["EdgeBOTRIGHTCORNER"]:SetGradientAlpha(orientation,maxR,maxG,maxB,maxA,maxR,maxG,maxB,maxA) |
self._backdrop["EdgeRIGHT"]:SetGradientAlpha(orientation,maxR,maxG,maxB,maxA,maxR,maxG,maxB,maxA) |
self._backdrop["EdgeRIGHT"]:SetGradientAlpha(orientation,maxR,maxG,maxB,maxA,maxR,maxG,maxB,maxA) |
else |
self._backdrop["EdgeTOPLEFTCORNER"]:SetGradientAlpha(orientation,maxR,maxG,maxB,maxA,maxR,maxG,maxB,maxA) |
self._backdrop["EdgeBOTLEFTCORNER"]:SetGradientAlpha(orientation,minR,minG,minB,minA,minR,minG,minB,minA) |
self._backdrop["EdgeTOP"]:SetGradientAlpha(orientation,maxR,maxG,maxB,maxA,maxR,maxG,maxB,maxA) |
self._backdrop["EdgeTOPRIGHTCORNER"]:SetGradientAlpha(orientation,maxR,maxG,maxB,maxA,maxR,maxG,maxB,maxA) |
self._backdrop["EdgeBOTRIGHTCORNER"]:SetGradientAlpha(orientation,minR,minG,minB,minA,minR,minG,minB,minA) |
self._backdrop["EdgeRIGHT"]:SetGradientAlpha(orientation,minR,minG,minB,minA,maxR,maxG,maxB,maxA) |
self._backdrop["EdgeRIGHT"]:SetGradientAlpha(orientation,minR,minG,minB,minA,maxR,maxG,maxB,maxA) |
end |
end |
-- Attach croners |
AttachNewCorners(self._backdrop) |
-- Attach sides |
AttachNewSides(self._backdrop,w,h) |
AttachNewSides(self._backdrop,w,h) |
end |
-- Attach Background |
self._backdrop.bgTexture:SetPoint("TOPLEFT", self._backdrop, "TOPLEFT", options.insets.left, -options.insets.top) |
self._backdrop.bgTexture:SetPoint("BOTTOMRIGHT", self._backdrop, "BOTTOMRIGHT", -options.insets.right, options.insets.bottom) |
if options.tile then |
self._backdrop.bgTexture:SetTexCoord(0,w/options.tileSize, 0,h/options.tileSize) |
self._backdrop.bgTexture:SetTexCoord(0,w/options.tileSize, 0,h/options.tileSize) |
end |
end |
--[[ |
Name: LibSharedMedia-3.0 |
Revision: $Revision: 58 $ |
Revision: $Revision: 62 $ |
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", 90000 + tonumber(("$Revision: 58 $"):match("(%d+)")) |
local MAJOR, MINOR = "LibSharedMedia-3.0", 100001 -- increase manualy on changes |
local lib = LibStub:NewLibrary(MAJOR, MINOR) |
if not lib then return end |
-- populate lib with default Blizzard data |
-- BACKGROUND |
if not lib.MediaTable.background then lib.MediaTable.background = {} end |
lib.MediaTable.background["Blizzard Dialog Background"] = [[Interface\DialogFrame\UI-DialogBox-Background]] |
lib.MediaTable.background["Blizzard Low Health"] = [[Interface\FullScreenTextures\LowHealth]] |
lib.MediaTable.background["Blizzard Out of Control"] = [[Interface\FullScreenTextures\OutOfControl]] |
lib.MediaTable.background["Blizzard Parchment"] = [[Interface\AchievementFrame\UI-Achievement-Parchment-Horizontal]] |
lib.MediaTable.background["Blizzard Parchment 2"] = [[Interface\AchievementFrame\UI-Achievement-Parchment]] |
lib.MediaTable.background["Blizzard Tabard Background"] = [[Interface\TabardFrame\TabardFrameBackground]] |
lib.MediaTable.background["Blizzard Tooltip"] = [[Interface\Tooltips\UI-Tooltip-Background]] |
lib.MediaTable.background["Solid"] = [[Interface\Buttons\WHITE8X8]] |
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 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]] |
lib.MediaTable.background["Blizzard Parchment"] = [[Interface\AchievementFrame\UI-Achievement-Parchment-Horizontal]] |
lib.MediaTable.background["Blizzard Parchment 2"] = [[Interface\AchievementFrame\UI-GuildAchievement-Parchment-Horizontal]] |
lib.MediaTable.background["Blizzard Rock"] = [[Interface\FrameGeneral\UI-Background-Rock]] |
lib.MediaTable.background["Blizzard Tabard Background"] = [[Interface\TabardFrame\TabardFrameBackground]] |
lib.MediaTable.background["Blizzard Tooltip"] = [[Interface\Tooltips\UI-Tooltip-Background]] |
lib.MediaTable.background["Solid"] = [[Interface\Buttons\WHITE8X8]] |
-- BORDER |
if not lib.MediaTable.border then lib.MediaTable.border = {} end |
-- STATUSBAR |
if not lib.MediaTable.statusbar then lib.MediaTable.statusbar = {} end |
lib.MediaTable.statusbar["Blizzard"] = [[Interface\TargetingFrame\UI-StatusBar]] |
lib.MediaTable.statusbar["Blizzard Character Skills Bar"] = [[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]] |
lib.DefaultMedia.statusbar = "Blizzard" |
-- SOUND |
if not lib.MediaTable.sound then lib.MediaTable.sound = {} end |
lib.MediaTable.sound["None"] = [[Interface\Quiet.mp3]] -- Relies on the fact that PlaySound[File] doesn't error on non-existing input. |
lib.MediaTable.sound["None"] = [[Interface\Quiet.ogg]] -- Relies on the fact that PlaySound[File] doesn't error on non-existing input. |
lib.DefaultMedia.sound = "None" |
local function rebuildMediaList(mediatype) |
if type(key) ~= "string" 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 |
mediatype = mediatype:lower() |
if not mediaTable[mediatype] then mediaTable[mediatype] = {} end |
local mtable = mediaTable[mediatype] |
if mtable[key] then return false end |
-- end |
-- @class file |
-- @name AceAddon-3.0.lua |
-- @release $Id: AceAddon-3.0.lua 895 2009-12-06 16:28:55Z nevcairiel $ |
-- @release $Id: AceAddon-3.0.lua 980 2010-10-27 14:20:11Z nevcairiel $ |
local MAJOR, MINOR = "AceAddon-3.0", 5 |
local MAJOR, MINOR = "AceAddon-3.0", 10 |
local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceAddon then return end -- No Upgrade needed. |
setmetatable( object, addonmeta ) |
self.addons[name] = object |
object.modules = {} |
object.orderedModules = {} |
object.defaultModuleLibraries = {} |
Embed( object ) -- embed NewModule, GetModule methods |
self:EmbedLibraries(object, select(i,...)) |
safecall(self.OnModuleCreated, self, module) -- Was in Ace2 and I think it could be a cool thing to have handy. |
self.modules[name] = module |
tinsert(self.orderedModules, module) |
return module |
end |
-- target (object) - target object to embed aceaddon in |
-- |
-- this is a local function specifically since it's meant to be only called internally |
function Embed(target) |
function Embed(target, skipPMixins) |
for k, v in pairs(mixins) do |
target[k] = v |
end |
for k, v in pairs(pmixins) do |
target[k] = target[k] or v |
if not skipPMixins then |
for k, v in pairs(pmixins) do |
target[k] = target[k] or v |
end |
end |
end |
end |
-- enable possible modules. |
for name, module in pairs(addon.modules) do |
self:EnableAddon(module) |
local modules = addon.orderedModules |
for i = 1, #modules do |
self:EnableAddon(modules[i]) |
end |
end |
return self.statuses[addon.name] -- return true if we're disabled |
if lib then safecall(lib.OnEmbedDisable, lib, addon) end |
end |
-- disable possible modules. |
for name, module in pairs(addon.modules) do |
self:DisableAddon(module) |
local modules = addon.orderedModules |
for i = 1, #modules do |
self:DisableAddon(modules[i]) |
end |
end |
-- upgrade embeded |
for name, addon in pairs(AceAddon.addons) do |
Embed(addon) |
Embed(addon, true) |
end |
-- 2010-10-27 nevcairiel - add new "orderedModules" table |
if oldminor and oldminor < 10 then |
for name, addon in pairs(AceAddon.addons) do |
addon.orderedModules = {} |
for module_name, module in pairs(addon.modules) do |
tinsert(addon.orderedModules, module) |
end |
end |
end |