- Major clean up on plugins that lost support on 8.0.

- Some code cleanup and old windows using old window styles are now using the framework.
- Removed some debug prints.
- All export data are using LibDeflate now.
This commit is contained in:
Tercioo
2019-01-23 16:20:12 -02:00
parent 9301c993ca
commit 2c71a6428c
39 changed files with 130 additions and 1170 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
## Interface: 80100
## Title: Details
## Title: Details! Damage Meter
## Notes: Computes detailed infos about combats.
## SavedVariables: _detalhes_global
## SavedVariablesPerCharacter: _detalhes_database
+2
View File
@@ -1030,6 +1030,8 @@ local create_panel_entry = function (self, row)
editbox:SetBackdropBorderColor (1, 1, 1, 0.1)
editbox.editbox.current_bordercolor = {1, 1, 1, 0.1}
editbox:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
tinsert (row.entry_available, editbox)
end
+2 -2
View File
@@ -4,8 +4,8 @@
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")
_detalhes.build_counter = 6867
_detalhes.alpha_build_counter = 6866 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 6873
_detalhes.alpha_build_counter = 6873 --if this is higher than the regular counter, use it instead
_detalhes.userversion = "v8.1.0." .. _detalhes.build_counter
_detalhes.realversion = 135 --core version, this is used to check API version for scripts and plugins (see alias below)
_detalhes.APIVersion = _detalhes.realversion --core version
+3
View File
@@ -2188,6 +2188,9 @@ function Details:DecompressData (data, dataType)
local dataCompressed
if (dataType == "print") then
data = DetailsFramework:Trim (data)
dataCompressed = LibDeflate:DecodeForPrint (data)
if (not dataCompressed) then
Details:Msg ("couldn't decode the data.")
+2 -1
View File
@@ -206,6 +206,7 @@
local SPELLNAME_UNLIVING = GetSpellInfo (284377)
--> discharge apetagonizer core
local SPELLNAME_GRONG_CORE = GetSpellInfo (285660)
local SPELLNAME_GRONG_CORE_ALLIANCE = GetSpellInfo (286435)
--> spells with special treatment
local special_damage_spells = {
@@ -428,7 +429,7 @@
--rules of specific encounters
if (_current_encounter_id == 2263) then --grong --REMOVE ON 9.0 LAUNCH
if (spellid == 285660 or spellname == SPELLNAME_GRONG_CORE) then
if (spellid == 285660 or spellname == SPELLNAME_GRONG_CORE or spellid == 286435 or spellname == SPELLNAME_GRONG_CORE_ALLIANCE) then
return
end
+2
View File
@@ -4697,6 +4697,8 @@
text_box:SetPoint ("topleft", f, "topleft", 220, -40)
text_box:SetBackdrop (nil)
DetailsFramework:ReskinSlider (text_box.scroll)
--background
f.bg1 = f:CreateTexture (nil, "background")
f.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true)
-1
View File
@@ -4881,7 +4881,6 @@ detailsOnDeathMenu.warningLabel:Hide()
detailsOnDeathMenu:SetScript ("OnEvent", function (self, event, ...)
if (event == "ENCOUNTER_END") then --event == "PLAYER_REGEN_ENABLED" or
print ("encounter ended")
C_Timer.After (0.5, detailsOnDeathMenu.ShowPanel)
end
end)
+16 -17
View File
@@ -817,15 +817,11 @@
end
end
local serialized_table = _detalhes:Serialize (export_object)
--local zip = LibStub:GetLibrary ("LibCompress"):CompressHuffman (serialized_table)
--local encoded = _detalhes._encode:Encode (zip)
local encoded = _detalhes._encode:Encode (serialized_table)
local encoded = Details:CompressData (export_object, "print")
if (not custom_window.ExportBox) then
local editbox = _detalhes.gump:NewTextEntry (custom_window, nil, "$parentExportBox", "ExportBox", CONST_EDITBOX_WIDTH, 20)
editbox:SetPoint ("bottomleft", custom_window, "bottomleft", 10, 6)
--editbox:SetPoint ("bottomright", custom_window, "bottomright", -10, 6)
editbox:SetAutoFocus (false)
editbox:SetTemplate (CONST_TEXTENTRY_TEMPLATE)
editbox:SetHook ("OnEditFocusLost", function()
@@ -834,6 +830,16 @@
editbox:SetHook ("OnChar", function()
editbox:Hide()
end)
local flashTexture = editbox:CreateTexture (nil, "overlay")
flashTexture:SetColorTexture (1, 1, 1)
flashTexture:SetAllPoints()
flashTexture:SetAlpha (0)
local flashAnimHub = DetailsFramework:CreateAnimationHub (flashTexture)
DetailsFramework:CreateAnimation (flashAnimHub, "alpha", 1, 0.2, 0, 1)
DetailsFramework:CreateAnimation (flashAnimHub, "alpha", 2, 0.2, 1, 0)
editbox.FlashAnimation = flashAnimHub
end
if (custom_window.ImportBox) then
@@ -847,6 +853,8 @@
custom_window.ExportBox:HighlightText()
custom_window.ExportBox:SetFocus()
custom_window.ExportBox.FlashAnimation:Play()
end
custom_window:CreateMenuButton (Loc ["STRING_CUSTOM_EXPORT"], "Interface\\ICONS\\INV_Misc_Gift_01", build_menu, export_display, nil, nil, "Export", {0.00, 0.9, 0.07, 0.93}) --> localize
@@ -867,26 +875,17 @@
local import = function()
local text = editbox:GetText()
local decode = _detalhes._encode:Decode (text)
--local unzip = LibStub:GetLibrary ("LibCompress"):DecompressHuffman (decode)
--local deserialized_object = select (2, _detalhes:Deserialize (unzip))
local deserialized_object = Plater.DecompressData (text, "print")
if (type (decode) ~= "string") then
if (not deserialized_object) then
_detalhes:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"])
return
return
end
local deserialized_object = select (2, _detalhes:Deserialize (decode))
if (DetailsCustomPanel.CodeEditing) then
DetailsCustomPanel:CancelFunc()
end
if (type (deserialized_object) == "string") then
_detalhes:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"])
return
end
setmetatable (deserialized_object, _detalhes.atributo_custom)
deserialized_object.__index = _detalhes.atributo_custom
+101 -262
View File
@@ -1394,14 +1394,6 @@ local menus2 = {
window_icon:SetPoint (12, -12)
window_icon:Hide()
--> decrease the width of menu background
--menu_background:SetSize (163, 488)
--menu_background:SetPoint ("topleft", window.widget, "topleft", 23, -78)
--menu_background:Hide()
--sub_background:SetPoint ("topleft", window.widget, "topleft", 192, -80)
--sub_background:SetPoint ("bottomright", window.widget, "bottomright", -30, 27)
--sub_background:Hide()
--> hide the dog and other stuff
bigdog:Hide()
window.descAnchorTopLeftImage:Hide()
@@ -1421,11 +1413,6 @@ local menus2 = {
--> location
fillbars:SetPoint ("bottomleft", window.widget, "bottomleft", 17, 16)
-- forge_button:SetTemplate (options_button_template)
-- forge_button:SetSize(120, 20) --
-- history_button:SetTemplate (options_button_template)
-- history_button:SetSize(120, 20)
fillbars:SetTemplate (options_button_template)
fillbars:SetSize(120, 20)
changelog:SetTemplate (options_button_template)
@@ -1433,17 +1420,6 @@ local menus2 = {
feedback_button:SetTemplate (options_button_template)
feedback_button:SetSize(120, 20)
--feedback_button.textcolor = "white"
--changelog.textcolor = "white"
--fillbars.textcolor = "white"
-- history_button.textcolor = "C_OptionsButtonOrange"
-- forge_button.textcolor = "C_OptionsButtonOrange"
-- history_button:SetHook ("OnEnter", extra_buttons_on_enter)
-- history_button:SetHook ("OnLeave", extra_buttons_on_leave)
-- forge_button:SetHook ("OnEnter", extra_buttons_on_enter)
-- forge_button:SetHook ("OnLeave", extra_buttons_on_leave)
feedback_button.textsize = 10
changelog.textsize = 10
fillbars.textsize = 10
@@ -1457,22 +1433,7 @@ local menus2 = {
changelog_image:Hide()
fillbars_image:Hide()
feedback_image:Hide()
-- history_button:ClearAllPoints()
-- forge_button:ClearAllPoints()
--forge_button:SetPoint ("topright", -17, -47)
-- forge_button:SetPoint ("bottomleft", fillbars, "topleft", 0, 2)
--history_button:SetPoint ("right", forge_button, "left", -2, 0)
-- history_button:SetPoint ("bottomleft", changelog, "topleft", 0, 2)
--forge_button:Hide()
--history_button:Hide()
--group_editing_help:ClearAllPoints()
--group_editing_help:SetPoint ("bottomleft", instances_string.widget, "topleft", -5, 2)
--group_editing:ClearAllPoints()
--group_editing:SetPoint ("left", group_editing_help, "right", 2, 0)
--DetailsOptionsWindowGroupEditingText:ClearAllPoints()
--DetailsOptionsWindowGroupEditingText:SetPoint ("left", group_editing, "right", 2, 0)
DetailsOptionsWindowGroupEditingText:ClearAllPoints()
DetailsOptionsWindowGroupEditingText:SetPoint ("bottomright", instances.widget, "topright", 0, 2)
@@ -3098,7 +3059,7 @@ function window:CreateFrame16()
if (not _detalhes:GetPlugin ("DETAILS_PLUGIN_CHART_VIEWER")) then
local label = g:NewLabel (frame16, _, "$parentPluginWarningLabel", "PluginWarningLabel", Loc ["STRING_OPTIONS_CHART_PLUGINWARNING"], "GameFontNormal")
local image = g:NewImage (frame16, [[Interface\DialogFrame\UI-Dialog-Icon-AlertNew]])
label:SetPoint ("topright", frame16, "topright", -42, -15)
label:SetPoint ("topright", frame16, "topright", -42, -10)
label:SetJustifyH ("left")
label:SetWidth (160)
image:SetPoint ("right", label, "left", -7, 0)
@@ -3114,19 +3075,12 @@ function window:CreateFrame16()
local big_code_editor = g:NewSpecialLuaEditorEntry (frame16, 643, 382, "bigCodeEditor", "$parentBigCodeEditor")
big_code_editor:SetPoint ("topleft", frame16, "topleft", 7, -70)
big_code_editor:SetFrameLevel (frame16:GetFrameLevel()+6)
big_code_editor:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 5, right = 5, top = 5, bottom = 5}})
big_code_editor:SetBackdropColor (0, 0, 0, 1)
big_code_editor:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16})
DetailsFramework:ReskinSlider (big_code_editor.scroll)
big_code_editor:SetBackdropColor (0.5, 0.5, 0.5, 0.95)
big_code_editor:SetBackdropBorderColor (0, 0, 0, 1)
big_code_editor:Hide()
big_code_editor:SetBackdropColor (0, 0, 0, 0.95)
local background = g:NewImage (big_code_editor, [[Interface\ARCHEOLOGY\Arch-BookCompletedLeft]])
background:SetPoint ("topleft", big_code_editor, "topleft")
background:SetPoint ("bottomright", big_code_editor, "bottomright")
background:SetDesaturated (true)
background:SetTexCoord (1, 0, 0, 0.9)
background:SetAlpha (0.2)
local accept = function()
big_code_editor:ClearFocus()
if (not big_code_editor.is_export) then
@@ -3185,47 +3139,39 @@ function window:CreateFrame16()
frame16.userTimeCaptureFillPanel:Refresh()
end
local big_code_editor2 = g:NewSpecialLuaEditorEntry (frame16, 643, 382, "exportEditor", "$parentExportEditor", true)
local big_code_editor2 = g:NewSpecialLuaEditorEntry (frame16, 643, 402, "exportEditor", "$parentExportEditor", true)
big_code_editor2:SetPoint ("topleft", frame16, "topleft", 7, -70)
big_code_editor2:SetFrameLevel (frame16:GetFrameLevel()+6)
big_code_editor2:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 5, right = 5, top = 5, bottom = 5}})
big_code_editor2:SetBackdropColor (0, 0, 0, 1)
big_code_editor2:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16})
DetailsFramework:ReskinSlider (big_code_editor2.scroll)
big_code_editor2:SetBackdropColor (0.5, 0.5, 0.5, 0.95)
big_code_editor2:SetBackdropBorderColor (0, 0, 0, 1)
big_code_editor2:Hide()
big_code_editor2:SetBackdropColor (0, 0, 0, 0.95)
local background = g:NewImage (big_code_editor2, [[Interface\ARCHEOLOGY\Arch-BookCompletedLeft]])
background:SetPoint ("topleft", big_code_editor2, "topleft")
background:SetPoint ("bottomright", big_code_editor2, "bottomright")
background:SetDesaturated (true)
background:SetTexCoord (1, 0, 0, 0.9)
background:SetAlpha (0.2)
local close_export_box = function()
big_code_editor2:ClearFocus()
big_code_editor2:Hide()
end
local close_export = g:NewButton (big_code_editor2, nil, "$parentClose", "closeButton", 24, 24, close_export_box, nil, nil, [[Interface\Buttons\UI-CheckBox-Check]])
local close_export = g:NewButton (big_code_editor2, nil, "$parentClose", "closeButton", 120, 20, close_export_box)
close_export:SetPoint (10, 18)
local close_export_label = g:NewLabel (big_code_editor2, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_CLOSE"])
close_export_label:SetPoint ("left", close_export, "right", 2, 0)
close_export:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]])
close_export:SetText (Loc ["STRING_OPTIONS_CHART_CLOSE"])
close_export:SetTemplate (options_button_template)
local export_function = function (index)
local data = _detalhes.savedTimeCaptures [index]
if (data) then
local serialized = _detalhes:Serialize (data)
local encoded = _detalhes._encode:Encode (serialized)
--serialized = LibStub:GetLibrary ("LibCompress"):CompressLZW (serialized)
--local serialized = LibStub:GetLibrary ("LibCompress"):Compress (func)
big_code_editor2:SetText (encoded)
big_code_editor2:Show()
big_code_editor2.editbox:HighlightText()
big_code_editor2.editbox:SetFocus (true)
local encoded = Details:CompressData (data, "print")
if (encoded) then
big_code_editor2:SetText (encoded)
big_code_editor2:Show()
big_code_editor2.editbox:HighlightText()
big_code_editor2.editbox:SetFocus (true)
else
Details:Msg ("error exporting the time capture.") --localize-me
end
end
end
@@ -3293,20 +3239,15 @@ function window:CreateFrame16()
panel:Refresh()
--> add panel
local addframe = g:NewPanel (frame16, nil, "$parentUserTimeCapturesAddPanel", "userTimeCaptureAddPanel", 644, 382)
addframe.backdrop = {bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 3, right = 3, top = 2, bottom = 2}}
local addframe = g:NewPanel (frame16, nil, "$parentUserTimeCapturesAddPanel", "userTimeCaptureAddPanel", 644, 402)
addframe:SetPoint (8, -70)
addframe:SetFrameLevel (7)
addframe:Hide()
addframe:SetBackdropColor (0, 0, 0, 0.95)
local background = g:NewImage (addframe, [[Interface\ARCHEOLOGY\Arch-BookCompletedLeft]])
background:SetPoint ("topleft", addframe, "topleft")
background:SetPoint ("bottomright", addframe, "bottomright")
background:SetDesaturated (true)
background:SetTexCoord (1, 0, 0, 0.9)
background:SetAlpha (0.2)
addframe:SetPoint ("topleft", frame16, "topleft", 7, -70)
addframe:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16})
addframe:SetBackdropColor (0.5, 0.5, 0.5, 0.95)
addframe:SetBackdropBorderColor (0, 0, 0, 1)
--> name
local capture_name = g:NewLabel (addframe, nil, "$parentNameLabel", "nameLabel", Loc ["STRING_OPTIONS_CHART_ADDNAME"])
@@ -3318,7 +3259,11 @@ function window:CreateFrame16()
local capture_func = g:NewLabel (addframe, nil, "$parentFunctionLabel", "functionLabel", Loc ["STRING_OPTIONS_CHART_ADDCODE"])
local capture_func_entry = g:NewSpecialLuaEditorEntry (addframe.widget, 300, 200, "funcEntry", "$parentFuncEntry")
capture_func_entry:SetPoint ("topleft", capture_func.widget, "topright", 2, 0)
capture_func_entry:SetSize (500, 200)
capture_func_entry:SetSize (500, 220)
capture_func_entry:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
capture_func_entry:SetBackdropBorderColor (0, 0, 0, 1)
capture_func_entry:SetBackdropColor (0, 0, 0, .5)
DetailsFramework:ReskinSlider (capture_func_entry.scroll)
--> icon
local capture_icon = g:NewLabel (addframe, nil, "$parentIconLabel", "iconLabel", Loc ["STRING_OPTIONS_CHART_ADDICON"])
@@ -3354,84 +3299,72 @@ function window:CreateFrame16()
DetailsIconPickFrame:Hide()
end
end
local addbutton = g:NewButton (frame16, nil, "$parentAddButton", "addbutton", 100, 21, add, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD"], nil, options_button_template)
--addbutton:InstallCustomTexture()
local addbutton = g:NewButton (frame16, nil, "$parentAddButton", "addbutton", 120, 20, add, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD"], nil, options_button_template)
addbutton:SetPoint ("bottomright", panel, "topright", -30, 0)
addbutton:SetIcon ([[Interface\PaperDollInfoFrame\Character-Plus]], 12, 12, nil, nil, nil, 4)
window:CreateLineBackground2 (frame16, "addbutton", "addbutton", nil, nil, {1, 0.8, 0}, button_color_rgb)
addbutton:SetTextColor (button_color_rgb)
local left = g:NewImage (frame16, "Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs", 64, 13, "artwork", {0, 1, 0, 0.05078125})
left:SetPoint ("bottomright", addbutton, "bottomleft", 34, 0)
left:SetBlendMode ("ADD")
left:Hide()
local right = g:NewImage (frame16, "Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs", 64, 13, "artwork", {0, 1, 0.0546875, 0.1015625})
right:SetPoint ("bottomleft", addbutton, "bottomright", 0, 0)
right:SetBlendMode ("ADD")
--> open import panel button
local importframe = g:NewSpecialLuaEditorEntry (frame16, 644, 382, "importEditor", "$parentImportEditor", true)
local importframe = g:NewSpecialLuaEditorEntry (frame16, 644, 402, "importEditor", "$parentImportEditor", true)
local font, size, flag = importframe.editbox:GetFont()
importframe.editbox:SetFont (font, 9, flag)
importframe:SetPoint ("topleft", frame16, "topleft", 8, -70)
importframe:SetFrameLevel (frame16:GetFrameLevel()+6)
importframe:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 5, right = 5, top = 5, bottom = 5}})
importframe:SetBackdropColor (0, 0, 0, 1)
importframe:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16})
DetailsFramework:ReskinSlider (importframe.scroll)
importframe:SetBackdropColor (0.5, 0.5, 0.5, 0.95)
importframe:SetBackdropBorderColor (0, 0, 0, 1)
importframe:Hide()
importframe:SetBackdropColor (0, 0, 0, 0.95)
local background = g:NewImage (importframe, [[Interface\ARCHEOLOGY\Arch-BookCompletedLeft]])
background:SetPoint ("topleft", importframe, "topleft")
background:SetPoint ("bottomright", importframe, "bottomright")
background:SetDesaturated (true)
background:SetTexCoord (1, 0, 0, 0.9)
background:SetAlpha (0.2)
local doimport = function()
local text = importframe:GetText()
local decode = _detalhes._encode:Decode (text)
if (type (decode) ~= "string") then
_detalhes:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"])
return
end
local unserialize = select (2, _detalhes:Deserialize (decode))
if (type (unserialize) == "table") then
if (unserialize[1] and unserialize[2] and unserialize[3] and unserialize[4] and unserialize[5]) then
local register = _detalhes:TimeDataRegister (unpack (unserialize))
if (type (register) == "string") then
_detalhes:Msg (register)
text = DetailsFramework:Trim (text)
local dataTable = Details:DecompressData (text, "print")
if (dataTable) then
local unserialize = dataTable
if (type (unserialize) == "table") then
if (unserialize[1] and unserialize[2] and unserialize[3] and unserialize[4] and unserialize[5]) then
local register = _detalhes:TimeDataRegister (unpack (unserialize))
if (type (register) == "string") then
_detalhes:Msg (register)
end
else
_detalhes:Msg (Loc ["STRING_OPTIONS_CHART_IMPORTERROR"])
end
else
_detalhes:Msg (Loc ["STRING_OPTIONS_CHART_IMPORTERROR"])
end
importframe:Hide()
panel:Refresh()
else
_detalhes:Msg (Loc ["STRING_OPTIONS_CHART_IMPORTERROR"])
_detalhes:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"])
return
end
importframe:Hide()
panel:Refresh()
end
local accept_import = g:NewButton (importframe, nil, "$parentAccept", "acceptButton", 24, 24, doimport, nil, nil, [[Interface\Buttons\UI-CheckBox-Check]])
local accept_import = g:NewButton (importframe, nil, "$parentAccept", "acceptButton", 120, 20, doimport)
accept_import:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]])
accept_import:SetPoint (10, 18)
local accept_import_label = g:NewLabel (importframe, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_IMPORT"])
accept_import_label:SetPoint ("left", accept_import, "right", 2, 0)
accept_import:SetText (Loc ["STRING_OPTIONS_CHART_IMPORT"])
accept_import:SetTemplate (options_button_template)
local cancelimport = function()
importframe:ClearFocus()
importframe:Hide()
end
local cancel_changes = g:NewButton (importframe, nil, "$parentCancel", "CancelButton", 20, 20, cancelimport, nil, nil, [[Interface\PetBattles\DeadPetIcon]])
cancel_changes:SetPoint (100, 17)
local cancel_changes_label = g:NewLabel (importframe, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_CANCEL"])
cancel_changes_label:SetPoint ("left", cancel_changes, "right", 2, 0)
local cancel_changes = g:NewButton (importframe, nil, "$parentCancel", "CancelButton", 120, 20, cancelimport)
cancel_changes:SetIcon ([[Interface\PetBattles\DeadPetIcon]])
cancel_changes:SetText (Loc ["STRING_OPTIONS_CHART_CANCEL"])
cancel_changes:SetPoint (132, 18)
cancel_changes:SetTemplate (options_button_template)
local import = function()
importframe:Show()
@@ -3446,23 +3379,15 @@ function window:CreateFrame16()
DetailsIconPickFrame:Hide()
end
end
local importbutton = g:NewButton (frame16, nil, "$parentImportButton", "importbutton", 100, 21, import, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_IMPORT"], nil, options_button_template)
--importbutton:InstallCustomTexture()
local importbutton = g:NewButton (frame16, nil, "$parentImportButton", "importbutton", 120, 20, import, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_IMPORT"], nil, options_button_template)
importbutton:SetPoint ("right", addbutton, "left", -4, 0)
importbutton:SetIcon ([[Interface\Buttons\UI-GuildButton-PublicNote-Up]], 14, 14, nil, nil, nil, 4)
window:CreateLineBackground2 (frame16, "importbutton", "importbutton", nil, nil, {1, 0.8, 0}, button_color_rgb)
importbutton:SetTextColor (button_color_rgb)
local left = g:NewImage (frame16, "Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs", 64, 13, "artwork", {0, 1, 0, 0.05078125})
left:SetPoint ("bottomright", importbutton, "bottomleft", 34, 0)
left:SetBlendMode ("ADD")
local right = g:NewImage (frame16, "Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs", 64, 13, "artwork", {0, 1, 0.0546875, 0.1015625})
right:SetPoint ("bottomleft", importbutton, "bottomright", 0, 0)
right:SetBlendMode ("ADD")
right:Hide()
--> close button
local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 100, 21, function() addframe:Hide() end, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_CLOSE"], nil, options_button_template)
local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 120, 20, function() addframe:Hide() end, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_CLOSE"], nil, options_button_template)
--closebutton:InstallCustomTexture()
--> confirm add capture
@@ -3502,12 +3427,11 @@ function window:CreateFrame16()
if (DetailsIconPickFrame and DetailsIconPickFrame:IsShown()) then
DetailsIconPickFrame:Hide()
end
addframe:Hide();
addframe:Hide()
end
local addcapturebutton = g:NewButton (addframe, nil, "$parentAddCaptureButton", "addCapturebutton", 100, 21, addcapture, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD2"], nil, options_button_template)
--addcapturebutton:InstallCustomTexture()
local addcapturebutton = g:NewButton (addframe, nil, "$parentAddCaptureButton", "addCapturebutton", 120, 21, addcapture, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD2"], nil, options_button_template)
--> anchors
local start = 25
@@ -3520,6 +3444,9 @@ function window:CreateFrame16()
addcapturebutton:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]], 18, 18, nil, nil, nil, 4)
closebutton:SetIcon ([[Interface\PetBattles\DeadPetIcon]], 14, 14, nil, nil, nil, 4)
addcapturebutton:SetTemplate (options_button_template)
closebutton:SetTemplate (options_button_template)
window:CreateLineBackground2 (addframe.widget, closebutton, closebutton, nil, nil, {1, 0.8, 0}, button_color_rgb)
closebutton:SetTextColor (button_color_rgb)
@@ -3587,31 +3514,18 @@ function window:CreateFrame15()
end
local panel = g:NewFillPanel (frame15, header, "$parentCustomSpellsFillPanel", "customSpellsFillPanel", 640, 382, total_lines, fill_row, false)
panel:Refresh()
--> add
--> add panel
local addframe = g:NewPanel (frame15, nil, "$parentCustomSpellsAddPanel", "customSpellsAddPanel", 644, 382)
addframe.backdrop = {bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 3, right = 3, top = 2, bottom = 2}}
addframe:SetPoint (8, -70)
addframe:SetPoint (8, -80)
addframe:SetFrameLevel (7)
addframe:Hide()
addframe:SetBackdropColor (0, 0, 0, 0.95)
local background = g:NewImage (addframe, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]])
background:SetPoint ("topleft", addframe, "topleft")
background:SetPoint ("bottomright", addframe, "bottomright")
background:SetDesaturated (true)
background:SetTexCoord (1, 0, 0, 1)
background:SetAlpha (0.4)
local desc = Loc ["STRING_OPTIONS_SPELL_SPELLID_DESC"]
local desc_spellid = g:NewLabel (addframe, nil, "$parentSpellidDescLabel", "spellidDescLabel", desc)
addframe:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,tile = 1, tileSize = 16})
addframe:SetBackdropColor (0.5, 0.5, 0.5, 0.95)
addframe:SetBackdropBorderColor (0, 0, 0, 1)
addframe:Hide()
local spellid = g:NewLabel (addframe, nil, "$parentSpellidLabel", "spellidLabel", Loc ["STRING_OPTIONS_SPELL_ADDSPELLID"])
local spellname = g:NewLabel (addframe, nil, "$parentSpellnameLabel", "spellnameLabel", Loc ["STRING_OPTIONS_SPELL_ADDNAME"])
local spellicon = g:NewLabel (addframe, nil, "$parentSpelliconLabel", "spelliconLabel", Loc ["STRING_OPTIONS_SPELL_ADDICON"])
@@ -3630,9 +3544,9 @@ function window:CreateFrame15()
end
end
local spellid_entry = g:NewSpellEntry (addframe, spellid_entry_func, 160, 20, nil, nil, "spellidEntry", "$parentSpellidEntry")
spellid_entry:SetTemplate (options_dropdown_template)
spellid_entry:SetPoint ("left", spellid, "right", 2, 0)
local icon_button_func = function (texture)
addframe.spellIconButton.icon.texture = texture
end
@@ -3642,51 +3556,9 @@ function window:CreateFrame15()
icon_button:InstallCustomTexture()
icon_button:SetPoint ("left", spellicon, "right", 2, 0)
local all_cached_spells = {}
local refresh_cache = function (self)
local offset = FauxScrollFrame_GetOffset (self)
local total = #all_cached_spells
for index = 1, #self.lines1 do
local label1 = self.lines1 [index]
local label2 = self.lines2 [index]
local data = all_cached_spells [index + offset]
if (data) then
label1.text = data [1]
label2.text = data [2]
else
label1.text = ""
label2.text = ""
end
end
end
local scrollframe = CreateFrame ("scrollframe", "SpellCacheBrowserFrame", addframe.widget, "FauxScrollFrameTemplate")
scrollframe:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (self, offset, 10, refresh_cache) end)
scrollframe:SetSize (250, 140)
scrollframe.lines1 = {}
scrollframe.lines2 = {}
scrollframe:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, edgeSize = 8, tileSize = 5})
for i = 1, 10 do
local label1 = g:NewLabel (scrollframe, nil, "$parentLabel1" .. i, nil)
local label2 = g:NewLabel (scrollframe, nil, "$parentLabel2" .. i, nil)
local y = (i-1) * 13 * -1 - 5
label1:SetPoint (3, y)
label2:SetPoint (70, y)
tinsert (scrollframe.lines1, label1)
tinsert (scrollframe.lines2, label2)
end
--> close button
local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 100, 21, function() addframe:Hide(); table.wipe (all_cached_spells) end, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_CLOSE"], nil, options_button_template)
--closebutton:InstallCustomTexture()
local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 120, 20, function() addframe:Hide() end, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_CLOSE"], nil, options_button_template)
local bg = window:CreateLineBackground2 (addframe.widget, closebutton, closebutton, nil, nil, {1, 0.8, 0}, button_color_rgb)
closebutton:SetTextColor (button_color_rgb)
@@ -3719,10 +3591,9 @@ function window:CreateFrame15()
DetailsIconPickFrame:Hide()
end
addframe:Hide();
table.wipe (all_cached_spells)
end
local addspellbutton = g:NewButton (addframe, nil, "$parentAddSpellButton", "addSpellbutton", 100, 21, addspell, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_ADD"], nil, options_button_template)
--addspellbutton:InstallCustomTexture()
local addspellbutton = g:NewButton (addframe, nil, "$parentAddSpellButton", "addSpellbutton", 120, 20, addspell, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_ADD"], nil, options_button_template)
local bg2 = window:CreateLineBackground2 (addframe.widget, addspellbutton, addspellbutton, nil, nil, {1, 0.8, 0}, button_color_rgb)
addspellbutton:SetTextColor (button_color_rgb)
bg:SetFrameLevel (bg2:GetFrameLevel()-1)
@@ -3732,51 +3603,20 @@ function window:CreateFrame15()
addspellbutton:SetPoint ("bottomright", addframe, "bottomright", -5, 5)
closebutton:SetPoint ("right", addspellbutton, "left", -4, 0)
desc_spellid:SetPoint (50, -30)
scrollframe:SetPoint ("topleft", addframe.widget, "topleft", 50, -110)
spellid:SetPoint (50, -285)
spellname:SetPoint (50, -310)
spellicon:SetPoint (50, -335)
scrollframe:Show()
local update_cache_scroll = function()
table.wipe (all_cached_spells)
for spellid, t in pairs (_detalhes.spellcache) do
tinsert (all_cached_spells, {spellid, t[1]})
end
table.sort (all_cached_spells, function (t1, t2) local a = t1 and t1[2] or "z"; local b = t2 and t2[2] or "z"; return a < b end)
FauxScrollFrame_Update (scrollframe, math.max (11, #all_cached_spells), 10, 12)
refresh_cache (scrollframe)
end
spellid:SetPoint (50, -10)
spellname:SetPoint (50, -35)
spellicon:SetPoint (50, -60)
--> open add panel button
local add = function()
update_cache_scroll()
addframe:Show()
end
local addbutton = g:NewButton (frame15, nil, "$parentAddButton", "addbutton", 100, 21, add, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_ADDSPELL"], nil, options_button_template)
--addbutton:InstallCustomTexture()
local addbutton = g:NewButton (frame15, nil, "$parentAddButton", "addbutton", 120, 20, add, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_ADDSPELL"], nil, options_button_template)
window:CreateLineBackground2 (frame15, "addbutton", "addbutton", nil, nil, {1, 0.8, 0}, button_color_rgb)
addbutton:SetTextColor (button_color_rgb)
addbutton:SetPoint ("bottomright", panel, "topright", -30, 0)
addbutton:SetPoint ("bottomright", panel, "topright", -00, 1)
addbutton:SetIcon ([[Interface\PaperDollInfoFrame\Character-Plus]], 12, 12, nil, nil, nil, 4)
local left = g:NewImage (frame15, "Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs", 64, 13, "artwork", {0, 1, 0, 0.05078125})
left:SetPoint ("bottomright", addbutton, "bottomleft", 34, 0)
left:SetBlendMode ("ADD")
local right = g:NewImage (frame15, "Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs", 64, 13, "artwork", {0, 1, 0.0546875, 0.1015625})
right:SetPoint ("bottomleft", addbutton, "bottomright", 0, 0)
right:SetBlendMode ("ADD")
--> anchors
@@ -5539,7 +5379,6 @@ function window:CreateFrame3()
g:NewLabel (frame3, _, "$parentSaveSkinLabel", "saveSkinLabel", Loc ["STRING_OPTIONS_SAVELOAD_PNAME"], "GameFontHighlightLeft")
frame3.saveStyleName:SetPoint ("left", frame3.saveSkinLabel, "right", 2)
g:NewButton (frame3, _, "$parentSaveStyleButton", "saveStyle", 50, 18, saveStyleFunc, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_SAVE"], nil, options_button_template)
--frame3.saveStyle:InstallCustomTexture()
window:CreateLineBackground2 (frame3, "saveStyleName", "saveSkinLabel", Loc ["STRING_OPTIONS_SAVELOAD_CREATE_DESC"])
@@ -5577,10 +5416,10 @@ function window:CreateFrame3()
g:NewLabel (frame3, _, "$parentToAllStyleLabel", "toAllStyleLabel", "", "GameFontHighlightLeft")
g:NewLabel (frame3, _, "$parentmakeDefaultLabel", "makeDefaultLabel", "", "GameFontHighlightLeft")
g:NewButton (frame3, _, "$parentToAllStyleButton", "applyToAll", 160, 18, applyToAll, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_APPLYTOALL"], 1, options_button_template)
g:NewButton (frame3, _, "$parentToAllStyleButton", "applyToAll", 160, 20, applyToAll, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_APPLYTOALL"], 1, options_button_template)
window:CreateLineBackground2 (frame3, "applyToAll", "applyToAll", Loc ["STRING_OPTIONS_SAVELOAD_APPLYALL_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
g:NewButton (frame3, _, "$parentMakeDefaultButton", "makeDefault", 160, 18, makeDefault, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_MAKEDEFAULT"], nil, options_button_template)
g:NewButton (frame3, _, "$parentMakeDefaultButton", "makeDefault", 160, 20, makeDefault, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_MAKEDEFAULT"], nil, options_button_template)
window:CreateLineBackground2 (frame3, "makeDefault", "makeDefault", Loc ["STRING_OPTIONS_SAVELOAD_STD_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
frame3.toAllStyleLabel:SetPoint ("left", frame3.applyToAll, "left")
@@ -5761,7 +5600,7 @@ function window:CreateFrame3()
end
g:NewButton (frame3, _, "$parentImportButton", "ImportButton", 160, 18, import_saved, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_IMPORT"], nil, options_button_template)
g:NewButton (frame3, _, "$parentImportButton", "ImportButton", 160, 20, import_saved, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_IMPORT"], nil, options_button_template)
--frame3.ImportButton:InstallCustomTexture (nil, nil, nil, nil, nil, true)
frame3.ImportButton:SetIcon ([[Interface\Buttons\UI-GuildButton-PublicNote-Up]], 14, 14, nil, nil, nil, 4, 2)
frame3.ImportButton:SetTextColor (button_color_rgb)
@@ -11061,7 +10900,7 @@ function window:CreateFrame12()
g:NewSwitch (bframe, _, "$parentToolbarSlider"..i, "toolbarPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled, nil, nil, nil, nil, options_switch_template)
bframe ["toolbarPluginsSlider"..i].PluginName = absName
tinsert (window.plugin_widgets, bframe ["toolbarPluginsSlider"..i])
bframe ["toolbarPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 415, y+1)
bframe ["toolbarPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 415, y)
bframe ["toolbarPluginsSlider"..i]:SetAsCheckBox()
bframe ["toolbarPluginsSlider"..i].OnSwitch = function (self, _, value)
plugin_stable.enabled = value
@@ -11074,7 +10913,7 @@ function window:CreateFrame12()
end
if (pluginObject.OpenOptionsPanel) then
g:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 18, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template)
g:NewButton (bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 120, 20, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template)
bframe ["OptionsButton"..i]:SetPoint ("topleft", frame4, "topleft", 510, y-0)
--bframe ["OptionsButton"..i]:InstallCustomTexture()
@@ -1 +0,0 @@
local DmgRank = nil
@@ -1,14 +0,0 @@
## Interface: 80100
## Title: Details Damage, the Game! (plugin)
## Notes: Plugin for Details
## 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
@@ -1,137 +0,0 @@
--- **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
@@ -1,4 +0,0 @@
<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>
@@ -1,51 +0,0 @@
-- $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
@@ -1,13 +0,0 @@
## 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
@@ -1,41 +0,0 @@
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)
@@ -1,27 +0,0 @@
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
@@ -1,14 +0,0 @@
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
@@ -1,41 +0,0 @@
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")
-7
View File
@@ -1,7 +0,0 @@
<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>
-65
View File
@@ -1,65 +0,0 @@
local Loc = LibStub("AceLocale-3.0"):NewLocale("DetailsDmgRank", "enUS", true)
if (not Loc) then
return
end
--> Labels:
Loc ["STRING_PLUGIN_NAME"] = "Damage, the Game!"
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: "
Loc ["STRING_HELP"] = "Damage Rank is a fun tool where your goal is reach the requested damage within the given time. Completing the mission, your rank increases and the challenge becomes harder and harder."
--> 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.
-65
View File
@@ -1,65 +0,0 @@
local Loc = LibStub("AceLocale-3.0"):NewLocale("DetailsDmgRank", "ptBR")
if (not Loc) then
return
end
--> Labels:
Loc ["STRING_PLUGIN_NAME"] = "Dano, o Jogo!"
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: "
Loc ["STRING_HELP"] = "Rank de Dano eh uma ferramenta interativa cujo o objetivo eh conseguir alcancar a margem de dano pedida dentro do tempo estabelecido. Cada vez que voce alcanca-lo, seu nivel aumenta e o desafio torna-se maior."
--> 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"
@@ -1 +0,0 @@
local DpsTuning = nil
@@ -1,7 +0,0 @@
## Interface: 80100
## Title: Details Dps Tuning (plugin)
## Notes: Plugin for Details
## RequiredDeps: Details
## OptionalDeps: Ace3
Details_DpsTuning.lua
@@ -1208,7 +1208,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
end
if (not _combat_object) then
EncounterDetails:Msg ("no combat found.")
--EncounterDetails:Msg ("no combat found.")
DebugMessage ("_combat_object is nil, EXIT")
return
end
@@ -1 +0,0 @@
local TimeAttack = nil
@@ -1,15 +0,0 @@
## Interface: 80100
## 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
@@ -1,137 +0,0 @@
--- **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
@@ -1,4 +0,0 @@
<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>
@@ -1,51 +0,0 @@
-- $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
@@ -1,13 +0,0 @@
## 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
@@ -1,41 +0,0 @@
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)
@@ -1,27 +0,0 @@
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
@@ -1,14 +0,0 @@
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
@@ -1,41 +0,0 @@
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")
-7
View File
@@ -1,7 +0,0 @@
<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>
-23
View File
@@ -1,23 +0,0 @@
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_HELP"] = "Use timeattack to measure your damage within a certain time window. You can choose the amount of time from on the slider bar below. After reaching the time you can save the attempt to compare with others attempts in the future. When you save an attempt, Timeattack record your item level and the date together with the damage and time."
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"
-23
View File
@@ -1,23 +0,0 @@
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_HELP"] = "Use o Cronometro para medir o seu dano dentro de um determinado tempo. Voce pode escolher a quantidade de tempo na barra de deslizar logo abaixo. Apos alcancar o tempo voce pode salvar a quantidade de dano que fez para comparar com outras no futuro."
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"