/
--L["Show text for no saved instances"] = true |
--L["Show the plugin text instead of number, when the character has no saved instances."] = true |
L["Short text"] = "Kurzer Text" |
--L["Only show the number of saved instances, in the format [Active]:[Expired]."] = true |
--L["Only show the number of saved instances, in the format [Group]:[Raid]:[Expired]."] = true |
L["Instance Information"] = "Instanzinformation" |
L["Show instance IDs"] = "Zeige Instanzen IDs" |
L["Show or hide the numeric instance IDs."] = "Zeige oder Verberge die numerischen Instanzen IDs." |
-- 1.8 strings |
--L["Hide expired instances from plugin text"] = true |
--L["Don't display instances with expired ID's on the plugin text."] = true |
--L["Active: "] = true |
--L["Expired: "] = true |
L["(Updating...)"] = "(ì ë°ì´í¸ì¤...)" |
L["Minimalistic LDB plugin that allows tracking of raid IDs across characters."] = "LDBì°½ì ìºë¦í°ë³ ê·ì ëì ì 보를 íìí©ëë¤." |
L["General Options"] = "ì¼ë° ì¤ì " |
--L["Show text for no saved instances"] = true |
--L["Show the plugin text instead of number, when the character has no saved instances."] = true |
L["Show text for no saved instances"] = "ê·ìë ëì ììì ëí 문구 íì" |
L["Show the plugin text instead of number, when the character has no saved instances."] = "ê·ìë ëì ì´ ìë ìºë¦í°ë¼ë©´, ì«ì ëì íë¬ê·¸ì¸ 문구를 íìí©ëë¤." |
L["Short text"] = "ì½ì íì" |
--L["Only show the number of saved instances, in the format [Active]:[Expired]."] = true |
--L["Only show the number of saved instances, in the format [Group]:[Raid]:[Expired]."] = true |
L["Instance Information"] = "ëì ì ë³´" |
L["Show instance IDs"] = "ëì ID íì" |
L["Show or hide the numeric instance IDs."] = "ê·ìë ëì ID를 íì ëë ì¨ê¹ëë¤." |
-- 1.7 strings |
L["Expired"] = "ë§ë£ë¨" |
--L["Hide expired instances from tooltip"] = true |
L["Hide expired instances from tooltip"] = "í´íìì ë§ë£ë ëì ì¨ê¹" |
L["Don't display instances with expired ID's on the tooltip."] = "í´íì ë§ë£ë IDì í¨ê» ëì ì íìíì§ ììµëë¤." |
L["|cffeda55fLeft Click|r |cff19ff19on plugin to toggle Blizzard's Raid Information frame."] = "|cffeda55fì¢-í´ë¦|r |cff19ff19íë¬ê·¸ì¸ì ëí ë¸ë¦¬ìë 공격ë ì ë³´ ì°½ íì/íììí¨." |
L["|cffeda55fRight Click|r |cff19ff19on plugin to open Configuration Menu."] = "|cffeda55fì°-í´ë¦|r |cff19ff19íë¬ê·¸ì¸ì ëí ì¤ì ë©ë´ ì´ê¸°." |
-- 1.8 strings |
--L["Hide expired instances from plugin text"] = true |
--L["Don't display instances with expired ID's on the plugin text."] = true |
--L["Active: "] = true |
--L["Expired: "] = true |
L["Show text for no saved instances"] = true |
L["Show the plugin text instead of number, when the character has no saved instances."] = true |
L["Short text"] = true |
L["Only show the number of saved instances, in the format [Active]:[Expired]."] = true |
L["Only show the number of saved instances, in the format [Group]:[Raid]:[Expired]."] = true |
L["Instance Information"] = true |
L["Show instance IDs"] = true |
L["Show or hide the numeric instance IDs."] = true |
-- 1.8 strings |
L["Hide expired instances from plugin text"] = true |
L["Don't display instances with expired ID's on the plugin text."] = true |
L["Active: "] = true |
L["Expired: "] = true |
--L["Show text for no saved instances"] = true |
--L["Show the plugin text instead of number, when the character has no saved instances."] = true |
L["Short text"] = "ç°¡çæå" |
--L["Only show the number of saved instances, in the format [Active]:[Expired]."] = true |
--L["Only show the number of saved instances, in the format [Group]:[Raid]:[Expired]."] = true |
L["Instance Information"] = "å¯æ¬é²åº¦è³è¨" |
L["Show instance IDs"] = "顯示å¯æ¬é²åº¦ID" |
L["Show or hide the numeric instance IDs."] = "顯示æé±èå¯æ¬é²åº¦çIDæ¸å" |
-- 1.8 strings |
--L["Hide expired instances from plugin text"] = true |
--L["Don't display instances with expired ID's on the plugin text."] = true |
--L["Active: "] = true |
--L["Expired: "] = true |
-- locals |
local _G = getfenv(0) |
local headings = {} |
local tt = nil |
local totaltime = 0 |
local returnarg = {} |
-- Helper funcs |
local function RemoveColorCode(label) |
if not label then return end |
return normalized |
end |
local function hidett(self, elapsed) |
totaltime = totaltime + elapsed |
if totaltime > 0.2 then |
totaltime = 0 |
if tt and not MouseIsOver(tt) then |
tt:SetScript("OnEnter", nil) |
tt:SetScript("OnLeave", nil) |
tooltip:Release(tt) |
tt = nil |
BRRaidSave:SetScript("OnUpdate", nil) |
elseif not tt then |
BRRaidSave:SetScript("OnUpdate", nil) |
end |
end |
end |
local function ClickHandlerFunc(cell, arg1, button) |
-- Obligatory sanity checks |
if not arg1 or type(arg1)~= "table" then return end |
if not arg1[1] or not arg1[2] or not arg1[3] or not arg1[4] or arg1[5] == nil then return end |
-- Handlers |
if button == "LeftButton" and not IsShiftKeyDown() then |
local iindex, instanceID, numofsaved = nil, nil, GetNumSavedInstances() |
for i = 1, numofsaved do |
instanceID = select(2, GetSavedInstanceInfo(i)) |
if instanceID == arg1[3] then iindex = i break end |
end |
if iindex and arg1[5] == false then |
SetSavedInstanceExtend(iindex, true) |
elseif iindex and arg1[5] == true then |
SetSavedInstanceExtend(iindex, false) |
end |
RequestRaidInfo() -- trigger update |
elseif button == "LeftButton" and IsShiftKeyDown() then |
if ChatFrameEditBox:IsVisible() then |
local reportlabel = L["Instance"]..": "..RemoveColorCode(arg1[1])..", "..L["Difficulty"]..": "..RemoveColorCode(arg1[2])..", "..L["ID"]..": "..RemoveColorCode(arg1[3])..", "..L["Expires"]..": "..RemoveColorCode(arg1[4]) |
ChatFrameEditBox:Insert(reportlabel) |
end |
end |
end |
-- Ace config table |
local options = { |
name = "Broker RaidSave", |
shortText = { |
type = 'toggle', width = "full", |
name = L["Short text"], |
desc = L["Only show the number of saved instances, in the format [Active]:[Expired]."], |
desc = L["Only show the number of saved instances, in the format [Group]:[Raid]:[Expired]."], |
order = 6, |
get = function() return Broker_RaidSaveConfig.shorttext end, |
set = function(_,v) Broker_RaidSaveConfig.shorttext = v |
BRRaidSave:Update() |
end, |
}, |
}, |
hidehint = { |
order = 7, type = "toggle", width = "full", |
name = L["Hide hint text"], |
desc = L["Hides the tooltip information/hint text."], |
get = function() return Broker_RaidSaveConfig.HideHint end, |
set = function(_,v) Broker_RaidSaveConfig.HideHint = v |
end, |
}, |
sortinstancesbyname = { |
type = 'toggle', |
name = L["Sort by name"], |
desc = L["Sorts the instances on the tooltip, using the name of the instance as a reference."], |
order = 7, |
order = 8, |
get = function() return Broker_RaidSaveConfig.sortbyinstancename end, |
set = function(_,v) |
Broker_RaidSaveConfig.sortbyinstancediff = false |
end, |
}, |
instancesnameorder = { |
order = 8, type = "select", |
order = 9, type = "select", |
name = L["List Ordering"], |
desc = L["Order style for the saved instances list."], |
get = function() return Broker_RaidSaveConfig.instancenameorder end, |
type = 'toggle', |
name = L["Sort by difficulty"], |
desc = L["Sorts the instances on the tooltip, using the instance difficulty as a reference."], |
order = 9, |
order = 10, |
get = function() return Broker_RaidSaveConfig.sortbyinstancediff end, |
set = function(_,v) |
Broker_RaidSaveConfig.sortbyinstancename = false |
Broker_RaidSaveConfig.sortbyinstancediff = v |
end, |
disabled = function() return not Broker_RaidSaveConfig.showdiff end, |
}, |
instancesdifforder = { |
order = 10, type = "select", |
order = 11, type = "select", |
name = L["List Ordering"], |
desc = L["Order style for the saved instances list."], |
get = function() return Broker_RaidSaveConfig.instancedifforder end, |
["desc"] = L["Descending"] |
}, |
}, |
showslider = { |
order = 12, type = "toggle", |
name = L["Enable scrolling"], |
desc = L["Activates and displays a scrolling slider bar, for the tooltip."], |
get = function() return Broker_RaidSaveConfig.ShowSlider end, |
set = function(_,v) Broker_RaidSaveConfig.ShowSlider = v |
end, |
}, |
slidermaxheight = { |
order = 13, type = "range", |
name = L["Tooltip Maximum Height"], |
desc = L["Sets the tooltip maximum height, after which it will be scrollable."], |
min = 100, max = 2000, step = 5, |
get = function() return Broker_RaidSaveConfig.SliderMaxHeight end, |
set = function(_,v) |
if v < 100 then v = 100 end |
if v > 2000 then v = 2000 end |
Broker_RaidSaveConfig.SliderMaxHeight = v end, |
disabled = function() return not Broker_RaidSaveConfig.ShowSlider end, |
}, |
nulloption2 = { |
order = 11, |
order = 14, |
type = "description", |
name = " ", |
cmdHidden = true |
}, |
instanceheader = { |
order = 12, |
order = 15, |
type = "header", |
name = L["Instance Information"], |
}, |
nulloption3 = { |
order = 13, |
order = 16, |
type = "description", |
name = " ", |
cmdHidden = true |
type = 'toggle', width = "full", |
name = L["Show instance IDs"], |
desc = L["Show or hide the numeric instance IDs."], |
order = 14, |
order = 17, |
get = function() return Broker_RaidSaveConfig.showid end, |
set = function(_,v) Broker_RaidSaveConfig.showid = v |
end, |
type = 'toggle', width = "full", |
name = L["Show instance difficulty mode"], |
desc = L["Adds a new column, indicating the dungeon or raid difficulty for the specific instance name and ID."], |
order = 15, |
order = 18, |
get = function() return Broker_RaidSaveConfig.showdiff end, |
set = function(_,v) Broker_RaidSaveConfig.showdiff = v |
set = function(_,v) Broker_RaidSaveConfig.showdiff = v |
if not Broker_RaidSaveConfig.showdiff and Broker_RaidSaveConfig.sortbyinstancediff then -- if not showing difficulty and we are sorting by it, sort by instance name instead |
Broker_RaidSaveConfig.sortbyinstancediff = false |
Broker_RaidSaveConfig.sortbyinstancename = true |
end |
end, |
}, |
showCooldown = { |
type = 'toggle', |
name = L["Show time remaining"], |
desc = L["Display the time the instance ID is still valid."], |
order = 16, |
order = 19, |
get = function() return Broker_RaidSaveConfig.showcooldown end, |
set = function(_,v) Broker_RaidSaveConfig.showcooldown = v |
set = function(_,v) Broker_RaidSaveConfig.showcooldown = v |
end, |
}, |
formatCooldown = { |
order = 17, type = "select", |
order = 20, type = "select", |
name = L["Remaining time format"], |
desc = L["Display style for the time until reset."], |
get = function() return Broker_RaidSaveConfig.formatcooldown end, |
}, |
}, |
nulloption4 = { |
order = 18, |
order = 21, |
type = "description", |
name = " ", |
cmdHidden = true |
}, |
instanceExpirationheader = { |
order = 19, |
order = 22, |
type = "header", |
name = L["Instance Expiration"], |
}, |
nulloption5 = { |
order = 20, |
order = 23, |
type = "description", |
name = " ", |
cmdHidden = true |
type = 'toggle', width = "full", |
name = L["Show instance expiration data"], |
desc = L["Display the date/time the instance ID expires."], |
order = 21, |
order = 24, |
get = function() return Broker_RaidSaveConfig.showreset end, |
set = function(_,v) Broker_RaidSaveConfig.showreset = v |
end, |
type = 'toggle', width = "full", |
name = L["Show day in week"], |
desc = L["Display the name of the day of the week, for the instance expiration string."], |
order = 22, |
order = 25, |
get = function() return Broker_RaidSaveConfig.formatdayw end, |
set = function(_,v) Broker_RaidSaveConfig.formatdayw = v |
end, |
type = 'toggle', width = "full", |
name = L["Hide expired instances from plugin text"], |
desc = L["Don't display instances with expired ID's on the plugin text."], |
order = 23, |
order = 26, |
get = function() return Broker_RaidSaveConfig.hideexpiredbutton end, |
set = function(_,v) Broker_RaidSaveConfig.hideexpiredbutton = v |
BRRaidSave:Update() |
type = 'toggle', width = "full", |
name = L["Hide expired instances from tooltip"], |
desc = L["Don't display instances with expired ID's on the tooltip."], |
order = 24, |
order = 27, |
get = function() return Broker_RaidSaveConfig.hideexpiredtip end, |
set = function(_,v) Broker_RaidSaveConfig.hideexpiredtip = v |
end, |
}, |
formatDate = { |
order = 25, type = "select", |
order = 28, type = "select", |
name = L["Expiry date format"], |
desc = L["Display style for the date instance IDs expire."], |
get = function() return Broker_RaidSaveConfig.formatdate end, |
}, |
}, |
formatTime = { |
order = 26, type = "select", |
order = 29, type = "select", |
name = L["Expiry time format"], |
desc = L["Display style for the time instance IDs expire."], |
get = function() return Broker_RaidSaveConfig.formattime end, |
instancenameorder = "desc", |
instancedifforder = "desc", |
hideexpiredtip = false, |
hideexpiredbutton = false |
hideexpiredbutton = false, |
SliderMaxHeight = 600, |
ShowSlider = true, |
HideHint = false |
} |
end |
-- added config options for v2.0 |
if not Broker_RaidSaveConfig.HideHint then Broker_RaidSaveConfig.HideHint = false end |
if not Broker_RaidSaveConfig.ShowSlider then Broker_RaidSaveConfig.ShowSlider = false end |
if not Broker_RaidSaveConfig.SliderMaxHeight then Broker_RaidSaveConfig.SliderMaxHeight = 600 end |
-- added config options for v1.7-v1.8 |
if not Broker_RaidSaveConfig.hideexpiredtip then Broker_RaidSaveConfig.hideexpiredtip = false end |
if not Broker_RaidSaveConfig.hideexpiredbutton then Broker_RaidSaveConfig.hideexpiredbutton = false end |
if Broker_RaidSaveConfig.hideexpiredbutton then instancenum = player.numactive else instancenum = player.numsaved end |
if instancenum == 0 and Broker_RaidSaveConfig.textwhenzero then self.obj.text = L["No Instances"] return end |
local labelactive = _G["NORMAL_FONT_COLOR_CODE"]..L["Active: "].."|r".._G["GREEN_FONT_COLOR_CODE"]..string.format("%d", player.numactive).."|r" |
local labelgroup = _G["NORMAL_FONT_COLOR_CODE"].._G["GROUP"]..": ".."|r".."|cff68ccef"..string.format("%d", player.numgroup).."|r" |
local labelraid = _G["NORMAL_FONT_COLOR_CODE"].." ".._G["RAID"]..": ".."|r".._G["GREEN_FONT_COLOR_CODE"]..string.format("%d", player.numraid).."|r" |
local labelexpired = _G["NORMAL_FONT_COLOR_CODE"].." "..L["Expired: "].."|r".._G["RED_FONT_COLOR_CODE"]..string.format("%d", player.numsaved - player.numactive).."|r" |
if Broker_RaidSaveConfig.shorttext then |
if Broker_RaidSaveConfig.hideexpiredbutton then |
self.obj.text = _G["GREEN_FONT_COLOR_CODE"]..string.format("%d", player.numactive).."|r" |
self.obj.text = "|cff68ccef"..string.format("%d", player.numgroup).."|r".." : ".._G["GREEN_FONT_COLOR_CODE"]..string.format("%d", player.numraid).."|r" |
else |
self.obj.text = _G["GREEN_FONT_COLOR_CODE"]..string.format("%d", player.numactive).."|r".." : ".._G["RED_FONT_COLOR_CODE"]..string.format("%d", player.numsaved - player.numactive).."|r" |
self.obj.text = "|cff68ccef"..string.format("%d", player.numgroup).."|r".." : ".._G["GREEN_FONT_COLOR_CODE"]..string.format("%d", player.numraid).."|r".." : ".._G["RED_FONT_COLOR_CODE"]..string.format("%d", player.numsaved - player.numactive).."|r" |
end |
else |
if Broker_RaidSaveConfig.hideexpiredbutton then labelexpired = "" end |
self.obj.text = labelactive..labelexpired |
self.obj.text = labelgroup..labelraid..labelexpired |
end |
end |
function BRRaidSave.obj.OnEnter(self) |
local colnum = 1 |
local savedinstances, templine |
local player = Broker_RaidSaveConfig.realm[GetRealmName()].char[GetUnitName("player")] |
local headings = {} |
local orientation = {"LEFT", "", "", "", "" } |
local colnum = 1 |
local orientation = {} |
headings = {} |
headings[colnum] = _G["LIGHTYELLOW_FONT_COLOR_CODE"]..L["Instance"].."|r " |
orientation[colnum] = "LEFT" |
if Broker_RaidSaveConfig.showdiff then |
colnum = colnum + 1 |
headings[colnum] = _G["LIGHTYELLOW_FONT_COLOR_CODE"]..L["Difficulty"].."|r " |
orientation[colnum] = "CENTER" |
end |
local maxentries = #orientation |
-- acquire frame |
tt = tooltip:Acquire("Broker_RaidSave", colnum, unpack(orientation, 1, 5)) |
tt = tooltip:Acquire("Broker_RaidSave", colnum, unpack(orientation, 1, maxentries)) |
tt:EnableMouse(true) |
tt:SetScript("OnEnter", function(self) BRRaidSave:SetScript("OnUpdate", nil) end) |
tt:SetScript("OnLeave", function(self) BRRaidSave:SetScript("OnUpdate", hidett) end) |
tt:SmartAnchorTo(self) |
tt:Clear() |
tt:SetScale(1) |
tt:SetBackdropBorderColor(1, 1, 1, 1) |
local colcount = tt:GetColumnCount() |
BRRaidSave:Drawtooltip() |
tt:Show() |
end |
function BRRaidSave:Drawtooltip() |
local player = Broker_RaidSaveConfig.realm[GetRealmName()].char[GetUnitName("player")] |
local savedinstances, templine |
local colcount = tt:GetColumnCount() |
tt:AddLine("") |
tt:SetCell(1, 1, _G["HIGHLIGHT_FONT_COLOR_CODE"].."Broker RaidSave", nil, "CENTER", colcount) |
for k, v in pairs(Broker_RaidSaveConfig.realm[GetRealmName()].char) do |
if v.numsaved > 0 then |
local displaytable = {} |
local i |
for i = 1, v.numsaved do |
if Broker_RaidSaveConfig.hideexpiredtip and (v.instance[i].expires == 0 or v.instance[i].expires < time()) then |
else |
local colnum = 1 |
local display = {} |
-- set namestring |
local namestring = _G["NORMAL_FONT_COLOR_CODE"]..v.instance[i].name.."|r" |
local namestring = "" |
if v.instance[i].extended then |
namestring = "|cff0090ff"..v.instance[i].name.."|r" |
else |
namestring = _G["NORMAL_FONT_COLOR_CODE"]..v.instance[i].name.."|r" |
end |
-- set idstring |
local idstring = "|cff2ce390".."["..v.instance[i].id.."]".."|r" |
-- set cooldown string |
if v.instance[i].israid ~= nil then |
instancediffstring = BRRaidSave:GetDungeonDifficultyText(v.instance[i].difficulty, v.instance[i].israid) |
else |
instancediffstring = "|cffa0933d".._G["UNKNOWN"].."|r".." " |
instancediffstring = "|cffa0933d".._G["UNKNOWN"].."|r" |
end |
-- Desaturate label colors for expired instances |
if v.instance[i].expires == 0 or v.instance[i].expires < time() then |
display[1] = namestring.." " |
if Broker_RaidSaveConfig.showdiff then |
colnum = colnum + 1 |
display[colnum] = instancediffstring |
display[colnum] = instancediffstring.." " |
end |
if Broker_RaidSaveConfig.showid then |
colnum = colnum + 1 |
colnum = colnum + 1 |
display[colnum] = expirestring |
end |
-- construct return table for currently logged on character only and insert it, into the display table |
-- Structure: returnarg = { <Instance Name>, <Diff>, <ID>, <Reset>, <Extended>} |
-- Instance Name : color coded string |
-- Diff : color coded string |
-- ID : string |
-- Reset : color coded string |
-- Extended : boolean |
if v.name == player.name then |
returnarg = {} -- reusable table |
returnarg[1] = namestring |
returnarg[2] = instancediffstring |
returnarg[3] = v.instance[i].id |
returnarg[4] = expirestring |
returnarg[5] = v.instance[i].extended |
display[colnum + 1] = returnarg |
end |
table.insert(displaytable, display) |
end |
end |
if #displaytable > 0 then |
-- handle sorting |
if Broker_RaidSaveConfig.sortbyinstancename then |
if Broker_RaidSaveConfig.instancenameorder == "desc" then |
table.sort(displaytable, function(a,b) return string.lower (a[1]) < string.lower(b[1]) end) |
table.sort(displaytable, function(a,b) return string.lower (RemoveColorCode(a[1])) < string.lower(RemoveColorCode(b[1])) end) |
else |
table.sort(displaytable, function(a,b) return string.lower (a[1]) > string.lower(b[1]) end) |
table.sort(displaytable, function(a,b) return string.lower (RemoveColorCode(a[1])) > string.lower(RemoveColorCode(b[1])) end) |
end |
elseif Broker_RaidSaveConfig.sortbyinstancediff then |
elseif Broker_RaidSaveConfig.sortbyinstancediff and Broker_RaidSaveConfig.showdiff then |
if Broker_RaidSaveConfig.instancedifforder == "desc" then |
table.sort(displaytable, function(a,b) return string.lower(RemoveColorCode(a[2])) < string.lower(RemoveColorCode(b[2])) end) |
else |
tt:AddLine(BRRaidSave:ClassColorise(v.class, v.name)) |
end |
tt:AddLine(unpack(headings,1,colcount)) |
local i |
for i = 1, #displaytable do |
tt:AddLine(unpack(displaytable[i],1,colcount)) |
templine = tt:AddLine(unpack(displaytable[i],1,colcount)) |
-- safeguard |
if displaytable[i][colcount + 1] then |
tt:SetCellScript(templine, 1, "OnMouseDown", ClickHandlerFunc , displaytable[i][colcount + 1]) |
end |
end |
end |
end |
end |
-- Tooltip Hint |
tt:AddLine(" ") |
templine = tt:AddLine("") |
tt:SetCell(templine, 1, L["|cffeda55fLeft Click|r |cff19ff19on plugin to toggle Blizzard's Raid Information frame."], nil, "LEFT", colcount) |
templine = tt:AddLine("") |
tt:SetCell(templine, 1, L["|cffeda55fRight Click|r |cff19ff19on plugin to open Configuration Menu."], nil, "LEFT", colcount) |
if not Broker_RaidSaveConfig.HideHint then |
tt:AddLine(" ") |
templine = tt:AddLine("") |
tt:SetCell(templine, 1, L["|cffeda55fLeft Click|r |cff19ff19on plugin to toggle Blizzard's Raid Information frame."], nil, "LEFT", colcount) |
templine = tt:AddLine("") |
tt:SetCell(templine, 1, L["|cffeda55fLeft Click|r |cff19ff19on instance name to toggle ID extension."], nil, "LEFT", colcount) |
templine = tt:AddLine("") |
tt:SetCell(templine, 1, L["|cffeda55fRight Click|r |cff19ff19on plugin to open Configuration Menu."], nil, "LEFT", colcount) |
templine = tt:AddLine("") |
tt:SetCell(templine, 1, L["|cffeda55fShift+Left Click|r |cff19ff19to paste instance info into chat."], nil, "LEFT", colcount) |
templine = tt:AddLine("") |
tt:SetCell(templine, 1, L["|cff0090ffBlue|r |cff19ff19colored instance names, indicate|r |cff0090ffextended|r |cff19ff19IDs.|r"], nil, "LEFT", colcount) |
end |
tt:Show() |
if Broker_RaidSaveConfig.ShowSlider then |
tt:UpdateScrolling(Broker_RaidSaveConfig.SliderMaxHeight) |
end |
end |
function BRRaidSave.obj.OnLeave() |
if tt then |
tooltip:Release(tt) |
tt = nil |
if tt and tt:IsVisible() then |
BRRaidSave:SetScript("OnUpdate", hidett) |
end |
end |
function BRRaidSave.obj.OnClick(self, button) |
if tt then |
tt:SetScript("OnEnter", nil) |
tt:SetScript("OnLeave", nil) |
tooltip:Release(tt) |
tt = nil |
end |
local par1, par2 = "", "" |
if withpar then par1, par2 = "(", ")" end |
local diffstr = "|cffffff9a"..par1.._G["UNKNOWN"]..par2.."|r" |
if not setting then return diffstr.." " end |
if not setting then return diffstr end |
if isRaid then |
-- raids |
if not _G["RAID_DIFFICULTY"..tostring(setting)] then return diffstr.." " end |
if not _G["RAID_DIFFICULTY"..tostring(setting)] then return diffstr end |
-- remove () chars from difficulty |
local tmpstr = string.gsub(_G["RAID_DIFFICULTY"..tostring(setting)], "%(", "") |
tmpstr = string.gsub(tmpstr, "%)", "") |
end |
else |
-- dungeons |
if not _G["DUNGEON_DIFFICULTY"..tostring(setting)] then return diffstr.." " end |
if not _G["DUNGEON_DIFFICULTY"..tostring(setting)] then return diffstr end |
-- remove () chars from difficulty |
local tmpstr = string.gsub(_G["DUNGEON_DIFFICULTY"..tostring(setting)], "%(", "") |
tmpstr = string.gsub(tmpstr, "%)", "") |
diffstr = _G["GREEN_FONT_COLOR_CODE"]..par1..tmpstr..par2.."|r" |
end |
end |
return diffstr.." " |
return diffstr |
end |
function BRRaidSave:Refresh() |
local player = Broker_RaidSaveConfig.realm[GetRealmName()].char[GetUnitName("player")] |
player.numsaved = GetNumSavedInstances() |
player.numactive = 0 |
player.instance = { } |
player.numactive, player.numgroup, player.numraid = 0, 0, 0 |
player.instance = {} |
if player.numsaved == 0 then |
else |
local iname, iid, iexpires, idiff, ilocked, iextended, iidmostsig, iisraid, temp |
for i = 1, player.numsaved do |
iname, iid, iexpires, idiff, ilocked, iextended, iidmostsig, iisraid = GetSavedInstanceInfo(i) |
if iexpires > 0 then iexpires = iexpires + time() player.numactive = player.numactive + 1 end |
if iexpires > 0 then |
iexpires = iexpires + time() |
player.numactive = player.numactive + 1 |
if iisraid == true then |
player.numraid = player.numraid + 1 |
elseif iisraid == false then |
player.numgroup = player.numgroup + 1 |
end |
end |
-- insert data into table |
temp = { name = iname, id = iid, idMostSig = iidmostsig, expires = iexpires, difficulty = idiff, locked = ilocked, extended = iextended, israid = iisraid } |
table.insert(player.instance, temp) |
end |
end |
self:Update() |
if tt and tt:IsVisible() then -- update tooltip if it exists and is visible |
tt:Clear() |
BRRaidSave:Drawtooltip() |
end |
end |
function BRRaidSave:GetDaysInMonth(year, month) |
## SavedVariables: Broker_RaidSaveConfig |
## X-Embeds: Ace3, LibAbacus-3.0, LibQTip-1.0 |
## X-Category: Raid |
## Version: 1.8 |
## Version: 2.0 |
## X-WoWI-ID: 11237 |
embeds.xml |
------------------------------------------------------------------------------ |
-- Cache debugging. |
------------------------------------------------------------------------------ |
--@debug@ |
--[===[@debug@ |
local usedTables, usedFrames, usedTooltips = 0, 0, 0 |
--@end-debug@ |
--@end-debug@]===] |
------------------------------------------------------------------------------ |
-- Internal constants to tweak the layout |
local function AcquireFrame(parent) |
local frame = tremove(frameHeap) or CreateFrame("Frame") |
frame:SetParent(parent) |
--@debug@ |
--[===[@debug@ |
usedFrames = usedFrames + 1 |
--@end-debug@ |
--@end-debug@]===] |
return frame |
end |
frame:SetBackdrop(nil) |
ClearFrameScripts(frame) |
tinsert(frameHeap, frame) |
--@debug@ |
--[===[@debug@ |
usedFrames = usedFrames - 1 |
--@end-debug@ |
--@end-debug@]===] |
end |
------------------------------------------------------------------------------ |
tooltip.scrollChild = scrollChild |
setmetatable(tooltip, tipMetatable) |
end |
--@debug@ |
--[===[@debug@ |
usedTooltips = usedTooltips + 1 |
--@end-debug@ |
--@end-debug@]===] |
return tooltip |
end |
layoutCleaner.registry[tooltip] = nil |
tinsert(tooltipHeap, tooltip) |
--@debug@ |
--[===[@debug@ |
usedTooltips = usedTooltips - 1 |
--@end-debug@ |
--@end-debug@]===] |
end |
------------------------------------------------------------------------------ |
-- Returns a table |
function AcquireTable() |
local tbl = tremove(tableHeap) or {} |
--@debug@ |
--[===[@debug@ |
usedTables = usedTables + 1 |
--@end-debug@ |
--@end-debug@]===] |
return tbl |
end |
function ReleaseTable(table) |
wipe(table) |
tinsert(tableHeap, table) |
--@debug@ |
--[===[@debug@ |
usedTables = usedTables - 1 |
--@end-debug@ |
--@end-debug@]===] |
end |
------------------------------------------------------------------------------ |
------------------------------------------------------------------------------ |
-- Debug slashcmds |
------------------------------------------------------------------------------ |
--@debug@ |
--[===[@debug@ |
local print = print |
local function PrintStats() |
local tipCache = tostring(#tooltipHeap) |
SLASH_LibQTip1 = "/qtip" |
SlashCmdList["LibQTip"] = PrintStats |
--@end-debug@ |
--@end-debug@]===] |