From 1e47bc89928affdfd91dd721d5d0042aee1cdde8 Mon Sep 17 00:00:00 2001 From: Tercio Date: Fri, 15 May 2015 13:10:32 -0300 Subject: [PATCH] - Added support for skins for Player Detail Window. --- boot.lua | 21 ++-- functions/profiles.lua | 10 ++ gumps/janela_info.lua | 251 +++++++++++++++++++++++++++++++++------ gumps/janela_options.lua | 36 +++++- gumps/janela_welcome.lua | 2 + startup.lua | 20 ++-- 6 files changed, 283 insertions(+), 57 deletions(-) diff --git a/boot.lua b/boot.lua index 35539231..e339eb82 100644 --- a/boot.lua +++ b/boot.lua @@ -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 = 896 --it's 896 for release - _detalhes.userversion = "v3.14.0b" - _detalhes.realversion = 68 --core version + _detalhes.userversion = "v3.14.1" + _detalhes.realversion = 69 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -22,12 +22,12 @@ do --[[ |cFFFFFF00-|r .\n\n -|cFFFFFF00v3.14.0 (|cFFFFCC00May 07, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Changing textures for a smaller download size, files changes: options_window, copy, custom_bg, welcome.tga replaced with border_welcome and built-in background.\n\n +|cFFFFFF00v3.14.1 (|cFFFFCC00May 15, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n --]] -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.14.0b (|cFFFFCC00May 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several texture changes for a smaller download size.\n\n|cFFFFFF00v3.13.4a (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created 'Details! Forge' but is still under development: /details forge.\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip.\n\n|cFFFFFF00v3.13.1 (|cFFFFCC00April 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added casted amount for healing and damage spells. The result is shown on Player Detail Window and Comparison Panel.\n\n|cFFFFFF00-|r Added uptime amount for healing spells on Player Detail Window.\n\n|cFFFFFF00-|r Added an option to disable lock/resize/ungroup buttons. It's under miscellaneous bracket on Options Panel.\n\n|cFFFFFF00-|r Wallpaper for menus on title bar got a customization option under tooltips bracket on Options Panel.\n\n|cFFFFFF00-|r Updated spell list for Crowd Control and class detection.\n\n|cFFFFFF00-|r Improved Weakaura creation tool under Encounter Details Plugin.\n\n|cFFFFFF00v3.12.10 (|cFFFFCC00April 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added the spell uptime on damage player detail window.\n\n|cFFFFFF00-|r Added Rune Tap as cooldown.\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n|cFFFFFF00v3.12.7 (|cFFFFCC00April 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00-|r Fixed issue with Dps/Hps data broker which wasn't respecting the type of time (effective/activity) selected.\n\n|cFFFFFF00-|r Fixed few bugs when using the key bind to toggle windows.\n\n|cFFFFFF00v3.11.5 (|cFFFFCC00Mar 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data where max/min amount for spells was being calculated wrong.\n\n|cFFFFFF00-|r Fixed a problem while reporting enemy damage taken.\n\n|cFFFFFF00-|r Fixed an issue with damage taken by spell where some spells wasn't shown.\n\n|cFFFFFF00-|r Few improvements on tooltips.\n\n|cFFFFFF00-|r Fixed a accuracy problem with shaman's spirit link toten where its life exchange was considered healing done.\n\n|cFFFFFF00-|r Boss segments now need to have at least 30 seconds to be added on the overall data.\n\n|cFFFFFF00-|r When the segment limit is reach, segments with less combat time will be erased instead of the olders.\n\n|cFFFFFF00-|r Added item level tracker.\n\n|cFFFFFF00-|r Fixed window positioning when changing from Solo mode to Group mode.\n\n|cFFFFFF00-|r Added an option for change the amount of lines on death log.\n\n|cFFFFFF00-|r Added custom display for CC done.\n\n|cFFFFFF00v3.10.10 (|cFFFFCC00Mar 10, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): done a calibration on endurance calculation.\n\n|cFFFFFF00-|r Raid Check (plugin): now also show information for 50+ stats runes.\n\n|cFFFFFF00-|r Fixed cooldowns spell targets on overall data.\n\n|cFFFFFF00-|r Fixed report custom displays where sometimes it didn't report spell links.\n\n|cFFFFFF00-|r Replaced old report line saying 'for the last X segments' with 'overall data'.\n\n|cFFFFFF00-|r Mini-displays on statusbar are now more responsible to right button click.\n\n|cFFFFFF00-|r Added Mage's Greater Invisibility as cooldown.\n\n|cFFFFFF00v3.10.8 (|cFFFFCC00Mar 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improved aura creation.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show your pets.\n\n|cFFFFFF00-|r Fixed 'Raid Check' plugin food detection.\n\n|cFFFFFF00v3.10.6 (|cFFFFCC00Feb 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): several bug fixes and improvements.\n\n|cFFFFFF00-|r Encounter Details (plugin): added new tab showing enemy spells from the encounter with an aura creation panel.\n\n|cFFFFFF00-|r Encounter Details (plugin): added phase indicators on graphic tab, hovering over shows the damage and heal for that specific phase.\n\n|cFFFFFF00-|r Segments menu now also show the encounter try number plus the elapsed combat time.\n\n|cFFFFFF00-|r Several improvements on Overall Data, also, now it has an option to not save it when the character logoff.\n\n|cFFFFFF00-|r Player Details window now closes with right click on any bar.\n\n|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n|cFFFFFF00v3.9.12a (|cFFFFCC00Feb 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Roll back on combat detection after reset data, might be causing problems.\n\n|cFFFFFF00v3.9.12 (|cFFFFCC00Feb 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): got report buttons for Endurance and Deaths Overall Damage.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): the Deaths and Endurance limits can now be changed under the plugin options.\n\n|cFFFFFF00-|r Chart Viewer (plugin): has been revamped and now it's less complicated to use." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.14.1 (|cFFFFCC00May 15, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n|cFFFFFF00v3.14.0b (|cFFFFCC00May 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Several texture changes for a smaller download size.\n\n|cFFFFFF00v3.13.4a (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created 'Details! Forge' but is still under development: /details forge.\n\n|cFFFFFF00-|r Several improvements on combatlog reader and custom displays.\n\n|cFFFFFF00-|r Improvements on enemies damage taken tooltip.\n\n|cFFFFFF00v3.13.1 (|cFFFFCC00April 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added casted amount for healing and damage spells. The result is shown on Player Detail Window and Comparison Panel.\n\n|cFFFFFF00-|r Added uptime amount for healing spells on Player Detail Window.\n\n|cFFFFFF00-|r Added an option to disable lock/resize/ungroup buttons. It's under miscellaneous bracket on Options Panel.\n\n|cFFFFFF00-|r Wallpaper for menus on title bar got a customization option under tooltips bracket on Options Panel.\n\n|cFFFFFF00-|r Updated spell list for Crowd Control and class detection.\n\n|cFFFFFF00-|r Improved Weakaura creation tool under Encounter Details Plugin.\n\n|cFFFFFF00v3.12.10 (|cFFFFCC00April 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added the spell uptime on damage player detail window.\n\n|cFFFFFF00-|r Added Rune Tap as cooldown.\n\n|cFFFFFF00-|r Report lines for deaths is now inverted. No need to scroll up the chat to see the cause of death anymore.\n\n|cFFFFFF00-|r Fixed some annoyances with auto current feature where it was changing the segments even when the user were using the window.\n\n|cFFFFFF00v3.12.7 (|cFFFFCC00April 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added slash command /details profile .\n\n|cFFFFFF00v3.12.6 (|cFFFFCC00May 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): added a report button on Emotes tab.\n\n|cFFFFFF00-|r Encounter Details (plugin): improved Weakauras creation.\n\n|cFFFFFF00-|r Encounter Details (plugin): fixed the report text for interrupts and dispells.\n\n|cFFFFFF00-|r Crowd control by Pets now is merged with its owner.\n\n|cFFFFFF00-|r Truncated left text on bars now shows the entire text when hover over the bar.\n\n|cFFFFFF00-|r Added an extra option on minimap menu to disable the minimap icon.\n\n|cFFFFFF00-|r Fixed a problem when disabling the minimap icon through options panel.\n\n|cFFFFFF00-|r Fixed an issue with item level tracker feature.\n\n|cFFFFFF00v3.12.2 (|cFFFFCC00Mar 30, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Raid Check (plugin): added item level.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): bug fixes, it's important to update it.\n\n|cFFFFFF00-|r Time Line (plugin): bug fixes.\n\n|cFFFFFF00-|r Added option to disabled th eitem level tracker.\n\n|cFFFFFF00-|r Added item level on Raid Check plugin panel.\n\n|cFFFFFF00-|r Added Spirit Link Totem damage and healing on death log.\n\n|cFFFFFF00-|r Added the total of life exchanged by the Spirit Link Totem on player detail window.\n\n|cFFFFFF00-|r Added more spells for crowd control.\n\n|cFFFFFF00-|r Added scroll on bookmark panel.\n\n|cFFFFFF00-|r Fixed issue with Dps/Hps data broker which wasn't respecting the type of time (effective/activity) selected.\n\n|cFFFFFF00-|r Fixed few bugs when using the key bind to toggle windows.\n\n|cFFFFFF00v3.11.5 (|cFFFFCC00Mar 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with overall data where max/min amount for spells was being calculated wrong.\n\n|cFFFFFF00-|r Fixed a problem while reporting enemy damage taken.\n\n|cFFFFFF00-|r Fixed an issue with damage taken by spell where some spells wasn't shown.\n\n|cFFFFFF00-|r Few improvements on tooltips.\n\n|cFFFFFF00-|r Fixed a accuracy problem with shaman's spirit link toten where its life exchange was considered healing done.\n\n|cFFFFFF00-|r Boss segments now need to have at least 30 seconds to be added on the overall data.\n\n|cFFFFFF00-|r When the segment limit is reach, segments with less combat time will be erased instead of the olders.\n\n|cFFFFFF00-|r Added item level tracker.\n\n|cFFFFFF00-|r Fixed window positioning when changing from Solo mode to Group mode.\n\n|cFFFFFF00-|r Added an option for change the amount of lines on death log.\n\n|cFFFFFF00-|r Added custom display for CC done.\n\n|cFFFFFF00v3.10.10 (|cFFFFCC00Mar 10, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): done a calibration on endurance calculation.\n\n|cFFFFFF00-|r Raid Check (plugin): now also show information for 50+ stats runes.\n\n|cFFFFFF00-|r Fixed cooldowns spell targets on overall data.\n\n|cFFFFFF00-|r Fixed report custom displays where sometimes it didn't report spell links.\n\n|cFFFFFF00-|r Replaced old report line saying 'for the last X segments' with 'overall data'.\n\n|cFFFFFF00-|r Mini-displays on statusbar are now more responsible to right button click.\n\n|cFFFFFF00-|r Added Mage's Greater Invisibility as cooldown.\n\n|cFFFFFF00v3.10.8 (|cFFFFCC00Mar 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improved aura creation.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show your pets.\n\n|cFFFFFF00-|r Fixed 'Raid Check' plugin food detection.\n\n|cFFFFFF00v3.10.6 (|cFFFFCC00Feb 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Encounter Details (plugin): several bug fixes and improvements.\n\n|cFFFFFF00-|r Encounter Details (plugin): added new tab showing enemy spells from the encounter with an aura creation panel.\n\n|cFFFFFF00-|r Encounter Details (plugin): added phase indicators on graphic tab, hovering over shows the damage and heal for that specific phase.\n\n|cFFFFFF00-|r Segments menu now also show the encounter try number plus the elapsed combat time.\n\n|cFFFFFF00-|r Several improvements on Overall Data, also, now it has an option to not save it when the character logoff.\n\n|cFFFFFF00-|r Player Details window now closes with right click on any bar.\n\n|cFFFFFF00-|r Fixed Nature's Vigil cooldown.\n\n|cFFFFFF00v3.9.12a (|cFFFFCC00Feb 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Roll back on combat detection after reset data, might be causing problems.\n\n|cFFFFFF00v3.9.12 (|cFFFFCC00Feb 13, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): got report buttons for Endurance and Deaths Overall Damage.\n\n|cFFFFFF00-|r Advanced Death Logs (plugin): the Deaths and Endurance limits can now be changed under the plugin options.\n\n|cFFFFFF00-|r Chart Viewer (plugin): has been revamped and now it's less complicated to use." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " @@ -94,17 +94,18 @@ do [1134] = {file = "LoadingScreen_Shadowpan_bg", coords = {0, 1, 0.29296875, 0.857421875}}, -- Tiger's Peak --"LoadScreenOrgrimmarArena", --Ring of Valor } - --> armazena instancias inativas - _detalhes.unused_instances = {} - _detalhes.default_skin_to_use = "Minimalistic" - function _detalhes:GetArenaInfo (mapid) local t = _detalhes.arena_info [mapid] if (t) then return t.file, t.coords end end - + --> armazena instancias inativas + _detalhes.unused_instances = {} + _detalhes.default_skin_to_use = "Minimalistic" + --> player detail skin + _detalhes.playerdetailwindow_skins = {} + --> tooltip _detalhes.tooltip_backdrop = { bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], @@ -252,7 +253,7 @@ do local _UIParent = UIParent --api locals --> Info Window - _detalhes.janela_info = _CreateFrame ("Frame", "Details_JanelaInfo", _UIParent) + _detalhes.janela_info = _CreateFrame ("Frame", "DetailsPlayerDetailsWindow", _UIParent) --> Event Frame _detalhes.listener = _CreateFrame ("Frame", nil, _UIParent) diff --git a/functions/profiles.lua b/functions/profiles.lua index 1d46ee6d..b93fd033 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -505,6 +505,9 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) --> update tooltip settings _detalhes:SetTooltipBackdrop() + + --> update player detail window + _detalhes:ApplyPDWSkin() if (_detalhes.initializing) then _detalhes.profile_loaded = true @@ -846,6 +849,13 @@ local default_profile = { disable_stretch_from_toolbar = false, disable_stretch_button = false, damage_taken_everything = false, + + --> info window + player_details_window = { + skin = "WoWClassic", + bar_texture = "Skyline", + scale = 1, + }, --> segments segments_amount = 12, diff --git a/gumps/janela_info.lua b/gumps/janela_info.lua index 92aa0020..53a9243c 100644 --- a/gumps/janela_info.lua +++ b/gumps/janela_info.lua @@ -232,7 +232,6 @@ function gump:TrocaBackgroundInfo() if (info.sub_atributo == 1 or info.sub_atributo == 2) then --> damage done / dps if (info.tipo ~= 1) then --> janela com as divisorias - info.bg1:SetTexture ([[Interface\AddOns\Details\images\info_window_background]]) info.bg1_sec_texture:SetTexture (nil) info.tipo = 1 end @@ -246,7 +245,6 @@ function gump:TrocaBackgroundInfo() elseif (info.sub_atributo == 3) then --> damage taken if (info.tipo ~= 2) then --> janela com fundo diferente - info.bg1:SetTexture ([[Interface\AddOns\Details\images\info_window_background]]) info.bg1_sec_texture:SetTexture ([[Interface\AddOns\Details\images\info_window_damagetaken]]) info.bg3_sec_texture:Show() info.bg2_sec_texture:Show() @@ -259,7 +257,6 @@ function gump:TrocaBackgroundInfo() elseif (info.sub_atributo == 4) then --> friendly fire if (info.tipo ~= 3) then --> janela com fundo diferente - info.bg1:SetTexture ([[Interface\AddOns\Details\images\info_window_background]]) info.bg1_sec_texture:SetTexture ([[Interface\AddOns\Details\images\info_window_damagetaken]]) info.bg3_sec_texture:Show() info.bg2_sec_texture:Show() @@ -269,7 +266,6 @@ function gump:TrocaBackgroundInfo() elseif (info.sub_atributo == 6) then --> enemies if (info.tipo ~= 3) then --> janela com fundo diferente - info.bg1:SetTexture ([[Interface\AddOns\Details\images\info_window_background]]) info.bg1_sec_texture:SetTexture ([[Interface\AddOns\Details\images\info_window_damagetaken]]) info.bg3_sec_texture:Show() info.bg2_sec_texture:Show() @@ -281,7 +277,6 @@ function gump:TrocaBackgroundInfo() elseif (info.atributo == 2) then --> HEALING if (info.sub_atributo == 1 or info.sub_atributo == 2 or info.sub_atributo == 3) then --> damage done / dps if (info.tipo ~= 1) then --> janela com as divisorias - info.bg1:SetTexture ([[Interface\AddOns\Details\images\info_window_background]]) info.bg1_sec_texture:SetTexture (nil) info.tipo = 1 end @@ -299,7 +294,6 @@ function gump:TrocaBackgroundInfo() elseif (info.sub_atributo == 4) then --> Healing taken if (info.tipo ~= 2) then --> janela com fundo diferente - info.bg1:SetTexture ([[Interface\AddOns\Details\images\info_window_background]]) info.bg1_sec_texture:SetTexture ([[Interface\AddOns\Details\images\info_window_damagetaken]]) info.bg3_sec_texture:Show() info.bg2_sec_texture:Show() @@ -313,7 +307,6 @@ function gump:TrocaBackgroundInfo() elseif (info.atributo == 3) then --> REGEN if (info.tipo ~= 2) then --> janela com fundo diferente - info.bg1:SetTexture ([[Interface\AddOns\Details\images\info_window_background]]) info.bg1_sec_texture:SetTexture (nil) info.tipo = 2 end @@ -321,7 +314,6 @@ function gump:TrocaBackgroundInfo() elseif (info.atributo == 4) then --> MISC if (info.tipo ~= 2) then --> janela com fundo diferente - info.bg1:SetTexture ([[Interface\AddOns\Details\images\info_window_background]]) info.bg1_sec_texture:SetTexture (nil) info.tipo = 2 end @@ -423,7 +415,7 @@ local function seta_scripts (este_gump) este_gump.container_alvos.gump:SetScript ("OnMouseUp", mouse_up_func) --> botão fechar - este_gump.fechar:SetScript ("OnClick", function (self) + este_gump.close_button:SetScript ("OnClick", function (self) _detalhes:FechaJanelaInfo() end) end @@ -766,14 +758,190 @@ local function cria_container_alvos (este_gump) este_gump.container_alvos = container_alvos_window end +function _detalhes:InstallPDWSkin (skin_name, func) + if (not skin_name) then + return false -- sem nome + elseif (_detalhes.playerdetailwindow_skins [skin_name]) then + return false -- ja existe + end + + _detalhes.playerdetailwindow_skins [skin_name] = func + return true +end + +function _detalhes:ApplyPDWSkin (skin_name) + +--already built + if (not DetailsPlayerDetailsWindow.Loaded) then + if (skin_name) then + _detalhes.player_details_window.skin = skin_name + end + return + end + +--hide extra frames + local window = DetailsPlayerDetailsWindow + if (window.extra_frames) then + for framename, frame in pairs (window.extra_frames) do + frame:Hide() + end + end + +--apply default first + local default_skin = _detalhes.playerdetailwindow_skins ["WoWClassic"] + pcall (default_skin.func) + +--than do the change + if (not skin_name) then + skin_name = _detalhes.player_details_window.skin + end + + local skin = _detalhes.playerdetailwindow_skins [skin_name] + if (skin) then + local successful, errortext = pcall (skin.func) + if (not successful) then + _detalhes:Msg ("error occurred on skin call():", errortext) + local former_skin = _detalhes.playerdetailwindow_skins [_detalhes.player_details_window.skin] + pcall (former_skin.func) + else + _detalhes.player_details_window.skin = skin_name + end + else + _detalhes:Msg ("skin not found.") + end +end + +function _detalhes:SetPlayerDetailsWindowTexture (texture) + DetailsPlayerDetailsWindow.bg1:SetTexture (texture) +end + +function _detalhes:SetPDWBarConfig (texture) + local window = DetailsPlayerDetailsWindow + + if (texture) then + _detalhes.player_details_window.bar_texture = texture + local texture = SharedMedia:Fetch ("statusbar", texture) + + for _, bar in ipairs (window.barras1) do + bar.textura:SetStatusBarTexture (texture) + end + for _, bar in ipairs (window.barras2) do + bar.textura:SetStatusBarTexture (texture) + end + for _, bar in ipairs (window.barras3) do + bar.textura:SetStatusBarTexture (texture) + end + end +end + +local default_skin = function() + local window = DetailsPlayerDetailsWindow + window.bg1:SetTexture ([[Interface\AddOns\Details\images\info_window_background]]) + window.bg1:SetSize (1024, 512) + window.bg1:SetAlpha (1) + window.bg1:SetVertexColor (1, 1, 1) + window:SetBackdrop (nil) + window:SetBackdropColor (1, 1, 1, 1) + window:SetBackdropBorderColor (1, 1, 1, 1) + window.classe_icone:SetDrawLayer ("background") + window.bg_icone_bg:Show() + window.bg_icone:Show() + + window.leftbars1_backgound:SetAlpha (1) + window.leftbars2_backgound:SetAlpha (1) + window.right_background1:SetAlpha (1) + window.right_background2:SetAlpha (1) + window.right_background3:SetAlpha (1) + window.right_background4:SetAlpha (1) + window.right_background5:SetAlpha (1) + + window.close_button:GetNormalTexture():SetDesaturated (false) + + window.title_string:ClearAllPoints() + window.title_string:SetPoint ("center", window, "center") + window.title_string:SetPoint ("top", window, "top", 0, -18) + window.title_string:SetParent (window) + + window.classe_icone:SetParent (window) + + window.close_button:SetWidth (32) + window.close_button:SetHeight (32) + window.close_button:SetPoint ("TOPRIGHT", window, "TOPRIGHT", 5, -8) + + window.avatar:SetParent (window) + + _detalhes:SetPDWBarConfig ("Skyline") +end +_detalhes:InstallPDWSkin ("WoWClassic", {func = default_skin, author = "Details! Team", version = "v1.0", desc = "Default skin."}) + +local elvui_skin = function() + local window = DetailsPlayerDetailsWindow + window.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + window.bg1:SetAlpha (0.7) + window.bg1:SetVertexColor (0.27, 0.27, 0.27) + window.bg1:SetVertTile (true) + window.bg1:SetHorizTile (true) + window.bg1:SetSize (590, 354) + window.classe_icone:SetDrawLayer ("overlay") + window:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + window:SetBackdropColor (1, 1, 1, 1) + window:SetBackdropBorderColor (0, 0, 0, 1) + window.bg_icone_bg:Hide() + window.bg_icone:Hide() + + local bgs_alpha = 0.6 + window.leftbars1_backgound:SetAlpha (bgs_alpha) + window.leftbars2_backgound:SetAlpha (bgs_alpha) + + window.right_background1:SetAlpha (bgs_alpha) + window.right_background2:SetAlpha (bgs_alpha) + window.right_background3:SetAlpha (bgs_alpha) + window.right_background4:SetAlpha (bgs_alpha) + window.right_background5:SetAlpha (bgs_alpha) + + window.close_button:GetNormalTexture():SetDesaturated (true) + + local titlebar = window.extra_frames ["ElvUITitleBar"] + if (not titlebar) then + titlebar = CreateFrame ("frame", nil, window) + titlebar:SetPoint ("topleft", window, "topleft", 2, -3) + titlebar:SetPoint ("topright", window, "topright", -2, -3) + titlebar:SetHeight (20) + titlebar:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titlebar:SetBackdropColor (.5, .5, .5, 1) + titlebar:SetBackdropBorderColor (0, 0, 0, 1) + window.extra_frames ["ElvUITitleBar"] = titlebar + else + titlebar:Show() + end + + window.title_string:ClearAllPoints() + window.title_string:SetPoint ("center", window, "center") + window.title_string:SetPoint ("top", window, "top", 0, -8) + window.title_string:SetParent (titlebar) + + window.classe_icone:SetParent (titlebar) + + window.close_button:SetWidth (20) + window.close_button:SetHeight (20) + window.close_button:SetPoint ("TOPRIGHT", window, "TOPRIGHT", 0, -3) + + window.avatar:SetParent (titlebar) +end +_detalhes:InstallPDWSkin ("ElvUI", {func = elvui_skin, author = "Details! Team", version = "v1.0", desc = "Skin compatible with ElvUI addon."}) + --> search key: ~create ~inicio function gump:CriaJanelaInfo() --> cria a janela em si local este_gump = info + este_gump.Loaded = true + este_gump:SetFrameStrata ("HIGH") este_gump:SetToplevel (true) + este_gump.extra_frames = {} + --> fehcar com o esc tinsert (UISpecialFrames, este_gump:GetName()) @@ -788,9 +956,7 @@ function gump:CriaJanelaInfo() --> joga a janela para a global _detalhes.janela_info = este_gump - - --> começa a montar as texturas <-- - + --> icone da classe no canto esquerdo superior este_gump.classe_icone = este_gump:CreateTexture (nil, "BACKGROUND") este_gump.classe_icone:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 4, 0) @@ -805,15 +971,10 @@ function gump:CriaJanelaInfo() este_gump.classe_iconePlus:SetDrawLayer ("BACKGROUND", 2) --> top left - este_gump.bg1 = este_gump:CreateTexture (nil, "BORDER") + este_gump.bg1 = este_gump:CreateTexture ("DetailsPSWBackground", "BORDER") este_gump.bg1:SetPoint ("TOPLEFT", este_gump, "TOPLEFT", 0, 0) este_gump.bg1:SetDrawLayer ("BORDER", 1) - - function _detalhes:SetPlayerDetailsWindowTexture (texture) - este_gump.bg1:SetTexture (texture) - end - _detalhes:SetPlayerDetailsWindowTexture ("Interface\\AddOns\\Details\\images\\info_window_background") - + -- local alpha_bgs = 1 @@ -822,45 +983,50 @@ function gump:CriaJanelaInfo() leftbars1_backgound:SetPoint ("topleft", este_gump, "topleft", 19, -74) leftbars1_backgound:SetSize (303, 149) leftbars1_backgound:SetAlpha (alpha_bgs) + este_gump.leftbars1_backgound = leftbars1_backgound local leftbars2_backgound = este_gump:CreateTexture (nil, "background") leftbars2_backgound:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) leftbars2_backgound:SetPoint ("topleft", este_gump, "topleft", 19, -226) leftbars2_backgound:SetSize (303, 122) leftbars2_backgound:SetAlpha (alpha_bgs) + este_gump.leftbars2_backgound = leftbars2_backgound -- local right_background1 = este_gump:CreateTexture (nil, "background") right_background1:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) right_background1:SetPoint ("topleft", este_gump, "topleft", 357, -85) right_background1:SetSize (220, 43) right_background1:SetAlpha (alpha_bgs) + este_gump.right_background1 = right_background1 local right_background2 = este_gump:CreateTexture (nil, "background") right_background2:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) - right_background2:SetPoint ("topleft", este_gump, "topleft", 357, -135) + right_background2:SetPoint ("topleft", este_gump, "topleft", 357, -136) right_background2:SetSize (220, 48) right_background2:SetAlpha (alpha_bgs) + este_gump.right_background2 = right_background2 local right_background3 = este_gump:CreateTexture (nil, "background") right_background3:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) right_background3:SetPoint ("topleft", este_gump, "topleft", 357, -191) right_background3:SetSize (220, 48) right_background3:SetAlpha (alpha_bgs) + este_gump.right_background3 = right_background3 local right_background4 = este_gump:CreateTexture (nil, "background") right_background4:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) right_background4:SetPoint ("topleft", este_gump, "topleft", 357, -246) right_background4:SetSize (220, 48) right_background4:SetAlpha (alpha_bgs) + este_gump.right_background4 = right_background4 local right_background5 = este_gump:CreateTexture (nil, "background") right_background5:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) right_background5:SetPoint ("topleft", este_gump, "topleft", 357, -301) right_background5:SetSize (220, 48) right_background5:SetAlpha (alpha_bgs) - + este_gump.right_background5 = right_background5 -- - este_gump.bg1_sec_texture = este_gump:CreateTexture (nil, "BORDER") este_gump.bg1_sec_texture:SetDrawLayer ("BORDER", 4) este_gump.bg1_sec_texture:SetPoint ("topleft", este_gump.bg1, "topleft", 348, -86) @@ -884,12 +1050,12 @@ function gump:CriaJanelaInfo() este_gump.bg3_sec_texture:Hide() --> botão de fechar - este_gump.fechar = _CreateFrame ("Button", nil, este_gump, "UIPanelCloseButton") - este_gump.fechar:SetWidth (32) - este_gump.fechar:SetHeight (32) - este_gump.fechar:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", 5, -8) - este_gump.fechar:SetText ("X") - este_gump.fechar:SetFrameLevel (este_gump:GetFrameLevel()+2) + este_gump.close_button = _CreateFrame ("Button", nil, este_gump, "UIPanelCloseButton") + este_gump.close_button:SetWidth (32) + este_gump.close_button:SetHeight (32) + este_gump.close_button:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", 5, -8) + este_gump.close_button:SetText ("X") + este_gump.close_button:SetFrameLevel (este_gump:GetFrameLevel()+5) este_gump.no_targets = este_gump:CreateTexture (nil, "overlay") este_gump.no_targets:SetPoint ("BOTTOMLEFT", este_gump, "BOTTOMLEFT", 20, 6) @@ -905,9 +1071,9 @@ function gump:CriaJanelaInfo() este_gump.no_targets:Hide() --> titulo - gump:NewLabel (este_gump, este_gump, nil, "titulo", Loc ["STRING_PLAYER_DETAILS"], "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) - este_gump.titulo:SetPoint ("center", este_gump, "center") - este_gump.titulo:SetPoint ("top", este_gump, "top", 0, -18) + gump:NewLabel (este_gump, este_gump, nil, "title_string", Loc ["STRING_PLAYER_DETAILS"], "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) + este_gump.title_string:SetPoint ("center", este_gump, "center") + este_gump.title_string:SetPoint ("top", este_gump, "top", 0, -18) --> cria os textos da janela cria_textos (este_gump) @@ -961,7 +1127,7 @@ function gump:CriaJanelaInfo() este_gump.bg_icone:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", -15, -12) este_gump.bg_icone:SetTexture ("Interface\\AddOns\\Details\\images\\icone_bg") este_gump.bg_icone:Show() - + --este_gump:Hide() este_gump.spell_icone = este_gump:CreateTexture (nil, "ARTWORK") @@ -970,6 +1136,8 @@ function gump:CriaJanelaInfo() este_gump.spell_icone:SetHeight (34) este_gump.spell_icone:SetDrawLayer ("ARTWORK", 0) este_gump.spell_icone:Show() + este_gump.spell_icone:SetTexCoord (4/64, 60/64, 4/64, 60/64) + --> coisinhas do lado do icone este_gump.apoio_icone_esquerdo = este_gump:CreateTexture (nil, "ARTWORK") @@ -994,6 +1162,12 @@ function gump:CriaJanelaInfo() "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", "Interface\\COMMON\\VOICECHAT-ON", nil, "DetailsJanelaInfoReport4") este_gump.report_direita:SetPoint ("TOPRIGHT", este_gump, "TOPRIGHT", -8, -57) este_gump.report_direita:Hide() + + --> apply default skin + _detalhes:ApplyPDWSkin() + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> tabs local red = "FFFFAAAA" local green = "FFAAFFAA" @@ -2437,7 +2611,7 @@ function gump:CriaJanelaInfo() else local spellname = GetSpellInfo (spellid) local extra_search_found - for casted_spellid, amount in _pairs (player1_misc.spell_cast) do + for casted_spellid, amount in _pairs (player1_misc.spell_cast or {}) do local casted_spellname = GetSpellInfo (casted_spellid) if (casted_spellname == spellname) then frame1.tooltip.casts_label2:SetText (amount) @@ -2552,7 +2726,7 @@ function gump:CriaJanelaInfo() local amt_casts = player2_misc.spell_cast and player2_misc.spell_cast [spellid] if (not amt_casts) then local spellname = GetSpellInfo (spellid) - for casted_spellid, amount in _pairs (player2_misc.spell_cast) do + for casted_spellid, amount in _pairs (player2_misc.spell_cast or {}) do local casted_spellname = GetSpellInfo (casted_spellid) if (casted_spellname == spellname) then amt_casts = amount @@ -2688,7 +2862,7 @@ function gump:CriaJanelaInfo() local amt_casts = player3_misc.spell_cast and player3_misc.spell_cast [spellid] if (not amt_casts) then local spellname = GetSpellInfo (spellid) - for casted_spellid, amount in _pairs (player3_misc.spell_cast) do + for casted_spellid, amount in _pairs (player3_misc.spell_cast or {}) do local casted_spellname = GetSpellInfo (casted_spellid) if (casted_spellname == spellname) then amt_casts = amount @@ -3740,9 +3914,10 @@ local function CriaTexturaBarra (instancia, barra) barra.textura:SetAllPoints (barra) barra.textura:SetAlpha (0.5) - --barra.textura:SetStatusBarTexture ([[Interface\AddOns\Details\images\bar_serenity]]) - barra.textura:SetStatusBarTexture ([[Interface\AddOns\Details\images\bar_skyline]]) - --barra.textura:SetStatusBarTexture (_detalhes.default_texture) + + local texture = SharedMedia:Fetch ("statusbar", _detalhes.player_details_window.bar_texture) + barra.textura:SetStatusBarTexture (texture) + barra.textura:SetStatusBarColor (.5, .5, .5, 0) barra.textura:SetMinMaxValues (0,100) diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 01b26179..eaa441e0 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -5239,6 +5239,35 @@ function window:CreateFrame3() window:CreateLineBackground2 (frame3, "ImportButton", "ImportButton", Loc ["STRING_OPTIONS_SAVELOAD_IMPORT_DESC"], nil, {1, 0.8, 0}, button_color_rgb) + --> player detail window + g:NewLabel (frame3, _, "$parentPDWAnchor", "PDWAnchor", Loc ["STRING_OPTIONS_PDW_ANCHOR"], "GameFontNormal") + + --skin + local onSelectPDWSkin = function (_, instance, skin_name) + _detalhes:ApplyPDWSkin (skin_name) + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + local buildPDWSkinMenu = function() + local skinOptions = {} + for skin_name, skin_table in pairs (_detalhes.playerdetailwindow_skins) do + local desc = "Author: |cFFFFFFFF" .. skin_table.author .. "|r\nVersion: |cFFFFFFFF" .. skin_table.version .. "|r\n\nDesc: |cFFFFFFFF" .. skin_table.desc .. "|r" + skinOptions [#skinOptions+1] = {value = skin_name, label = skin_name, onclick = onSelectPDWSkin, icon = "Interface\\GossipFrame\\TabardGossipIcon", desc = desc} + end + return skinOptions + end + + -- skin + local d = g:NewDropDown (frame3, _, "$parentPDWSkinDropdown", "PDWSkinDropdown", 160, dropdown_height, buildPDWSkinMenu, 1) + d.onenter_backdrop = dropdown_backdrop_onenter + d.onleave_backdrop = dropdown_backdrop_onleave + d:SetBackdrop (dropdown_backdrop) + d:SetBackdropColor (unpack (dropdown_backdrop_onleave)); d:SetBackdropBorderColor (unpack (dropdown_backdrop_border_color)) + + g:NewLabel (frame3, _, "$parentPDWSkinLabel", "PDWSkinLabel", Loc ["STRING_OPTIONS_INSTANCE_SKIN"], "GameFontHighlightLeft") + window:CreateLineBackground2 (frame3, "PDWSkinDropdown", "PDWSkinLabel", Loc ["STRING_OPTIONS_PDW_SKIN_DESC"]) + frame3.PDWSkinDropdown:SetPoint ("left", frame3.PDWSkinLabel, "right", 2) + --> extra Options g:NewLabel (frame3, _, "$parentSkinExtraOptionsAnchor", "SkinExtraOptionsAnchor", Loc ["STRING_OPTIONS_SKIN_EXTRA_OPTIONS_ANCHOR"], "GameFontNormal") --frame3.SkinExtraOptionsAnchor:Hide() @@ -5271,7 +5300,10 @@ function window:CreateFrame3() {"ImportButton", 9, true}, {"makeDefault", 10}, {"applyToAll", 11}, - --{"", 10}, + + {"PDWAnchor", 12, true}, + {"PDWSkinLabel", 13}, + } window:arrange_menu (frame3, left_side, x, -90) @@ -10076,6 +10108,8 @@ end --> if not window _G.DetailsOptionsWindow3SkinDropdown.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow3SkinDropdown.MyObject:Select (skin) + _G.DetailsOptionsWindow3PDWSkinDropdown.MyObject:Select (_detalhes.player_details_window.skin) + local skin_object = editing_instance:GetSkin() local skin_name_formated = skin:gsub (" ", "") diff --git a/gumps/janela_welcome.lua b/gumps/janela_welcome.lua index 37067feb..4cb2b1ea 100644 --- a/gumps/janela_welcome.lua +++ b/gumps/janela_welcome.lua @@ -193,6 +193,8 @@ function _detalhes:OpenWelcomeWindow () end end _detalhes.standard_skin = savedObject + + _detalhes:ApplyPDWSkin ("ElvUI") end -- frame alert diff --git a/startup.lua b/startup.lua index 21c40bd0..b2ff801c 100644 --- a/startup.lua +++ b/startup.lua @@ -161,8 +161,6 @@ function _G._detalhes:Start() function _detalhes:CheckWallpaperAfterStartup() - --print ("1 Checking WallPaper...") - if (not _detalhes.profile_loaded) then return _detalhes:ScheduleTimer ("CheckWallpaperAfterStartup", 2) end @@ -173,16 +171,11 @@ function _G._detalhes:Start() if (not instance.wallpaper.enabled) then instance:InstanceWallpaper (false) end - - --print ("==== 2 Moving Window ", instance.meu_id, instance.ativa) - --vardump (instance.snap) - --print ("===============") - + instance.do_not_snap = true self.move_janela_func (instance.baseframe, true, instance, true) self.move_janela_func (instance.baseframe, false, instance, true) instance.do_not_snap = false - end end self.CheckWallpaperAfterStartup = nil @@ -346,6 +339,17 @@ function _G._detalhes:Start() _detalhes:FillUserCustomSpells() _detalhes:AddDefaultCustomDisplays() + --> check elvui for the new player detail skin + if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < 69 and enable_reset_warning) then + function _detalhes:PDWElvuiCheck() + local ElvUI = _G.ElvUI + if (ElvUI) then + _detalhes:ApplyPDWSkin ("ElvUI") + end + end + _detalhes:ScheduleTimer ("PDWElvuiCheck", 1) + end + --> Reset for the new structure if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < 66 and enable_reset_warning) then function _detalhes:ResetDataStorage()