From f6d807bf51000bd254734165fb5a27ee6967d1d5 Mon Sep 17 00:00:00 2001 From: terciob19 Date: Fri, 20 Dec 2013 19:23:57 -0200 Subject: [PATCH] - added a new builtin plugin: Details_YouAreNotPrepared. - options panel recreated from scretch. --- .pkgmeta | 3 +- boot.lua | 6 +- classes/classe_instancia.lua | 4 +- core/control.lua | 20 +- core/parser.lua | 24 +- framework/button.lua | 58 +- framework/dropdown.lua | 9 +- framework/dropdown.xml | 8 +- framework/label.lua | 19 +- framework/panel.lua | 4 +- functions/hooks.lua | 2 + gumps/janela_info.lua | 1 + gumps/janela_options.lua | 3135 ++++++++++------- gumps/janela_principal.lua | 25 +- images/icons.tga | Bin 479239 -> 488732 bytes images/options_window.tga | Bin 0 -> 638972 bytes images/skins/default_skin.tga | Bin 180210 -> 180170 bytes locales/Details-enUS.lua | 167 +- locales/Details-ptBR.lua | 2 +- .../SiegeOfOrgrimmar.lua | 3 +- .../Details_YouAreNotPrepared.lua | 426 +++ .../Details_YouAreNotPrepared.toc | 14 + .../Libs/AceLocale-3.0/AceLocale-3.0.lua | 137 + .../Libs/AceLocale-3.0/AceLocale-3.0.xml | 4 + .../Libs/LibStub/LibStub.lua | 51 + .../Libs/LibStub/LibStub.toc | 13 + .../Libs/LibStub/tests/test.lua | 41 + .../Libs/LibStub/tests/test2.lua | 27 + .../Libs/LibStub/tests/test3.lua | 14 + .../Libs/LibStub/tests/test4.lua | 41 + .../Details_YouAreNotPrepared/background.tga | Bin 0 -> 222684 bytes plugins/Details_YouAreNotPrepared/embeds.xml | 7 + plugins/Details_YouAreNotPrepared/enUS.lua | 9 + plugins/Details_YouAreNotPrepared/ptBR.lua | 8 + 34 files changed, 2986 insertions(+), 1296 deletions(-) create mode 100644 images/options_window.tga create mode 100644 plugins/Details_YouAreNotPrepared/Details_YouAreNotPrepared.lua create mode 100644 plugins/Details_YouAreNotPrepared/Details_YouAreNotPrepared.toc create mode 100644 plugins/Details_YouAreNotPrepared/Libs/AceLocale-3.0/AceLocale-3.0.lua create mode 100644 plugins/Details_YouAreNotPrepared/Libs/AceLocale-3.0/AceLocale-3.0.xml create mode 100644 plugins/Details_YouAreNotPrepared/Libs/LibStub/LibStub.lua create mode 100644 plugins/Details_YouAreNotPrepared/Libs/LibStub/LibStub.toc create mode 100644 plugins/Details_YouAreNotPrepared/Libs/LibStub/tests/test.lua create mode 100644 plugins/Details_YouAreNotPrepared/Libs/LibStub/tests/test2.lua create mode 100644 plugins/Details_YouAreNotPrepared/Libs/LibStub/tests/test3.lua create mode 100644 plugins/Details_YouAreNotPrepared/Libs/LibStub/tests/test4.lua create mode 100644 plugins/Details_YouAreNotPrepared/background.tga create mode 100644 plugins/Details_YouAreNotPrepared/embeds.xml create mode 100644 plugins/Details_YouAreNotPrepared/enUS.lua create mode 100644 plugins/Details_YouAreNotPrepared/ptBR.lua diff --git a/.pkgmeta b/.pkgmeta index 14196a30..db7b80eb 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -8,4 +8,5 @@ move-folders: Details/plugins/Details_SpellDetails: Details_SpellDetails Details/plugins/Details_TimeAttack: Details_TimeAttack Details/plugins/Details_TinyThreat: Details_TinyThreat - Details/plugins/Details_Vanguard: Details_Vanguard \ No newline at end of file + Details/plugins/Details_Vanguard: Details_Vanguard + Details/plugins/Details_YouAreNotPrepared: Details_YouAreNotPrepared \ No newline at end of file diff --git a/boot.lua b/boot.lua index cee84316..17b2c831 100644 --- a/boot.lua +++ b/boot.lua @@ -8,9 +8,9 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.userversion = "v1.7.0" - _detalhes.version = "Alpha 011" - _detalhes.realversion = 11 + _detalhes.userversion = "v1.8.0" + _detalhes.version = "Alpha 012" + _detalhes.realversion = 12 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> initialization stuff diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index 67235fc5..4973e616 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -2067,9 +2067,9 @@ function _detalhes:envia_relatorio (linhas, custom) end if (_detalhes.time_type == 2) then - linhas[1] = linhas[1] .. " (Co)" + linhas[1] = linhas[1] .. " (Ef)" else - linhas[1] = linhas[1] .. " (Cr)" + linhas[1] = linhas[1] .. " (Ac)" end local editbox = _detalhes.janela_report.editbox diff --git a/core/control.lua b/core/control.lua index 95cdad28..a8fef0c3 100644 --- a/core/control.lua +++ b/core/control.lua @@ -287,6 +287,18 @@ _detalhes:SendEvent ("COMBAT_PLAYER_ENTER", nil, _detalhes.tabela_vigente) end + + function _detalhes:DelayedSyncAlert() + local lower_instance = _detalhes:GetLowerInstanceNumber() + if (lower_instance) then + lower_instance = _detalhes:GetInstance (lower_instance) + if (lower_instance) then + if (not lower_instance:HaveInstanceAlert()) then + lower_instance:InstanceAlert (Loc ["STRING_EQUILIZING"], {[[Interface\COMMON\StreamCircle]], 22, 22, true}, 5, {function() end}) + end + end + end + end function _detalhes:SairDoCombate (bossKilled) @@ -365,13 +377,7 @@ --> schedule sync _detalhes:EqualizeActorsSchedule (_detalhes.host_of) if (_detalhes:GetEncounterEqualize (_detalhes.tabela_vigente.is_boss.mapid, _detalhes.tabela_vigente.is_boss.index)) then - local lower_instance = _detalhes:GetLowerInstanceNumber() - if (lower_instance) then - lower_instance = _detalhes:GetInstance (lower_instance) - if (lower_instance) then - lower_instance:InstanceAlert (Loc ["STRING_EQUILIZING"], {[[Interface\COMMON\StreamCircle]], 22, 22, true}, 5) - end - end + _detalhes:ScheduleTimer ("DelayedSyncAlert", 3) end --> schedule clean up diff --git a/core/parser.lua b/core/parser.lua index efef1327..841a7e8b 100644 --- a/core/parser.lua +++ b/core/parser.lua @@ -103,7 +103,9 @@ local _in_combat = false --> hooks local _hook_cooldowns = false + local _hook_deaths = false local _hook_cooldowns_container = _detalhes.hooks ["HOOK_COOLDOWN"] + local _hook_deaths_container = _detalhes.hooks ["HOOK_DEATH"] @@ -2226,6 +2228,20 @@ _table_sort (esta_morte, _detalhes.Sort4) + if (_hook_deaths) then + --> send event to registred functions + local death_at = _tempo - _current_combat.start_time + local max_health = _UnitHealthMax (alvo_name) + + local new_death_table = {} + for index, t in _ipairs (esta_morte) do + new_death_table [index] = t + end + for _, func in _ipairs (_hook_deaths_container) do + func (nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, new_death_table, este_jogador.last_cooldown, death_at, max_health) + end + end + if (_detalhes.deadlog_limit and #esta_morte > _detalhes.deadlog_limit) then for i = #esta_morte, _detalhes.deadlog_limit+1, -1 do _table_remove (esta_morte, i) @@ -2265,7 +2281,7 @@ --> reseta a pool dano.last_events_table = _detalhes:CreateActorLastEventTable() cura.last_events_table = _detalhes:CreateActorLastEventTable() - + end end end @@ -2736,6 +2752,12 @@ else _hook_cooldowns = false end + + if (_detalhes.hooks ["HOOK_DEATH"].enabled) then + _hook_deaths = true + else + _hook_deaths = false + end return _detalhes:ClearParserCache() end diff --git a/framework/button.lua b/framework/button.lua index b5d02415..e2e44056 100644 --- a/framework/button.lua +++ b/framework/button.lua @@ -407,7 +407,7 @@ local ButtonMetaFunctions = {} end --> custom textures - function ButtonMetaFunctions:InstallCustomTexture (texture, rect) + function ButtonMetaFunctions:InstallCustomTexture (texture, rect, coords) self.button:SetNormalTexture (nil) self.button:SetPushedTexture (nil) @@ -424,7 +424,13 @@ local ButtonMetaFunctions = {} self.button.texture:SetPoint ("bottomright", self.button, "bottomright", rect.x2, rect.y2) end - self.button.texture:SetTexCoord (0, 1, 0, 0.24609375) + if (coords) then + self.button.texture.coords = coords + self.button.texture:SetTexCoord (_unpack (coords.Normal)) + else + self.button.texture:SetTexCoord (0, 1, 0, 0.24609375) + end + self.button.texture:SetTexture (texture) end @@ -440,8 +446,14 @@ local ButtonMetaFunctions = {} end end + button.MyObject.is_mouse_over = true + if (button.texture) then - button.texture:SetTexCoord (0, 1, 0.25+(0.0078125/2), 0.5+(0.0078125/2)) + if (button.texture.coords) then + button.texture:SetTexCoord (_unpack (button.texture.coords.Highlight)) + else + button.texture:SetTexCoord (0, 1, 0.24609375, 0.49609375) + end end if (button.MyObject.have_tooltip) then @@ -466,10 +478,16 @@ local ButtonMetaFunctions = {} end end - if (button.texture) then - button.texture:SetTexCoord (0, 1, 0, 0.24609375) + button.MyObject.is_mouse_over = false + + if (button.texture and not button.MyObject.is_mouse_down) then + if (button.texture.coords) then + button.texture:SetTexCoord (_unpack (button.texture.coords.Normal)) + else + button.texture:SetTexCoord (0, 1, 0, 0.24609375) + end end - + if (button.MyObject.have_tooltip) then _detalhes.popup:ShowMe (false) end @@ -512,6 +530,16 @@ local ButtonMetaFunctions = {} end end + button.MyObject.is_mouse_down = true + + if (button.texture) then + if (button.texture.coords) then + button.texture:SetTexCoord (_unpack (button.texture.coords.Pushed)) + else + button.texture:SetTexCoord (0, 1, 0.5078125, 0.75) + end + end + button.text:SetPoint ("center", button,"center", 1, -1) button.mouse_down = GetTime() @@ -548,7 +576,25 @@ local ButtonMetaFunctions = {} return end end + + button.MyObject.is_mouse_down = false + if (button.texture) then + if (button.texture.coords) then + if (button.MyObject.is_mouse_over) then + button.texture:SetTexCoord (_unpack (button.texture.coords.Highlight)) + else + button.texture:SetTexCoord (_unpack (coords.Normal)) + end + else + if (button.MyObject.is_mouse_over) then + button.texture:SetTexCoord (0, 1, 0.24609375, 0.49609375) + else + button.texture:SetTexCoord (0, 1, 0, 0.24609375) + end + end + end + button.text:SetPoint ("center", button,"center", 0, 0) if (button.MyObject.container.isMoving) then diff --git a/framework/dropdown.lua b/framework/dropdown.lua index 56d13017..b74688e8 100644 --- a/framework/dropdown.lua +++ b/framework/dropdown.lua @@ -239,7 +239,7 @@ local DropDownMetaFunctions = {} end --> frame stratas - function DropDownMetaFunctions:SetFrameStrata() + function DropDownMetaFunctions:GetFrameStrata() return self.dropdown:GetFrameStrata() end function DropDownMetaFunctions:SetFrameStrata (strata) @@ -423,6 +423,13 @@ function DetailsDropDownOnMouseDown (button) local selectedTexture = _G [button:GetName() .. "_ScrollFrame_ScrollChild_SelectedTexture"] local mouseOverTexture = _G [button:GetName() .. "_ScrollFrame_ScrollChild_MouseOverTexture"] + --scrollFrame:SetFrameStrata ("DIALOG") + --scrollBorder:SetFrameStrata ("DIALOG") + --scrollChild:SetFrameStrata ("DIALOG") + + --print (scrollFrame:GetFrameStrata()) + --print (_G ["DetailsOptionsWindow1FragsPvpSlider"]:GetFrameStrata()) + local i = 1 local showing = 0 local currentText = button.text:GetText() or "" diff --git a/framework/dropdown.xml b/framework/dropdown.xml index e1bc17f8..85e878ee 100644 --- a/framework/dropdown.xml +++ b/framework/dropdown.xml @@ -69,7 +69,7 @@ - + @@ -99,14 +99,14 @@ -