update
This commit is contained in:
@@ -0,0 +1,550 @@
|
||||
local AceLocale = LibStub ("AceLocale-3.0")
|
||||
local Loc = AceLocale:GetLocale ("DetailsDmgRank")
|
||||
|
||||
--> Needed locals
|
||||
local _GetTime = GetTime --> wow api local
|
||||
local _UFC = UnitAffectingCombat --> wow api local
|
||||
local _IsInRaid = IsInRaid --> wow api local
|
||||
local _IsInGroup = IsInGroup --> wow api local
|
||||
local _UnitAura = UnitAura --> wow api local
|
||||
local _math_floor = math.floor --> lua library local
|
||||
local _cstr = string.format --> lua library local
|
||||
|
||||
--> Create the plugin Object
|
||||
local DmgRank = _detalhes:NewPluginObject ("Details_DmgRank")
|
||||
--> Main Frame
|
||||
local DmgRankFrame = DmgRank.Frame
|
||||
|
||||
|
||||
--> this function will run when the plugin receives the Addon_Loaded event, ["data"] = previus saved player rank
|
||||
local function CreatePluginFrames (data)
|
||||
|
||||
--> catch Details! main object
|
||||
local _detalhes = _G._detalhes
|
||||
local DetailsFrameWork = _detalhes.gump
|
||||
--local
|
||||
|
||||
--> default rank table
|
||||
DmgRank.rank = data or {level = 1, dps = 0, dpshistory = {}, lasttry = {}, annouce = true}
|
||||
--DmgRank.rank.level = 20
|
||||
|
||||
--> OnEvent Table
|
||||
function DmgRank:OnDetailsEvent (event, ...)
|
||||
if (event == "HIDE") then --> plugin hidded, disabled
|
||||
DmgRankFrame:SetScript ("OnUpdate", nil)
|
||||
DmgRank:Cancel()
|
||||
|
||||
elseif (event == "SHOW") then
|
||||
|
||||
elseif (event == "REFRESH") then --> requested a refresh window
|
||||
DmgRank:Refresh()
|
||||
|
||||
elseif (event == "COMBAT_PLAYER_TIMESTARTED") then --> combat started
|
||||
--print ("recebeu event start")
|
||||
local combat = select (1, ...)
|
||||
--print (combat)
|
||||
DmgRank:Start()
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
------------- Build Ranking ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--> damage goal table
|
||||
DmgRank.TimeGoal = {
|
||||
|
||||
--> The 30 seconds Trial
|
||||
{time = 30, damage = 1500000, name = Loc ["CHALLENGENAME_1"]}, -- Ready to Raid -- rank 2 --> -- Patrulha --> 50K DPS required
|
||||
{time = 30, damage = 1800000, name = Loc ["CHALLENGENAME_2"]}, -- Damage Practice --rank 3 --> -- Soldier --> 60K DPS required
|
||||
{time = 30, damage = 2100000, name = Loc ["CHALLENGENAME_3"]}, -- The Training Continue... -- rank 4 --> -- Corporal --> 70K DPS required
|
||||
|
||||
--> 90 seconds bracket
|
||||
{time = 90, damage = 5080000, name = Loc ["CHALLENGENAME_4"]}, -- You Just Need a Little More Time -- rank 5 --> -- Sergeant --> 56K DPS required
|
||||
{time = 90, damage = 5814800, name = Loc ["CHALLENGENAME_5"]}, -- Became a Knight -- rank 6 --> -- Sergeant --> 64K DPS required
|
||||
|
||||
--> middle bracket
|
||||
{time = 120, damage = 7901760, name = Loc ["CHALLENGENAME_6"]}, -- Two Minutes -- rank 7 --> Iron Knight --> 65K DPS required
|
||||
{time = 120, damage = 8442112, name = Loc ["CHALLENGENAME_7"]}, --rank 8 --> Steel Knight --> 70K DPS required
|
||||
{time = 180, damage = 13452000, name = Loc ["CHALLENGENAME_8"]}, --rank 9 --> --> The High Knight --> 74K DPS required
|
||||
{time = 180, damage = 14152100, name = Loc ["CHALLENGENAME_9"]}, --rank 10 --> Yes Sir! -- Thorium Knight --> 78K DPS required
|
||||
{time = 180, damage = 15052100, name = Loc ["CHALLENGENAME_10"]}, --rank 11 --> Salute -- Silver Lieutenant --> 83K DPS required
|
||||
|
||||
--> burst bracket
|
||||
{time = 40, damage = 5000000, name = Loc ["CHALLENGENAME_11"]}, --rank 12 --> In Burst We Trust -- Gold Lieutenant --> 125K DPS required
|
||||
{time = 40, damage = 5700000, name = Loc ["CHALLENGENAME_12"]}, --rank 13 --> Watch me Explode -- Stone Guardian --> 142K DPS required
|
||||
{time = 40, damage = 6300000, name = Loc ["CHALLENGENAME_13"]}, --rank 14 --> T.N.T-- Fel Guardian --> 157K DPS required
|
||||
|
||||
--> long run bracket
|
||||
{time = 300, damage = 35052100, name = Loc ["CHALLENGENAME_14"]}, --rank 15 --> Time is Damage My Friend -- Titan Guardian --> 116K DPS required
|
||||
{time = 330, damage = 41151120, name = Loc ["CHALLENGENAME_15"]}, --rank 16 - Just a Little Patience --> Bronze Centurion --> 124K DPS required
|
||||
{time = 360, damage = 47395100, name = Loc ["CHALLENGENAME_16"]}, --rank 17 --> Silver Centurion --> 131K DPS required
|
||||
|
||||
{time = 300, damage = 56911000, name = Loc ["CHALLENGENAME_17"]}, --rank 18 --> Flame Centurion --> ?K DPS required
|
||||
{time = 360, damage = 71821980, name = Loc ["CHALLENGENAME_18"]}, --rank 19 --> Lower Vanquisher --> ?K DPS required
|
||||
{time = 180, damage = 45910990, name = Loc ["CHALLENGENAME_19"]}, --rank 20 --> Middle Vanquisher --> ?K DPS required
|
||||
|
||||
--> end
|
||||
{time = nil, damage = nil, name = ""}, --rank 21 --> none
|
||||
}
|
||||
|
||||
--> tiles and badges
|
||||
DmgRank.Titles = {
|
||||
|
||||
Loc ["RANKNAME_1"], --> rank 1 --> -- recruit -- Recruta -- Farmer
|
||||
Loc ["RANKNAME_2"], --> rank 2 --> soldier
|
||||
Loc ["RANKNAME_3"], --> rank 3 --> corporal
|
||||
|
||||
Loc ["RANKNAME_4"], --> rank 4 --> -- Gold Sergeant
|
||||
Loc ["RANKNAME_5"], --> rank 5 --> -- Star Sergeant
|
||||
|
||||
Loc ["RANKNAME_6"], --> rank 6 - Iron Knight
|
||||
Loc ["RANKNAME_7"], --> rank 7 - Steel Knight
|
||||
Loc ["RANKNAME_8"], --> rank 8 - Mithril Knight
|
||||
Loc ["RANKNAME_9"], --> rank 9 - Thorium Knight
|
||||
|
||||
Loc ["RANKNAME_10"], --> rank 10 - Silver Lieutenant
|
||||
Loc ["RANKNAME_11"], --> rank 11 - Gold Lieutenant
|
||||
|
||||
Loc ["RANKNAME_12"], --> rank 12 - Stone Guardian
|
||||
Loc ["RANKNAME_13"], --> rank 13 - Fel Guardian
|
||||
Loc ["RANKNAME_14"], --> rank 14 - Titan Guardian
|
||||
|
||||
Loc ["RANKNAME_15"], --> rank 15 - Bronze Centurion
|
||||
Loc ["RANKNAME_16"], --> rank 16 - Silver Centurion
|
||||
Loc ["RANKNAME_17"], --> rank 17 - Flame Centurion
|
||||
|
||||
Loc ["RANKNAME_18"], --> rank 18 - "Lower Vanquisher"
|
||||
Loc ["RANKNAME_19"], --> rank 19 - "Middle Vanquisher"
|
||||
Loc ["RANKNAME_20"], --> rank 20 - "High Vanquisher"
|
||||
|
||||
--[[
|
||||
legionary
|
||||
Commander
|
||||
General
|
||||
marshal
|
||||
Champion -- campeoao
|
||||
Conqueror -- conquistador
|
||||
--]]
|
||||
|
||||
}
|
||||
DmgRank.Badges = {}
|
||||
DmgRank.Badges.TexCoords = {
|
||||
{0.7734375, 0.89453125, 0.060546875, 0.181640625}, --> rank 1
|
||||
{0.1640625, 0.259765625, 0.083984375, 0.185546875}, --> rank 2 - soldier
|
||||
{0.31640625, 0.412109375, 0.06640625, 0.18359375}, --> rank 3 --> Corporal
|
||||
{0.45703125, 0.55078125, 0.05859375, 0.177734375}, --> rank 4 --> Gold Sergeant
|
||||
{0.607421875, 0.701171875, 0.044921875, 0.177734375}, --> rank 5 --> star Sergeant
|
||||
|
||||
{0.017578125, 0.169921875, 0.236328125, 0.3984375}, --> rank 6 - Iron Knight
|
||||
{0.201171875, 0.357421875, 0.234375, 0.3984375}, --> rank 7 - Steel Knight
|
||||
{0.38671875, 0.541015625, 0.234375, 0.3984375}, --> rank 8 - Mithril Knight
|
||||
{0.572265625, 0.7265625, 0.234375, 0.3984375}, --> rank 9 - Thorium Knight
|
||||
|
||||
{0.16015625, 0.2734375, 0.44921875, 0.583984375}, --> rank 10 - Silver Lieutenant
|
||||
{0.0234375, 0.130859375, 0.44921875, 0.583984375}, --> rank 11 - Gold Lieutenant
|
||||
|
||||
{0.30078125, 0.4375, 0.44140625, 0.5859375}, --> rank 12 - Stone Guardian
|
||||
{0.45703125, 0.59375, 0.44140625, 0.5859375}, --> rank 13 - Fel Guardian
|
||||
{0.61328125, 0.75, 0.44140625, 0.5859375}, --> rank 14 - Titan Guardian
|
||||
|
||||
{0.017578125, 0.173828125, 0.625, 0.78125}, --> rank 15 - Bronze Centurion
|
||||
{0.212890625, 0.369140625, 0.625, 0.78125}, --> rank 16 - Silver Centurion
|
||||
{0.408203125, 0.56640625, 0.625, 0.78125}, --> rank 17 - Flame Centurion
|
||||
|
||||
{0.00390625, 0.208984375, 0.810546875, 0.9765625}, --> rank 18 - Lower Vanquisher
|
||||
{0.21875, 0.42578125, 0.810546875, 0.9765625}, --> rank 19 - Middle Vanquisher
|
||||
{0.43359375, 0.638671875, 0.810546875, 0.9765625}, --> rank 20 - High Vanquisher
|
||||
|
||||
}
|
||||
DmgRank.Badges.Sizes = {
|
||||
{50, 50}, --> rank 1
|
||||
{50, 52}, --> rank 2 - soldier
|
||||
{50, 60}, --> rank 3 - Corporal
|
||||
{49, 59}, --> rank 4 - Gold Sergeant
|
||||
{48, 61}, ---> rank 5 - star Sergeant
|
||||
{56, 63}, --> rank 6 - Iron Knight
|
||||
{56, 63}, -->rank 7 - Steel Knight
|
||||
{56, 63}, --> rank 8 - Mithril Knight
|
||||
{56, 63}, --> rank 9 - Thorium Knight
|
||||
|
||||
{61, 59}, --> rank 10 - Silver Lieutenant
|
||||
{55, 67}, --> rank 11 - Gold Lieutenant
|
||||
|
||||
{70, 74}, --> rank 12 - Stone Guardian
|
||||
{70, 74}, --> rank 13 - Fel Guardian
|
||||
{70, 74}, --> rank 14 - Titan Guardian
|
||||
|
||||
{70, 70}, --> rank 15 - Bronze Centurion
|
||||
{70, 70}, --> rank 16 - Silver Centurion
|
||||
{70, 70}, --> rank 17 - Flame Centurion
|
||||
|
||||
{80, 65}, --> rank 18 - Lower Vanquisher
|
||||
{80, 65}, --> rank 19 - Middle Vanquisher
|
||||
{80, 65}, --> rank 20 - High Vanquisher
|
||||
}
|
||||
DmgRank.Badges.SetPointMod = {
|
||||
{0, 6}, --> rank 1
|
||||
{0, 5}, --> rank 2 - soldier
|
||||
{0, 10}, --> rank 3 - Corporal
|
||||
{0, 10}, --> rank 4 - Gold Sergeant
|
||||
{0, 16}, --> rank 5 - star Sergeant
|
||||
{0, 12}, --> rank 6 - Iron Knight
|
||||
{0, 12}, --> rank 7 - Steel Knight
|
||||
{0, 12}, --> rank 8 - Mithril Knight
|
||||
{0, 12}, --> rank 9 - Thorium Knight
|
||||
|
||||
{0, 12}, --> rank 10 - Silver Lieutenant
|
||||
{0, 17}, --> rank 11 - Gold Lieutenant
|
||||
|
||||
{0, 20}, --> rank 12 - Stone Guardian
|
||||
{0, 20}, --> rank 13 - Fel Guardian
|
||||
{0, 20}, --> rank 14 - Titan Guardian
|
||||
|
||||
{0, 20}, --> rank 15 - Bronze Centurion
|
||||
{0, 20}, --> rank 16 - Silver Centurion
|
||||
{0, 20}, --> rank 17 - Flame Centurion
|
||||
|
||||
{-3, 16}, --> rank 18 - Lower Vanquisher
|
||||
{-3, 16}, --> rank 19 - Middle Vanquisher
|
||||
{-3, 16}, --> rank 20 - High Vanquisher
|
||||
|
||||
}
|
||||
|
||||
--> main frame and background texture
|
||||
|
||||
DmgRankFrame:SetPoint ("topleft", UIParent)
|
||||
DmgRankFrame:SetResizable (false) --> cant resize, this is a fixed size
|
||||
DmgRankFrame:SetWidth (300) --> need to be 300x300 to fit details window
|
||||
DmgRankFrame:SetHeight (300) --> need to be 300x300 to fit details window
|
||||
DmgRank.Frame = DmgRankFrame
|
||||
DmgRankFrame:Hide()
|
||||
|
||||
--> default background picture
|
||||
local background = DmgRankFrame:CreateTexture (nil, "background")
|
||||
background:SetTexture ("Interface\\ACHIEVEMENTFRAME\\UI-Achievement-StatsBackground")
|
||||
background:SetPoint ("topleft", DmgRankFrame, "topleft", 2, 0)
|
||||
background:SetPoint ("bottomright", DmgRankFrame, "bottomright", -2, 0)
|
||||
background:SetVertexColor (.7, .7, .7, 1)
|
||||
background:SetDrawLayer ("background", 1)
|
||||
DmgRank.BackgroundTex = background
|
||||
|
||||
local AnimeFrame = CreateFrame ("frame", nil, DmgRankFrame)
|
||||
AnimeFrame:SetAllPoints (DmgRankFrame)
|
||||
|
||||
local background2 = AnimeFrame:CreateTexture (nil, "background")
|
||||
background2:SetTexture ("Interface\\AddOns\\Details_DmgRank\\solo_bgtimeattack")
|
||||
background2:SetPoint ("topleft", DmgRankFrame, "topleft", 2, 0)
|
||||
background2:SetPoint ("bottomright", DmgRankFrame, "bottomright", -2, 0)
|
||||
DmgRank.BackgroundTex2 = background2
|
||||
background2:SetDrawLayer ("background", 2)
|
||||
|
||||
local RotateAnimGroup = AnimeFrame:CreateAnimationGroup()
|
||||
local rotate = RotateAnimGroup:CreateAnimation ("Rotation")
|
||||
rotate:SetDegrees (360)
|
||||
rotate:SetDuration (120)
|
||||
RotateAnimGroup:SetLooping ("repeat")
|
||||
RotateAnimGroup:Play()
|
||||
|
||||
--> next rank at display
|
||||
local challengeName = DetailsFrameWork:NewLabel (DmgRankFrame, DmgRankFrame, nil, "challengeName", "", "QuestFont_Shadow_Huge")
|
||||
challengeName:SetPoint ("center", DmgRankFrame, "center")
|
||||
challengeName:SetPoint ("top", DmgRankFrame, "top", 0, -98)
|
||||
DmgRank.challengeName = challengeName
|
||||
|
||||
local challengeGoal = DetailsFrameWork:NewLabel (DmgRankFrame, DmgRankFrame, nil, "challengeGoal", "", "GameFontHighlightSmall")
|
||||
challengeGoal:SetPoint ("center", DmgRankFrame, "center")
|
||||
challengeGoal:SetPoint ("top", DmgRankFrame, "top", 0, -118)
|
||||
DmgRank.challengeGoal = challengeGoal
|
||||
|
||||
--> main time display
|
||||
local showTimeMinutes = DetailsFrameWork:NewLabel (DmgRankFrame, DmgRankFrame, nil, "showTimeMinutes", "00:", "GameFontHighlightLarge")
|
||||
showTimeMinutes:SetPoint ("center", DmgRankFrame, "center")
|
||||
showTimeMinutes:SetPoint ("top", DmgRankFrame, "top", -25, -150)
|
||||
showTimeMinutes:SetJustifyH ("RIGHT")
|
||||
DmgRank.TimeMinutes = showTimeMinutes
|
||||
|
||||
local showTimeSeconds = DetailsFrameWork:NewLabel (DmgRankFrame, DmgRankFrame, nil, "showTimeSeconds", "00:", "GameFontHighlightLarge")
|
||||
showTimeSeconds:SetPoint ("center", DmgRankFrame, "center")
|
||||
showTimeSeconds:SetPoint ("top", DmgRankFrame, "top", 0, -150)
|
||||
DmgRank.TimeSeconds = showTimeSeconds
|
||||
|
||||
local showTimeMiliSeconds = DetailsFrameWork:NewLabel (DmgRankFrame, DmgRankFrame, nil, "showTimeMiliSeconds", "00", "GameFontHighlightLarge")
|
||||
showTimeMiliSeconds:SetPoint ("center", DmgRankFrame, "center")
|
||||
showTimeMiliSeconds:SetPoint ("top", DmgRankFrame, "top", 23, -150)
|
||||
DmgRank.TimeMiliSeconds = showTimeMiliSeconds
|
||||
|
||||
--> main damage display
|
||||
local damage = DetailsFrameWork:NewLabel (DmgRankFrame, DmgRankFrame, "showdamage", nil, "00.000.000", "GameFontHighlightLarge")
|
||||
damage:SetPoint ("center", DmgRankFrame, "center")
|
||||
damage:SetPoint ("top", DmgRankFrame, "top", 0, -170)
|
||||
DmgRank.MainDamageDisplay = damage
|
||||
|
||||
--> background da badge e titulo
|
||||
local bg1 = DetailsFrameWork:NewPanel (DmgRankFrame, _, "DetailsDmgRankBadgeBackground", _, 280, 75)
|
||||
bg1:SetPoint ("topleft", DmgRankFrame, 10, -10)
|
||||
bg1:DisableGradient()
|
||||
|
||||
local GlowFrame = CreateFrame ("frame", "DetailsRankUpGlowFrame", bg1.widget, "DetailsAlertRankUpTemplate")
|
||||
GlowFrame:SetPoint ("topleft", bg1.widget)
|
||||
GlowFrame:SetWidth (280)
|
||||
GlowFrame:SetHeight (60)
|
||||
GlowFrame:Hide()
|
||||
|
||||
--> badge icon display
|
||||
local titleIcon = bg1:CreateTexture (nil, "overlay")
|
||||
titleIcon:SetTexture ("Interface\\AddOns\\Details_DmgRank\\images\\badges")
|
||||
titleIcon:SetTexCoord (unpack (DmgRank.Badges.TexCoords [DmgRank.rank.level]))
|
||||
titleIcon:SetWidth (DmgRank.Badges.Sizes [DmgRank.rank.level] [1]*1.33)
|
||||
titleIcon:SetHeight (DmgRank.Badges.Sizes [DmgRank.rank.level] [2]*1.33)
|
||||
titleIcon:SetPoint ("topleft", DmgRankFrame, "topleft", 20, -20)
|
||||
DmgRank.TitleIcon = titleIcon
|
||||
|
||||
--> title
|
||||
local pretitle = DetailsFrameWork:NewLabel (bg1, bg1, nil, "pretitle", Loc ["STRING_CURRENTRANK"], "GameFontHighlightSmall")
|
||||
pretitle:SetPoint ("left", titleIcon, "right", 20, 9)
|
||||
DmgRank.PreTitle = pretitle
|
||||
|
||||
local title = DetailsFrameWork:NewLabel (bg1, bg1, nil, "title", DmgRank.Titles [DmgRank.rank.level], "GameFontHighlightLarge")
|
||||
title:SetPoint ("left", titleIcon, "right", 20, -9)
|
||||
DmgRank.Title = title
|
||||
|
||||
--> announce switch
|
||||
local announce = DetailsFrameWork:NewSwitch (bg1, _, "DetailsDmgRankAnnouce", "announceSwitch", 60, 20, _, _, DmgRank.rank.annouce)
|
||||
bg1.announceSwitch:SetPoint ("topleft", DmgRankFrame, 12, -184)
|
||||
bg1.announceSwitch.OnSwitch = function (self, _, value)
|
||||
DmgRank.rank.annouce = value
|
||||
end
|
||||
DetailsFrameWork:NewLabel (bg1, _, nil, "announceLabel", Loc ["STRING_ANNOUNCE"], "GameFontHighlightSmall")
|
||||
bg1.announceLabel:SetPoint ("bottom", bg1.announceSwitch, "top", -5, -2)
|
||||
|
||||
--> background dos tempos das ultimas tries
|
||||
local lasttrylabel = DetailsFrameWork:NewLabel (bg1, bg1, nil, "lasttrylabel", Loc ["STRING_LASTTRIES"], "GameFontHighlightSmall") -->
|
||||
lasttrylabel:SetPoint ("topleft", DmgRankFrame, 12, -204)
|
||||
local lastranklabel = DetailsFrameWork:NewLabel (bg1, bg1, nil, "lastranklabel", Loc ["STRING_LASTRANKS"], "GameFontHighlightSmall") -->
|
||||
lastranklabel:SetPoint ("topleft", DmgRankFrame, 162, -204)
|
||||
|
||||
local bg_esq = DetailsFrameWork:NewPanel (DmgRankFrame, _, "DetailsDmgRankLeftBackground", _, 130, 85, _, {.9, .9, .9, .7})
|
||||
bg_esq:SetPoint ("topleft", DmgRankFrame, 10, -215)
|
||||
local bg_dir = DetailsFrameWork:NewPanel (DmgRankFrame, _, "DetailsDmgRankRightBackground", _, 130, 85, _, {.9, .9, .9, .7})
|
||||
bg_dir:SetPoint ("topleft", DmgRankFrame, 160, -215)
|
||||
|
||||
--> try dps dos 5 ultimos ranks
|
||||
DmgRank.Try = {}
|
||||
for i = 1, 5 do
|
||||
DetailsFrameWork:NewLabel (bg_esq, bg_esq, nil, "try"..i, "0", "GameFontHighlightSmall")
|
||||
bg_esq ["try"..i]:SetPoint ("bottomleft", DmgRankFrame, "bottomleft", 20, math.abs (i*15-83))
|
||||
DmgRank.Try [i] = bg_esq ["try"..i]
|
||||
end
|
||||
|
||||
--> dps dos 5 ultimos ranks
|
||||
DmgRank.Dps = {}
|
||||
for i = 1, 5 do
|
||||
DetailsFrameWork:NewLabel (bg_dir, bg_dir, nil, "dps"..i, "0", "GameFontHighlightSmall")
|
||||
bg_dir ["dps"..i]:SetPoint ("bottomleft", DmgRankFrame, "bottomleft", 170, math.abs (i*15-83))
|
||||
DmgRank.Dps [i] = bg_dir ["dps"..i]
|
||||
end
|
||||
|
||||
--> refresh all window components
|
||||
function DmgRank:Refresh()
|
||||
--> update badge icon and text
|
||||
|
||||
if (not self) then
|
||||
self = DmgRank
|
||||
end
|
||||
|
||||
self.challengeName:SetText (self.TimeGoal[DmgRank.rank.level].name)
|
||||
if (self.TimeGoal[DmgRank.rank.level].damage) then
|
||||
self.challengeGoal:SetText (_detalhes:comma_value (self.TimeGoal[DmgRank.rank.level].damage) .. " ".. Loc ["STRING_DAMAGEIN"] .." " .. self.TimeGoal[DmgRank.rank.level].time .. " " ..Loc ["STRING_SECONDS"])
|
||||
else
|
||||
self.challengeGoal:SetText ("")
|
||||
end
|
||||
self.Title:SetText (self.Titles [DmgRank.rank.level])
|
||||
|
||||
self.TitleIcon:SetTexCoord (unpack (self.Badges.TexCoords [DmgRank.rank.level]))
|
||||
self.TitleIcon:SetWidth (self.Badges.Sizes [DmgRank.rank.level] [1]*1.33)
|
||||
self.TitleIcon:SetHeight (self.Badges.Sizes [DmgRank.rank.level] [2]*1.33)
|
||||
self.TitleIcon:SetPoint ("topleft", DmgRankFrame, 20+self.Badges.SetPointMod[DmgRank.rank.level][1], -20+self.Badges.SetPointMod[DmgRank.rank.level][2])
|
||||
|
||||
--> update last try atempts
|
||||
for i = 1, 5 do
|
||||
if (DmgRank.rank.lasttry [i]) then
|
||||
self.Try [i]:SetText ("#"..i..": ".. _detalhes:comma_value (DmgRank.rank.lasttry [i]))
|
||||
else
|
||||
self.Try [i]:SetText ("-")
|
||||
end
|
||||
end
|
||||
|
||||
--> update last levels ups
|
||||
for i = 1, 5 do
|
||||
if (DmgRank.rank.dpshistory [i]) then
|
||||
self.Dps [i]:SetText (Loc ["STRING_RANK"] .. " ".. DmgRank.rank.dpshistory [i])
|
||||
else
|
||||
self.Dps [i]:SetText ("-")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--> Refresh on Addon Load
|
||||
DmgRank:Refresh()
|
||||
|
||||
local update = 0
|
||||
local player --> short cut for Player Actor Object
|
||||
|
||||
--> Cancel function
|
||||
function DmgRank:Cancel()
|
||||
if (DmgRank.Time and DmgRank.Time.Working) then
|
||||
print (Loc ["STRING_CANCELLED"])
|
||||
DmgRank.Time.Working = false
|
||||
DmgRank.Time.Done = true
|
||||
DmgRank.Frame:SetScript ("OnUpdate", nil)
|
||||
end
|
||||
end
|
||||
|
||||
--> Exec function
|
||||
local DoDmgRank = function (self, elapsed)
|
||||
|
||||
DmgRank.Time.Elapsed = DmgRank.Time.Elapsed + elapsed
|
||||
update = update + elapsed
|
||||
|
||||
if (_GetTime() > DmgRank.Time.EndTime) then --> reached the end time
|
||||
if (DmgRank.Time.Working and not DmgRank.Time.Done) then
|
||||
DmgRank:Cancel()
|
||||
DmgRank:Finish()
|
||||
end
|
||||
else
|
||||
--> aqui vem as funções que verificam se o jogador esta em grupo ou se tem algum buff proibido
|
||||
DmgRank.Time.Tick = DmgRank.Time.Tick + elapsed
|
||||
if (DmgRank.Time.Tick > 1) then
|
||||
DmgRank.Time.Tick = 0
|
||||
if (not _UFC ("player")) then --> isn't in combat
|
||||
print (Loc ["STRING_CANCELLED_NOT_COMBAT"])
|
||||
DmgRank:Cancel()
|
||||
elseif (_IsInRaid() or _IsInGroup()) then
|
||||
print (Loc ["STRING_CANCELLED_IN_GROUP"])
|
||||
DmgRank:Cancel()
|
||||
else
|
||||
--> check for not allowed buffs:
|
||||
for i = 1, 41 do
|
||||
local auraName, _, _, _, _, _, _, _, _, _, spellId = _UnitAura ("player", i)
|
||||
if (spellId and (spellId == 2825 or spellId == 80353 or spellId == 90355)) then --> bloodlust//timewarp//ancient hysteria
|
||||
print (Loc ["STRING_CANCELLED_AURA"] .. auraName)
|
||||
DmgRank:Cancel()
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if (update > 0.050) then
|
||||
|
||||
local minutos, segundos = _math_floor (DmgRank.Time.Elapsed/60), _math_floor (DmgRank.Time.Elapsed%60)
|
||||
if (segundos < 10) then
|
||||
segundos = "0"..segundos
|
||||
end
|
||||
local mili = _cstr ("%.2f", DmgRank.Time.Elapsed - _math_floor (DmgRank.Time.Elapsed))*100
|
||||
if (mili < 10) then
|
||||
mili = "0"..mili
|
||||
end
|
||||
DmgRank.TimeMinutes:SetText ("0".. minutos .. ":")
|
||||
DmgRank.TimeSeconds:SetText (segundos ..":")
|
||||
DmgRank.TimeMiliSeconds:SetText (mili)
|
||||
|
||||
DmgRank.MainDamageDisplay:SetText (_detalhes:comma_value (player.total))
|
||||
update = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--> add failed attempt to falied records
|
||||
function DmgRank:FailedLevelUpRank()
|
||||
table.insert (DmgRank.rank.lasttry, 1, player.total)
|
||||
table.remove (DmgRank.rank.lasttry, 6)
|
||||
DmgRank:Refresh()
|
||||
end
|
||||
|
||||
--> Levelup
|
||||
function DmgRank:LevelUpRank()
|
||||
_detalhes:PlayGlow (GlowFrame)
|
||||
DmgRank.rank.level = DmgRank.rank.level + 1
|
||||
|
||||
if (DmgRank.rank.annouce) then
|
||||
SendChatMessage (UnitName ("player") .. " " .. Loc ["STRING_ANNOUNCE_STRING"] .. " " .. DmgRank.rank.level .. " (" .. self.Titles [DmgRank.rank.level] .. ") " .. Loc ["STRING_ANNOUNCE_ON"] .. " Details! " .. Loc ["STRING_PLUGIN_NAME"] .. ".", "GUILD")
|
||||
end
|
||||
|
||||
DmgRank.rank.dps = player.total
|
||||
table.insert (DmgRank.rank.dpshistory, 1, DmgRank.rank.level..": ".._detalhes:comma_value (player.total))
|
||||
table.remove (DmgRank.rank.dpshistory, 6)
|
||||
DmgRank:Refresh()
|
||||
end
|
||||
|
||||
--> When the time is gone
|
||||
function DmgRank:Finish()
|
||||
local DamageGoal = DmgRank.TimeGoal [DmgRank.rank.level].damage --> damage
|
||||
if (player.total > DamageGoal) then --> yeah, you didit
|
||||
DmgRank:LevelUpRank()
|
||||
else
|
||||
DmgRank:FailedLevelUpRank()
|
||||
end
|
||||
end
|
||||
|
||||
--> When a new combat is received by the PlugIn
|
||||
function DmgRank:Start()
|
||||
|
||||
if (DmgRank.Time and DmgRank.Time.Working) then
|
||||
return
|
||||
end
|
||||
|
||||
if (not DmgRank.TimeGoal[DmgRank.rank.level].damage) then
|
||||
return
|
||||
end
|
||||
|
||||
--> reset
|
||||
DmgRank.TimeMinutes:SetText ("00:")
|
||||
DmgRank.TimeSeconds:SetText ("00:")
|
||||
DmgRank.TimeMiliSeconds:SetText ("00")
|
||||
DmgRank.MainDamageDisplay:SetText ("00.000.000")
|
||||
|
||||
DmgRank.Time = {}
|
||||
DmgRank.Time.StartTime = _GetTime()
|
||||
DmgRank.Time.EndTime = DmgRank.Time.StartTime + DmgRank.TimeGoal[DmgRank.rank.level].time
|
||||
DmgRank.Time.Elapsed = 0
|
||||
DmgRank.Time.Done = nil
|
||||
DmgRank.Time.Working = true
|
||||
DmgRank.Time.Tick = 0
|
||||
player = _detalhes:GetActor() --> param 1 = combat | param 2 = attribute | param 3 = player name
|
||||
update = 0
|
||||
DmgRank.Frame:SetScript ("OnUpdate", DoDmgRank)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function DmgRank:OnEvent (_, event, ...)
|
||||
|
||||
if (event == "ADDON_LOADED") then
|
||||
local AddonName = select (1, ...)
|
||||
if (AddonName == "Details_DmgRank") then
|
||||
|
||||
if (_G._detalhes) then
|
||||
|
||||
--> create widgets
|
||||
CreatePluginFrames (_detalhes_databaseDmgRank)
|
||||
|
||||
local MINIMAL_DETAILS_VERSION_REQUIRED = 1
|
||||
|
||||
--> Install plugin inside details
|
||||
local install = _G._detalhes:InstallPlugin ("SOLO", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\ACHIEVEMENT_GUILDPERK_HONORABLEMENTION_RANK2", DmgRank, "DETAILS_PLUGIN_DAMAGE_RANK", MINIMAL_DETAILS_VERSION_REQUIRED)
|
||||
if (type (install) == "table" and install.error) then
|
||||
print (install.error)
|
||||
end
|
||||
|
||||
--> Register needed events
|
||||
_G._detalhes:RegisterEvent (DmgRank, "COMBAT_PLAYER_TIMESTARTED")
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
elseif (event == "PLAYER_LOGOUT") then
|
||||
_detalhes_databaseDmgRank = DmgRank.rank
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
## Interface: 50300
|
||||
## Title: Details DamageRank (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## SavedVariablesPerCharacter: _detalhes_databaseDmgRank
|
||||
## RequiredDeps: Details
|
||||
## OptionalDeps: Ace3, LibSharedMedia-3.0, LibBossIDs-1.0, LibGraph-2.0, !ClassColors
|
||||
|
||||
#@no-lib-strip@
|
||||
embeds.xml
|
||||
#@end-no-lib-strip@
|
||||
|
||||
enUS.lua
|
||||
ptBR.lua
|
||||
|
||||
Details_DmgRank.lua
|
||||
@@ -0,0 +1,137 @@
|
||||
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
|
||||
-- @class file
|
||||
-- @name AceLocale-3.0
|
||||
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
|
||||
local MAJOR,MINOR = "AceLocale-3.0", 6
|
||||
|
||||
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not AceLocale then return end -- no upgrade needed
|
||||
|
||||
-- Lua APIs
|
||||
local assert, tostring, error = assert, tostring, error
|
||||
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GAME_LOCALE, geterrorhandler
|
||||
|
||||
local gameLocale = GetLocale()
|
||||
if gameLocale == "enGB" then
|
||||
gameLocale = "enUS"
|
||||
end
|
||||
|
||||
AceLocale.apps = AceLocale.apps or {} -- array of ["AppName"]=localetableref
|
||||
AceLocale.appnames = AceLocale.appnames or {} -- array of [localetableref]="AppName"
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale
|
||||
local readmeta = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: fire off a nonbreaking error and return key
|
||||
rawset(self, key, key) -- only need to see the warning once, really
|
||||
geterrorhandler()(MAJOR..": "..tostring(AceLocale.appnames[self])..": Missing entry for '"..tostring(key).."'")
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale if the silent flag is true, it does not issue a warning on unknown keys
|
||||
local readmetasilent = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: return key
|
||||
rawset(self, key, key) -- only need to invoke this function once
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- Remember the locale table being registered right now (it gets set by :NewLocale())
|
||||
-- NOTE: Do never try to register 2 locale tables at once and mix their definition.
|
||||
local registering
|
||||
|
||||
-- local assert false function
|
||||
local assertfalse = function() assert(false) end
|
||||
|
||||
-- This metatable proxy is used when registering nondefault locales
|
||||
local writeproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
rawset(registering, key, value == true and key or value) -- assigning values: replace 'true' with key string
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
-- This metatable proxy is used when registering the default locale.
|
||||
-- It refuses to overwrite existing values
|
||||
-- Reason 1: Allows loading locales in any order
|
||||
-- Reason 2: If 2 modules have the same string, but only the first one to be
|
||||
-- loaded has a translation for the current locale, the translation
|
||||
-- doesn't get overwritten.
|
||||
--
|
||||
local writedefaultproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
if not rawget(registering, key) then
|
||||
rawset(registering, key, value == true and key or value)
|
||||
end
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
--- Register a new locale (or extend an existing one) for the specified application.
|
||||
-- :NewLocale will return a table you can fill your locale into, or nil if the locale isn't needed for the players
|
||||
-- game locale.
|
||||
-- @paramsig application, locale[, isDefault[, silent]]
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param locale Name of the locale to register, e.g. "enUS", "deDE", etc.
|
||||
-- @param isDefault If this is the default locale being registered (your addon is written in this language, generally enUS)
|
||||
-- @param silent If true, the locale will not issue warnings for missing keys. Must be set on the first locale registered. If set to "raw", nils will be returned for unknown keys (no metatable used).
|
||||
-- @usage
|
||||
-- -- enUS.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "enUS", true)
|
||||
-- L["string1"] = true
|
||||
--
|
||||
-- -- deDE.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "deDE")
|
||||
-- if not L then return end
|
||||
-- L["string1"] = "Zeichenkette1"
|
||||
-- @return Locale Table to add localizations to, or nil if the current locale is not required.
|
||||
function AceLocale:NewLocale(application, locale, isDefault, silent)
|
||||
|
||||
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
|
||||
local gameLocale = GAME_LOCALE or gameLocale
|
||||
|
||||
local app = AceLocale.apps[application]
|
||||
|
||||
if silent and app and getmetatable(app) ~= readmetasilent then
|
||||
geterrorhandler()("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' must be specified for the first locale registered")
|
||||
end
|
||||
|
||||
if not app then
|
||||
if silent=="raw" then
|
||||
app = {}
|
||||
else
|
||||
app = setmetatable({}, silent and readmetasilent or readmeta)
|
||||
end
|
||||
AceLocale.apps[application] = app
|
||||
AceLocale.appnames[app] = application
|
||||
end
|
||||
|
||||
if locale ~= gameLocale and not isDefault then
|
||||
return -- nop, we don't need these translations
|
||||
end
|
||||
|
||||
registering = app -- remember globally for writeproxy and writedefaultproxy
|
||||
|
||||
if isDefault then
|
||||
return writedefaultproxy
|
||||
end
|
||||
|
||||
return writeproxy
|
||||
end
|
||||
|
||||
--- Returns localizations for the current locale (or default locale if translations are missing).
|
||||
-- Errors if nothing is registered (spank developer, not just a missing translation)
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param silent If true, the locale is optional, silently return nil if it's not found (defaults to false, optional)
|
||||
-- @return The locale table for the current language.
|
||||
function AceLocale:GetLocale(application, silent)
|
||||
if not silent and not AceLocale.apps[application] then
|
||||
error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2)
|
||||
end
|
||||
return AceLocale.apps[application]
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
<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">
|
||||
<Script file="AceLocale-3.0.lua"/>
|
||||
</Ui>
|
||||
@@ -0,0 +1,51 @@
|
||||
-- $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
|
||||
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.")
|
||||
|
||||
local oldminor = self.minors[major]
|
||||
if oldminor and oldminor >= minor then return nil end
|
||||
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
||||
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)
|
||||
end
|
||||
return self.libs[major], self.minors[major]
|
||||
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
|
||||
@@ -0,0 +1,13 @@
|
||||
## Interface: 40200
|
||||
## Title: Lib: LibStub
|
||||
## Notes: Universal Library Stub
|
||||
## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
|
||||
## X-Website: http://www.wowace.com/addons/libstub/
|
||||
## X-Category: Library
|
||||
## X-License: Public Domain
|
||||
## X-Curse-Packaged-Version: r95
|
||||
## X-Curse-Project-Name: LibStub
|
||||
## X-Curse-Project-ID: libstub
|
||||
## X-Curse-Repository-ID: wow/libstub/mainline
|
||||
|
||||
LibStub.lua
|
||||
@@ -0,0 +1,41 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local lib, oldMinor = LibStub:NewLibrary("Pants", 1) -- make a new thingy
|
||||
assert(lib) -- should return the library table
|
||||
assert(not oldMinor) -- should not return the old minor, since it didn't exist
|
||||
|
||||
-- the following is to create data and then be able to check if the same data exists after the fact
|
||||
function lib:MyMethod()
|
||||
end
|
||||
local MyMethod = lib.MyMethod
|
||||
lib.MyTable = {}
|
||||
local MyTable = lib.MyTable
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 1) -- try to register a library with the same version, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 0) -- try to register a library with a previous, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 2) -- register a new version
|
||||
assert(newLib) -- library table
|
||||
assert(rawequal(newLib, lib)) -- should be the same reference as the previous
|
||||
assert(newOldMinor == 1) -- should return the minor version of the previous version
|
||||
|
||||
assert(rawequal(lib.MyMethod, MyMethod)) -- verify that values were saved
|
||||
assert(rawequal(lib.MyTable, MyTable)) -- verify that values were saved
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 3 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib) -- library table
|
||||
assert(newOldMinor == 2) -- previous version was 2
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 4 and please ignore 15 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 3) -- previous version was 3 (even though it gave a string)
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 5) -- register a new library, using a normal number instead of a string
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 4) -- previous version was 4 (even though it gave a string)
|
||||
@@ -0,0 +1,27 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib doesn't exist yet, by iterating through all the libraries
|
||||
assert(major ~= "MyLib")
|
||||
end
|
||||
|
||||
assert(not LibStub:GetLibrary("MyLib", true)) -- check that MyLib doesn't exist yet by direct checking
|
||||
assert(not pcall(LibStub.GetLibrary, LibStub, "MyLib")) -- don't silently fail, thus it should raise an error.
|
||||
local lib = LibStub:NewLibrary("MyLib", 1) -- create the lib
|
||||
assert(lib) -- check it exists
|
||||
assert(rawequal(LibStub:GetLibrary("MyLib"), lib)) -- verify that :GetLibrary("MyLib") properly equals the lib reference
|
||||
|
||||
assert(LibStub:NewLibrary("MyLib", 2)) -- create a new version
|
||||
|
||||
local count=0
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib exists somewhere in the libraries, by iterating through all the libraries
|
||||
if major == "MyLib" then -- we found it!
|
||||
count = count +1
|
||||
assert(rawequal(library, lib)) -- verify that the references are equal
|
||||
end
|
||||
end
|
||||
assert(count == 1) -- verify that we actually found it, and only once
|
||||
@@ -0,0 +1,14 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local proxy = newproxy() -- non-string
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, proxy, 1)) -- should error, proxy is not a string, it's userdata
|
||||
local success, ret = pcall(LibStub.GetLibrary, proxy, true)
|
||||
assert(not success or not ret) -- either error because proxy is not a string or because it's not actually registered.
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, "Something", "No number in here")) -- should error, minor has no string in it.
|
||||
|
||||
assert(not LibStub:GetLibrary("Something", true)) -- shouldn't've created it from the above statement
|
||||
@@ -0,0 +1,41 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
|
||||
-- Pretend like loaded libstub is old and doesn't have :IterateLibraries
|
||||
assert(LibStub.minor)
|
||||
LibStub.minor = LibStub.minor - 0.0001
|
||||
LibStub.IterateLibraries = nil
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(type(LibStub.IterateLibraries)=="function")
|
||||
|
||||
|
||||
-- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created
|
||||
LibStub.IterateLibraries = 123
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created
|
||||
LibStub.minor = LibStub.minor + 0.0001
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Again with a huge number
|
||||
LibStub.minor = LibStub.minor + 1234567890
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
print("OK")
|
||||
@@ -0,0 +1,7 @@
|
||||
<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">
|
||||
|
||||
<Script file="Libs\LibStub\LibStub.lua"/>
|
||||
<Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml" />
|
||||
|
||||
</Ui>
|
||||
@@ -0,0 +1,64 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("DetailsDmgRank", "enUS", true)
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
--> Labels:
|
||||
Loc ["STRING_PLUGIN_NAME"] = "Damage Rank"
|
||||
Loc ["STRING_CURRENTRANK"] = "Your current rank is:"
|
||||
Loc ["STRING_ANNOUNCE"] = "announce"
|
||||
Loc ["STRING_ANNOUNCE_STRING"] = "has reached the level"
|
||||
Loc ["STRING_ANNOUNCE_ON"] = "on"
|
||||
Loc ["STRING_LASTTRIES"] = "Recent Attempts"
|
||||
Loc ["STRING_LASTRANKS"] = "Last Ranks:"
|
||||
Loc ["STRING_DAMAGEIN"] = "damage over"
|
||||
Loc ["STRING_SECONDS"] = "seconds"
|
||||
Loc ["STRING_RANK"] = "rank"
|
||||
Loc ["STRING_CANCELLED"] = "This attempt has been cancelled."
|
||||
Loc ["STRING_CANCELLED_NOT_COMBAT"] = "This attempt has been cancelled: you aren't in combat."
|
||||
Loc ["STRING_CANCELLED_IN_GROUP"] = "This attempt has been cancelled: you are in a group."
|
||||
Loc ["STRING_CANCELLED_AURA"] = "This attempt has been cancelled: prohibited aura: "
|
||||
|
||||
--> Challenge Names:
|
||||
Loc ["CHALLENGENAME_1"] = "Ready to Raid"
|
||||
Loc ["CHALLENGENAME_2"] = "Damage Practice"
|
||||
Loc ["CHALLENGENAME_3"] = "The Training Continue"
|
||||
Loc ["CHALLENGENAME_4"] = "You Just Need a Little More Time"
|
||||
Loc ["CHALLENGENAME_5"] = "Became a Knight"
|
||||
Loc ["CHALLENGENAME_6"] = "60*2 Seconds"
|
||||
Loc ["CHALLENGENAME_7"] = "Hand of Mithril"
|
||||
Loc ["CHALLENGENAME_8"] = "The High Knight"
|
||||
Loc ["CHALLENGENAME_9"] = "Yes Sir!"
|
||||
Loc ["CHALLENGENAME_10"] = "Salute"
|
||||
Loc ["CHALLENGENAME_11"] = "In Burst We Trust"
|
||||
Loc ["CHALLENGENAME_12"] = "Watch me Explode"
|
||||
Loc ["CHALLENGENAME_13"] = "T.N.T"
|
||||
Loc ["CHALLENGENAME_14"] = "Time is Damage My Friend"
|
||||
Loc ["CHALLENGENAME_15"] = "Just a Little Patience"
|
||||
Loc ["CHALLENGENAME_16"] = "I'm D.P.S And I Know It"
|
||||
Loc ["CHALLENGENAME_17"] = "Gear Check"
|
||||
Loc ["CHALLENGENAME_18"] = "Just Do It..."
|
||||
Loc ["CHALLENGENAME_19"] = "I Remember You... In The Details!"
|
||||
|
||||
--> Rank Names:
|
||||
Loc ["RANKNAME_1"] = "Farmer"
|
||||
Loc ["RANKNAME_2"] = "Soldier"
|
||||
Loc ["RANKNAME_3"] = "Corporal"
|
||||
Loc ["RANKNAME_4"] = "Gold Sergeant"
|
||||
Loc ["RANKNAME_5"] = "Star Sergeant"
|
||||
Loc ["RANKNAME_6"] = "Iron Knight"
|
||||
Loc ["RANKNAME_7"] = "Steel Knight"
|
||||
Loc ["RANKNAME_8"] = "Mithril Knight"
|
||||
Loc ["RANKNAME_9"] = "Thorium Knight"
|
||||
Loc ["RANKNAME_10"] = "Silver Lieutenant"
|
||||
Loc ["RANKNAME_11"] = "Gold Lieutenant"
|
||||
Loc ["RANKNAME_12"] = "Stone Guardian"
|
||||
Loc ["RANKNAME_13"] = "Fel Guardian"
|
||||
Loc ["RANKNAME_14"] = "Titan Guardian"
|
||||
Loc ["RANKNAME_15"] = "Bronze Centurion"
|
||||
Loc ["RANKNAME_16"] = "Silver Centurion"
|
||||
Loc ["RANKNAME_17"] = "Flame Centurion"
|
||||
Loc ["RANKNAME_18"] = "Lower Vanquisher"
|
||||
Loc ["RANKNAME_19"] = "Middle Vanquisher"
|
||||
Loc ["RANKNAME_20"] = "High Vanquisher"
|
||||
Binary file not shown.
@@ -0,0 +1,64 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("DetailsDmgRank", "ptBR")
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
--> Labels:
|
||||
Loc ["STRING_PLUGIN_NAME"] = "Rank de Dano"
|
||||
Loc ["STRING_CURRENTRANK"] = "Seu rank atual:"
|
||||
Loc ["STRING_LASTTRIES"] = "Ultimas tentativas:"
|
||||
Loc ["STRING_ANNOUNCE"] = "anunciar"
|
||||
Loc ["STRING_ANNOUNCE_STRING"] = "alcancou o nivel"
|
||||
Loc ["STRING_ANNOUNCE_ON"] = "no"
|
||||
Loc ["STRING_LASTRANKS"] = "Ultimos ranks:"
|
||||
Loc ["STRING_DAMAGEIN"] = "de dano em"
|
||||
Loc ["STRING_SECONDS"] = "segundos"
|
||||
Loc ["STRING_RANK"] = "rank"
|
||||
Loc ["STRING_CANCELLED"] = "Esta tentativa foi cancelada."
|
||||
Loc ["STRING_CANCELLED_NOT_COMBAT"] = "Esta tentativa foi cancelada: você não esta mais em combate."
|
||||
Loc ["STRING_CANCELLED_IN_GROUP"] = "Esta tentativa foi cancelada: você está em grupo."
|
||||
Loc ["STRING_CANCELLED_AURA"] = "Esta tentativa foi cancelada: buff proibido: "
|
||||
|
||||
--> Challenge Names:
|
||||
Loc ["CHALLENGENAME_1"] = "Pronto Para Raidar"
|
||||
Loc ["CHALLENGENAME_2"] = "Pratique, pratique, pratique"
|
||||
Loc ["CHALLENGENAME_3"] = "Continue a treinar"
|
||||
Loc ["CHALLENGENAME_4"] = "Um Pouco Mais de Tempo"
|
||||
Loc ["CHALLENGENAME_5"] = "Tornando-se um Cavalheiro"
|
||||
Loc ["CHALLENGENAME_6"] = "2 minutos"
|
||||
Loc ["CHALLENGENAME_7"] = "Maos de Mithril"
|
||||
Loc ["CHALLENGENAME_8"] = "A Alta Cavalaria"
|
||||
Loc ["CHALLENGENAME_9"] = "Sim Senhor!"
|
||||
Loc ["CHALLENGENAME_10"] = "Continencia"
|
||||
Loc ["CHALLENGENAME_11"] = "Na Explosão Nós Confiamos"
|
||||
Loc ["CHALLENGENAME_12"] = "Me Veja Explodir"
|
||||
Loc ["CHALLENGENAME_13"] = "T.N.T"
|
||||
Loc ["CHALLENGENAME_14"] = "Tempo é Dano Meu Amigo"
|
||||
Loc ["CHALLENGENAME_15"] = "Apenas um Pouco de Paciência"
|
||||
Loc ["CHALLENGENAME_16"] = "Meu Dano Calcula-se Em Milésimos"
|
||||
Loc ["CHALLENGENAME_17"] = "Prova Do Equipamento"
|
||||
Loc ["CHALLENGENAME_18"] = "Apenas Faça..."
|
||||
Loc ["CHALLENGENAME_19"] = "Eu Lembro de Você... no Detalhes!"
|
||||
|
||||
--> Rank Names:
|
||||
Loc ["RANKNAME_1"] = "Fazendeiro"
|
||||
Loc ["RANKNAME_2"] = "Soldado"
|
||||
Loc ["RANKNAME_3"] = "Cabo"
|
||||
Loc ["RANKNAME_4"] = "Sargento de Ouro"
|
||||
Loc ["RANKNAME_5"] = "Sargento Estrela"
|
||||
Loc ["RANKNAME_6"] = "Cavaleiro de Ferro"
|
||||
Loc ["RANKNAME_7"] = "Cavaleiro de Aço"
|
||||
Loc ["RANKNAME_8"] = "Cavaleiro de Mithril"
|
||||
Loc ["RANKNAME_9"] = "Cavaleiro de Thorium"
|
||||
Loc ["RANKNAME_10"] = "Tenente de Prata"
|
||||
Loc ["RANKNAME_11"] = "Tenente de Ouro"
|
||||
Loc ["RANKNAME_12"] = "Guardião de Pedra"
|
||||
Loc ["RANKNAME_13"] = "Guardião Vil"
|
||||
Loc ["RANKNAME_14"] = "Guardião Titânico"
|
||||
Loc ["RANKNAME_15"] = "Centurião de Bronze"
|
||||
Loc ["RANKNAME_16"] = "Centurião de Prata"
|
||||
Loc ["RANKNAME_17"] = "Centurião das Chamas"
|
||||
Loc ["RANKNAME_18"] = "Vencedor Menor"
|
||||
Loc ["RANKNAME_19"] = "Vencedor"
|
||||
Loc ["RANKNAME_20"] = "Vencedor Maior"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 256 KiB |
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,16 @@
|
||||
## Interface: 50300
|
||||
## Title: Details Encounter (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## SavedVariablesPerCharacter: _detalhes_databaseEncounterDetails
|
||||
## RequiredDeps: Details
|
||||
## OptionalDeps: Ace3
|
||||
|
||||
#@no-lib-strip@
|
||||
embeds.xml
|
||||
#@end-no-lib-strip@
|
||||
|
||||
enUS.lua
|
||||
ptBR.lua
|
||||
frames.lua
|
||||
|
||||
Details_EncounterDetails.lua
|
||||
@@ -0,0 +1,137 @@
|
||||
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
|
||||
-- @class file
|
||||
-- @name AceLocale-3.0
|
||||
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
|
||||
local MAJOR,MINOR = "AceLocale-3.0", 6
|
||||
|
||||
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not AceLocale then return end -- no upgrade needed
|
||||
|
||||
-- Lua APIs
|
||||
local assert, tostring, error = assert, tostring, error
|
||||
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GAME_LOCALE, geterrorhandler
|
||||
|
||||
local gameLocale = GetLocale()
|
||||
if gameLocale == "enGB" then
|
||||
gameLocale = "enUS"
|
||||
end
|
||||
|
||||
AceLocale.apps = AceLocale.apps or {} -- array of ["AppName"]=localetableref
|
||||
AceLocale.appnames = AceLocale.appnames or {} -- array of [localetableref]="AppName"
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale
|
||||
local readmeta = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: fire off a nonbreaking error and return key
|
||||
rawset(self, key, key) -- only need to see the warning once, really
|
||||
geterrorhandler()(MAJOR..": "..tostring(AceLocale.appnames[self])..": Missing entry for '"..tostring(key).."'")
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale if the silent flag is true, it does not issue a warning on unknown keys
|
||||
local readmetasilent = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: return key
|
||||
rawset(self, key, key) -- only need to invoke this function once
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- Remember the locale table being registered right now (it gets set by :NewLocale())
|
||||
-- NOTE: Do never try to register 2 locale tables at once and mix their definition.
|
||||
local registering
|
||||
|
||||
-- local assert false function
|
||||
local assertfalse = function() assert(false) end
|
||||
|
||||
-- This metatable proxy is used when registering nondefault locales
|
||||
local writeproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
rawset(registering, key, value == true and key or value) -- assigning values: replace 'true' with key string
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
-- This metatable proxy is used when registering the default locale.
|
||||
-- It refuses to overwrite existing values
|
||||
-- Reason 1: Allows loading locales in any order
|
||||
-- Reason 2: If 2 modules have the same string, but only the first one to be
|
||||
-- loaded has a translation for the current locale, the translation
|
||||
-- doesn't get overwritten.
|
||||
--
|
||||
local writedefaultproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
if not rawget(registering, key) then
|
||||
rawset(registering, key, value == true and key or value)
|
||||
end
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
--- Register a new locale (or extend an existing one) for the specified application.
|
||||
-- :NewLocale will return a table you can fill your locale into, or nil if the locale isn't needed for the players
|
||||
-- game locale.
|
||||
-- @paramsig application, locale[, isDefault[, silent]]
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param locale Name of the locale to register, e.g. "enUS", "deDE", etc.
|
||||
-- @param isDefault If this is the default locale being registered (your addon is written in this language, generally enUS)
|
||||
-- @param silent If true, the locale will not issue warnings for missing keys. Must be set on the first locale registered. If set to "raw", nils will be returned for unknown keys (no metatable used).
|
||||
-- @usage
|
||||
-- -- enUS.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "enUS", true)
|
||||
-- L["string1"] = true
|
||||
--
|
||||
-- -- deDE.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "deDE")
|
||||
-- if not L then return end
|
||||
-- L["string1"] = "Zeichenkette1"
|
||||
-- @return Locale Table to add localizations to, or nil if the current locale is not required.
|
||||
function AceLocale:NewLocale(application, locale, isDefault, silent)
|
||||
|
||||
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
|
||||
local gameLocale = GAME_LOCALE or gameLocale
|
||||
|
||||
local app = AceLocale.apps[application]
|
||||
|
||||
if silent and app and getmetatable(app) ~= readmetasilent then
|
||||
geterrorhandler()("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' must be specified for the first locale registered")
|
||||
end
|
||||
|
||||
if not app then
|
||||
if silent=="raw" then
|
||||
app = {}
|
||||
else
|
||||
app = setmetatable({}, silent and readmetasilent or readmeta)
|
||||
end
|
||||
AceLocale.apps[application] = app
|
||||
AceLocale.appnames[app] = application
|
||||
end
|
||||
|
||||
if locale ~= gameLocale and not isDefault then
|
||||
return -- nop, we don't need these translations
|
||||
end
|
||||
|
||||
registering = app -- remember globally for writeproxy and writedefaultproxy
|
||||
|
||||
if isDefault then
|
||||
return writedefaultproxy
|
||||
end
|
||||
|
||||
return writeproxy
|
||||
end
|
||||
|
||||
--- Returns localizations for the current locale (or default locale if translations are missing).
|
||||
-- Errors if nothing is registered (spank developer, not just a missing translation)
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param silent If true, the locale is optional, silently return nil if it's not found (defaults to false, optional)
|
||||
-- @return The locale table for the current language.
|
||||
function AceLocale:GetLocale(application, silent)
|
||||
if not silent and not AceLocale.apps[application] then
|
||||
error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2)
|
||||
end
|
||||
return AceLocale.apps[application]
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
<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">
|
||||
<Script file="AceLocale-3.0.lua"/>
|
||||
</Ui>
|
||||
@@ -0,0 +1,51 @@
|
||||
-- $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
|
||||
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.")
|
||||
|
||||
local oldminor = self.minors[major]
|
||||
if oldminor and oldminor >= minor then return nil end
|
||||
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
||||
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)
|
||||
end
|
||||
return self.libs[major], self.minors[major]
|
||||
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
|
||||
@@ -0,0 +1,13 @@
|
||||
## Interface: 40200
|
||||
## Title: Lib: LibStub
|
||||
## Notes: Universal Library Stub
|
||||
## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
|
||||
## X-Website: http://www.wowace.com/addons/libstub/
|
||||
## X-Category: Library
|
||||
## X-License: Public Domain
|
||||
## X-Curse-Packaged-Version: r95
|
||||
## X-Curse-Project-Name: LibStub
|
||||
## X-Curse-Project-ID: libstub
|
||||
## X-Curse-Repository-ID: wow/libstub/mainline
|
||||
|
||||
LibStub.lua
|
||||
@@ -0,0 +1,41 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local lib, oldMinor = LibStub:NewLibrary("Pants", 1) -- make a new thingy
|
||||
assert(lib) -- should return the library table
|
||||
assert(not oldMinor) -- should not return the old minor, since it didn't exist
|
||||
|
||||
-- the following is to create data and then be able to check if the same data exists after the fact
|
||||
function lib:MyMethod()
|
||||
end
|
||||
local MyMethod = lib.MyMethod
|
||||
lib.MyTable = {}
|
||||
local MyTable = lib.MyTable
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 1) -- try to register a library with the same version, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 0) -- try to register a library with a previous, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 2) -- register a new version
|
||||
assert(newLib) -- library table
|
||||
assert(rawequal(newLib, lib)) -- should be the same reference as the previous
|
||||
assert(newOldMinor == 1) -- should return the minor version of the previous version
|
||||
|
||||
assert(rawequal(lib.MyMethod, MyMethod)) -- verify that values were saved
|
||||
assert(rawequal(lib.MyTable, MyTable)) -- verify that values were saved
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 3 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib) -- library table
|
||||
assert(newOldMinor == 2) -- previous version was 2
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 4 and please ignore 15 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 3) -- previous version was 3 (even though it gave a string)
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 5) -- register a new library, using a normal number instead of a string
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 4) -- previous version was 4 (even though it gave a string)
|
||||
@@ -0,0 +1,27 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib doesn't exist yet, by iterating through all the libraries
|
||||
assert(major ~= "MyLib")
|
||||
end
|
||||
|
||||
assert(not LibStub:GetLibrary("MyLib", true)) -- check that MyLib doesn't exist yet by direct checking
|
||||
assert(not pcall(LibStub.GetLibrary, LibStub, "MyLib")) -- don't silently fail, thus it should raise an error.
|
||||
local lib = LibStub:NewLibrary("MyLib", 1) -- create the lib
|
||||
assert(lib) -- check it exists
|
||||
assert(rawequal(LibStub:GetLibrary("MyLib"), lib)) -- verify that :GetLibrary("MyLib") properly equals the lib reference
|
||||
|
||||
assert(LibStub:NewLibrary("MyLib", 2)) -- create a new version
|
||||
|
||||
local count=0
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib exists somewhere in the libraries, by iterating through all the libraries
|
||||
if major == "MyLib" then -- we found it!
|
||||
count = count +1
|
||||
assert(rawequal(library, lib)) -- verify that the references are equal
|
||||
end
|
||||
end
|
||||
assert(count == 1) -- verify that we actually found it, and only once
|
||||
@@ -0,0 +1,14 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local proxy = newproxy() -- non-string
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, proxy, 1)) -- should error, proxy is not a string, it's userdata
|
||||
local success, ret = pcall(LibStub.GetLibrary, proxy, true)
|
||||
assert(not success or not ret) -- either error because proxy is not a string or because it's not actually registered.
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, "Something", "No number in here")) -- should error, minor has no string in it.
|
||||
|
||||
assert(not LibStub:GetLibrary("Something", true)) -- shouldn't've created it from the above statement
|
||||
@@ -0,0 +1,41 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
|
||||
-- Pretend like loaded libstub is old and doesn't have :IterateLibraries
|
||||
assert(LibStub.minor)
|
||||
LibStub.minor = LibStub.minor - 0.0001
|
||||
LibStub.IterateLibraries = nil
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(type(LibStub.IterateLibraries)=="function")
|
||||
|
||||
|
||||
-- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created
|
||||
LibStub.IterateLibraries = 123
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created
|
||||
LibStub.minor = LibStub.minor + 0.0001
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Again with a huge number
|
||||
LibStub.minor = LibStub.minor + 1234567890
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
print("OK")
|
||||
@@ -0,0 +1,6 @@
|
||||
<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">
|
||||
|
||||
<Script file="Libs\LibStub\LibStub.lua"/>
|
||||
<Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml" />
|
||||
</Ui>
|
||||
@@ -0,0 +1,52 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("Details_EncounterDetails", "enUS", true)
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
Loc ["STRING_PLUGIN_NAME"] = "Encounter Details"
|
||||
Loc ["STRING_WINDOW_TITLE"] = "Encounter Details"
|
||||
Loc ["STRING_TOTAL_DAMAGE"] = "Total Damage"
|
||||
Loc ["STRING_TOTAL_HEAL"] = "Total Heal"
|
||||
Loc ["STRING_SHOW_ALL_DATA"] = "Show overall data"
|
||||
Loc ["STRING_SHOW_PHASE_DATA"] = "Show details for this phase"
|
||||
Loc ["STRING_NOT IMPLEMENTED"] = "Not implemented yet"
|
||||
Loc ["STRING_DIED"] = "died"
|
||||
Loc ["STRING_MELEE_DAMAGE"] = "melee damage"
|
||||
Loc ["STRING_DAMAGE_TAKEN_REPORT"] = "Damage taken by ability"
|
||||
Loc ["STRING_ABILITY_DAMAGE"] = "Ability damage"
|
||||
Loc ["STRING_DAMAGE_TAKEN"] = "Damage Taken"
|
||||
Loc ["STRING_TOOK_DAMAGE_FROM"] = "Took damage from"
|
||||
Loc ["STRING_INTERRUPT_BY"] = "interrupted by"
|
||||
Loc ["STRING_DISPELLED_BY"] = "dispelled by"
|
||||
Loc ["STRING_DEAD_LOG"] = "last seconds of"
|
||||
Loc ["STRING_CURRENT"] = "Current"
|
||||
Loc ["STRING_TRY"] = "Fight"
|
||||
Loc ["STRING_DAMAGE_AT"] = "Damage Taken"
|
||||
Loc ["STRING_INFLICTED_BY"] = "Damage inflicted by"
|
||||
Loc ["STRING_INFLICTED"] = "Damage inflicted"
|
||||
Loc ["STRING_ADDS"] = "Adds"
|
||||
Loc ["STRING_INTERRUPTS"] = "Interrupts"
|
||||
Loc ["STRING_DISPELLS"] = "Dispells"
|
||||
Loc ["STRING_DEATH_LOG"] = "Death Log"
|
||||
Loc ["STRING_FIGHT_SUMMARY"] = "fight details"
|
||||
Loc ["STRING_FIGHT_GRAPHIC"] = "performance charts"
|
||||
Loc ["STRING_TOOLTIP"] = "Show Encounter Details Window"
|
||||
Loc ["STRING_"] = ""
|
||||
|
||||
--> mechanic types
|
||||
Loc ["STRING_HEAL"] = "heal"
|
||||
Loc ["STRING_LOWDPS"] = "lowdps"
|
||||
Loc ["STRING_LOWHEAL"] = "lowheal"
|
||||
Loc ["STRING_VOIDZONE"] = "voidzone"
|
||||
Loc ["STRING_DISPELL"] = "dispell"
|
||||
Loc ["STRING_INTERRUPT"] = "interrupt"
|
||||
Loc ["STRING_POSITIONING"] = "positioning"
|
||||
Loc ["STRING_RUNAWAY"] = "runaway"
|
||||
Loc ["STRING_TANKSWITCH"] = "tankswitch"
|
||||
Loc ["STRING_MECHANIC"] = "mechanic"
|
||||
Loc ["STRING_CROWDCONTROL"] = "cc"
|
||||
Loc ["STRING_TANKCOOLDOWN"] = "tankcooldown"
|
||||
Loc ["STRING_KILLADD"] = "killadd"
|
||||
Loc ["STRING_SPREADOUT"] = "spreadout"
|
||||
Loc ["STRING_STOPCAST"] = "stopcast"
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,51 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("Details_EncounterDetails", "ptBR")
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
Loc ["STRING_PLUGIN_NAME"] = "Detalhes do Combate"
|
||||
Loc ["STRING_WINDOW_TITLE"] = "Detalhes do Combate"
|
||||
Loc ["STRING_TOTAL_DAMAGE"] = "Total de Dano"
|
||||
Loc ["STRING_TOTAL_HEAL"] = "Total de Cura"
|
||||
Loc ["STRING_SHOW_ALL_DATA"] = "Mostrar dados totais"
|
||||
Loc ["STRING_SHOW_PHASE_DATA"] = "Mostrar dados apenas para esta fase"
|
||||
Loc ["STRING_NOT IMPLEMENTED"] = "Nao esta implementado ainda"
|
||||
Loc ["STRING_DIED"] = "morreu"
|
||||
Loc ["STRING_MELEE_DAMAGE"] = "dano corpo-a-corpo"
|
||||
Loc ["STRING_DAMAGE_TAKEN_REPORT"] = "Dano recebido por habilidade"
|
||||
Loc ["STRING_ABILITY_DAMAGE"] = "Dano da habilidade"
|
||||
Loc ["STRING_DAMAGE_TAKEN"] = "Dano recebido"
|
||||
Loc ["STRING_TOOK_DAMAGE_FROM"] = "Recebeu dano de"
|
||||
Loc ["STRING_INTERRUPT_BY"] = "interrompido por"
|
||||
Loc ["STRING_DISPELLED_BY"] = "removido por"
|
||||
Loc ["STRING_DEAD_LOG"] = "ultimos segundos de"
|
||||
Loc ["STRING_CURRENT"] = "Atual"
|
||||
Loc ["STRING_TRY"] = "Luta"
|
||||
Loc ["STRING_DAMAGE_AT"] = "Dano causado em"
|
||||
Loc ["STRING_INFLICTED_BY"] = "Dano causado por"
|
||||
Loc ["STRING_ADDS"] = "Adds"
|
||||
Loc ["STRING_INTERRUPTS"] = "Cortes"
|
||||
Loc ["STRING_DISPELLS"] = "Dissipados"
|
||||
Loc ["STRING_DEATH_LOG"] = "Ultimos Segundos"
|
||||
Loc ["STRING_FIGHT_SUMMARY"] = "detalhes da luta"
|
||||
Loc ["STRING_FIGHT_GRAPHIC"] = "graficos da performance"
|
||||
Loc ["STRING_TOOLTIP"] = "Mostrar os detalhes do combate"
|
||||
Loc ["STRING_"] = ""
|
||||
|
||||
--> mechanic types
|
||||
Loc ["STRING_HEAL"] = "cura"
|
||||
Loc ["STRING_LOWDPS"] = "dpsbaixo"
|
||||
Loc ["STRING_LOWHEAL"] = "curabaixa"
|
||||
Loc ["STRING_VOIDZONE"] = "voidzone"
|
||||
Loc ["STRING_DISPELL"] = "dispell"
|
||||
Loc ["STRING_INTERRUPT"] = "interromper"
|
||||
Loc ["STRING_POSITIONING"] = "posicao"
|
||||
Loc ["STRING_RUNAWAY"] = "correr"
|
||||
Loc ["STRING_TANKSWITCH"] = "trocadetank"
|
||||
Loc ["STRING_MECHANIC"] = "mecanica"
|
||||
Loc ["STRING_CROWDCONTROL"] = "cc"
|
||||
Loc ["STRING_TANKCOOLDOWN"] = "tankcooldown"
|
||||
Loc ["STRING_KILLADD"] = "mataradd"
|
||||
Loc ["STRING_SPREADOUT"] = "separar"
|
||||
Loc ["STRING_STOPCAST"] = "pararcast"
|
||||
@@ -0,0 +1,228 @@
|
||||
--localization
|
||||
--> english
|
||||
do
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("DetailsErrorReport", "enUS", true)
|
||||
Loc ["STRING_PLUGIN_NAME"] = "Error Report"
|
||||
Loc ["STRING_TOOLTIP"] = "Did you found a bug? Report here!"
|
||||
Loc ["STRING_REPORT"] = "Details Report"
|
||||
Loc ["STRING_PROBLEM"] = "problem"
|
||||
Loc ["STRING_SUGESTION"] = "sugestion"
|
||||
Loc ["STRING_LUAERROR_DESC"] = "send a report about occurrence of lua errors"
|
||||
Loc ["STRING_ACCURACY_DESC"] = "you found something which isn't the amount that should be\nfor instance, some healing or damage spell doesn't have the correct amount calculated."
|
||||
Loc ["STRING_NOTWORK_DESC"] = "anything which should be doing something and actually isn't"
|
||||
Loc ["STRING_OTHER_DESC"] = "any other problem or perhaps a suggesting not involving the subjects above, can be reported here"
|
||||
Loc ["STRING_LUA_ERROR"] = "Lua Error"
|
||||
Loc ["STRING_ACCURACY_ERROR"] = "Instable Accuracy"
|
||||
Loc ["STRING_NOTWORK_ERROR"] = "Isn't Working"
|
||||
Loc ["STRING_OTHER_ERROR"] = "Other"
|
||||
|
||||
Loc ["STRING_DEFAULT_TEXT_LUA"] = "You can copy and paste here the first 20 lines from the lua error window, also, is important a small description about the error, when it occurs and with what frequency it occurs."
|
||||
Loc ["STRING_DEFAULT_TEXT_ACCURACY"] = "A miss accuracy is normal and happen all the time, but when the problem happen with frequency it's important tell to us. A good way to report is analyzing when the instability occurs, if is caused by a spell or if is a untracked pet."
|
||||
Loc ["STRING_DEFAULT_TEXT_NOTWORK"] = "When you click in something and the result isn't the expected, could be a bug. If thing like this occurs more then once, report the problem to us, dont forget to mention which button is and the frequency."
|
||||
Loc ["STRING_DEFAULT_TEXT_OTHER"] = "Any other problem not mentioned in the other 3 options should be reported here."
|
||||
|
||||
Loc ["STRING_WELCOME_TEXT"] = "Details are in early alpha stages and many errors can occur,\nto try make this report process faster, we'll use this small plug in,\nat least on alpha stage."
|
||||
Loc ["STRING_SEND"] = "Send"
|
||||
Loc ["STRING_CANCELLED"] = "Cancelled."
|
||||
Loc ["STRING_EMPTY"] = "Text field is empty"
|
||||
Loc ["STRING_TOOBIG"] = "1024 Text characters limit reached"
|
||||
end
|
||||
|
||||
|
||||
|
||||
--> português
|
||||
do
|
||||
--[[
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("DetailsErrorReport", "ptBR")
|
||||
Loc ["STRING_PLUGIN_NAME"] = "Relatorio de Erros"
|
||||
Loc ["STRING_TOOLTIP"] = "Encontrou um bug? reporte aqui"
|
||||
Loc ["STRING_REPORT"] = "Details Relatorio de Erros"
|
||||
Loc ["STRING_PROBLEM"] = "problema"
|
||||
Loc ["STRING_SUGESTION"] = "sugestao"
|
||||
Loc ["STRING_LUAERROR_DESC"] = "envia um relatorio sobre erros de lua que estao ocorrendo"
|
||||
Loc ["STRING_ACCURACY_DESC"] = "caso voce encontre problemas na quantidade de dano ou healing que esta mais baixo do que deveria ser"
|
||||
Loc ["STRING_NOTWORK_DESC"] = "qualquer coisa que voce clique e deveria efetuar uma funcao mas que nao esta"
|
||||
Loc ["STRING_OTHER_DESC"] = "outros problemas e por que nao, sugestoes, podem ser enviadas usando este assunto"
|
||||
Loc ["STRING_LUA_ERROR"] = "Erro de Lua"
|
||||
Loc ["STRING_ACCURACY_ERROR"] = "Precisao dos Dados"
|
||||
Loc ["STRING_NOTWORK_ERROR"] = "Algo Nao Funciona"
|
||||
Loc ["STRING_OTHER_ERROR"] = "Outro"
|
||||
Loc ["STRING_WELCOME_TEXT"] = "Detalhes esta apenas comecando a caminhar e muitos erros podem surgir, para que o erros chegem a nos mais rapidamente estaremos usando este plugin pelo menos na etapa Alfa do projeto."
|
||||
Loc ["STRING_SEND"] = "Enviar"
|
||||
--]]
|
||||
end
|
||||
|
||||
|
||||
--plugin object
|
||||
local ErrorReport = _G._detalhes:NewPluginObject ("Details_ErrorReport")
|
||||
tinsert (UISpecialFrames, "Details_ErrorReport")
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ("DetailsErrorReport")
|
||||
|
||||
--plugin panel
|
||||
local BuildReportPanel = function()
|
||||
|
||||
function ErrorReport:OnDetailsEvent (event, ...)
|
||||
return
|
||||
end
|
||||
|
||||
--> catch Details! main object
|
||||
local _detalhes = _G._detalhes
|
||||
local DetailsFrameWork = _detalhes.gump
|
||||
|
||||
--> create the button to show on toolbar [1] function OnClick [2] texture [3] tooltip [4] width or 14 [5] height or 14 [6] frame name or nil
|
||||
function ErrorReport:OpenWindow()
|
||||
ErrorReport.Frame:SetPoint ("center", UIParent, "center")
|
||||
ErrorReport.Frame:Show()
|
||||
end
|
||||
ErrorReport.ToolbarButton = _detalhes.ToolBar:NewPluginToolbarButton (ErrorReport.OpenWindow, "Interface\\HELPFRAME\\HelpIcon-Bug", Loc ["STRING_TOOLTIP"], 20, 20, "DETAILS_ERRORREPORT_BUTTON")
|
||||
--> setpoint anchors mod if needed
|
||||
ErrorReport.ToolbarButton.y = 0
|
||||
ErrorReport.ToolbarButton.x = 1
|
||||
|
||||
ErrorReport:ShowToolbarIcon (ErrorReport.ToolbarButton)
|
||||
|
||||
local mainFrame = ErrorReport.Frame
|
||||
mainFrame:SetWidth (400)
|
||||
mainFrame:SetHeight (400)
|
||||
|
||||
--[[
|
||||
o que falta fazer:
|
||||
- fazer toda parte externa do report com .php talvez e mandando email? acho que sim
|
||||
--]]
|
||||
|
||||
--> build widgets
|
||||
|
||||
--background
|
||||
DetailsFrameWork:NewPanel (mainFrame, _, "DetailsErrorReportBackground", "background", 400, 400)
|
||||
local bg = mainFrame.background
|
||||
bg:SetPoint()
|
||||
|
||||
bg.close_with_right = true
|
||||
|
||||
bg:SetHook ("OnHide", function()
|
||||
mainFrame:Hide()
|
||||
end)
|
||||
mainFrame:SetScript ("OnShow", function()
|
||||
bg:Show()
|
||||
end)
|
||||
|
||||
--title
|
||||
DetailsFrameWork:NewLabel (bg, _, _, "titlelabel", Loc ["STRING_REPORT"], "GameFontHighlightSmall", 11)
|
||||
bg.titlelabel:SetPoint (10, -10)
|
||||
|
||||
--welcome
|
||||
DetailsFrameWork:NewLabel (bg, _, _, "welcomelabel", Loc ["STRING_WELCOME_TEXT"], "GameFontHighlightSmall", 9)
|
||||
bg.welcomelabel:SetPoint (10, -25)
|
||||
|
||||
local textArray = {Loc ["STRING_DEFAULT_TEXT_LUA"], Loc ["STRING_DEFAULT_TEXT_ACCURACY"], Loc ["STRING_DEFAULT_TEXT_NOTWORK"], Loc ["STRING_DEFAULT_TEXT_OTHER"]}
|
||||
|
||||
--text field background
|
||||
DetailsFrameWork:NewPanel (bg, _, "DetailsErrorReportTextFieldBackground", "textfieldBackground", 390, 260)
|
||||
bg.textfieldBackground:SetPoint (5, -85)
|
||||
|
||||
local lastValue = 1
|
||||
|
||||
--text field
|
||||
DetailsFrameWork:NewTextEntry (bg, _, "DetailsErrorReportText", "textfield", 380, 260)
|
||||
bg.textfield:SetBackdrop (nil)
|
||||
bg.textfield:SetPoint (10, -90) -- topleft anchor and parent will be use in this case
|
||||
bg.textfield:SetFrameLevel (1, bg.textfieldBackground) -- +1 relative to other frame
|
||||
bg.textfield.text = Loc ["STRING_DEFAULT_TEXT_LUA"]
|
||||
bg.textfield.multiline = true
|
||||
bg.textfield.align = "left"
|
||||
|
||||
bg.textfield:SetHook ("OnEditFocusGained", function()
|
||||
if (bg.textfield.text == textArray [lastValue]) then
|
||||
bg.textfield.text = ""
|
||||
end
|
||||
end)
|
||||
|
||||
bg.textfield:SetHook ("OnEditFocusLost", function()
|
||||
if (bg.textfield.text == "") then
|
||||
bg.textfield.text = textArray [lastValue]
|
||||
end
|
||||
end)
|
||||
|
||||
--type dropdown
|
||||
local selected = function (self, _, index)
|
||||
if (bg.textfield.text == textArray [self.lastValue]) then
|
||||
bg.textfield.text = textArray [index]
|
||||
end
|
||||
self.lastValue = index
|
||||
lastValue = index
|
||||
end
|
||||
|
||||
local options = {
|
||||
{onclick = selected, desc = Loc ["STRING_LUAERROR_DESC"], value = 1, icon = "Interface\\ICONS\\INV_Pet_Cockroach", label = Loc ["STRING_LUA_ERROR"], color = "yellow", selected = true },
|
||||
{onclick = selected, desc = Loc ["STRING_ACCURACY_DESC"], value = 2, icon = "Interface\\ICONS\\Ability_Hunter_FocusedAim", label = Loc ["STRING_ACCURACY_ERROR"], color = "skyblue" },
|
||||
{onclick = selected, desc = Loc ["STRING_NOTWORK_DESC"], value = 3, icon = "Interface\\ICONS\\INV_Misc_ScrewDriver_01", label = Loc ["STRING_NOTWORK_ERROR"], color = "pink" },
|
||||
{onclick = selected, desc = Loc ["STRING_OTHER_DESC"], value = 4, icon = "Interface\\ICONS\\Achievement_Reputation_01", label = Loc ["STRING_OTHER_ERROR"], color = "white" },
|
||||
}
|
||||
local buildMenu = function()
|
||||
return options
|
||||
end
|
||||
DetailsFrameWork:NewDropDown (bg, _, "DetailsErrorReportType", "type", 250, 20, buildMenu, 1) -- func, default
|
||||
bg.type:SetPoint (10, -60)
|
||||
bg.type:SetFrameLevel (2, bg)
|
||||
bg.type.lastValue = 1
|
||||
|
||||
|
||||
|
||||
--send button
|
||||
local sendFunc = function()
|
||||
|
||||
if (string.len (bg.textfield.text) < 2) then
|
||||
print (Loc ["STRING_EMPTY"])
|
||||
return
|
||||
end
|
||||
|
||||
if (string.len (bg.textfield.text) > 1024) then
|
||||
print (Loc ["STRING_TOOBIG"])
|
||||
return
|
||||
end
|
||||
|
||||
if (bg.textfield.text == textArray [lastValue]) then
|
||||
print (Loc ["STRING_CANCELLED"])
|
||||
mainFrame:Hide()
|
||||
return
|
||||
end
|
||||
|
||||
local subject = {
|
||||
"LuaError", "InstableAccuracy", "IsntWorking", "Other"
|
||||
}
|
||||
|
||||
local url = "http://reporttodevs.hol.es/sendtodev.php?dev=detailsaddon&subject=" .. subject [bg.type.value] .. "&text=" .. bg.textfield.text:gsub (" ", "%%20")
|
||||
|
||||
ErrorReport:CopyPaste (url)
|
||||
mainFrame:Hide()
|
||||
end
|
||||
|
||||
DetailsFrameWork:NewButton (bg, _, "DetailsErrorReportButton", "send", 100, 20, sendFunc, _, _, _, Loc ["STRING_SEND"])
|
||||
bg.send:InstallCustomTexture()
|
||||
bg.send:SetPoint (10, -370)
|
||||
|
||||
|
||||
end
|
||||
|
||||
--events
|
||||
function ErrorReport:OnEvent (_, event, ...)
|
||||
|
||||
if (event == "ADDON_LOADED") then
|
||||
local AddonName = select (1, ...)
|
||||
if (AddonName == "Details_ErrorReport") then
|
||||
|
||||
if (_G._detalhes) then
|
||||
|
||||
--> create widgets
|
||||
BuildReportPanel (data)
|
||||
|
||||
--> Install
|
||||
local install = _G._detalhes:InstallPlugin ("TOOLBAR", Loc ["STRING_PLUGIN_NAME"], "placeholder string", ErrorReport, "DETAILS_PLUGIN_REPORT_ERRORS")
|
||||
if (type (install) == "table" and install.error) then
|
||||
print (install.error)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
## Interface: 50300
|
||||
## Title: Details Error Report
|
||||
## Notes: This plugin adds a button to Details tooltip where you can report bugs directly to Details Developers.
|
||||
## RequiredDeps: Details
|
||||
|
||||
Details_ErrorReport.lua
|
||||
@@ -0,0 +1,9 @@
|
||||
## Interface: 50300
|
||||
## Title: Details: Throne of Thunder
|
||||
## Notes: Plugin for Details
|
||||
## RequiredDeps: Details
|
||||
|
||||
enUS.lua
|
||||
ptBR.lua
|
||||
|
||||
ThroneOfThunder.lua
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
|
||||
-- @class file
|
||||
-- @name AceLocale-3.0
|
||||
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
|
||||
local MAJOR,MINOR = "AceLocale-3.0", 6
|
||||
|
||||
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not AceLocale then return end -- no upgrade needed
|
||||
|
||||
-- Lua APIs
|
||||
local assert, tostring, error = assert, tostring, error
|
||||
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GAME_LOCALE, geterrorhandler
|
||||
|
||||
local gameLocale = GetLocale()
|
||||
if gameLocale == "enGB" then
|
||||
gameLocale = "enUS"
|
||||
end
|
||||
|
||||
AceLocale.apps = AceLocale.apps or {} -- array of ["AppName"]=localetableref
|
||||
AceLocale.appnames = AceLocale.appnames or {} -- array of [localetableref]="AppName"
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale
|
||||
local readmeta = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: fire off a nonbreaking error and return key
|
||||
rawset(self, key, key) -- only need to see the warning once, really
|
||||
geterrorhandler()(MAJOR..": "..tostring(AceLocale.appnames[self])..": Missing entry for '"..tostring(key).."'")
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale if the silent flag is true, it does not issue a warning on unknown keys
|
||||
local readmetasilent = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: return key
|
||||
rawset(self, key, key) -- only need to invoke this function once
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- Remember the locale table being registered right now (it gets set by :NewLocale())
|
||||
-- NOTE: Do never try to register 2 locale tables at once and mix their definition.
|
||||
local registering
|
||||
|
||||
-- local assert false function
|
||||
local assertfalse = function() assert(false) end
|
||||
|
||||
-- This metatable proxy is used when registering nondefault locales
|
||||
local writeproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
rawset(registering, key, value == true and key or value) -- assigning values: replace 'true' with key string
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
-- This metatable proxy is used when registering the default locale.
|
||||
-- It refuses to overwrite existing values
|
||||
-- Reason 1: Allows loading locales in any order
|
||||
-- Reason 2: If 2 modules have the same string, but only the first one to be
|
||||
-- loaded has a translation for the current locale, the translation
|
||||
-- doesn't get overwritten.
|
||||
--
|
||||
local writedefaultproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
if not rawget(registering, key) then
|
||||
rawset(registering, key, value == true and key or value)
|
||||
end
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
--- Register a new locale (or extend an existing one) for the specified application.
|
||||
-- :NewLocale will return a table you can fill your locale into, or nil if the locale isn't needed for the players
|
||||
-- game locale.
|
||||
-- @paramsig application, locale[, isDefault[, silent]]
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param locale Name of the locale to register, e.g. "enUS", "deDE", etc.
|
||||
-- @param isDefault If this is the default locale being registered (your addon is written in this language, generally enUS)
|
||||
-- @param silent If true, the locale will not issue warnings for missing keys. Must be set on the first locale registered. If set to "raw", nils will be returned for unknown keys (no metatable used).
|
||||
-- @usage
|
||||
-- -- enUS.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "enUS", true)
|
||||
-- L["string1"] = true
|
||||
--
|
||||
-- -- deDE.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "deDE")
|
||||
-- if not L then return end
|
||||
-- L["string1"] = "Zeichenkette1"
|
||||
-- @return Locale Table to add localizations to, or nil if the current locale is not required.
|
||||
function AceLocale:NewLocale(application, locale, isDefault, silent)
|
||||
|
||||
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
|
||||
local gameLocale = GAME_LOCALE or gameLocale
|
||||
|
||||
local app = AceLocale.apps[application]
|
||||
|
||||
if silent and app and getmetatable(app) ~= readmetasilent then
|
||||
geterrorhandler()("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' must be specified for the first locale registered")
|
||||
end
|
||||
|
||||
if not app then
|
||||
if silent=="raw" then
|
||||
app = {}
|
||||
else
|
||||
app = setmetatable({}, silent and readmetasilent or readmeta)
|
||||
end
|
||||
AceLocale.apps[application] = app
|
||||
AceLocale.appnames[app] = application
|
||||
end
|
||||
|
||||
if locale ~= gameLocale and not isDefault then
|
||||
return -- nop, we don't need these translations
|
||||
end
|
||||
|
||||
registering = app -- remember globally for writeproxy and writedefaultproxy
|
||||
|
||||
if isDefault then
|
||||
return writedefaultproxy
|
||||
end
|
||||
|
||||
return writeproxy
|
||||
end
|
||||
|
||||
--- Returns localizations for the current locale (or default locale if translations are missing).
|
||||
-- Errors if nothing is registered (spank developer, not just a missing translation)
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param silent If true, the locale is optional, silently return nil if it's not found (defaults to false, optional)
|
||||
-- @return The locale table for the current language.
|
||||
function AceLocale:GetLocale(application, silent)
|
||||
if not silent and not AceLocale.apps[application] then
|
||||
error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2)
|
||||
end
|
||||
return AceLocale.apps[application]
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
<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">
|
||||
<Script file="AceLocale-3.0.lua"/>
|
||||
</Ui>
|
||||
@@ -0,0 +1,51 @@
|
||||
-- $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
|
||||
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.")
|
||||
|
||||
local oldminor = self.minors[major]
|
||||
if oldminor and oldminor >= minor then return nil end
|
||||
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
||||
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)
|
||||
end
|
||||
return self.libs[major], self.minors[major]
|
||||
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
|
||||
@@ -0,0 +1,13 @@
|
||||
## Interface: 40200
|
||||
## Title: Lib: LibStub
|
||||
## Notes: Universal Library Stub
|
||||
## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
|
||||
## X-Website: http://www.wowace.com/addons/libstub/
|
||||
## X-Category: Library
|
||||
## X-License: Public Domain
|
||||
## X-Curse-Packaged-Version: r95
|
||||
## X-Curse-Project-Name: LibStub
|
||||
## X-Curse-Project-ID: libstub
|
||||
## X-Curse-Repository-ID: wow/libstub/mainline
|
||||
|
||||
LibStub.lua
|
||||
@@ -0,0 +1,41 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local lib, oldMinor = LibStub:NewLibrary("Pants", 1) -- make a new thingy
|
||||
assert(lib) -- should return the library table
|
||||
assert(not oldMinor) -- should not return the old minor, since it didn't exist
|
||||
|
||||
-- the following is to create data and then be able to check if the same data exists after the fact
|
||||
function lib:MyMethod()
|
||||
end
|
||||
local MyMethod = lib.MyMethod
|
||||
lib.MyTable = {}
|
||||
local MyTable = lib.MyTable
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 1) -- try to register a library with the same version, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 0) -- try to register a library with a previous, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 2) -- register a new version
|
||||
assert(newLib) -- library table
|
||||
assert(rawequal(newLib, lib)) -- should be the same reference as the previous
|
||||
assert(newOldMinor == 1) -- should return the minor version of the previous version
|
||||
|
||||
assert(rawequal(lib.MyMethod, MyMethod)) -- verify that values were saved
|
||||
assert(rawequal(lib.MyTable, MyTable)) -- verify that values were saved
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 3 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib) -- library table
|
||||
assert(newOldMinor == 2) -- previous version was 2
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 4 and please ignore 15 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 3) -- previous version was 3 (even though it gave a string)
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 5) -- register a new library, using a normal number instead of a string
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 4) -- previous version was 4 (even though it gave a string)
|
||||
@@ -0,0 +1,27 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib doesn't exist yet, by iterating through all the libraries
|
||||
assert(major ~= "MyLib")
|
||||
end
|
||||
|
||||
assert(not LibStub:GetLibrary("MyLib", true)) -- check that MyLib doesn't exist yet by direct checking
|
||||
assert(not pcall(LibStub.GetLibrary, LibStub, "MyLib")) -- don't silently fail, thus it should raise an error.
|
||||
local lib = LibStub:NewLibrary("MyLib", 1) -- create the lib
|
||||
assert(lib) -- check it exists
|
||||
assert(rawequal(LibStub:GetLibrary("MyLib"), lib)) -- verify that :GetLibrary("MyLib") properly equals the lib reference
|
||||
|
||||
assert(LibStub:NewLibrary("MyLib", 2)) -- create a new version
|
||||
|
||||
local count=0
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib exists somewhere in the libraries, by iterating through all the libraries
|
||||
if major == "MyLib" then -- we found it!
|
||||
count = count +1
|
||||
assert(rawequal(library, lib)) -- verify that the references are equal
|
||||
end
|
||||
end
|
||||
assert(count == 1) -- verify that we actually found it, and only once
|
||||
@@ -0,0 +1,14 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local proxy = newproxy() -- non-string
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, proxy, 1)) -- should error, proxy is not a string, it's userdata
|
||||
local success, ret = pcall(LibStub.GetLibrary, proxy, true)
|
||||
assert(not success or not ret) -- either error because proxy is not a string or because it's not actually registered.
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, "Something", "No number in here")) -- should error, minor has no string in it.
|
||||
|
||||
assert(not LibStub:GetLibrary("Something", true)) -- shouldn't've created it from the above statement
|
||||
@@ -0,0 +1,41 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
|
||||
-- Pretend like loaded libstub is old and doesn't have :IterateLibraries
|
||||
assert(LibStub.minor)
|
||||
LibStub.minor = LibStub.minor - 0.0001
|
||||
LibStub.IterateLibraries = nil
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(type(LibStub.IterateLibraries)=="function")
|
||||
|
||||
|
||||
-- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created
|
||||
LibStub.IterateLibraries = 123
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created
|
||||
LibStub.minor = LibStub.minor + 0.0001
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Again with a huge number
|
||||
LibStub.minor = LibStub.minor + 1234567890
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
print("OK")
|
||||
@@ -0,0 +1,946 @@
|
||||
--[[
|
||||
=====================================================================================================
|
||||
Throne of Thunder Mobs and Spells Ids for Details
|
||||
=====================================================================================================
|
||||
]]--
|
||||
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ("Details_RaidInfo-ThroneOfThunder")
|
||||
|
||||
local _detalhes = _G._detalhes
|
||||
|
||||
local throne_of_thunder = {
|
||||
id = 1098,
|
||||
|
||||
name = Loc ["STRING_RAID_NAME"],
|
||||
|
||||
icons = "Interface\\AddOns\\Details_RaidInfo-ThroneOfThunder\\images\\tot",
|
||||
|
||||
icon = "Interface\\AddOns\\Details_RaidInfo-ThroneOfThunder\\images\\icon256x128",
|
||||
|
||||
background = "Interface\\AddOns\\Details_RaidInfo-ThroneOfThunder\\images\\raid_tot",
|
||||
|
||||
boss_names = {
|
||||
"Jin'rokh the Breaker",
|
||||
"Horridon",
|
||||
"Frost King Malakk",
|
||||
"Tortos",
|
||||
"Magaera",
|
||||
"Ji-Kun",
|
||||
"Durumu the Forgotten",
|
||||
"Primordius",
|
||||
"Dark Animus",
|
||||
"Iron Qon",
|
||||
"Lu'lin",
|
||||
"Lei Shen",
|
||||
"Ra-den"
|
||||
},
|
||||
|
||||
boss_ids = {
|
||||
-- Last Stand of the Zandalari
|
||||
[69465] = 1, -- Jin'rokh the Breaker
|
||||
[68476] = 2, -- Horridon
|
||||
[69134] = 3, -- Kazra'jin, Council of Elders
|
||||
[69078] = 3, -- Sul the Sandcrawler, Council of Elders
|
||||
[69131] = 3, -- Frost King Malakk, Council of Elders
|
||||
[69132] = 3, -- High Priestess Mar'li, Council of Elders
|
||||
-- Forgotten Depths
|
||||
[67977] = 4, -- Tortos
|
||||
[70229] = 5, -- Flaming Head <Head of Megaera>
|
||||
[70250] = 5, -- Frozen Head <Head of Megaera>
|
||||
[70251] = 5, -- Venomous Head <Head of Megaera>
|
||||
[70247] = 5, -- Venomous Head <Head of Megaera>
|
||||
[69712] = 6, -- Ji-Kun
|
||||
-- Halls of Flesh-Shaping
|
||||
[68036] = 7, -- Durumu the Forgotten
|
||||
[69017] = 8, -- Primordius
|
||||
[69427] = 9, -- Dark Animus
|
||||
-- Pinnacle of Storms
|
||||
[68078] = 10, -- Iron Qon <Master of Quilen>
|
||||
[68905] = 11, -- Lu'lin <Mistress of Solitude>, Twin Consorts
|
||||
[68904] = 11, -- Suen <Mistress of Anger>, Twin Consorts
|
||||
[68397] = 12 -- Lei Shen <The Thunder King>
|
||||
},
|
||||
|
||||
encounters = {
|
||||
|
||||
------------> Jin'rokh the Breaker ------------------------------------------------------------------------------
|
||||
[1] = {
|
||||
|
||||
boss = "Jin'rokh the Breaker",
|
||||
|
||||
spell_mechanics = {
|
||||
[137261] = {0x1, 0x40}, --> Lightning Storm
|
||||
[137162] = {0x1, 0x100}, --> Static Burst
|
||||
[138389] = {0x100}, --> Static Wound
|
||||
[137423] = {0x80}, --> Focused Lightning
|
||||
[137374] = {0x40}, --> Focused Lightning Detonation
|
||||
[138133] = {0x40}, --> Lightning Fissure Conduction
|
||||
[137485] = {0x40}, --> Lightning Fissure
|
||||
[137370] = {0x200, 0x1}, --> Thundering Throw
|
||||
[137167] = {0x200, 0x1}, --> Thundering Throw
|
||||
[137905] = {0x40}, --> Lightning Diffusion
|
||||
[138733] = {0x10, 0x40}, --> Ionization
|
||||
[137647] = {0x40}, --> Lightning Strike
|
||||
},
|
||||
|
||||
phases = {
|
||||
--> fase 1
|
||||
{
|
||||
spells = {
|
||||
137261, --> Lightning Storm
|
||||
137162, --> Static Burst
|
||||
138389, --> Static Wound
|
||||
137423, --> Focused Lightning
|
||||
137374, --> Focused Lightning Detonation
|
||||
138133, --> Lightning Fissure Conduction
|
||||
137370, --> Thundering Throw
|
||||
137167 --> Thundering Throw
|
||||
},
|
||||
|
||||
adds = {
|
||||
69465, -- Jin'rokh the Breaker
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
------------> Horridon ------------------------------------------------------------------------------
|
||||
[2] = {
|
||||
|
||||
boss = "Horridon",
|
||||
|
||||
spell_mechanics = {
|
||||
[136719] = {0x10}, --> Blazing Sunlight (Wastewalker)
|
||||
[136723] = {0x8}, --> Sand Trap (Voidzone)
|
||||
[136725] = {0x8}, --> Sand Trap Heroic (Voidzone)
|
||||
[136654] = {0x1}, --> Rending Charge (Bloodlord)
|
||||
[136653] = {0x1}, --> Rending Charge (Bloodlord)
|
||||
[136587] = {0x20, 0x10, 0x1}, --> Venom Bolt Volley (Venom Priest & Venomous Effusions)
|
||||
[136646] = {0x8}, --> Living Poison (Voidzone)
|
||||
[136710] = {0x400, 0x10}, --> Deadly Plague (Drakkari Champions & Drakkari Warriors)
|
||||
[136670] = {0x800, 0x1}, --> Mortal Strike (Frozen Warlords)
|
||||
[136573] = {0x8}, --> Frozen Bolt (Voidzone)
|
||||
[136465] = {0x1, 0x20}, --> Fireball (Amani'shi Flame Casters)
|
||||
[136480] = {0x20, 0x40, 0x1}, --> Chain Lightning (Amani'shi Beast Shaman)
|
||||
[136513] = {0x10, 0x1}, --> Hex of Confusion (Amani'shi Beast Shaman)
|
||||
[136489] = {0x8}, --> Lightning Nova (Voidzone)
|
||||
[136490] = {0x8}, --> Lightning Nova (Voidzone)
|
||||
[136817] = {0x200, 0x2, 0x1}, --> Bestial Cry (dpsrun)
|
||||
[136740] = {0x40}, --> Double Swipe (frontal)
|
||||
[136739] = {0x40}, --> Double Swipe (trazeiro)
|
||||
[137458] = {0x1}, --> Dire Call (heroic)
|
||||
[136767] = {0x1, 0x100}, --> Triple Puncture
|
||||
[136463] = {0x40} --> Swipe (Amani Warbear)
|
||||
},
|
||||
|
||||
continuo = {
|
||||
136767, --> Triple Puncture 10m normal (Horridon)
|
||||
136740, -- Double Swipe (frontal)
|
||||
136739, -- Double Swipe (trazeiro)
|
||||
137458 --> Dire Call (heroic)
|
||||
},
|
||||
|
||||
phases = {
|
||||
{
|
||||
--> fase 1 - The Farraki
|
||||
spells = {
|
||||
136719, --> Blazing Sunlight 10m normal (Wastewalker)
|
||||
136723, --> Sand Trap 10m normal (Voidzone)
|
||||
136725 --> Sand Trap 10m heroic (Voidzone)
|
||||
},
|
||||
adds = {
|
||||
69175, --> Farraki Wastewalker
|
||||
69172, --> Sul'lithuz Stonegazers
|
||||
69173 --> Farraki Skirmishers
|
||||
}
|
||||
},
|
||||
{
|
||||
--> fase 2 - The Gurubashi
|
||||
spells = {
|
||||
136654, --> Rending Charge 10m normal (Bloodlord)
|
||||
136587, --> Venom Bolt Volley 10m normal (Venom Priest & Venomous Effusions)
|
||||
136646 --> Living Poison 10m normal (Voidzone)
|
||||
},
|
||||
adds = {
|
||||
69167, -- Gurubashi Bloodlord
|
||||
69164, -- Gurubashi Venom Priest
|
||||
69314, -- Venomous Effusion
|
||||
68476 -- Horridon
|
||||
}
|
||||
},
|
||||
{
|
||||
--> fase 3 - The Drakkari
|
||||
spells = {
|
||||
136710, --> Deadly Plague (Drakkari Champions & Drakkari Warriors)
|
||||
136670, --> Mortal Strike (Frozen Warlords)
|
||||
139573 --> Frozen Bolt (Voidzone)
|
||||
},
|
||||
adds = {
|
||||
69178,-- "Drakkari Frozen Warlord",
|
||||
69184,-- "Risen Drakkari Warriors",
|
||||
69185, --"Risen Drakkari Champions"
|
||||
68476 -- Horridon
|
||||
}
|
||||
},
|
||||
{
|
||||
--> fase 4 - The Amani
|
||||
spells = {
|
||||
136465, --> Fireball (Amani'shi Flame Casters)
|
||||
136480, --> Chain Lightning (Amani'shi Beast Shaman)
|
||||
136513, --> Hex of Confusion (Amani'shi Beast Shaman)
|
||||
136489, --> Lightning Nova (Voidzone)
|
||||
136463 --> Swipe (Warbears)
|
||||
},
|
||||
adds = {
|
||||
69169, -- "Amani'shi Protector",
|
||||
69168, -- "Amani'shi Flame Caster",
|
||||
69177, -- "Amani Warbear",
|
||||
69176, -- "Amani'shi Beast Shaman"
|
||||
68476 -- Horridon
|
||||
}
|
||||
},
|
||||
{
|
||||
--> fase 5 - War-God Jalak's
|
||||
spells = {
|
||||
136817 --> Bestial Cry
|
||||
},
|
||||
adds = {
|
||||
69374, --"War-God Jalak"
|
||||
68476 -- Horridon
|
||||
}
|
||||
}
|
||||
|
||||
} --> fim das fasses do segundo boss
|
||||
|
||||
}, --> fim do segundo boss
|
||||
|
||||
------------> Concil of Elders ------------------------------------------------------------------------------
|
||||
[3] = {
|
||||
boss = "Council of Elders",
|
||||
|
||||
--> this is a fix for twisted fate spell, due Mar'li adds comes with exactly the same name as the player name, the add spell are assigned to the player
|
||||
func = function()
|
||||
local combat = _detalhes:GetCombat ("current")
|
||||
local actorList = combat:GetActorList (DETAILS_ATTRIBUTE_DAMAGE)
|
||||
|
||||
for _, actor in ipairs (actorList) do
|
||||
local TwistedFate = actor.spell_tables:GetSpell (137972) --> twisted fate adds spell
|
||||
if (TwistedFate) then
|
||||
if (not actor.lastTwistedFate) then
|
||||
actor.lastTwistedFate = 0
|
||||
end
|
||||
actor.total = actor.total - (TwistedFate.total - actor.lastTwistedFate)
|
||||
actor.lastTwistedFate = TwistedFate.total
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
funcType = 0x3, -- 0x1 + 0x2 --> realtime + end of combat
|
||||
|
||||
spell_mechanics = {
|
||||
[136507] = {0x2}, --> Dark Power (Todos)
|
||||
|
||||
[136190] = {0x20, 0x1}, --> Sandbold (Sul the Sandcrawler)
|
||||
[138740] = {0x20, 0x1}, --> Sandbolt (Sul the Sandcrawler)
|
||||
[136899] = {0x1}, --> Sandstorm (Sul the Sandcrawler)
|
||||
[136860] = {0x10, 0x8}, --> Quicksand (Sul the Sandcrawler)
|
||||
|
||||
[137344] = {0x20, 0x1}, --> Wrath of the Loa (High Priestess Mar'li)
|
||||
[137347] = {0x20, 0x1}, --> Wrath of the Loa (High Priestess Mar'li)
|
||||
[137390] = {0x80, 0x1000}, --> Shadowed Gift (High Priestess Mar'li)
|
||||
[137407] = {0x80, 0x1000}, --> Shadowed Gift (High Priestess Mar'li)
|
||||
[137972] = {0x200, 0x40}, --> Twisted Fate (High Priestess Mar'li)
|
||||
|
||||
[136937] = {0x40, 0x1}, --> Frostbite (Frost King Malakk)
|
||||
[136990] = {0x40, 0x1}, --> Frostbite (Frost King Malakk)
|
||||
[136911] = {0x1}, --> Frigid Assault (Frost King Malakk)
|
||||
[136991] = {0x40}, --> Biting Cold (Frost King Malakk)
|
||||
[136917] = {0x40}, --> Biting Cold (Frost King Malakk)
|
||||
|
||||
[137151] = {0x1}, --> Overload (Kazra'jin)
|
||||
[136935] = {0x1}, --> Discharge (Kazra'jin)
|
||||
[137122] = {0x8}, --> Reckless Charge (Kazra'jin)
|
||||
[137133] = {0x8}, --> Reckless Charge (Kazra'jin)
|
||||
|
||||
[137641] = {0x200, 0x1} --> Soul Fragment
|
||||
},
|
||||
|
||||
continuo = {
|
||||
136507, --> Dark Power (Todos)
|
||||
137641, --> Soul Fragment
|
||||
|
||||
136190, --> Sandbold (Sul the Sandcrawler)
|
||||
138740, --> Sandbolt (Sul the Sandcrawler)
|
||||
136899, --> Sandstorm (Sul the Sandcrawler)
|
||||
136860, --> Quicksand (Sul the Sandcrawler)
|
||||
|
||||
137344, --> Wrath of the Loa (High Priestess Mar'li)
|
||||
137390, --> Shadowed Gift (High Priestess Mar'li)
|
||||
137407, --> Shadowed Gift (High Priestess Mar'li)
|
||||
137347, --> Wrath of the Loa (High Priestess Mar'li)
|
||||
137972, --> Twisted Fate (High Priestess Mar'li)
|
||||
|
||||
136937, --> Frostbite (Frost King Malakk)
|
||||
136990, --> Frostbite (Frost King Malakk)
|
||||
136911, --> Frigid Assault (Frost King Malakk)
|
||||
136991, --> Biting Cold (Frost King Malakk)
|
||||
136917, --> Biting Cold (Frost King Malakk)
|
||||
|
||||
137151, --> Overload (Kazra'jin)
|
||||
137122, --> Reckless Charge (Kazra'jin)
|
||||
137133, --> Reckless Charge (Kazra'jin)
|
||||
136935 --> Discharge (Kazra'jin)
|
||||
},
|
||||
|
||||
phases = {
|
||||
{
|
||||
adds = {
|
||||
69548, -- "Shadowed Loa Spirit"
|
||||
69491, -- "Blessed Loa Spirit"
|
||||
69480, -- "Living Sand"
|
||||
69131, -- Frost King Malakk
|
||||
69134, -- Kazra'jin
|
||||
69078, -- Sul the Sandcrawler
|
||||
69132 -- High Priestess Mar'li
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
------------> Tortos ------------------------------------------------------------------------------
|
||||
[4] = {
|
||||
boss = "Tortos",
|
||||
|
||||
spell_mechanics = {
|
||||
[134476] = {0x1}, --> "Rockfall",
|
||||
[134920] = {0x1}, --> "Quake Stomp",
|
||||
[134011] = {0x1, 0x40}, --> "Spinning Shell",
|
||||
[135251] = {0x1}, --> "Snapping Bite",
|
||||
[134539] = {0x8, 0x40}, --> "Rockfall",
|
||||
[135101] = {0x4, 0x200, 0x800} --> "Drain the Weak",
|
||||
|
||||
},
|
||||
|
||||
continuo = {
|
||||
134476, --> "Rockfall",
|
||||
134920, --> "Quake Stomp",
|
||||
134011, --> "Spinning Shell",
|
||||
135251, --> "Snapping Bite",
|
||||
134539, --> "Rockfall",
|
||||
135101 --> "Drain the Weak",
|
||||
},
|
||||
|
||||
phases = {
|
||||
{
|
||||
adds = {
|
||||
67966, --"Whirl Turtle",
|
||||
68497, -- "Vampiric Cave Bat"
|
||||
67977 -- Tortos
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
------------> Megaera ------------------------------------------------------------------------------
|
||||
[5] = {
|
||||
boss = "Megaera",
|
||||
|
||||
spell_mechanics = {
|
||||
[139549] = {0x1}, --Rampage blue
|
||||
[139548] = {0x1}, --rampage red
|
||||
[139551] = {0x1}, --rampage green
|
||||
[139552] = {0x1}, --rampage arcane
|
||||
|
||||
[139842] = {0x100}, --Arctic Freeze
|
||||
[137731] = {0x100}, --Ignite Flesh
|
||||
[137730] = {0x100}, --Ignite Flesh
|
||||
[139839] = {0x100}, --Rot Armor
|
||||
|
||||
[139850] = {0x80, 0x40}, -- Acid Rain
|
||||
[139836] = {0x10}, --Cinders
|
||||
[139822] = {0x10}, --Cinders
|
||||
[139836] = {0x8},--Cinders voidzone
|
||||
[139909] = {0x8}, -- Icy Ground
|
||||
[139889] = {0x80}, -- Torrent of Ice
|
||||
[139992] = {0x100}, -- Diffusion
|
||||
[140178] = {0x20} --Nether Spike
|
||||
},
|
||||
|
||||
continuo = {
|
||||
139549, --Rampage blue
|
||||
139548, --rampage red
|
||||
139551, --rampage green
|
||||
139552, --rampage arcane
|
||||
|
||||
139842, --Arctic Freeze
|
||||
137731, --Ignite Flesh
|
||||
137730, --Ignite Flesh
|
||||
139839, --Rot Armor
|
||||
|
||||
139850, -- Acid Rain
|
||||
139822, --Cinders
|
||||
139836,--Cinders voidzone
|
||||
139909, -- Icy Ground
|
||||
139889, -- Torrent of Ice
|
||||
140178, --Nether Spike
|
||||
139992 --Diffusion
|
||||
},
|
||||
|
||||
phases = {
|
||||
{
|
||||
adds = {
|
||||
70235, --"Frozen Head",
|
||||
70247, --"Venomous Head",
|
||||
70212, --"Flaming Head"
|
||||
70248, --"Arcane Head"
|
||||
70507 -- Nether Wyrm (heroic)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
------------> Ji-Kun ------------------------------------------------------------------------------
|
||||
[6] = {
|
||||
boss = "Ji'kun",
|
||||
|
||||
spell_mechanics = {
|
||||
[134381] = {0x1}, --Quills
|
||||
[140092] = {0x100}, -- Infected Talons
|
||||
[134366] = {0x100}, -- Talon Rake
|
||||
[139100] = {0x100}, -- Talon Strike
|
||||
[134256] = {0x200, 0x1, 0x8}, -- Slimed
|
||||
[134375] = {0x1, 0x40}, -- Caw
|
||||
[138319] = {0x200, 0x1}, -- Feed Pool
|
||||
[140129] = {0x1}, -- Cheep
|
||||
[139296] = {0x1}, -- Cheep
|
||||
[140570] = {0x1}, -- Cheep
|
||||
[139298] = {0x1} -- Cheep
|
||||
},
|
||||
|
||||
continuo = {
|
||||
134381, --Quills
|
||||
140092, -- Infected Talons
|
||||
134256, -- Slimed
|
||||
134366, -- Talon Rake
|
||||
139100, -- Talon Strike
|
||||
134375, -- Caw
|
||||
138319, -- Feed Pool
|
||||
140129, -- Cheep
|
||||
139296, -- Cheep
|
||||
140570, -- Cheep
|
||||
139298 -- Cheep
|
||||
},
|
||||
|
||||
phases = {
|
||||
{
|
||||
adds = {
|
||||
68192, --Hatchling
|
||||
69628, --Mature Egg of Ji-Kun
|
||||
68192, --Fledgling
|
||||
69836, --Juvenile
|
||||
70134 --Nest Guardian
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
------------> Durumu the forgotten ------------------------------------------------------------------------------
|
||||
[7] = {
|
||||
boss = "Durumu the Forgotten",
|
||||
spell_mechanics = {
|
||||
[133732] = {0x1, 0x200}, --> Infrared Light
|
||||
[133738] = {0x1, 0x200}, --> Bright Light
|
||||
[133677] = {0x1, 0x200}, --> Blue Rays
|
||||
[139107] = {0x1}, --> Mind Daggers
|
||||
[133597] = {0x10, 0x200}, --> Dark Parasite
|
||||
[134755] = {0x40}, --> Eye Sore
|
||||
[133765] = {0x100}, --> Hard Stare
|
||||
[133768] = {0x1, 0x100}, --> Arterial Cut
|
||||
[133793] = {0x8}, --> Lingering Gaze
|
||||
[134044] = {0x8}, --> Lingering Gaze
|
||||
[140495] = {0x8}, --> Lingering Gaze
|
||||
[133798] = {0x200}, --> Life Drain
|
||||
[134005] = {0x1}, --> Devour
|
||||
[134010] = {0x1}, --> Devour
|
||||
[136154] = {0x1}, --> Caustic Spike
|
||||
[136123] = {0x200}, --> Burst of Amber
|
||||
[136175] = {0x1}, --> Amber Retaliation
|
||||
[134029] = {0x40}, --> Gaze
|
||||
[136413] = {0x40}, --> Force of Will
|
||||
[134169] = {0x80} --> Disintegration Beam
|
||||
},
|
||||
|
||||
continuo = {},
|
||||
|
||||
phases = {
|
||||
{
|
||||
spells = {
|
||||
139107, --> Mind Daggers
|
||||
133732, --> Infrared Light
|
||||
133738, --> Bright Light
|
||||
133597, --> Dark Parasite
|
||||
133677, --> Blue Rays
|
||||
133765, --> Hard Stare
|
||||
133793, --> Lingering Gaze
|
||||
133798, --> Life Drain
|
||||
134044, --> Lingering Gaze
|
||||
134005, --> Devour
|
||||
136154, --> Caustic Spike
|
||||
134010, --> Devour
|
||||
140495, --> Lingering Gaze
|
||||
133768, --> Arterial Cut
|
||||
136123, --> Burst of Amber
|
||||
136175, --> Amber Retaliation
|
||||
134029, --> Gaze
|
||||
136413 --> Force of Will
|
||||
},
|
||||
adds = {
|
||||
68036, --> Durumu the Forgotten
|
||||
69050, --> Crimson Fogs
|
||||
69052, --> Azure Fog
|
||||
69051, --> Amber Fog
|
||||
67859, --> Hungry Eye
|
||||
68024, --> Wandering Eye
|
||||
68291 --> Ice Wall
|
||||
}
|
||||
},
|
||||
{
|
||||
spells = {
|
||||
139107, --> Mind Daggers
|
||||
133597, --> Dark Parasite
|
||||
134755, --> Eye Sore
|
||||
133793, --> Lingering Gaze
|
||||
134044, --> Lingering Gaze
|
||||
134005, --> Devour
|
||||
134010, --> Devour
|
||||
140495, --> Lingering Gaze
|
||||
134169 --> Disintegration Beam
|
||||
},
|
||||
adds = {
|
||||
68036, --> Durumu the Forgotten
|
||||
67859, --> Hungry Eye
|
||||
68024, --> Wandering Eye
|
||||
68291 --> Ice Wall
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
------------> Primordius ------------------------------------------------------------------------------
|
||||
[8] = {
|
||||
boss = "Primordius",
|
||||
spell_mechanics = {
|
||||
[136220] = {0x1, 0x2000}, --> Acidic Explosion
|
||||
[136216] = {0x1, 0x40}, --> Caustic Gas
|
||||
[136178] = {0x1}, --> Mutation
|
||||
[136211] = {0x1}, --> Ventral Sacs
|
||||
[137000] = {0x100, 0x1}, --> Black Blood
|
||||
[136247] = {0x40}, --> Pustule Eruption
|
||||
[136050] = {0x100, 0x1}, --> Malformed Blood
|
||||
[136231] = {0x1}, --> Volatile Pathogen
|
||||
[136037] = {0x800, 0x1}, --> Primordial Strike
|
||||
[140508] = {0x1} --> Volatile Mutation
|
||||
},
|
||||
continuo = {
|
||||
136220, --> Acidic Explosion
|
||||
136216, --> Caustic Gas
|
||||
136178, --> Mutation
|
||||
136211, --> Ventral Sacs
|
||||
137000, --> Black Blood
|
||||
136247, --> Pustule Eruption
|
||||
136050, --> Malformed Blood
|
||||
136231, --> Volatile Pathogen
|
||||
136037, --> Primordial Strike
|
||||
140508 --> Volatile Mutation
|
||||
},
|
||||
phases = {
|
||||
{
|
||||
spells = {},
|
||||
adds = {
|
||||
69069, --> living-fluid
|
||||
69017, --> Primordius
|
||||
69070 --> Viscous Horror
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
------------> Dark Animus ------------------------------------------------------------------------------
|
||||
|
||||
[9] = {
|
||||
boss = "Dark Animus",
|
||||
spell_mechanics = {
|
||||
[139867] = {0x1, 0x3000}, --> Interrupting Jolt
|
||||
[138659] = {0x1}, --> Touch of the Animus
|
||||
[138707] = {0x2000, 0x1}, --> Anima Font
|
||||
[138618] = {0x200, 0x10}, --> Matter Swap
|
||||
[138569] = {0x40, 0x100}, --> Explosive Slam
|
||||
[136962] = {0x100}, --> Anima Ring
|
||||
[138480] = {0x8, 0x80} --> Crimson Wake
|
||||
},
|
||||
continuo = {
|
||||
139867, --> Interrupting Jolt
|
||||
138659, --> Touch of the Animus
|
||||
138707, --> Anima Font
|
||||
138618, --> Matter Swap
|
||||
138569, --> Explosive Slam
|
||||
136962, --> Anima Ring
|
||||
138480 --> Crimson Wake
|
||||
},
|
||||
phases = {
|
||||
{
|
||||
spells = {
|
||||
},
|
||||
adds = {
|
||||
69427, --> Dark Animus
|
||||
69701, --> Anima Golem
|
||||
69699, --> Massive Anima Golem
|
||||
69700 --> Large Anima Golem
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
------------> Iron Qon ------------------------------------------------------------------------------
|
||||
[10] = {
|
||||
boss = "Iron Qon",
|
||||
spell_mechanics = {
|
||||
[136925] = {0x40}, --> Burning Blast
|
||||
[134628] = {0x200, 0x1}, --> Unleashed Flame
|
||||
[134664] = {0x200}, --> Molten Inferno
|
||||
|
||||
[136193] = {0x2000}, --> Arcing Lightning
|
||||
[137669] = {0x8}, --> Storm Cloud
|
||||
[136577] = {0x80}, --> Wind Storm
|
||||
[139167] = {0x40}, --> Whirling Winds
|
||||
[136192] = {0x200}, --> Lightning Storm
|
||||
[136498] = {0x1}, --> Storm Surge
|
||||
[137654] = {0x80}, --> Rushing Winds
|
||||
|
||||
[137709] = {0x1}, --> Shatter
|
||||
[135146] = {0x1}, --> Shatter
|
||||
[137664] = {0x8}, --> Frozen Blood
|
||||
[136520] = {0x8}, --> Frozen Blood
|
||||
[135142] = {0x1}, --> Frozen Resilience
|
||||
[139180] = {0x40}, --> Frost Spike
|
||||
[134759] = {0x8}, --> Ground Rupture
|
||||
|
||||
[136147] = {0x2, 0x1}, --> Fist Smash
|
||||
[134691] = {0x100}, --> Impale
|
||||
[134926] = {0x40} --> Throw Spear
|
||||
},
|
||||
|
||||
continuo = {
|
||||
134691 --> Impale
|
||||
},
|
||||
|
||||
phases = {
|
||||
--> phase 1 Ro'shak
|
||||
{
|
||||
spells = {
|
||||
136925, --> Burning Blast
|
||||
134664, --> Molten Inferno
|
||||
134628, --> Unleashed Flame
|
||||
139167, --> Whirling Winds
|
||||
136192, --> Lightning Storm
|
||||
139167, --> Whirling Winds
|
||||
136498 --> Storm Surge
|
||||
},
|
||||
adds = {
|
||||
68079 --> Ro'shak
|
||||
}
|
||||
},
|
||||
|
||||
--> phase 2 Quet'zal
|
||||
{
|
||||
spells = {
|
||||
136193, --> Arcing Lightning
|
||||
137669, --> Storm Cloud
|
||||
136577, --> Wind Storm
|
||||
139167, --> Whirling Winds
|
||||
136192, --> Lightning Storm
|
||||
136498, --> Storm Surge
|
||||
137654, --> Rushing Winds
|
||||
139180 --> Frost Spike
|
||||
},
|
||||
adds = {
|
||||
68080 --> Quet'zal
|
||||
}
|
||||
},
|
||||
|
||||
--> phase 3 Dam'ren
|
||||
{
|
||||
spells = {
|
||||
137709, --> Shatter
|
||||
135146, --> Shatter
|
||||
137664, --> Frozen Blood
|
||||
136520, --> Frozen Blood
|
||||
135142, --> Frozen Resilience
|
||||
139180, --> Frost Spike
|
||||
134759, --> Ground Rupture
|
||||
134664, --> Molten Inferno
|
||||
134628 --> Unleashed Flame
|
||||
},
|
||||
adds = {
|
||||
68081 --> Dam'ren
|
||||
}
|
||||
},
|
||||
|
||||
--> phase 4 Iron Qon
|
||||
{
|
||||
spells = {
|
||||
139167, --> Whirling Winds
|
||||
136147, --> Fist Smash
|
||||
134691, --> Impale
|
||||
134664, --> Molten Inferno
|
||||
134628, --> Unleashed Flame
|
||||
139180, --> Frost Spike
|
||||
139167, --> Whirling Winds
|
||||
136498 --> Storm Surge
|
||||
},
|
||||
adds = {
|
||||
68078 --> Iron Qon
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
------------> Twin Consorts ------------------------------------------------------------------------------
|
||||
[11] = {
|
||||
boss = "Twin Consorts",
|
||||
|
||||
spell_mechanics = {
|
||||
[137410] = {0x200, 0x1}, --> Blazing Radiance
|
||||
[137492] = {0x1}, --> Nuclear Inferno
|
||||
[137382] = {0x1}, --> Darkness
|
||||
[138682] = {0x1}, --> Darkness
|
||||
[137129] = {0x1, 0x2000}, --> Crashing Star
|
||||
[137405] = {0x1}, --> Tears of the Sun
|
||||
[138746] = {0x1}, --> Tears of the Sun
|
||||
[137494] = {0x1, 0x2000}, --> Light of Day
|
||||
[137403] = {0x1, 0x2000}, --> Light of Day
|
||||
[138804] = {0x1, 0x2000}, --> Light of Day
|
||||
[137360] = {0x200}, --> Corrupted Healing
|
||||
[137408] = {0x100}, --> Fan of Flames
|
||||
[136722] = {0x40}, --> Slumber Spores
|
||||
[137417] = {0x8}, --> Flames of Passion
|
||||
[137414] = {0x8}, --> Flames of Passion
|
||||
[138688] = {0x1}, --> Tidal Force
|
||||
[137716] = {0x1}, --> Tidal Force
|
||||
[137419] = {0x1, 0x2000} --> Ice Comet
|
||||
},
|
||||
|
||||
continuo = {
|
||||
},
|
||||
|
||||
phases = {
|
||||
--> phase 1 (night)
|
||||
{
|
||||
spells = {
|
||||
137382, --> Darkness
|
||||
138682, --> Darkness
|
||||
137405, --> Tears of the Sun
|
||||
138746, --> Tears of the Sun
|
||||
137494, --> Light of Day
|
||||
137403, --> Light of Day
|
||||
138804, --> Light of Day
|
||||
137360, --> Corrupted Healing
|
||||
136722, --> Slumber Spores
|
||||
137129 --> Crashing Star
|
||||
|
||||
},
|
||||
adds = {
|
||||
69591, -- Lurker in the Night
|
||||
69479, -- Beast of Nightmares
|
||||
68905, --> Lu'lin
|
||||
68904 --> Suen
|
||||
}
|
||||
},
|
||||
--> phase 2 (day)
|
||||
{
|
||||
spells = {
|
||||
137492, --> Nuclear Inferno
|
||||
137410, --> Blazing Radiance
|
||||
137408, --> Fan of Flames
|
||||
137417, --> Flames of Passion
|
||||
137419, --> Ice Comet
|
||||
137129 --> Crashing Star
|
||||
},
|
||||
adds = {
|
||||
68904 --> Suen
|
||||
}
|
||||
},
|
||||
--> phase 3 (dusk)
|
||||
{
|
||||
spells = {
|
||||
137492, --> Nuclear Inferno
|
||||
137410, --> Blazing Radiance
|
||||
138688, --> Tidal Force
|
||||
137419, --> Ice Comet
|
||||
137494, --> Light of Day
|
||||
137403, --> Light of Day
|
||||
138804, --> Light of Day
|
||||
137410 --> Blazing Radiance
|
||||
},
|
||||
adds = {
|
||||
68905, --> Lu'lin
|
||||
68904 --> Suen
|
||||
}
|
||||
},
|
||||
--> phase 4
|
||||
{
|
||||
spells = {
|
||||
137492, --> Nuclear Inferno
|
||||
137410, --> Blazing Radiance
|
||||
137382, --> Darkness
|
||||
138682, --> Darkness
|
||||
137360, --> Corrupted Healing
|
||||
137408, --> Fan of Flames
|
||||
136722, --> Slumber Spores
|
||||
137417, --> Flames of Passion
|
||||
137129 --> Crashing Star
|
||||
},
|
||||
adds = {
|
||||
69591, --Lurker in the Night
|
||||
69479, --Beast of Nightmares
|
||||
68905, --> Lu'lin
|
||||
68904 --> Suen
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
------------> Lei Shen ------------------------------------------------------------------------------
|
||||
[12] = {
|
||||
boss = "Lei Shen",
|
||||
|
||||
spell_mechanics = {
|
||||
[136889] = {0x2, 0x1}, --> Violent Gale Winds
|
||||
[135096] = {0x40}, --> Thunderstruck
|
||||
[135703] = {0x200}, --> Static Shock
|
||||
[134821] = {0x200}, --> Discharged Energy
|
||||
[136366] = {0x1}, --> Bouncing Bolt
|
||||
[136620] = {0x1}, --> Ball Lightning
|
||||
[136543] = {0x1}, --> Summon Ball Lightning
|
||||
[136021] = {0x40}, --> Chain Lightning
|
||||
[135150] = {0x8}, --> Crashing Thunder
|
||||
[135153] = {0x8}, --> Crashing Thunder
|
||||
[136914] = {0x1}, --> Electrical Shock
|
||||
[136019] = {0x40}, --> Chain Lightning
|
||||
[136018] = {0x40}, --> Chain Lightning
|
||||
[139011] = {0x1}, --> Helm of Command
|
||||
[134916] = {0x80, 0x100}, --> Decapitate
|
||||
[136326] = {0x40}, --> Overcharge
|
||||
[136478] = {0x100}, --> Fusion Slash
|
||||
[135991] = {0x40}, --> Diffusion Chain
|
||||
[136853] = {0x8}, --> Lightning Bolt
|
||||
[137176] = {0x8}, --> Overloaded Circuits
|
||||
[136850] = {0x8, 0x40} --> Lightning Whip
|
||||
},
|
||||
continuo = {
|
||||
135703, --> Static Shock
|
||||
136366, --> Bouncing Bolt
|
||||
136021, --> Chain Lightning
|
||||
136019, --> Chain Lightning
|
||||
136018, --> Chain Lightning
|
||||
136326, --> Overcharge
|
||||
135991 --> Diffusion Chain
|
||||
},
|
||||
phases = {
|
||||
|
||||
--> phase 1
|
||||
{
|
||||
spells = {
|
||||
135096, --> Thunderstruck
|
||||
134821, --> Discharged Energy
|
||||
135150, --> Crashing Thunder
|
||||
135153, --> Crashing Thunder
|
||||
134916 --> Decapitate
|
||||
},
|
||||
adds = {
|
||||
69013, --> Diffused Lightning
|
||||
69133, --> Unharnessed Power
|
||||
68397 --> Lei Shen
|
||||
}
|
||||
},
|
||||
|
||||
--> phase 2
|
||||
{
|
||||
spells = {
|
||||
|
||||
},
|
||||
adds = {
|
||||
69013, --> Diffused Lightning
|
||||
69133 --> Unharnessed Power
|
||||
}
|
||||
},
|
||||
|
||||
--> phase 3
|
||||
{
|
||||
spells = {
|
||||
134821, --> Discharged Energy
|
||||
136620, --> Ball Lightning
|
||||
136543, --> Summon Ball Lightning
|
||||
139011, --> Helm of Command
|
||||
136478, --> Fusion Slash
|
||||
136853, --> Lightning Bolt
|
||||
137176, --> Overloaded Circuits
|
||||
136850 --> Lightning Whip
|
||||
},
|
||||
adds = {
|
||||
69013, --> Diffused Lightning
|
||||
69133, --> Unharnessed Power
|
||||
69232, --> Ball Lightning
|
||||
68397 --> Lei Shen
|
||||
}
|
||||
},
|
||||
|
||||
--> phase 4
|
||||
{
|
||||
spells = {
|
||||
137176 --> Overloaded Circuits
|
||||
},
|
||||
adds = {
|
||||
69013, --> Diffused Lightning
|
||||
69133 --> Unharnessed Power
|
||||
}
|
||||
},
|
||||
|
||||
--> phase 5
|
||||
{
|
||||
spells = {
|
||||
136889, --> Violent Gale Winds
|
||||
135096, --> Thunderstruck
|
||||
134821, --> Discharged Energy
|
||||
136620, --> Ball Lightning
|
||||
136543, --> Summon Ball Lightning
|
||||
136914, --> Electrical Shock
|
||||
139011, --> Helm of Command
|
||||
136478, --> Fusion Slash
|
||||
136853, --> Lightning Bolt
|
||||
137176, --> Overloaded Circuits
|
||||
136850 --> Lightning Whip
|
||||
},
|
||||
adds = {
|
||||
69013, --> Diffused Lightning
|
||||
69133, --> Unharnessed Power
|
||||
69232, --> Ball Lightning
|
||||
68397 --> Lei Shen
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
------------> Ra-den ------------------------------------------------------------------------------
|
||||
[13] = {
|
||||
boss = "Ra-Den",
|
||||
phases = {}
|
||||
}
|
||||
|
||||
} --> Fim da lista dos Bosses de Throne of Thunder
|
||||
}
|
||||
|
||||
|
||||
_detalhes:InstallEncounter (throne_of_thunder)
|
||||
@@ -0,0 +1,6 @@
|
||||
<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">
|
||||
|
||||
<Script file="Libs\LibStub\LibStub.lua"/>
|
||||
<Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml" />
|
||||
</Ui>
|
||||
@@ -0,0 +1,24 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("Details_RaidInfo-ThroneOfThunder", "enUS", true)
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
Loc ["PLUGIN_NAME"] = "Raid Info Throne of Thunder"
|
||||
Loc ["STRING_RAID_NAME"] = "Throne of Thunder"
|
||||
|
||||
---------------------------------------------------------------------------------------------------
|
||||
|
||||
Loc ["STRING_JINROKH"] = "Jin'rokh the Breaker"
|
||||
Loc ["STRING_HORRIDON"] = "Horridon"
|
||||
Loc ["STRING_CONCIL"] = "Council of Elders"
|
||||
Loc ["STRING_TORTOS"] = "Tortos"
|
||||
Loc ["STRING_MEGAERA"] = "Megaera"
|
||||
Loc ["STRING_JIKUN"] = "Ji'kun"
|
||||
Loc ["STRING_DURUMU"] = "Durumu the Forgotten"
|
||||
Loc ["STRING_PRIMORDIUS"] = "Primordius"
|
||||
Loc ["STRING_DARKANIMUS"] = "Dark Animus"
|
||||
Loc ["STRING_IRONQON"] = "Iron Qon"
|
||||
Loc ["STRING_TWINS"] = "Twin Consorts"
|
||||
Loc ["STRING_LEISHEN"] = "Lei Shen"
|
||||
Loc ["STRING_RADEN"] = "Ra-Den"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 128 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 512 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 256 KiB |
@@ -0,0 +1,11 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("Details_RaidInfo-ThroneOfThunder", "ptBR")
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
Loc ["PLUGIN_NAME"] = "Info da Raide Trono do Trovao"
|
||||
Loc ["STRING_RAID_NAME"] = "Trono do Trovao"
|
||||
|
||||
---------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
## Interface: 50300
|
||||
## Title: Details Save Data
|
||||
## Notes: Save Details database
|
||||
## RequiredDeps: Details
|
||||
|
||||
Details_SaveData.xml
|
||||
@@ -0,0 +1,24 @@
|
||||
<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">
|
||||
|
||||
<Frame>
|
||||
<Scripts>
|
||||
|
||||
<OnLoad>
|
||||
self:RegisterEvent ("ADDON_LOADED")
|
||||
self:RegisterEvent ("PLAYER_LOGOUT")
|
||||
</OnLoad>
|
||||
|
||||
<OnEvent>
|
||||
if (event == "ADDON_LOADED") then
|
||||
_G._detalhes_saver = true
|
||||
|
||||
elseif (event == "PLAYER_LOGOUT") then
|
||||
_G._detalhes:SaveDataOnLogout()
|
||||
|
||||
end
|
||||
</OnEvent>
|
||||
|
||||
</Scripts>
|
||||
</Frame>
|
||||
|
||||
</Ui>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
## Interface: 50300
|
||||
## Title: Details Spells (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## SavedVariablesPerCharacter: _detalhes_databaseSpellDetails
|
||||
## RequiredDeps: Details
|
||||
## OptionalDeps: Ace3
|
||||
|
||||
#@no-lib-strip@
|
||||
embeds.xml
|
||||
#@end-no-lib-strip@
|
||||
|
||||
enUS.lua
|
||||
ptBR.lua
|
||||
|
||||
Details_SpellDetails.lua
|
||||
@@ -0,0 +1,137 @@
|
||||
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
|
||||
-- @class file
|
||||
-- @name AceLocale-3.0
|
||||
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
|
||||
local MAJOR,MINOR = "AceLocale-3.0", 6
|
||||
|
||||
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not AceLocale then return end -- no upgrade needed
|
||||
|
||||
-- Lua APIs
|
||||
local assert, tostring, error = assert, tostring, error
|
||||
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GAME_LOCALE, geterrorhandler
|
||||
|
||||
local gameLocale = GetLocale()
|
||||
if gameLocale == "enGB" then
|
||||
gameLocale = "enUS"
|
||||
end
|
||||
|
||||
AceLocale.apps = AceLocale.apps or {} -- array of ["AppName"]=localetableref
|
||||
AceLocale.appnames = AceLocale.appnames or {} -- array of [localetableref]="AppName"
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale
|
||||
local readmeta = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: fire off a nonbreaking error and return key
|
||||
rawset(self, key, key) -- only need to see the warning once, really
|
||||
geterrorhandler()(MAJOR..": "..tostring(AceLocale.appnames[self])..": Missing entry for '"..tostring(key).."'")
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale if the silent flag is true, it does not issue a warning on unknown keys
|
||||
local readmetasilent = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: return key
|
||||
rawset(self, key, key) -- only need to invoke this function once
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- Remember the locale table being registered right now (it gets set by :NewLocale())
|
||||
-- NOTE: Do never try to register 2 locale tables at once and mix their definition.
|
||||
local registering
|
||||
|
||||
-- local assert false function
|
||||
local assertfalse = function() assert(false) end
|
||||
|
||||
-- This metatable proxy is used when registering nondefault locales
|
||||
local writeproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
rawset(registering, key, value == true and key or value) -- assigning values: replace 'true' with key string
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
-- This metatable proxy is used when registering the default locale.
|
||||
-- It refuses to overwrite existing values
|
||||
-- Reason 1: Allows loading locales in any order
|
||||
-- Reason 2: If 2 modules have the same string, but only the first one to be
|
||||
-- loaded has a translation for the current locale, the translation
|
||||
-- doesn't get overwritten.
|
||||
--
|
||||
local writedefaultproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
if not rawget(registering, key) then
|
||||
rawset(registering, key, value == true and key or value)
|
||||
end
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
--- Register a new locale (or extend an existing one) for the specified application.
|
||||
-- :NewLocale will return a table you can fill your locale into, or nil if the locale isn't needed for the players
|
||||
-- game locale.
|
||||
-- @paramsig application, locale[, isDefault[, silent]]
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param locale Name of the locale to register, e.g. "enUS", "deDE", etc.
|
||||
-- @param isDefault If this is the default locale being registered (your addon is written in this language, generally enUS)
|
||||
-- @param silent If true, the locale will not issue warnings for missing keys. Must be set on the first locale registered. If set to "raw", nils will be returned for unknown keys (no metatable used).
|
||||
-- @usage
|
||||
-- -- enUS.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "enUS", true)
|
||||
-- L["string1"] = true
|
||||
--
|
||||
-- -- deDE.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "deDE")
|
||||
-- if not L then return end
|
||||
-- L["string1"] = "Zeichenkette1"
|
||||
-- @return Locale Table to add localizations to, or nil if the current locale is not required.
|
||||
function AceLocale:NewLocale(application, locale, isDefault, silent)
|
||||
|
||||
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
|
||||
local gameLocale = GAME_LOCALE or gameLocale
|
||||
|
||||
local app = AceLocale.apps[application]
|
||||
|
||||
if silent and app and getmetatable(app) ~= readmetasilent then
|
||||
geterrorhandler()("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' must be specified for the first locale registered")
|
||||
end
|
||||
|
||||
if not app then
|
||||
if silent=="raw" then
|
||||
app = {}
|
||||
else
|
||||
app = setmetatable({}, silent and readmetasilent or readmeta)
|
||||
end
|
||||
AceLocale.apps[application] = app
|
||||
AceLocale.appnames[app] = application
|
||||
end
|
||||
|
||||
if locale ~= gameLocale and not isDefault then
|
||||
return -- nop, we don't need these translations
|
||||
end
|
||||
|
||||
registering = app -- remember globally for writeproxy and writedefaultproxy
|
||||
|
||||
if isDefault then
|
||||
return writedefaultproxy
|
||||
end
|
||||
|
||||
return writeproxy
|
||||
end
|
||||
|
||||
--- Returns localizations for the current locale (or default locale if translations are missing).
|
||||
-- Errors if nothing is registered (spank developer, not just a missing translation)
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param silent If true, the locale is optional, silently return nil if it's not found (defaults to false, optional)
|
||||
-- @return The locale table for the current language.
|
||||
function AceLocale:GetLocale(application, silent)
|
||||
if not silent and not AceLocale.apps[application] then
|
||||
error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2)
|
||||
end
|
||||
return AceLocale.apps[application]
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
<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">
|
||||
<Script file="AceLocale-3.0.lua"/>
|
||||
</Ui>
|
||||
@@ -0,0 +1,51 @@
|
||||
-- $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
|
||||
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.")
|
||||
|
||||
local oldminor = self.minors[major]
|
||||
if oldminor and oldminor >= minor then return nil end
|
||||
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
||||
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)
|
||||
end
|
||||
return self.libs[major], self.minors[major]
|
||||
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
|
||||
@@ -0,0 +1,13 @@
|
||||
## Interface: 40200
|
||||
## Title: Lib: LibStub
|
||||
## Notes: Universal Library Stub
|
||||
## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
|
||||
## X-Website: http://www.wowace.com/addons/libstub/
|
||||
## X-Category: Library
|
||||
## X-License: Public Domain
|
||||
## X-Curse-Packaged-Version: r95
|
||||
## X-Curse-Project-Name: LibStub
|
||||
## X-Curse-Project-ID: libstub
|
||||
## X-Curse-Repository-ID: wow/libstub/mainline
|
||||
|
||||
LibStub.lua
|
||||
@@ -0,0 +1,41 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local lib, oldMinor = LibStub:NewLibrary("Pants", 1) -- make a new thingy
|
||||
assert(lib) -- should return the library table
|
||||
assert(not oldMinor) -- should not return the old minor, since it didn't exist
|
||||
|
||||
-- the following is to create data and then be able to check if the same data exists after the fact
|
||||
function lib:MyMethod()
|
||||
end
|
||||
local MyMethod = lib.MyMethod
|
||||
lib.MyTable = {}
|
||||
local MyTable = lib.MyTable
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 1) -- try to register a library with the same version, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 0) -- try to register a library with a previous, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 2) -- register a new version
|
||||
assert(newLib) -- library table
|
||||
assert(rawequal(newLib, lib)) -- should be the same reference as the previous
|
||||
assert(newOldMinor == 1) -- should return the minor version of the previous version
|
||||
|
||||
assert(rawequal(lib.MyMethod, MyMethod)) -- verify that values were saved
|
||||
assert(rawequal(lib.MyTable, MyTable)) -- verify that values were saved
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 3 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib) -- library table
|
||||
assert(newOldMinor == 2) -- previous version was 2
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 4 and please ignore 15 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 3) -- previous version was 3 (even though it gave a string)
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 5) -- register a new library, using a normal number instead of a string
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 4) -- previous version was 4 (even though it gave a string)
|
||||
@@ -0,0 +1,27 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib doesn't exist yet, by iterating through all the libraries
|
||||
assert(major ~= "MyLib")
|
||||
end
|
||||
|
||||
assert(not LibStub:GetLibrary("MyLib", true)) -- check that MyLib doesn't exist yet by direct checking
|
||||
assert(not pcall(LibStub.GetLibrary, LibStub, "MyLib")) -- don't silently fail, thus it should raise an error.
|
||||
local lib = LibStub:NewLibrary("MyLib", 1) -- create the lib
|
||||
assert(lib) -- check it exists
|
||||
assert(rawequal(LibStub:GetLibrary("MyLib"), lib)) -- verify that :GetLibrary("MyLib") properly equals the lib reference
|
||||
|
||||
assert(LibStub:NewLibrary("MyLib", 2)) -- create a new version
|
||||
|
||||
local count=0
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib exists somewhere in the libraries, by iterating through all the libraries
|
||||
if major == "MyLib" then -- we found it!
|
||||
count = count +1
|
||||
assert(rawequal(library, lib)) -- verify that the references are equal
|
||||
end
|
||||
end
|
||||
assert(count == 1) -- verify that we actually found it, and only once
|
||||
@@ -0,0 +1,14 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local proxy = newproxy() -- non-string
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, proxy, 1)) -- should error, proxy is not a string, it's userdata
|
||||
local success, ret = pcall(LibStub.GetLibrary, proxy, true)
|
||||
assert(not success or not ret) -- either error because proxy is not a string or because it's not actually registered.
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, "Something", "No number in here")) -- should error, minor has no string in it.
|
||||
|
||||
assert(not LibStub:GetLibrary("Something", true)) -- shouldn't've created it from the above statement
|
||||
@@ -0,0 +1,41 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
|
||||
-- Pretend like loaded libstub is old and doesn't have :IterateLibraries
|
||||
assert(LibStub.minor)
|
||||
LibStub.minor = LibStub.minor - 0.0001
|
||||
LibStub.IterateLibraries = nil
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(type(LibStub.IterateLibraries)=="function")
|
||||
|
||||
|
||||
-- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created
|
||||
LibStub.IterateLibraries = 123
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created
|
||||
LibStub.minor = LibStub.minor + 0.0001
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Again with a huge number
|
||||
LibStub.minor = LibStub.minor + 1234567890
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
print("OK")
|
||||
@@ -0,0 +1,6 @@
|
||||
<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">
|
||||
|
||||
<Script file="Libs\LibStub\LibStub.lua"/>
|
||||
<Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml" />
|
||||
</Ui>
|
||||
@@ -0,0 +1,20 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("Details_SpellDetails", "enUS", true)
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
Loc ["PLUGIN_NAME"] = "Spell Details"
|
||||
Loc ["STRING_TOOSHORT"] = "Combat time was too short \n and the graph cannot be generated."
|
||||
|
||||
Loc ["STRING_DAMAGE"] = "DMG"
|
||||
Loc ["STRING_DPS"] = "DPS"
|
||||
Loc ["STRING_TEMPO"] = "TIME"
|
||||
Loc ["STRING_PERCENT"] = "Percent"
|
||||
Loc ["STRING_UPTIME"] = "Uptime"
|
||||
Loc ["STRING_CRIT"] = "Critical"
|
||||
Loc ["STRING_MISS"] = "Miss"
|
||||
Loc ["STRING_BLOCKED"] = "Blocked"
|
||||
Loc ["STRING_GLANCING"] = "Glancing"
|
||||
Loc ["STRING_DEBUFFNAME"] = "insert buff name"
|
||||
Loc ["STRING_INCOMBAT"] = "You are in combat"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 512 KiB |
@@ -0,0 +1,21 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("Details_SpellDetails", "ptBR")
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
Loc ["PLUGIN_NAME"] = "Detalhes das Magias"
|
||||
Loc ["STRING_TOOSHORT"] = "O tempo do combat foi curto\n e o grafico nao pode ser gerado."
|
||||
|
||||
Loc ["STRING_DAMAGE"] = "Dano"
|
||||
Loc ["STRING_DPS"] = "Dps"
|
||||
Loc ["STRING_TEMPO"] = "Tempo"
|
||||
Loc ["STRING_PERCENT"] = "Porcentagem"
|
||||
Loc ["STRING_UPTIME"] = "Ativo"
|
||||
Loc ["STRING_CRIT"] = "Critico"
|
||||
Loc ["STRING_MISS"] = "Erros"
|
||||
Loc ["STRING_BLOCKED"] = "Bloqueios"
|
||||
|
||||
Loc ["STRING_GLANCING"] = "Golpes Fracos"
|
||||
Loc ["STRING_DEBUFFNAME"] = "insira o nome do buff"
|
||||
Loc ["STRING_INCOMBAT"] = "Voce esta em combate"
|
||||
@@ -0,0 +1,681 @@
|
||||
local AceLocale = LibStub ("AceLocale-3.0")
|
||||
local Loc = AceLocale:GetLocale ("Details_TimeAttack")
|
||||
|
||||
local _GetTime = GetTime --> wow api local
|
||||
local _UFC = UnitAffectingCombat --> wow api local
|
||||
local _IsInRaid = IsInRaid --> wow api local
|
||||
local _IsInGroup = IsInGroup --> wow api local
|
||||
local _UnitAura = UnitAura --> wow api local
|
||||
|
||||
local _math_floor = math.floor --> lua library local
|
||||
local _cstr = string.format --> lua library local
|
||||
|
||||
--> Create the plugin Object
|
||||
local TimeAttack = _detalhes:NewPluginObject ("Details_TimeAttack")
|
||||
--> Main Frame
|
||||
local TimeAttackFrame = TimeAttack.Frame
|
||||
|
||||
local function CreatePluginFrames (data)
|
||||
|
||||
--> catch Details! main object
|
||||
local _detalhes = _G._detalhes
|
||||
local DetailsFrameWork = _detalhes.gump
|
||||
local instance --> shortcut for details instance wich are holding solo plugins
|
||||
local GameCooltip = GameCooltip
|
||||
|
||||
|
||||
--> default rank table
|
||||
TimeAttack.data = data or {time = 180, dps = 0, history = {}}
|
||||
TimeAttack.try = 1
|
||||
|
||||
--> OnEvent Table
|
||||
function TimeAttack:OnDetailsEvent (event)
|
||||
if (event == "HIDE") then --> plugin hidded, disabled
|
||||
TimeAttackFrame:SetScript ("OnUpdate", nil)
|
||||
TimeAttack:Cancel()
|
||||
|
||||
elseif (event == "SHOW") then
|
||||
instance = _detalhes.SoloTables.instancia --> update wich instance solo mode are running
|
||||
DetailsFrameWork:RegisterForDetailsMove (DetailsTimeAttackHistoryBackground, instance)
|
||||
|
||||
elseif (event == "COMBAT_PLAYER_ENTER") then --> combat started
|
||||
TimeAttack:ScheduleTimer ("TimeAttackPluginStart", 2)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
------------- Build TimeAttack Object ------------------------------------------------------------------------------------------------
|
||||
|
||||
--> main frame and background texture
|
||||
TimeAttackFrame:SetResizable (false) --> cant resize, this is a fixed size
|
||||
TimeAttackFrame:SetWidth (300) --> need to be 300x300 to fit details window
|
||||
TimeAttackFrame:SetHeight (300) --> need to be 300x300 to fit details window
|
||||
|
||||
--> default background picture, will hold the actor spec background, like old school talent frame
|
||||
local background = TimeAttackFrame:CreateTexture (nil, "background")
|
||||
|
||||
--> some times the current spec isn't avaliable yet, so we try to catch 5 seconds after character logon
|
||||
function _detalhes:TimeAttackStartupBackground()
|
||||
local spec = GetSpecialization()
|
||||
if (spec) then
|
||||
local id, name, description, icon, _background, role = GetSpecializationInfo (spec)
|
||||
if (_background) then
|
||||
background:SetTexture ("Interface\\TALENTFRAME\\".._background)
|
||||
end
|
||||
end
|
||||
end
|
||||
TimeAttack:ScheduleTimer ("TimeAttackStartupBackground", 5)
|
||||
|
||||
background:SetTexCoord (0, 1, 0, 0.705078125)
|
||||
background:SetPoint ("topleft", TimeAttackFrame, "topleft", 2, 0)
|
||||
background:SetPoint ("bottomright", TimeAttackFrame, "bottomright", -2, 0)
|
||||
background:SetVertexColor (.3, .3, .3, 1)
|
||||
background:SetDrawLayer ("background", 1)
|
||||
TimeAttack.BackgroundTex = background
|
||||
|
||||
--> Time attack string
|
||||
local title = DetailsFrameWork:NewLabel (TimeAttackFrame, TimeAttackFrame, nil, "title", "Time Attack", "QuestFont_Super_Huge", _, {1, 1, 1, 1})
|
||||
title:SetPoint ("topleft", TimeAttackFrame, 5, -8)
|
||||
|
||||
--> background glow bellow title string
|
||||
local texturetitle = TimeAttackFrame:CreateTexture (nil, "artwork")
|
||||
texturetitle:SetTexture ("Interface\\ACHIEVEMENTFRAME\\UI-Achievement-Borders")
|
||||
texturetitle:SetTexCoord (0.287109375, 1, 0.26, 0.5)
|
||||
texturetitle:SetVertexColor (1, 1, 1, .5)
|
||||
texturetitle:SetPoint ("topleft", TimeAttackFrame)
|
||||
texturetitle:SetWidth (300)
|
||||
texturetitle:SetHeight (128)
|
||||
|
||||
--> a dark blue image on bottom of window
|
||||
local texturedown = TimeAttackFrame:CreateTexture (nil, "artwork")
|
||||
texturedown:SetTexture ("Interface\\PetBattles\\Weather-Darkness")
|
||||
texturedown:SetTexCoord (.15, .85, 1, 0)
|
||||
texturedown:SetVertexColor (1, 1, 1, .25)
|
||||
texturedown:SetPoint ("bottomright", TimeAttackFrame)
|
||||
texturedown:SetWidth (300)
|
||||
|
||||
--> text informing about the amount of time
|
||||
local TimeDesc = DetailsFrameWork:NewLabel (TimeAttackFrame, TimeAttackFrame, nil, "TimeDesc", Loc ["STRING_TIME_SELECTION"])
|
||||
TimeDesc:SetPoint ("topleft", TimeAttackFrame, 15, -260)
|
||||
--> slider
|
||||
local TimeAmount = DetailsFrameWork:NewSlider (TimeAttackFrame, nil, "DetailsTimeAttackTimeSelect", "TimeSelect", 270, 20, 30, 330, 10, TimeAttack.data.time)
|
||||
--local TimeAmount = DetailsFrameWork:NewSlider2 (TimeAttackFrame, "DetailsTimeAttackTimeSelect", "TimeSelect", 270, 20, 30, 330, 10, TimeAttack.data.time)
|
||||
TimeAmount:SetPoint ("topleft", TimeAttackFrame, 15, -270)
|
||||
TimeAmount.OnChangeHook = function() TimeAttack.data.time = TimeAmount.value end
|
||||
|
||||
--> main time/damage/dps texts
|
||||
local clock = DetailsFrameWork:NewLabel (TimeAttackFrame, TimeAttackFrame, nil, "TIMER", "00:00:00", "GameFontHighlightLarge")
|
||||
clock:SetPoint ("center", TimeAttackFrame, 0, -20)
|
||||
local damage = DetailsFrameWork:NewLabel (TimeAttackFrame, TimeAttackFrame, nil, "DAMAGE", "00.000.000", "GameFontHighlightLarge")
|
||||
damage:SetPoint ("center", TimeAttackFrame, 0, -40)
|
||||
local persecond = DetailsFrameWork:NewLabel (TimeAttackFrame, TimeAttackFrame, nil, "DPS", "000.000", "GameFontHighlightLarge")
|
||||
persecond:SetPoint ("center", TimeAttackFrame, 0, -60)
|
||||
|
||||
--> two yellow rows
|
||||
local barraUP = TimeAttackFrame:CreateTexture (nil, "overlay")
|
||||
barraUP:SetTexture ("Interface\\TALENTFRAME\\talent-main")
|
||||
barraUP:SetWidth (300)
|
||||
barraUP:SetHeight (3)
|
||||
barraUP:SetPoint ("topleft", TimeAttackFrame, 0, -49)
|
||||
barraUP:SetTexCoord (0, 0.7890625, 0.248046875, 0.264625)
|
||||
|
||||
local barraDOWN = TimeAttackFrame:CreateTexture (nil, "overlay")
|
||||
barraDOWN:SetTexture ("Interface\\TALENTFRAME\\talent-main")
|
||||
barraDOWN:SetWidth (300)
|
||||
barraDOWN:SetHeight (3)
|
||||
barraDOWN:SetPoint ("topleft", TimeAttackFrame, 0, -148)
|
||||
barraDOWN:SetTexCoord (0, 0.7890625, 0.248046875, 0.264625)
|
||||
|
||||
--> background between the two yellow rows
|
||||
local bg1 = DetailsFrameWork:NewPanel (TimeAttackFrame, _, "DetailsTimeAttackHistoryBackground", _, 295, 100)
|
||||
bg1:SetBackdrop ({tile = true, tileSize = 16, bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"})
|
||||
bg1:SetBackdropColor ({.95, .95, .95, .6})
|
||||
bg1:SetPoint ("center", TimeAttackFrame, 0, 50)
|
||||
--> default panel options come with enabled gradiens, we want to disable this
|
||||
bg1:DisableGradient()
|
||||
|
||||
--> this is the main table wich will hold the times and labels also is a class
|
||||
local HistoryPanelObject = {
|
||||
NowShowing = 1, --> 1 for recently 2 for saved
|
||||
LabelsCreated = {},
|
||||
Recently = {},
|
||||
Hystory = TimeAttack.data.history
|
||||
}
|
||||
HistoryPanelObject.__index = HistoryPanelObject
|
||||
|
||||
--> build the button to switch between recent times and saved times
|
||||
local displayTipes = {Loc ["STRING_RECENTLY"], Loc ["STRING_SAVED"]}
|
||||
local switchButton
|
||||
function changedisplay()
|
||||
HistoryPanelObject.NowShowing = math.abs (HistoryPanelObject.NowShowing-3)
|
||||
HistoryPanelObject:Refresh()
|
||||
switchButton.text = displayTipes [HistoryPanelObject.NowShowing]
|
||||
end
|
||||
|
||||
switchButton = DetailsFrameWork:NewButton (TimeAttackFrame, nil, "DetailsTimeAttackSwitchButton", "switchButton", 70, 15, changedisplay)
|
||||
switchButton:InstallCustomTexture()
|
||||
switchButton:SetPoint (227, -35)
|
||||
switchButton.text = displayTipes [HistoryPanelObject.NowShowing]
|
||||
|
||||
local leftSwitchTexture = switchButton:CreateTexture (nil, "overlay")
|
||||
leftSwitchTexture:SetTexture ("Interface\\TALENTFRAME\\talent-main")
|
||||
leftSwitchTexture:SetTexCoord (0.13671875, 0.25, 0.486328125, 0.576171875)
|
||||
leftSwitchTexture:SetPoint ("left", switchButton.button, 0, 0)
|
||||
leftSwitchTexture:SetWidth (10)
|
||||
leftSwitchTexture:SetHeight (17)
|
||||
|
||||
local rightSwitchTexture = switchButton:CreateTexture (nil, "overlay")
|
||||
rightSwitchTexture:SetTexture ("Interface\\TALENTFRAME\\talent-main")
|
||||
rightSwitchTexture:SetTexCoord (0.01953125, 0.13671875, 0.486328125, 0.576171875)
|
||||
rightSwitchTexture:SetPoint ("right", switchButton.button, 0, 0)
|
||||
rightSwitchTexture:SetWidth (10)
|
||||
rightSwitchTexture:SetHeight (17)
|
||||
|
||||
--> remove a saved or recently time
|
||||
local remove = function (index)
|
||||
if (HistoryPanelObject.NowShowing == 1) then --> recently
|
||||
table.remove (HistoryPanelObject.Recently, index)
|
||||
else --> history
|
||||
table.remove (TimeAttack.data.history, index)
|
||||
end
|
||||
HistoryPanelObject:Refresh()
|
||||
end
|
||||
|
||||
--> save a recently time
|
||||
local save = function (RecentlyIndex)
|
||||
if (RecentlyIndex) then --> click on any label
|
||||
local ToSaveTimeObject = HistoryPanelObject.Recently [RecentlyIndex]
|
||||
if (ToSaveTimeObject and not ToSaveTimeObject.FinishSaved) then
|
||||
local NewSave = {}
|
||||
NewSave.DamageDone = ToSaveTimeObject.FinishDamage
|
||||
NewSave.Dps = ToSaveTimeObject.FinishDps
|
||||
NewSave.Time = ToSaveTimeObject.FinishTime
|
||||
NewSave.ItemLevel = ToSaveTimeObject.FinishIlevel
|
||||
NewSave.Date = ToSaveTimeObject.Date
|
||||
NewSave.note = ToSaveTimeObject.note
|
||||
|
||||
table.insert (TimeAttack.data.history, 1, NewSave)
|
||||
table.remove (TimeAttack.data.history, 25)
|
||||
HistoryPanelObject:AddHistory (NewSave)
|
||||
ToSaveTimeObject.FinishSaved = true
|
||||
HistoryPanelObject:Refresh()
|
||||
|
||||
if (TimeAttack.Time == ToSaveTimeObject) then
|
||||
TimeAttackFrame ["SaveButton"]:Disable()
|
||||
end
|
||||
end
|
||||
|
||||
elseif (TimeAttack.Time and TimeAttack.Time.FinishOkey and not TimeAttack.Time.FinishSaved) then --> click on SAVE button
|
||||
local NewSave = {}
|
||||
NewSave.DamageDone = TimeAttack.Time.FinishDamage
|
||||
NewSave.Dps = TimeAttack.Time.FinishDps
|
||||
NewSave.Time = TimeAttack.Time.FinishTime
|
||||
NewSave.ItemLevel = TimeAttack.Time.FinishIlevel
|
||||
NewSave.Date = TimeAttack.Time.Date
|
||||
TimeAttack.Time.FinishSaved = true
|
||||
table.insert (TimeAttack.data.history, 1, NewSave)
|
||||
table.remove (TimeAttack.data.history, 25)
|
||||
HistoryPanelObject:AddHistory (NewSave)
|
||||
HistoryPanelObject:Refresh()
|
||||
TimeAttackFrame ["SaveButton"]:Disable()
|
||||
end
|
||||
end
|
||||
|
||||
--> save button
|
||||
|
||||
local SaveButton = DetailsFrameWork:NewButton (TimeAttackFrame, nil, "DetailsTimeAttackSaveButton", "SaveButton", 70, 20, save)
|
||||
SaveButton:InstallCustomTexture()
|
||||
SaveButton.text = Loc ["STRING_SAVE"]
|
||||
SaveButton:SetPoint ("center", 0, -90)
|
||||
SaveButton:Disable()
|
||||
|
||||
function HistoryPanelObject:AddRecently (data)
|
||||
table.insert (self.Recently, 1, data)
|
||||
table.remove (self.Recently, 24)
|
||||
if (self.NowShowing == 1) then
|
||||
HistoryPanelObject:Refresh()
|
||||
end
|
||||
end
|
||||
|
||||
function HistoryPanelObject:AddHistory (data)
|
||||
if (self.NowShowing == 2) then
|
||||
HistoryPanelObject:Refresh()
|
||||
end
|
||||
end
|
||||
|
||||
--> report button
|
||||
local reportFunc = function (IsCurrent, IsReverse, AmtLines) --> localize-me
|
||||
local lines = { Loc ["STRING_REPORT"]..":",
|
||||
TimeAttack:comma_value (TimeAttack.Time.FinishDamage) .. " " .. Loc ["STRING_DAMAGEOVER"] .. " " .. TimeAttack.Time.FinishTime .. " " .. Loc ["STRING_SECONDS"] .. ".",
|
||||
Loc ["STRING_AVERAGEDPS"] .. " " .. TimeAttack:comma_value (_math_floor (TimeAttack.Time.FinishDps)) .. " " .. Loc ["STRING_WITH"] .. " " .. _cstr ("%.1f", TimeAttack.Time.FinishIlevel) .. " " .. Loc ["STRING_ITEMLEVEL"] .. "."}
|
||||
TimeAttack:SendReportLines (lines)
|
||||
end
|
||||
|
||||
--[1] fucntion wich will build report lines after click on 'Send Button' [2] enable current button [3] enable reverse button
|
||||
local ReportButton = DetailsFrameWork:NewButton (TimeAttackFrame, nil, "DetailsTimeAttackReportButton", "ReportButton", 20, 20, function() TimeAttack:SendReportWindow (reportFunc) end)
|
||||
ReportButton.texture = "Interface\\COMMON\\VOICECHAT-ON"
|
||||
ReportButton:SetPoint ("left", DetailsTimeAttackSaveButton, "right", -10, 0)
|
||||
ReportButton:Hide()
|
||||
|
||||
--------------> general functions: ----------------
|
||||
|
||||
function HistoryPanelObject:RefreshLabel (AttemptTable, AlreadySaved, First)
|
||||
|
||||
self.table = AttemptTable
|
||||
if (AlreadySaved) then --> showing historic
|
||||
self.remove:SetPoint ("left", self.background.frame, "left")
|
||||
self.note:SetPoint ("left", self.remove.button, "right")
|
||||
if (AttemptTable.note) then
|
||||
self.note:SetNormalTexture ("Interface\\Buttons\\UI-GuildButton-PublicNote-Up")
|
||||
self.note.tooltip = AttemptTable.note
|
||||
else
|
||||
self.note:SetNormalTexture ("Interface\\Buttons\\UI-GuildButton-PublicNote-Disabled")
|
||||
self.note.tooltip = Loc ["STRING_SETNOTE"]
|
||||
end
|
||||
self.save:Hide()
|
||||
local diamesano = string.gsub (AttemptTable.Date, "(.-)%s", "")
|
||||
self.text:SetText (diamesano)
|
||||
|
||||
elseif (not AttemptTable.FinishSaved) then --> não foi salvo ainda
|
||||
self.remove:Show()
|
||||
self.save:Show()
|
||||
self.note:SetPoint ("left", self.save.button, "right")
|
||||
if (AttemptTable.note) then
|
||||
self.note:SetNormalTexture ("Interface\\Buttons\\UI-GuildButton-PublicNote-Up")
|
||||
self.note.tooltip = AttemptTable.note
|
||||
else
|
||||
self.note:SetNormalTexture ("Interface\\Buttons\\UI-GuildButton-PublicNote-Disabled")
|
||||
self.note.tooltip = Loc ["STRING_SETNOTE"]
|
||||
end
|
||||
if (First) then
|
||||
self.text:SetText ("-".. TimeAttack:ToK (First-AttemptTable.FinishDamage).." (#"..AttemptTable.N..")")
|
||||
else
|
||||
self.text:SetText (TimeAttack:ToK (AttemptTable.FinishDamage).." (#"..AttemptTable.N..")")
|
||||
end
|
||||
else --> ta mostrando recentes e ja foi salvo
|
||||
self.remove:Show()
|
||||
self.note:SetPoint ("left", self.remove.button, "right")
|
||||
if (AttemptTable.note) then
|
||||
self.note:SetNormalTexture ("Interface\\Buttons\\UI-GuildButton-PublicNote-Up")
|
||||
self.note.tooltip = AttemptTable.note
|
||||
else
|
||||
self.note:SetNormalTexture ("Interface\\Buttons\\UI-GuildButton-PublicNote-Disabled")
|
||||
self.note.tooltip = Loc ["STRING_SETNOTE"]
|
||||
end
|
||||
self.save:Hide()
|
||||
if (First) then
|
||||
self.text:SetText ("-".. TimeAttack:ToK (First-AttemptTable.FinishDamage).." (#"..AttemptTable.N..")")
|
||||
else
|
||||
self.text:SetText (TimeAttack:ToK (AttemptTable.FinishDamage).." (#"..AttemptTable.N..")")
|
||||
end
|
||||
end
|
||||
self.background:Show()
|
||||
end
|
||||
|
||||
local OnEnterHook = function (self, arg2, arg3)
|
||||
|
||||
self = self.BoxObject
|
||||
|
||||
if (HistoryPanelObject.NowShowing == 1) then --> recently
|
||||
|
||||
GameCooltip:Reset()
|
||||
|
||||
local TimeObject = HistoryPanelObject.Recently [self.index]
|
||||
|
||||
GameCooltip:AddLine (TimeAttack:comma_value (TimeObject.FinishDamage))
|
||||
GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\PetBadge-Undead")
|
||||
|
||||
GameCooltip:AddLine (TimeAttack:comma_value (math.floor (TimeObject.FinishDps)))
|
||||
GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\PetBadge-Elemental")
|
||||
|
||||
GameCooltip:AddLine (TimeObject.FinishTime.." " .. Loc ["STRING_SECONDS"])
|
||||
GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\PetBadge-Mechanical")
|
||||
|
||||
GameCooltip:AddLine (string.format ("%.1f", TimeObject.FinishIlevel))
|
||||
GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\PetBadge-Humanoid")
|
||||
|
||||
GameCooltip:SetOption ("TextHeightMod", -4)
|
||||
GameCooltip:ShowCooltip (self.background, "tooltip")
|
||||
|
||||
else --> history
|
||||
|
||||
GameCooltip:Reset()
|
||||
|
||||
local TimeObject = TimeAttack.data.history [self.index]
|
||||
|
||||
GameCooltip:AddLine (TimeAttack:comma_value (TimeObject.DamageDone))
|
||||
GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\PetBadge-Undead")
|
||||
|
||||
GameCooltip:AddLine (TimeAttack:comma_value (math.floor (TimeObject.Dps)))
|
||||
GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\PetBadge-Elemental")
|
||||
|
||||
GameCooltip:AddLine (TimeObject.Time.." " .. Loc ["STRING_SECONDS"])
|
||||
GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\PetBadge-Mechanical")
|
||||
|
||||
GameCooltip:AddLine (string.format ("%.1f", TimeObject.ItemLevel))
|
||||
GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\PetBadge-Humanoid")
|
||||
|
||||
GameCooltip:SetOption ("TextHeightMod", -4)
|
||||
GameCooltip:ShowCooltip (self.background, "tooltip")
|
||||
end
|
||||
end
|
||||
|
||||
local OnLeaveHook= function (self)
|
||||
GameCooltip:ShowMe (false)
|
||||
end
|
||||
|
||||
TimeAttack.HistoryX = 4
|
||||
TimeAttack.HistoryY = -52
|
||||
|
||||
local WriteNoteStop = function()
|
||||
|
||||
local editbox = TimeAttackFrame ["NoteEntry"]
|
||||
|
||||
local texto = editbox:GetText()
|
||||
if (string.len (texto) > 0) then
|
||||
if (HistoryPanelObject.NowShowing == 1) then --> recently
|
||||
HistoryPanelObject.Recently [editbox.editing].note = texto
|
||||
else
|
||||
TimeAttack.data.history [editbox.editing].note = texto
|
||||
end
|
||||
end
|
||||
editbox:SetText ("")
|
||||
editbox.editing = nil
|
||||
editbox:Hide()
|
||||
switchButton:Enable()
|
||||
|
||||
if (TimeAttack.Time and TimeAttack.Time.FinishOkey and not TimeAttack.Time.FinishSaved) then
|
||||
SaveButton:Enable()
|
||||
ReportButton:Show()
|
||||
end
|
||||
|
||||
HistoryPanelObject:Refresh()
|
||||
end
|
||||
|
||||
--local NoteInsertField = DetailsFrameWork:NewTextBox (TimeAttackFrame, TimeAttackFrame, "NoteEntry", WriteNoteStop, _, _, 296, 15)
|
||||
local NoteInsertField = DetailsFrameWork:NewTextEntry (TimeAttackFrame, nil, "DetailsTimeAttackNoteEntry", "NoteEntry", 296, 15, WriteNoteStop)
|
||||
NoteInsertField:SetBackdropColor (0, 0, 0, 1)
|
||||
NoteInsertField:SetPoint ("bottom", barraDOWN, "top", 0, 0)
|
||||
NoteInsertField:SetFrameLevel (TimeAttackFrame:GetFrameLevel()+3)
|
||||
NoteInsertField:Hide()
|
||||
|
||||
NoteInsertField.OnEscapePressedHook = function()
|
||||
NoteInsertField.editing = nil
|
||||
NoteInsertField:SetText ("")
|
||||
switchButton:Enable()
|
||||
NoteInsertField:Hide()
|
||||
|
||||
if (TimeAttack.Time and TimeAttack.Time.FinishOkey and not TimeAttack.Time.FinishSaved) then
|
||||
SaveButton:Enable()
|
||||
ReportButton:Show()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local WriteNoteStart = function (index)
|
||||
|
||||
if (HistoryPanelObject.NowShowing == 1 and HistoryPanelObject.Recently [index].note) then --> recently
|
||||
NoteInsertField:SetText (HistoryPanelObject.Recently [index].note)
|
||||
elseif (HistoryPanelObject.NowShowing == 2 and TimeAttack.data.history [index].note) then
|
||||
NoteInsertField:SetText (TimeAttack.data.history [index].note)
|
||||
else
|
||||
NoteInsertField:SetText ("")
|
||||
end
|
||||
|
||||
NoteInsertField.editing = index
|
||||
NoteInsertField:Show()
|
||||
NoteInsertField:SetFocus()
|
||||
switchButton:Disable()
|
||||
SaveButton:Disable()
|
||||
ReportButton:Hide()
|
||||
end
|
||||
|
||||
function HistoryPanelObject:CreateNewLabel (index)
|
||||
|
||||
local LabelBoxObject = {}
|
||||
self.LabelsCreated [#self.LabelsCreated+1] = LabelBoxObject
|
||||
setmetatable (LabelBoxObject, HistoryPanelObject)
|
||||
LabelBoxObject.index = index
|
||||
|
||||
local LabelBackground = DetailsFrameWork:NewPanel (bg1.frame, bg1.frame, "DetailsTimeAttackPanel"..index, "label"..index, 95, 12,
|
||||
{tile = true, tileSize = 16, bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"}, {.5, .5, .5, 1})
|
||||
|
||||
LabelBackground:SetPoint ("topleft", TimeAttackFrame, TimeAttack.HistoryX, TimeAttack.HistoryY)
|
||||
LabelBackground.frame.Gradient.OnEnter = {.9, .9, .9, 1}
|
||||
LabelBackground.frame:SetFrameLevel (bg1.frame:GetFrameLevel()+1)
|
||||
|
||||
LabelBackground:SetHook ("OnEnter", OnEnterHook)
|
||||
LabelBackground:SetHook ("OnLeave", OnLeaveHook)
|
||||
|
||||
LabelBackground.frame.BoxObject = LabelBoxObject
|
||||
|
||||
TimeAttack.HistoryY = TimeAttack.HistoryY - 12
|
||||
if (TimeAttack.HistoryY <= -148) then
|
||||
TimeAttack.HistoryY = -52
|
||||
TimeAttack.HistoryX = TimeAttack.HistoryX + 99
|
||||
end
|
||||
|
||||
local LabelText = DetailsFrameWork:NewLabel (LabelBackground.frame, LabelBackground.frame, nil, "text", "000.000", "GameFontHighlightSmall")
|
||||
LabelText:SetPoint ("right", LabelBackground.frame, 0, 0)
|
||||
LabelText:SetJustifyH ("right")
|
||||
|
||||
--local LabelRemoveButton = DetailsFrameWork:NewDetailsButton (LabelBackground.frame, LabelBackground.frame, _, remove, index, index, 10, 10, "Interface\\PetBattles\\DeadPetIcon")
|
||||
local LabelRemoveButton = DetailsFrameWork:NewButton (LabelBackground.frame, nil, "DetailsTimeAttackRemoveButton"..index, "RemoveButton"..index, 10, 10, remove, index, index, "Interface\\PetBattles\\DeadPetIcon")
|
||||
LabelRemoveButton:SetPoint ("left", LabelBackground.frame)
|
||||
LabelRemoveButton.tooltip = Loc ["STRING_REMOVERECORD"]
|
||||
|
||||
--local LabelSaveButton = DetailsFrameWork:NewDetailsButton (LabelBackground.frame, LabelBackground.frame, _, save, index, index, 10, 10, "Interface\\Scenarios\\ScenarioIcon-Check")
|
||||
local LabelSaveButton = DetailsFrameWork:NewButton (LabelBackground.frame, nil, "DetailsTimeAttackSaveButton"..index, "SaveButton"..index, 10, 10, save, index, index, "Interface\\Scenarios\\ScenarioIcon-Check")
|
||||
LabelSaveButton:SetPoint ("left", LabelRemoveButton.button, "right", 0, 0)
|
||||
LabelSaveButton.tooltip = Loc ["STRING_SAVERECORD"]
|
||||
|
||||
--local LabelSetnoteButton = DetailsFrameWork:NewDetailsButton (LabelBackground.frame, LabelBackground.frame, _, WriteNoteStart, index, index, 10, 10, "Interface\\Buttons\\UI-GuildButton-PublicNote-Disabled")
|
||||
local LabelSetnoteButton = DetailsFrameWork:NewButton (LabelBackground.frame, nil, "DetailsTimeAttackSetNoteButton"..index, "SetNoteButton"..index, 10, 10, WriteNoteStart, index, index, "Interface\\Buttons\\UI-GuildButton-PublicNote-Disabled")
|
||||
LabelSetnoteButton:SetPoint ("left", LabelSaveButton.button, "right", 0, 0)
|
||||
LabelSetnoteButton.tooltip = Loc ["STRING_SETNOTE"]
|
||||
|
||||
LabelBoxObject.text = LabelText
|
||||
LabelBoxObject.background = LabelBackground
|
||||
LabelBoxObject.remove = LabelRemoveButton
|
||||
LabelBoxObject.save = LabelSaveButton
|
||||
LabelBoxObject.note = LabelSetnoteButton
|
||||
LabelBoxObject.HaveNote = false
|
||||
|
||||
return LabelBoxObject
|
||||
end
|
||||
|
||||
function HistoryPanelObject:Refresh()
|
||||
if (self.NowShowing == 1) then --> recent
|
||||
|
||||
--> sort by damage done
|
||||
table.sort (self.Recently, function (a,b) return a.FinishDamage > b.FinishDamage end)
|
||||
local first = self.Recently [1]
|
||||
if (first) then
|
||||
first = first.FinishDamage
|
||||
end
|
||||
for index, AttemptTable in ipairs (self.Recently) do
|
||||
|
||||
local thisLabel = self.LabelsCreated [index]
|
||||
if (not thisLabel) then
|
||||
thisLabel = self:CreateNewLabel (index)
|
||||
end
|
||||
if (index == 1) then
|
||||
thisLabel:RefreshLabel (AttemptTable, false)
|
||||
else
|
||||
thisLabel:RefreshLabel (AttemptTable, false, first)
|
||||
end
|
||||
end
|
||||
|
||||
for amt = #self.Recently+1, #self.LabelsCreated do
|
||||
local thisLabel = self.LabelsCreated [amt]
|
||||
thisLabel.background:Hide()
|
||||
end
|
||||
|
||||
elseif (self.NowShowing == 2) then
|
||||
for index, AttemptTable in ipairs (TimeAttack.data.history) do
|
||||
local thisLabel = self.LabelsCreated [index]
|
||||
if (not thisLabel) then
|
||||
thisLabel = self:CreateNewLabel (index)
|
||||
end
|
||||
thisLabel:RefreshLabel (AttemptTable, true)
|
||||
end
|
||||
|
||||
for amt = #TimeAttack.data.history+1, #self.LabelsCreated do
|
||||
local thisLabel = self.LabelsCreated [amt]
|
||||
thisLabel.background:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
HistoryPanelObject:Refresh()
|
||||
|
||||
local update = 0
|
||||
local player --> short cut for Player Actor Object
|
||||
|
||||
--> Cancel function
|
||||
function TimeAttack:Cancel()
|
||||
if (TimeAttack.Time and TimeAttack.Time.Working) then
|
||||
TimeAttack.Time.Working = false
|
||||
TimeAttack.Time.Done = true
|
||||
end
|
||||
TimeAttack.Frame:SetScript ("OnUpdate", nil)
|
||||
end
|
||||
|
||||
--> Exec function
|
||||
local DoTimeAttack = function (self, elapsed)
|
||||
|
||||
TimeAttack.Time.Elapsed = TimeAttack.Time.Elapsed + elapsed
|
||||
update = update + elapsed
|
||||
if (_GetTime() > TimeAttack.Time.EndTime) then --> reached the end time
|
||||
if (TimeAttack.Time.Working and not TimeAttack.Time.Done) then
|
||||
TimeAttack:Cancel()
|
||||
TimeAttack:Finish()
|
||||
end
|
||||
else
|
||||
--> aqui vem as funções que verificam se o jogador esta em grupo ou se tem algum buff proibido
|
||||
TimeAttack.Time.Tick = TimeAttack.Time.Tick + elapsed
|
||||
if (TimeAttack.Time.Tick > 1) then
|
||||
TimeAttack.Time.Tick = 0
|
||||
if (not _UFC ("player")) then --> isn't in combat
|
||||
TimeAttack:Cancel()
|
||||
end
|
||||
else
|
||||
if (update > 0.050) then
|
||||
--> Update Timer Here
|
||||
|
||||
local minutos, segundos = _math_floor (TimeAttack.Time.Elapsed/60), _math_floor (TimeAttack.Time.Elapsed%60)
|
||||
|
||||
if (segundos < 10) then
|
||||
segundos = "0"..segundos
|
||||
end
|
||||
|
||||
local mili = _cstr ("%.2f", TimeAttack.Time.Elapsed-_math_floor (TimeAttack.Time.Elapsed))*100
|
||||
if (mili < 10) then
|
||||
mili = "0"..mili
|
||||
end
|
||||
|
||||
clock:SetText ("0".. minutos .. ":"..segundos ..":"..mili)
|
||||
damage:SetText (TimeAttack:comma_value (player.total))
|
||||
|
||||
if (TimeAttack.Time.Elapsed > 3) then
|
||||
persecond:SetText (TimeAttack:comma_value (_math_floor (player.total/TimeAttack.Time.Elapsed)))
|
||||
end
|
||||
|
||||
update = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
--> When the time is gone
|
||||
function TimeAttack:Finish()
|
||||
TimeAttack.Time.FinishOkey = true
|
||||
TimeAttack.Time.FinishSaved = false
|
||||
TimeAttack.Time.FinishDamage = player.total
|
||||
TimeAttack.Time.FinishDps = player.total/TimeAttack.Time.Elapsed
|
||||
local _, equipped = GetAverageItemLevel()
|
||||
TimeAttack.Time.FinishIlevel = equipped
|
||||
TimeAttack.Time.Date = date ("%H:%M %d/%m/%y")
|
||||
TimeAttack.Time.N = TimeAttack.try
|
||||
HistoryPanelObject:AddRecently (TimeAttack.Time)
|
||||
TimeAttack.try = TimeAttack.try + 1
|
||||
SaveButton:Enable()
|
||||
ReportButton:Show()
|
||||
end
|
||||
|
||||
function _detalhes:TimeAttackPluginStart()
|
||||
TimeAttack:Start()
|
||||
end
|
||||
|
||||
--> When a new combat is received by the PlugIn
|
||||
function TimeAttack:Start()
|
||||
|
||||
if (TimeAttack.Time and TimeAttack.Time.Working) then
|
||||
return
|
||||
end
|
||||
|
||||
TimeAttack.Time = {}
|
||||
TimeAttack.Time.StartTime = _GetTime()
|
||||
TimeAttack.Time.EndTime = TimeAttack.Time.StartTime + TimeAmount.value - 2
|
||||
TimeAttack.Time.Elapsed = 2
|
||||
TimeAttack.Time.Done = nil
|
||||
TimeAttack.Time.Working = true
|
||||
TimeAttack.Time.Tick = 0
|
||||
|
||||
TimeAttack.Time.FinishOkey = false
|
||||
TimeAttack.Time.FinishSaved = false
|
||||
TimeAttack.Time.FinishDamage = nil
|
||||
TimeAttack.Time.FinishTime = TimeAmount.value
|
||||
TimeAttack.Time.FinishDps = nil
|
||||
TimeAttack.Time.FinishIlevel = nil
|
||||
TimeAttack.Time.Date = nil
|
||||
|
||||
SaveButton:Disable()
|
||||
ReportButton:Hide()
|
||||
|
||||
player = TimeAttack:GetActor ("current", 1, UnitName ("player")) --> param 1 = combat | param 2 = attribute | param 3 = player name | all none = current, damage, player
|
||||
|
||||
if (not player) then
|
||||
print (Loc ["STRING_COMBATFAIL"])
|
||||
return
|
||||
end
|
||||
|
||||
update = 0
|
||||
TimeAttack.Frame:SetScript ("OnUpdate", DoTimeAttack)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function TimeAttack:OnEvent (_, event, ...)
|
||||
|
||||
if (event == "ADDON_LOADED") then
|
||||
local AddonName = select (1, ...)
|
||||
if (AddonName == "Details_TimeAttack") then
|
||||
|
||||
if (_G._detalhes) then
|
||||
|
||||
--> create widgets
|
||||
CreatePluginFrames (_detalhes_databaseTimeAttack)
|
||||
|
||||
local MINIMAL_DETAILS_VERSION_REQUIRED = 1
|
||||
|
||||
--> Install
|
||||
local install = _G._detalhes:InstallPlugin ("SOLO", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\SPELL_HOLY_BORROWEDTIME", TimeAttack, "DETAILS_PLUGIN_TIME_ATTACK", MINIMAL_DETAILS_VERSION_REQUIRED)
|
||||
if (type (install) == "table" and install.error) then
|
||||
print (install.errortext)
|
||||
return
|
||||
end
|
||||
|
||||
--> Register needed events
|
||||
_G._detalhes:RegisterEvent (TimeAttack, "COMBAT_PLAYER_ENTER")
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
elseif (event == "PLAYER_LOGOUT") then
|
||||
_detalhes_databaseTimeAttack = TimeAttack.data
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
## Interface: 50300
|
||||
## Title: Details TimeAttack (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## SavedVariablesPerCharacter: _detalhes_databaseTimeAttack
|
||||
## RequiredDeps: Details
|
||||
## OptionalDeps: Ace3
|
||||
|
||||
#@no-lib-strip@
|
||||
embeds.xml
|
||||
#@end-no-lib-strip@
|
||||
|
||||
enUS.lua
|
||||
ptBR.lua
|
||||
|
||||
Details_TimeAttack.lua
|
||||
@@ -0,0 +1,137 @@
|
||||
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
|
||||
-- @class file
|
||||
-- @name AceLocale-3.0
|
||||
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
|
||||
local MAJOR,MINOR = "AceLocale-3.0", 6
|
||||
|
||||
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not AceLocale then return end -- no upgrade needed
|
||||
|
||||
-- Lua APIs
|
||||
local assert, tostring, error = assert, tostring, error
|
||||
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GAME_LOCALE, geterrorhandler
|
||||
|
||||
local gameLocale = GetLocale()
|
||||
if gameLocale == "enGB" then
|
||||
gameLocale = "enUS"
|
||||
end
|
||||
|
||||
AceLocale.apps = AceLocale.apps or {} -- array of ["AppName"]=localetableref
|
||||
AceLocale.appnames = AceLocale.appnames or {} -- array of [localetableref]="AppName"
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale
|
||||
local readmeta = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: fire off a nonbreaking error and return key
|
||||
rawset(self, key, key) -- only need to see the warning once, really
|
||||
geterrorhandler()(MAJOR..": "..tostring(AceLocale.appnames[self])..": Missing entry for '"..tostring(key).."'")
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale if the silent flag is true, it does not issue a warning on unknown keys
|
||||
local readmetasilent = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: return key
|
||||
rawset(self, key, key) -- only need to invoke this function once
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- Remember the locale table being registered right now (it gets set by :NewLocale())
|
||||
-- NOTE: Do never try to register 2 locale tables at once and mix their definition.
|
||||
local registering
|
||||
|
||||
-- local assert false function
|
||||
local assertfalse = function() assert(false) end
|
||||
|
||||
-- This metatable proxy is used when registering nondefault locales
|
||||
local writeproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
rawset(registering, key, value == true and key or value) -- assigning values: replace 'true' with key string
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
-- This metatable proxy is used when registering the default locale.
|
||||
-- It refuses to overwrite existing values
|
||||
-- Reason 1: Allows loading locales in any order
|
||||
-- Reason 2: If 2 modules have the same string, but only the first one to be
|
||||
-- loaded has a translation for the current locale, the translation
|
||||
-- doesn't get overwritten.
|
||||
--
|
||||
local writedefaultproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
if not rawget(registering, key) then
|
||||
rawset(registering, key, value == true and key or value)
|
||||
end
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
--- Register a new locale (or extend an existing one) for the specified application.
|
||||
-- :NewLocale will return a table you can fill your locale into, or nil if the locale isn't needed for the players
|
||||
-- game locale.
|
||||
-- @paramsig application, locale[, isDefault[, silent]]
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param locale Name of the locale to register, e.g. "enUS", "deDE", etc.
|
||||
-- @param isDefault If this is the default locale being registered (your addon is written in this language, generally enUS)
|
||||
-- @param silent If true, the locale will not issue warnings for missing keys. Must be set on the first locale registered. If set to "raw", nils will be returned for unknown keys (no metatable used).
|
||||
-- @usage
|
||||
-- -- enUS.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "enUS", true)
|
||||
-- L["string1"] = true
|
||||
--
|
||||
-- -- deDE.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "deDE")
|
||||
-- if not L then return end
|
||||
-- L["string1"] = "Zeichenkette1"
|
||||
-- @return Locale Table to add localizations to, or nil if the current locale is not required.
|
||||
function AceLocale:NewLocale(application, locale, isDefault, silent)
|
||||
|
||||
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
|
||||
local gameLocale = GAME_LOCALE or gameLocale
|
||||
|
||||
local app = AceLocale.apps[application]
|
||||
|
||||
if silent and app and getmetatable(app) ~= readmetasilent then
|
||||
geterrorhandler()("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' must be specified for the first locale registered")
|
||||
end
|
||||
|
||||
if not app then
|
||||
if silent=="raw" then
|
||||
app = {}
|
||||
else
|
||||
app = setmetatable({}, silent and readmetasilent or readmeta)
|
||||
end
|
||||
AceLocale.apps[application] = app
|
||||
AceLocale.appnames[app] = application
|
||||
end
|
||||
|
||||
if locale ~= gameLocale and not isDefault then
|
||||
return -- nop, we don't need these translations
|
||||
end
|
||||
|
||||
registering = app -- remember globally for writeproxy and writedefaultproxy
|
||||
|
||||
if isDefault then
|
||||
return writedefaultproxy
|
||||
end
|
||||
|
||||
return writeproxy
|
||||
end
|
||||
|
||||
--- Returns localizations for the current locale (or default locale if translations are missing).
|
||||
-- Errors if nothing is registered (spank developer, not just a missing translation)
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param silent If true, the locale is optional, silently return nil if it's not found (defaults to false, optional)
|
||||
-- @return The locale table for the current language.
|
||||
function AceLocale:GetLocale(application, silent)
|
||||
if not silent and not AceLocale.apps[application] then
|
||||
error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2)
|
||||
end
|
||||
return AceLocale.apps[application]
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
<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">
|
||||
<Script file="AceLocale-3.0.lua"/>
|
||||
</Ui>
|
||||
@@ -0,0 +1,51 @@
|
||||
-- $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
|
||||
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.")
|
||||
|
||||
local oldminor = self.minors[major]
|
||||
if oldminor and oldminor >= minor then return nil end
|
||||
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
||||
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)
|
||||
end
|
||||
return self.libs[major], self.minors[major]
|
||||
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
|
||||
@@ -0,0 +1,13 @@
|
||||
## Interface: 40200
|
||||
## Title: Lib: LibStub
|
||||
## Notes: Universal Library Stub
|
||||
## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
|
||||
## X-Website: http://www.wowace.com/addons/libstub/
|
||||
## X-Category: Library
|
||||
## X-License: Public Domain
|
||||
## X-Curse-Packaged-Version: r95
|
||||
## X-Curse-Project-Name: LibStub
|
||||
## X-Curse-Project-ID: libstub
|
||||
## X-Curse-Repository-ID: wow/libstub/mainline
|
||||
|
||||
LibStub.lua
|
||||
@@ -0,0 +1,41 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local lib, oldMinor = LibStub:NewLibrary("Pants", 1) -- make a new thingy
|
||||
assert(lib) -- should return the library table
|
||||
assert(not oldMinor) -- should not return the old minor, since it didn't exist
|
||||
|
||||
-- the following is to create data and then be able to check if the same data exists after the fact
|
||||
function lib:MyMethod()
|
||||
end
|
||||
local MyMethod = lib.MyMethod
|
||||
lib.MyTable = {}
|
||||
local MyTable = lib.MyTable
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 1) -- try to register a library with the same version, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 0) -- try to register a library with a previous, should silently fail
|
||||
assert(not newLib) -- should not return since out of date
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 2) -- register a new version
|
||||
assert(newLib) -- library table
|
||||
assert(rawequal(newLib, lib)) -- should be the same reference as the previous
|
||||
assert(newOldMinor == 1) -- should return the minor version of the previous version
|
||||
|
||||
assert(rawequal(lib.MyMethod, MyMethod)) -- verify that values were saved
|
||||
assert(rawequal(lib.MyTable, MyTable)) -- verify that values were saved
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 3 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib) -- library table
|
||||
assert(newOldMinor == 2) -- previous version was 2
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 4 and please ignore 15 Blah") -- register a new version with a string minor version (instead of a number)
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 3) -- previous version was 3 (even though it gave a string)
|
||||
|
||||
local newLib, newOldMinor = LibStub:NewLibrary("Pants", 5) -- register a new library, using a normal number instead of a string
|
||||
assert(newLib)
|
||||
assert(newOldMinor == 4) -- previous version was 4 (even though it gave a string)
|
||||
@@ -0,0 +1,27 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib doesn't exist yet, by iterating through all the libraries
|
||||
assert(major ~= "MyLib")
|
||||
end
|
||||
|
||||
assert(not LibStub:GetLibrary("MyLib", true)) -- check that MyLib doesn't exist yet by direct checking
|
||||
assert(not pcall(LibStub.GetLibrary, LibStub, "MyLib")) -- don't silently fail, thus it should raise an error.
|
||||
local lib = LibStub:NewLibrary("MyLib", 1) -- create the lib
|
||||
assert(lib) -- check it exists
|
||||
assert(rawequal(LibStub:GetLibrary("MyLib"), lib)) -- verify that :GetLibrary("MyLib") properly equals the lib reference
|
||||
|
||||
assert(LibStub:NewLibrary("MyLib", 2)) -- create a new version
|
||||
|
||||
local count=0
|
||||
for major, library in LibStub:IterateLibraries() do
|
||||
-- check that MyLib exists somewhere in the libraries, by iterating through all the libraries
|
||||
if major == "MyLib" then -- we found it!
|
||||
count = count +1
|
||||
assert(rawequal(library, lib)) -- verify that the references are equal
|
||||
end
|
||||
end
|
||||
assert(count == 1) -- verify that we actually found it, and only once
|
||||
@@ -0,0 +1,14 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
local proxy = newproxy() -- non-string
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, proxy, 1)) -- should error, proxy is not a string, it's userdata
|
||||
local success, ret = pcall(LibStub.GetLibrary, proxy, true)
|
||||
assert(not success or not ret) -- either error because proxy is not a string or because it's not actually registered.
|
||||
|
||||
assert(not pcall(LibStub.NewLibrary, LibStub, "Something", "No number in here")) -- should error, minor has no string in it.
|
||||
|
||||
assert(not LibStub:GetLibrary("Something", true)) -- shouldn't've created it from the above statement
|
||||
@@ -0,0 +1,41 @@
|
||||
debugstack = debug.traceback
|
||||
strmatch = string.match
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
|
||||
-- Pretend like loaded libstub is old and doesn't have :IterateLibraries
|
||||
assert(LibStub.minor)
|
||||
LibStub.minor = LibStub.minor - 0.0001
|
||||
LibStub.IterateLibraries = nil
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(type(LibStub.IterateLibraries)=="function")
|
||||
|
||||
|
||||
-- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created
|
||||
LibStub.IterateLibraries = 123
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created
|
||||
LibStub.minor = LibStub.minor + 0.0001
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
-- Again with a huge number
|
||||
LibStub.minor = LibStub.minor + 1234567890
|
||||
|
||||
loadfile("../LibStub.lua")()
|
||||
|
||||
assert(LibStub.IterateLibraries == 123)
|
||||
|
||||
|
||||
print("OK")
|
||||
@@ -0,0 +1,7 @@
|
||||
<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">
|
||||
|
||||
<Script file="Libs\LibStub\LibStub.lua"/>
|
||||
<Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml" />
|
||||
|
||||
</Ui>
|
||||
@@ -0,0 +1,22 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("Details_TimeAttack", "enUS", true)
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
Loc ["STRING_PLUGIN_NAME"] = "Time Attack"
|
||||
Loc ["STRING_TIME_SELECTION"] = "Select the amount of time (seconds):"
|
||||
Loc ["STRING_SAVE"] = "Save"
|
||||
Loc ["STRING_SAVED"] = "Saved"
|
||||
Loc ["STRING_SAVERECORD"] = "save record"
|
||||
Loc ["STRING_REMOVERECORD"] = "remove record"
|
||||
Loc ["STRING_RECENTLY"] = "Recently"
|
||||
Loc ["STRING_SETNOTE"] = "set note"
|
||||
Loc ["STRING_SECONDS"] = "seconds"
|
||||
Loc ["STRING_COMBATFAIL"] = "Combat wasn't started by you, try leave your group or raid."
|
||||
|
||||
Loc ["STRING_REPORT"] = "Details Time Attack Report"
|
||||
Loc ["STRING_DAMAGEOVER"] = "damage over"
|
||||
Loc ["STRING_AVERAGEDPS"] = "Average DPS of"
|
||||
Loc ["STRING_WITH"] = "with"
|
||||
Loc ["STRING_ITEMLEVEL"] = "gear score"
|
||||
@@ -0,0 +1,22 @@
|
||||
local Loc = LibStub("AceLocale-3.0"):NewLocale("Details_TimeAttack", "ptBR")
|
||||
|
||||
if (not Loc) then
|
||||
return
|
||||
end
|
||||
|
||||
Loc ["STRING_PLUGIN_NAME"] = "Cronometro"
|
||||
Loc ["STRING_TIME_SELECTION"] = "Selecione o tempo desejado (em segundos):"
|
||||
Loc ["STRING_SAVE"] = "Salvar"
|
||||
Loc ["STRING_SAVED"] = "Salvo"
|
||||
Loc ["STRING_SAVERECORD"] = "salvar"
|
||||
Loc ["STRING_REMOVERECORD"] = "remover"
|
||||
Loc ["STRING_RECENTLY"] = "Recente"
|
||||
Loc ["STRING_SETNOTE"] = "escrever comentario"
|
||||
Loc ["STRING_SECONDS"] = "segundos"
|
||||
Loc ["STRING_COMBATFAIL"] = "O combate não foi iniciado por voce, tente saido do grupo ou da raide."
|
||||
|
||||
Loc ["STRING_REPORT"] = "Details Relatorio do Cronometro"
|
||||
Loc ["STRING_DAMAGEOVER"] = "de dano em"
|
||||
Loc ["STRING_AVERAGEDPS"] = "media de dano de"
|
||||
Loc ["STRING_WITH"] = "com"
|
||||
Loc ["STRING_ITEMLEVEL"] = "level dos equipamentos"
|
||||
@@ -0,0 +1,326 @@
|
||||
local AceLocale = LibStub ("AceLocale-3.0")
|
||||
local Loc = AceLocale:GetLocale ("Details_Threat")
|
||||
|
||||
local _GetNumSubgroupMembers = GetNumSubgroupMembers --> wow api
|
||||
local _GetNumGroupMembers = GetNumGroupMembers --> wow api
|
||||
local _UnitIsFriend = UnitIsFriend --> wow api
|
||||
local _UnitName = UnitName --> wow api
|
||||
local _UnitDetailedThreatSituation = UnitDetailedThreatSituation
|
||||
local _IsInRaid = IsInRaid --> wow api
|
||||
local _IsInGroup = IsInGroup --> wow api
|
||||
local _UnitGroupRolesAssigned = UnitGroupRolesAssigned --> wow api
|
||||
|
||||
local _ipairs = ipairs --> lua api
|
||||
local _table_sort = table.sort --> lua api
|
||||
local _cstr = string.format --> lua api
|
||||
local _unpack = unpack
|
||||
|
||||
--> Create the plugin Object
|
||||
local ThreatMeter = _detalhes:NewPluginObject ("Details_Threat")
|
||||
--> Main Frame
|
||||
local ThreatMeterFrame = ThreatMeter.Frame
|
||||
|
||||
local function CreatePluginFrames (data)
|
||||
|
||||
--> catch Details! main object
|
||||
local _detalhes = _G._detalhes
|
||||
local DetailsFrameWork = _detalhes.gump
|
||||
|
||||
--> data
|
||||
ThreatMeter.data = data or {}
|
||||
|
||||
--> defaults
|
||||
ThreatMeter.RowWidth = 294
|
||||
ThreatMeter.RowHeight = 14
|
||||
--> amount of row wich can be displayed
|
||||
ThreatMeter.CanShow = 0
|
||||
--> all rows already created
|
||||
ThreatMeter.Rows = {}
|
||||
--> current shown rows
|
||||
ThreatMeter.ShownRows = {}
|
||||
|
||||
--> window reference
|
||||
local instance
|
||||
local player
|
||||
|
||||
--> OnEvent Table
|
||||
function ThreatMeter:OnDetailsEvent (event)
|
||||
|
||||
if (event == "HIDE") then --> plugin hidded, disabled
|
||||
ThreatMeterFrame:SetScript ("OnUpdate", nil)
|
||||
ThreatMeter:Cancel()
|
||||
|
||||
elseif (event == "SHOW") then
|
||||
instance = _detalhes.RaidTables.instancia
|
||||
|
||||
ThreatMeter.RowWidth = instance.baseframe:GetWidth()-6
|
||||
|
||||
ThreatMeter:UpdateContainers()
|
||||
ThreatMeter:UpdateRows()
|
||||
|
||||
ThreatMeter:SizeChanged()
|
||||
|
||||
if (ThreatMeter:IsInCombat()) then
|
||||
ThreatMeter:Start()
|
||||
end
|
||||
|
||||
player = UnitName ("player")
|
||||
|
||||
elseif (event == "REFRESH") then --> requested a refresh window
|
||||
-->
|
||||
|
||||
elseif (event == "COMBAT_PLAYER_ENTER") then --> combat started
|
||||
--print ("ENTER COMBAT - nova tabela")
|
||||
ThreatMeter:Start()
|
||||
|
||||
elseif (event == "COMBAT_PLAYER_LEAVE") then --> combat ended
|
||||
ThreatMeter:End()
|
||||
|
||||
elseif (event == "DETAILS_INSTANCE_ENDRESIZE" or event == "DETAILS_INSTANCE_SIZECHANGED") then
|
||||
ThreatMeter:SizeChanged()
|
||||
|
||||
elseif (event == "DETAILS_INSTANCE_STARTSTRETCH") then
|
||||
ThreatMeterFrame:SetFrameStrata ("TOOLTIP")
|
||||
ThreatMeterFrame:SetFrameLevel (instance.baseframe:GetFrameLevel()+1)
|
||||
|
||||
elseif (event == "DETAILS_INSTANCE_ENDSTRETCH") then
|
||||
ThreatMeterFrame:SetFrameStrata ("MEDIUM")
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
ThreatMeterFrame:SetWidth (300)
|
||||
ThreatMeterFrame:SetHeight (100)
|
||||
ThreatMeterFrame:SetBackdrop ({
|
||||
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
|
||||
tile = true, tileSize = 16,
|
||||
insets = {left = 1, right = 1, top = 0, bottom = 1},})
|
||||
ThreatMeterFrame:SetBackdropColor (.3, .3, .3, .3)
|
||||
|
||||
function ThreatMeter:UpdateContainers()
|
||||
for _, row in _ipairs (ThreatMeter.Rows) do
|
||||
row:SetContainer (instance.baseframe)
|
||||
end
|
||||
end
|
||||
|
||||
function ThreatMeter:UpdateRows()
|
||||
for _, row in _ipairs (ThreatMeter.Rows) do
|
||||
row.width = ThreatMeter.RowWidth
|
||||
end
|
||||
end
|
||||
|
||||
function ThreatMeter:HideBars()
|
||||
for _, row in _ipairs (ThreatMeter.Rows) do
|
||||
row:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
local target = nil
|
||||
local timer = 0
|
||||
local interval = 1.0
|
||||
|
||||
function ThreatMeter:TargetChanged()
|
||||
local NewTarget = _UnitName ("target")
|
||||
if (NewTarget and not _UnitIsFriend ("player", "target")) then
|
||||
target = NewTarget
|
||||
end
|
||||
ThreatMeter:HideBars()
|
||||
end
|
||||
|
||||
local RoleIconCoord = {
|
||||
["TANK"] = {0, 0.28125, 0.328125, 0.625},
|
||||
["HEALER"] = {0.3125, 0.59375, 0, 0.296875},
|
||||
["DAMAGER"] = {0.3125, 0.59375, 0.328125, 0.625}
|
||||
}
|
||||
|
||||
function ThreatMeter:SizeChanged()
|
||||
|
||||
local w, h = instance:GetSize()
|
||||
ThreatMeterFrame:SetWidth (w)
|
||||
ThreatMeterFrame:SetHeight (h)
|
||||
|
||||
ThreatMeter.CanShow = math.floor ( h / (ThreatMeter.RowHeight+1))
|
||||
|
||||
for i = #ThreatMeter.Rows+1, ThreatMeter.CanShow do
|
||||
ThreatMeter:NewRow (i)
|
||||
end
|
||||
|
||||
ThreatMeter.ShownRows = {}
|
||||
|
||||
for i = 1, ThreatMeter.CanShow do
|
||||
ThreatMeter.ShownRows [#ThreatMeter.ShownRows+1] = ThreatMeter.Rows[i]
|
||||
if (_detalhes.in_combat) then
|
||||
ThreatMeter.Rows[i]:Show()
|
||||
end
|
||||
ThreatMeter.Rows[i].width = w-5
|
||||
end
|
||||
|
||||
for i = #ThreatMeter.ShownRows+1, #ThreatMeter.Rows do
|
||||
ThreatMeter.Rows [i]:Hide()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function ThreatMeter:NewRow (i)
|
||||
local newrow = DetailsFrameWork:NewBar (ThreatMeterFrame, _, "DetailsThreatRow"..i, _, 300, 14)
|
||||
newrow:SetPoint (3, -((i-1)*15))
|
||||
newrow.lefttext = "bar " .. i
|
||||
newrow.color = "skyblue"
|
||||
newrow.fontsize = 9.9
|
||||
newrow.fontface = "GameFontHighlightSmall"
|
||||
newrow:SetIcon ("Interface\\LFGFRAME\\UI-LFG-ICON-PORTRAITROLES", RoleIconCoord ["DAMAGER"])
|
||||
ThreatMeter.Rows [#ThreatMeter.Rows+1] = newrow
|
||||
newrow:Hide()
|
||||
return newrow
|
||||
end
|
||||
|
||||
local sort = function (table1, table2)
|
||||
if (table1[2] > table2[2]) then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
local Threater = function()
|
||||
|
||||
local threat_table = {}
|
||||
|
||||
if (target) then
|
||||
if (_IsInRaid()) then
|
||||
for i = 1, _GetNumGroupMembers(), 1 do
|
||||
local isTanking, status, threatpct, rawthreatpct, threatvalue = _UnitDetailedThreatSituation ("raid"..i, "target")
|
||||
if (status) then
|
||||
threat_table [#threat_table+1] = {_UnitName ("raid"..i), threatpct, isTanking}
|
||||
end
|
||||
end
|
||||
elseif (_IsInGroup()) then
|
||||
for i = 1, _GetNumGroupMembers()-1, 1 do
|
||||
local isTanking, status, threatpct, rawthreatpct, threatvalue = _UnitDetailedThreatSituation ("party"..i, "target")
|
||||
if (status) then
|
||||
threat_table [#threat_table+1] = {_UnitName ("party"..i), threatpct, isTanking}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
_table_sort (threat_table, sort)
|
||||
|
||||
local lastIndex = 0
|
||||
local shownMe = false
|
||||
|
||||
for index = 1, #ThreatMeter.ShownRows do
|
||||
local thisRow = ThreatMeter.ShownRows [index]
|
||||
local threat_actor = threat_table [index]
|
||||
|
||||
if (threat_actor) then
|
||||
local role = _UnitGroupRolesAssigned (threat_actor [1])
|
||||
thisRow.icon:SetTexCoord (_unpack (RoleIconCoord [role]))
|
||||
thisRow:SetLeftText (threat_actor [1])
|
||||
thisRow:SetRightText (_cstr ("%.1f", threat_actor [2]).."%")
|
||||
thisRow:SetValue (threat_actor [2])
|
||||
if (index == 1) then
|
||||
thisRow:SetColor (threat_actor [2]*0.01, math.abs (threat_actor [2]-100)*0.01, 0, 1)
|
||||
else
|
||||
thisRow:SetColor (threat_actor [2]*0.01, math.abs (threat_actor [2]-100)*0.01, 0, .3)
|
||||
end
|
||||
if (not thisRow.statusbar:IsShown()) then
|
||||
thisRow:Show()
|
||||
end
|
||||
if (threat_actor [1] == player) then
|
||||
shownMe = true
|
||||
end
|
||||
else
|
||||
thisRow:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
if (not shownMe) then
|
||||
--> show my self into last bar
|
||||
local isTanking, status, threatpct, rawthreatpct, threatvalue = _UnitDetailedThreatSituation ("player", "target")
|
||||
if (threatpct and threatpct > 0.1) then
|
||||
local thisRow = ThreatMeter.ShownRows [#ThreatMeter.ShownRows]
|
||||
thisRow:SetLeftText (player)
|
||||
local role = _UnitGroupRolesAssigned (player)
|
||||
thisRow.icon:SetTexCoord (_unpack (RoleIconCoord [role]))
|
||||
thisRow:SetRightText (_cstr ("%.1f", threatpct).."%")
|
||||
thisRow:SetValue (threatpct)
|
||||
thisRow:SetColor (threatpct*0.01, math.abs (threatpct-100)*0.01, 0, .3)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local OnUpdate = function (self, elapsed)
|
||||
timer = timer + elapsed
|
||||
if (timer > interval) then
|
||||
timer = 0
|
||||
--if (_IsInRaid() or _IsInGroup()) then
|
||||
--print ("aqui")
|
||||
Threater()
|
||||
--end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function ThreatMeter:Start()
|
||||
ThreatMeter:HideBars()
|
||||
if (_IsInRaid() or _IsInGroup()) then
|
||||
--print ("Iniciando analizador de Threat")
|
||||
ThreatMeterFrame:SetScript ("OnUpdate", OnUpdate)
|
||||
end
|
||||
end
|
||||
|
||||
function ThreatMeter:End()
|
||||
--print ("=== COMBAT LEAVE ===")
|
||||
ThreatMeter:HideBars()
|
||||
ThreatMeterFrame:SetScript ("OnEvent", nil)
|
||||
end
|
||||
|
||||
function ThreatMeter:Cancel()
|
||||
ThreatMeter:HideBars()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function ThreatMeter:OnEvent (_, event, ...)
|
||||
|
||||
if (event == "ADDON_LOADED") then
|
||||
local AddonName = select (1, ...)
|
||||
if (AddonName == "Details_TinyThreat") then
|
||||
|
||||
if (_G._detalhes) then
|
||||
|
||||
--> create widgets
|
||||
CreatePluginFrames (data)
|
||||
|
||||
local MINIMAL_DETAILS_VERSION_REQUIRED = 1
|
||||
|
||||
--> Install
|
||||
local install = _G._detalhes:InstallPlugin ("TANK", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Paladin_ShieldofVengeance", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED)
|
||||
if (type (install) == "table" and install.error) then
|
||||
print (install.error)
|
||||
end
|
||||
|
||||
--> Register needed events
|
||||
_G._detalhes:RegisterEvent (ThreatMeter, "COMBAT_PLAYER_ENTER")
|
||||
_G._detalhes:RegisterEvent (ThreatMeter, "COMBAT_PLAYER_LEAVE")
|
||||
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_ENDRESIZE")
|
||||
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_SIZECHANGED")
|
||||
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_STARTSTRETCH")
|
||||
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_ENDSTRETCH")
|
||||
|
||||
ThreatMeterFrame:RegisterEvent ("PLAYER_TARGET_CHANGED")
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
elseif (event == "PLAYER_TARGET_CHANGED") then
|
||||
ThreatMeter:TargetChanged()
|
||||
|
||||
elseif (event == "PLAYER_LOGOUT") then
|
||||
_detalhes_databaseThreat = ThreatMeter.data
|
||||
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
## Interface: 50300
|
||||
## Title: Details Tiny Threat (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## SavedVariablesPerCharacter: _detalhes_databaseThreat
|
||||
## RequiredDeps: Details
|
||||
## OptionalDeps: Ace3
|
||||
|
||||
#@no-lib-strip@
|
||||
embeds.xml
|
||||
#@end-no-lib-strip@
|
||||
|
||||
enUS.lua
|
||||
ptBR.lua
|
||||
|
||||
Details_TinyThreat.lua
|
||||
@@ -0,0 +1,137 @@
|
||||
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
|
||||
-- @class file
|
||||
-- @name AceLocale-3.0
|
||||
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
|
||||
local MAJOR,MINOR = "AceLocale-3.0", 6
|
||||
|
||||
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not AceLocale then return end -- no upgrade needed
|
||||
|
||||
-- Lua APIs
|
||||
local assert, tostring, error = assert, tostring, error
|
||||
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GAME_LOCALE, geterrorhandler
|
||||
|
||||
local gameLocale = GetLocale()
|
||||
if gameLocale == "enGB" then
|
||||
gameLocale = "enUS"
|
||||
end
|
||||
|
||||
AceLocale.apps = AceLocale.apps or {} -- array of ["AppName"]=localetableref
|
||||
AceLocale.appnames = AceLocale.appnames or {} -- array of [localetableref]="AppName"
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale
|
||||
local readmeta = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: fire off a nonbreaking error and return key
|
||||
rawset(self, key, key) -- only need to see the warning once, really
|
||||
geterrorhandler()(MAJOR..": "..tostring(AceLocale.appnames[self])..": Missing entry for '"..tostring(key).."'")
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- This metatable is used on all tables returned from GetLocale if the silent flag is true, it does not issue a warning on unknown keys
|
||||
local readmetasilent = {
|
||||
__index = function(self, key) -- requesting totally unknown entries: return key
|
||||
rawset(self, key, key) -- only need to invoke this function once
|
||||
return key
|
||||
end
|
||||
}
|
||||
|
||||
-- Remember the locale table being registered right now (it gets set by :NewLocale())
|
||||
-- NOTE: Do never try to register 2 locale tables at once and mix their definition.
|
||||
local registering
|
||||
|
||||
-- local assert false function
|
||||
local assertfalse = function() assert(false) end
|
||||
|
||||
-- This metatable proxy is used when registering nondefault locales
|
||||
local writeproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
rawset(registering, key, value == true and key or value) -- assigning values: replace 'true' with key string
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
-- This metatable proxy is used when registering the default locale.
|
||||
-- It refuses to overwrite existing values
|
||||
-- Reason 1: Allows loading locales in any order
|
||||
-- Reason 2: If 2 modules have the same string, but only the first one to be
|
||||
-- loaded has a translation for the current locale, the translation
|
||||
-- doesn't get overwritten.
|
||||
--
|
||||
local writedefaultproxy = setmetatable({}, {
|
||||
__newindex = function(self, key, value)
|
||||
if not rawget(registering, key) then
|
||||
rawset(registering, key, value == true and key or value)
|
||||
end
|
||||
end,
|
||||
__index = assertfalse
|
||||
})
|
||||
|
||||
--- Register a new locale (or extend an existing one) for the specified application.
|
||||
-- :NewLocale will return a table you can fill your locale into, or nil if the locale isn't needed for the players
|
||||
-- game locale.
|
||||
-- @paramsig application, locale[, isDefault[, silent]]
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param locale Name of the locale to register, e.g. "enUS", "deDE", etc.
|
||||
-- @param isDefault If this is the default locale being registered (your addon is written in this language, generally enUS)
|
||||
-- @param silent If true, the locale will not issue warnings for missing keys. Must be set on the first locale registered. If set to "raw", nils will be returned for unknown keys (no metatable used).
|
||||
-- @usage
|
||||
-- -- enUS.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "enUS", true)
|
||||
-- L["string1"] = true
|
||||
--
|
||||
-- -- deDE.lua
|
||||
-- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "deDE")
|
||||
-- if not L then return end
|
||||
-- L["string1"] = "Zeichenkette1"
|
||||
-- @return Locale Table to add localizations to, or nil if the current locale is not required.
|
||||
function AceLocale:NewLocale(application, locale, isDefault, silent)
|
||||
|
||||
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
|
||||
local gameLocale = GAME_LOCALE or gameLocale
|
||||
|
||||
local app = AceLocale.apps[application]
|
||||
|
||||
if silent and app and getmetatable(app) ~= readmetasilent then
|
||||
geterrorhandler()("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' must be specified for the first locale registered")
|
||||
end
|
||||
|
||||
if not app then
|
||||
if silent=="raw" then
|
||||
app = {}
|
||||
else
|
||||
app = setmetatable({}, silent and readmetasilent or readmeta)
|
||||
end
|
||||
AceLocale.apps[application] = app
|
||||
AceLocale.appnames[app] = application
|
||||
end
|
||||
|
||||
if locale ~= gameLocale and not isDefault then
|
||||
return -- nop, we don't need these translations
|
||||
end
|
||||
|
||||
registering = app -- remember globally for writeproxy and writedefaultproxy
|
||||
|
||||
if isDefault then
|
||||
return writedefaultproxy
|
||||
end
|
||||
|
||||
return writeproxy
|
||||
end
|
||||
|
||||
--- Returns localizations for the current locale (or default locale if translations are missing).
|
||||
-- Errors if nothing is registered (spank developer, not just a missing translation)
|
||||
-- @param application Unique name of addon / module
|
||||
-- @param silent If true, the locale is optional, silently return nil if it's not found (defaults to false, optional)
|
||||
-- @return The locale table for the current language.
|
||||
function AceLocale:GetLocale(application, silent)
|
||||
if not silent and not AceLocale.apps[application] then
|
||||
error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2)
|
||||
end
|
||||
return AceLocale.apps[application]
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
<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">
|
||||
<Script file="AceLocale-3.0.lua"/>
|
||||
</Ui>
|
||||
@@ -0,0 +1,51 @@
|
||||
-- $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
|
||||
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.")
|
||||
|
||||
local oldminor = self.minors[major]
|
||||
if oldminor and oldminor >= minor then return nil end
|
||||
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
||||
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)
|
||||
end
|
||||
return self.libs[major], self.minors[major]
|
||||
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
|
||||
@@ -0,0 +1,13 @@
|
||||
## Interface: 40200
|
||||
## Title: Lib: LibStub
|
||||
## Notes: Universal Library Stub
|
||||
## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
|
||||
## X-Website: http://www.wowace.com/addons/libstub/
|
||||
## X-Category: Library
|
||||
## X-License: Public Domain
|
||||
## X-Curse-Packaged-Version: r95
|
||||
## X-Curse-Project-Name: LibStub
|
||||
## X-Curse-Project-ID: libstub
|
||||
## X-Curse-Repository-ID: wow/libstub/mainline
|
||||
|
||||
LibStub.lua
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user