/
## Title: CoolLine |
## Notes: Shows cooldowns on a single bar. |
## Author: TotalPackage |
## Version: 4.3.001 |
## Version: 4.3.002 |
## SavedVariables: CoolLineDB |
## SavedVariablesPerCharacter: CoolLineCharDB |
local random = math.random |
local strmatch = strmatch |
local UnitExists, HasPetUI = UnitExists, HasPetUI |
local GetSpellInfo = GetSpellInfo |
local db, block |
local backdrop = { edgeSize=16, } |
local section, iconsize = 0, 0 |
local tick0, tick1, tick10, tick30, tick60, tick120, tick300 |
local tick0, tick1, tick3, tick10, tick30, tick120, tick300 |
local BOOKTYPE_SPELL, BOOKTYPE_PET = BOOKTYPE_SPELL, BOOKTYPE_PET |
local spells = { [BOOKTYPE_SPELL] = { }, [BOOKTYPE_PET] = { }, } |
local frames, cooldowns = { }, { } |
local frames, cooldowns, specialspells = { }, { }, { } |
local SetValue, updatelook, createfs, ShowOptions, RuneCheck |
local function SetValueH(this, v, just) |
end |
end |
end |
if select(2, UnitClass("player")) == "PRIEST" then |
specialspells = { |
[GetSpellInfo(87151) or "blah"] = 87151, -- Archangel |
[GetSpellInfo(14751) or "blah"] = 14751, -- Chakra |
[GetSpellInfo(81209) or "blah"] = 81209, -- Chakra |
[GetSpellInfo(88684) or "blah"] = 88684, -- Holy Word: Serenity |
[GetSpellInfo(88682) or "blah"] = 88682, -- Holy Word: Aspire |
[GetSpellInfo(88685) or "blah"] = 88685, -- Holy Word: Sanctuary |
[GetSpellInfo(88625) or "blah"] = 88625 -- Holy Word: Chastise |
} |
end |
SlashCmdList.COOLLINE = ShowOptions |
SLASH_COOLLINE1 = "/coolline" |
tick0 = createfs(tick0, "0", 0, "LEFT") |
tick1 = createfs(tick1, "1", section) |
tick10 = createfs(tick10, "3", section * 2) |
tick30 = createfs(tick30, "10", section * 3) |
tick60 = createfs(tick60, "60", section * 4) |
tick3 = createfs(tick3, "3", section * 2) |
tick10 = createfs(tick10, "10", section * 3) |
tick30 = createfs(tick30, "30", section * 4) |
tick120 = createfs(tick120, "2m", section * 5) |
tick300 = createfs(tick300, "6m", section * 6, "RIGHT") |
ClearCooldown(frame) |
end |
elseif remain < 10 then |
SetupIcon(frame, section * (remain + 11) * 0.143, remain > 4 and 0.05 or 0.02, true, dofl) -- 2 + (remain - 3) / 7 |
elseif remain < 60 then |
SetupIcon(frame, section * (remain + 140) * 0.02, 0.12, true, dofl) -- 3 + (remain - 10) / 50 |
SetupIcon(frame, section * (remain + 11) * 0.14286, remain > 4 and 0.05 or 0.02, true, dofl) -- 2 + (remain - 3) / 7 |
elseif remain < 30 then |
SetupIcon(frame, section * (remain + 50) * 0.05, 0.09, true, dofl) -- 3 + (remain - 10) / 20 |
elseif remain < 120 then |
SetupIcon(frame, section * (remain + 180) * 0.01666, 0.25, true, dofl) -- 4 + (remain - 60) / 60 |
SetupIcon(frame, section * (remain + 330) * 0.011111, 0.21, true, dofl) -- 4 + (remain - 30) / 90 |
elseif remain < 360 then |
SetupIcon(frame, section * (remain + 1080) * 0.004166, 1.2, true, dofl) -- 5 + (remain - 120) / 240 |
SetupIcon(frame, section * (remain + 1080) * 0.0041667, 1.2, true, dofl) -- 5 + (remain - 120) / 240 |
frame:SetAlpha(1) |
else |
SetupIcon(frame, 6 * section, 2, false, dofl) |
local CLTip = CreateFrame("GameTooltip", "CLTip", CoolLine, "GameTooltipTemplate") |
CLTip:SetOwner(CoolLine, "ANCHOR_NONE") |
local GetSpellBookItemName, GetSpellBookItemInfo = GetSpellBookItemName, GetSpellBookItemInfo |
local specialspells = { |
[GetSpellInfo(87151) or "blah"] = true, -- Archangel |
[GetSpellInfo(14751) or "blah"] = "chakra", -- Chakra |
} |
local cooldown1 = gsub(SPELL_RECAST_TIME_MIN, "%%%.%d[fg]", "(.+)") |
local cooldown2 = gsub(SPELL_RECAST_TIME_SEC, "%%%.%d[fg]", "(.+)") |
local function CheckRight(rtext) |
local stype, id = GetSpellBookItemInfo(i, btype) |
last = name |
if sb[name] then |
sb[name] = id |
elseif specialspells[name] then |
sb[name] = id |
if specialspells[name] == "chakra" then |
sb[GetSpellInfo(88684) or "blah"] = 88684 -- Holy Word: Serenity |
sb[GetSpellInfo(88682) or "blah"] = 88682 -- Holy Word: Aspire |
sb[GetSpellInfo(88685) or "blah"] = 88685 -- Holy Word: Sanctuary |
end |
sb[name] = specialspells[name] or id |
else |
CLTip:SetSpellBookItem(i, btype) |
if CheckRight(CLTipTextRight2) or CheckRight(CLTipTextRight3) or CheckRight(CLTipTextRight4) then |
sb[name] = id |
sb[name] = specialspells[name] or id |
end |
end |
end |
end |
spellthrot:SetScript("OnUpdate", function(this, a1) |
selap = selap + a1 |
if selap < 0.33 then return end |
if selap < 0.3 then return end |
selap = 0 |
this:Hide() |
CheckSpellBook(BOOKTYPE_SPELL) |
-- $Id: LibStub.lua 76 2007-09-03 01:50:17Z mikk $ |
-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info |
-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke |
-- LibStub is hereby placed in the Public Domain |
-- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke |
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS! |
local LibStub = _G[LIBSTUB_MAJOR] |
-- Check to see is this version of the stub is obsolete |
if not LibStub or LibStub.minor < LIBSTUB_MINOR then |
LibStub = LibStub or {libs = {}, minors = {} } |
_G[LIBSTUB_MAJOR] = LibStub |
LibStub.minor = LIBSTUB_MINOR |
-- LibStub:NewLibrary(major, minor) |
-- major (string) - the major version of the library |
-- minor (string or number ) - the minor version of the library |
-- |
-- returns nil if a newer or same version of the lib is already present |
-- returns empty library object or old library object if upgrade is needed |
function LibStub:NewLibrary(major, minor) |
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)") |
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.") |
return self.libs[major], oldminor |
end |
-- LibStub:GetLibrary(major, [silent]) |
-- major (string) - the major version of the library |
-- silent (boolean) - if true, library is optional, silently return nil if its not found |
-- |
-- throws an error if the library can not be found (except silent is set) |
-- returns the library object if found |
function LibStub:GetLibrary(major, silent) |
if not self.libs[major] and not silent then |
error(("Cannot find a library instance of %q."):format(tostring(major)), 2) |
return self.libs[major], self.minors[major] |
end |
function LibStub:IterateLibraries() return pairs(self.libs) end |
-- LibStub:IterateLibraries() |
-- |
-- Returns an iterator for the currently registered libraries |
function LibStub:IterateLibraries() |
return pairs(self.libs) |
end |
setmetatable(LibStub, { __call = LibStub.GetLibrary }) |
end |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ |
..\FrameXML\UI.xsd"> |
<Include file="LibSharedMedia-3.0\lib.xml" /> |
</Ui> |
--[[ |
--[[ |
Name: LibSharedMedia-3.0 |
Revision: $Revision: 62 $ |
Revision: $Revision: 69 $ |
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", 100001 -- increase manualy on changes |
local MAJOR, MINOR = "LibSharedMedia-3.0", 4030402 -- 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["None"] = [[]] |
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 Tabard Background"] = [[Interface\TabardFrame\TabardFrameBackground]] |
lib.MediaTable.background["Blizzard Tooltip"] = [[Interface\Tooltips\UI-Tooltip-Background]] |
lib.MediaTable.background["Solid"] = [[Interface\Buttons\WHITE8X8]] |
lib.DefaultMedia.background = "None" |
-- BORDER |
if not lib.MediaTable.border then lib.MediaTable.border = {} end |
lib.MediaTable.border["None"] = [[Interface\None]] |
lib.MediaTable.border["None"] = [[]] |
lib.MediaTable.border["Blizzard Achievement Wood"] = [[Interface\AchievementFrame\UI-Achievement-WoodBorder]] |
lib.MediaTable.border["Blizzard Chat Bubble"] = [[Interface\Tooltips\ChatBubble-Backdrop]] |
lib.MediaTable.border["Blizzard Dialog"] = [[Interface\DialogFrame\UI-DialogBox-Border]] |
lib.MediaTable.border["Blizzard Dialog Gold"] = [[Interface\DialogFrame\UI-DialogBox-Gold-Border]] |
lib.MediaTable.border["Blizzard Party"] = [[Interface\CHARACTERFRAME\UI-Party-Border]] |
lib.MediaTable.border["Blizzard Tooltip"] = [[Interface\Tooltips\UI-Tooltip-Border]] |
lib.DefaultMedia.border = "None" |
-- FONT |
if not lib.MediaTable.font then lib.MediaTable.font = {} end |
elseif locale == "zhCN" then |
LOCALE_MASK = lib.LOCALE_BIT_zhCN |
-- |
SML_MT_font["伤害æ°å"] = [[Fonts\ZYKai_C.ttf]] |
SML_MT_font["é»è®¤"] = [[Fonts\ZYKai_T.ttf]] |
SML_MT_font["è天"] = [[Fonts\ZYHei.ttf]] |
SML_MT_font["伤害æ°å"] = [[Fonts\ARKai_C.ttf]] |
SML_MT_font["é»è®¤"] = [[Fonts\ARKai_T.ttf]] |
SML_MT_font["è天"] = [[Fonts\ARHei.ttf]] |
-- |
lib.DefaultMedia["font"] = "é»è®¤" -- someone from zhCN please adjust if needed |
-- |
local mtt = mediaTable[mediatype] |
local overridekey = overrideMedia[mediatype] |
local result = mtt and ((overridekey and mtt[overridekey] or mtt[key]) or (not noDefault and defaultMedia[mediatype] and mtt[defaultMedia[mediatype]])) or nil |
return result |
return result ~= "" and result or nil |
end |
function lib:IsValid(mediatype, key) |
## Interface: 20400 |
## Title: Lib: SharedMedia-3.0 |
## Notes: Shared handling of media data (fonts, sounds, textures, ...) between addons. |
## Version: 3.0 |
## Author: Elkano |
## X-Category: Library |
## LoadOnDemand: 1 |
LibStub\LibStub.lua |
CallbackHandler-1.0\CallbackHandler-1.0.lua |
lib.xml |