diff --git a/boot.lua b/boot.lua index f5245523..7976907a 100644 --- a/boot.lua +++ b/boot.lua @@ -1,10 +1,10 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> global name declaration - + _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 83 --it's 88 for release - _detalhes.userversion = "a1.28.1" + _detalhes.build_counter = 83 --it's 89 for release + _detalhes.userversion = "a1.28.2" _detalhes.realversion = 28 _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" @@ -25,10 +25,11 @@ do |cFFFFFF00-|r Added auto erase/ask to erase options.\n\n |cFFFFFF00-|r Bars now highlight when hover over.\n\n |cFFFFFF00-|r Fixed problem with drag the window when the toolbar is on the bottom side.\n\n +|cFFFFFF00-|r Added scale option.\n\n --]] - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00a1.28.0 (|cFFFFCC00Set 29, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r Added option to use the same profile on all characters without asking.\n\n|cFFFFFF00-|r Added a shortcut color button on main panel on Options Panel.\n\n|cFFFFFF00-|r Added auto erase/ask to erase options.\n\n|cFFFFFF00-|r Bars now highlight when hover over.\n\n|cFFFFFF00-|r Fixed problem with drag the window when the toolbar is on the bottom side.\n\n|cFFFFFF00v1.27.0 (|cFFFFCC00Set 27, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Minimalistic skin is now the old minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 got a new texture, little more darker.\n\n|cFFFFFF00-|r Few tweaks to make more easy making groups of windows.\n\n|cFFFFFF00-|r Bookmark now accepts more than two columns.\n\n|cFFFFFF00v1.26.3 (|cFFFFCC00Set 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Changed the way to set the broker text to be more customizable.\n\n|cFFFFFF00-|r Fixed the problem with custom display report.\n\n|cFFFFFF00-|r Added tutorial and a config panel for bookmarks.\n\n|cFFFFFF00-|r Added option for choose the format type of data broker's text.\n\n|cFFFFFF00-|r Changed few icons on damage done tooltip.\n\n|cFFFFFF00-|r Fixed the class color on texts for healing attribute.\n\n|cFFFFFF00-|r Added options for change the tooltip border's size, color and texture.\n\n|cFFFFFF00-|r Added buttons for test interrupt and cooldown announcers under raid tools section.\n\n|cFFFFFF00v1.25.1 (|cFFFFCC00Set 09, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added buttons to edit the total and percentage code for custom displays.\n\n|cFFFFFF00-|r Fixed a problem while report custom displays.\n\n|cFFFFFF00-|r Added Acitivity Time for Damage + Healing, tooltip show the activity separately.\n\n|cFFFFFF00-|r Major changes on Encounter Details Plugin making more easy to use.\n\n|cFFFFFF00-|r Removed Spell Details Plugin.\n\n|cFFFFFF00-|r Added new plugin for Solo Mode: Dps Tuning.\n\n|cFFFFFF00v1.24.5 (|cFFFFCC00Ago 31, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Raid Tools bracket on Options Panel.\n\n|cFFFFFF00-|r Added interrupt, cooldown and death announcers (raid tools).\n\n|cFFFFFF00-|r Added pre potion recognition, showing after the encounter on the chat only for you (raid tools).\n\n|cFFFFFF00-|r Added a Boss Emotes tab for Encounter Details plugin |cFF999999(thanks Bloodforce-Azralon)|r.\n\n|cFFFFFF00-|r Rework on Activity Time, now it is tuned to closely match warcraftlogs |cFF999999(thanks www.warcraftlogs.com)|r.\n\n|cFFFFFF00-|r Added two new customs: Damage Activity Time and Healing Activity Time.\n\n|cFFFFFF00-|r Time Attack Plugin now have six fixed time amount options for test your dps on training dummies.\n\n|cFFFFFF00-|r Time Attack Plugin can now also share results on your realm, between players with the same class.\n\n|cFFFFFF00v1.23.6 (|cFFFFCC00Ago 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 2 new bar textures and 6 new fonts.\n\n|cFFFFFF00-|r Swapped left and middle button for enemy bars, now left button open damage taken and middle button player detail window.\n\n|cFFFFFF00-|r Added new skin: Minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 is now the default skin.\n\n|cFFFFFF00-|r Few changes on both icon packs with transparency.\n\n|cFFFFFF00-|r Replaced the slash command '/d' with '/de' |cFF999999(thanks @kamuul-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added custom spells for Atonement, Power Word: Solance and Life Bloom |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00v1.22.4 (|cFFFFCC00Ago 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added new skin: ElvUI Frame Style (Black White).\n\n|cFFFFFF00-|r Align With Right Chat Window option now check if the window have statusbar enabled.\n\n|cFFFFFF00-|r Few improvements on report for Deaths and Spells over Player Detail Window.\n\n|cFFFFFF00-|r Added option to disable reset button (reset only using its tooltip menu).\n\n|cFFFFFF00-|r Added option for disable window groups.\n\n|cFFFFFF00-|r Added option for select the icon pack to use, also added black white icon pack.\n\n|cFFFFFF00-|r Fixed many bugs involving skins and profiles, thing should run more smooth now.\n\n|cFFFFFF00-|r Plugin Time Attack now correctly saves the attempt when pressing the big save button.\n\n|cFFFFFF00-|r Added support for hotcorners.\n\n|cFFFFFF00v1.21.4 (|cFFFFCC00Ago 9, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Shaman's Ancestral Guidance on cooldowns list |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added a profile selection screen when Details! are running for the first time on a character.\n\n|cFFFFFF00-|r Added Menu Text Size option over miscellaneous section on options panel |cFF999999(thanks @ Revi-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed a bug over Healing Player Details Window where pets wasn't being shown |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed issue with summoning pets with unknown owners where it was breaking the summon of all the others pets. |cFF999999(thanks @ThunderLost-curse website)|r.\n\n|cFFFFFF00-|r Hot Corners isn't no more a part of Details!, instead of that, Hot Corner is now a standalone addon which needs to be installed separately for who wants to use it.\n\n|cFFFFFF00-|r Skin data is now stored inside the profiles, many code parts got rewrite, still may have few bugs but it's more reliable then before.\n\n|cFFFFFF00-|r Rework on Auras and Voidzones: now shows damage, dps and percentage. Also its tooltip got fixes and now shows the correct damage done to players.\n\n|cFFFFFF00-|r Tooltip for Enemies now shows damage taken from players |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Right clicking a real-time enemy bar, makes it back to Enemies display instead of show Bookmark panel |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Tank comparison from previous segment now uses the same percentage method from player comparison panel.\n\n|cFFFFFF00-|r Fix bug with the slash command 'show' where was ignoring the window limit set on options panel |cFF999999(thanks @Castiel-US-Azralon realm)|r.\n\n|cFFFFFF00-|r Fixed few bugs with scroll bars, including scrolls on dropdown menu and player detail window |cFF999999(thanks @Revi-mmochampion forum)|r.\n\n|cFFFFFF00v1.20.2 (|cFFFFCC00Aug 1, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a option under Miscellaneous section to provide spell link instead of spell name for helpful spells when reporting a death |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Improvements done on how deaths are handled, now latest events before death will be more precise.\n\n|cFFFFFF00-|r Implemented Damage Taken from environment like lava, gravity, etc.\n\n|cFFFFFF00-|r Added Warlock's Fire and Brimstone spell on customized spells.\n\n|cFFFFFF00-|r Added dwarf racial Stone Form on cooldown list |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Bookmark now are shared between all characters.\n\n|cFFFFFF00-|r Fixed few inconsistencies with trash recognition.\n\n|cFFFFFF00-|r Fixed Cloud Capture where sometimes it wasn't sharing.\n\n|cFFFFFF00-|r Fixed report where it wasn't sharing for guild and raid when the player name box were empty.\n\n|cFFFFFF00-|r Report box now also saves the position and the last channel used to report |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r You Are Not Prepared plugin now have tooltips for spells and its window auto opens after a boss encounter.\n\n|cFFFFFF00-|r Advanced Death Logs plugin got full rewrite (and still are in development)." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00a1.28.2 (|cFFFFCC00Oct 03, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added scale option.\n\n|cFFFFFF00-|r Added a Change Log button on Options Panel.\n\n|cFFFFFF00-|r Added option to use the same profile on all characters without asking.\n\n|cFFFFFF00-|r Added a shortcut color button on main panel on Options Panel.\n\n|cFFFFFF00-|r Added auto erase/ask to erase options.\n\n|cFFFFFF00-|r Bars now highlight when hover over.\n\n|cFFFFFF00-|r Fixed problem with drag the window when the toolbar is on the bottom side.\n\n|cFFFFFF00v1.27.0 (|cFFFFCC00Set 27, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Minimalistic skin is now the old minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 got a new texture, little more darker.\n\n|cFFFFFF00-|r Few tweaks to make more easy making groups of windows.\n\n|cFFFFFF00-|r Bookmark now accepts more than two columns.\n\n|cFFFFFF00v1.26.3 (|cFFFFCC00Set 18, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Changed the way to set the broker text to be more customizable.\n\n|cFFFFFF00-|r Fixed the problem with custom display report.\n\n|cFFFFFF00-|r Added tutorial and a config panel for bookmarks.\n\n|cFFFFFF00-|r Added option for choose the format type of data broker's text.\n\n|cFFFFFF00-|r Changed few icons on damage done tooltip.\n\n|cFFFFFF00-|r Fixed the class color on texts for healing attribute.\n\n|cFFFFFF00-|r Added options for change the tooltip border's size, color and texture.\n\n|cFFFFFF00-|r Added buttons for test interrupt and cooldown announcers under raid tools section.\n\n|cFFFFFF00v1.25.1 (|cFFFFCC00Set 09, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added buttons to edit the total and percentage code for custom displays.\n\n|cFFFFFF00-|r Fixed a problem while report custom displays.\n\n|cFFFFFF00-|r Added Acitivity Time for Damage + Healing, tooltip show the activity separately.\n\n|cFFFFFF00-|r Major changes on Encounter Details Plugin making more easy to use.\n\n|cFFFFFF00-|r Removed Spell Details Plugin.\n\n|cFFFFFF00-|r Added new plugin for Solo Mode: Dps Tuning.\n\n|cFFFFFF00v1.24.5 (|cFFFFCC00Ago 31, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Raid Tools bracket on Options Panel.\n\n|cFFFFFF00-|r Added interrupt, cooldown and death announcers (raid tools).\n\n|cFFFFFF00-|r Added pre potion recognition, showing after the encounter on the chat only for you (raid tools).\n\n|cFFFFFF00-|r Added a Boss Emotes tab for Encounter Details plugin |cFF999999(thanks Bloodforce-Azralon)|r.\n\n|cFFFFFF00-|r Rework on Activity Time, now it is tuned to closely match warcraftlogs |cFF999999(thanks www.warcraftlogs.com)|r.\n\n|cFFFFFF00-|r Added two new customs: Damage Activity Time and Healing Activity Time.\n\n|cFFFFFF00-|r Time Attack Plugin now have six fixed time amount options for test your dps on training dummies.\n\n|cFFFFFF00-|r Time Attack Plugin can now also share results on your realm, between players with the same class.\n\n|cFFFFFF00v1.23.6 (|cFFFFCC00Ago 24, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 2 new bar textures and 6 new fonts.\n\n|cFFFFFF00-|r Swapped left and middle button for enemy bars, now left button open damage taken and middle button player detail window.\n\n|cFFFFFF00-|r Added new skin: Minimalistic v2.\n\n|cFFFFFF00-|r Minimalistic v2 is now the default skin.\n\n|cFFFFFF00-|r Few changes on both icon packs with transparency.\n\n|cFFFFFF00-|r Replaced the slash command '/d' with '/de' |cFF999999(thanks @kamuul-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added custom spells for Atonement, Power Word: Solance and Life Bloom |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00v1.22.4 (|cFFFFCC00Ago 15, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added new skin: ElvUI Frame Style (Black White).\n\n|cFFFFFF00-|r Align With Right Chat Window option now check if the window have statusbar enabled.\n\n|cFFFFFF00-|r Few improvements on report for Deaths and Spells over Player Detail Window.\n\n|cFFFFFF00-|r Added option to disable reset button (reset only using its tooltip menu).\n\n|cFFFFFF00-|r Added option for disable window groups.\n\n|cFFFFFF00-|r Added option for select the icon pack to use, also added black white icon pack.\n\n|cFFFFFF00-|r Fixed many bugs involving skins and profiles, thing should run more smooth now.\n\n|cFFFFFF00-|r Plugin Time Attack now correctly saves the attempt when pressing the big save button.\n\n|cFFFFFF00-|r Added support for hotcorners.\n\n|cFFFFFF00v1.21.4 (|cFFFFCC00Ago 9, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added Shaman's Ancestral Guidance on cooldowns list |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added a profile selection screen when Details! are running for the first time on a character.\n\n|cFFFFFF00-|r Added Menu Text Size option over miscellaneous section on options panel |cFF999999(thanks @ Revi-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed a bug over Healing Player Details Window where pets wasn't being shown |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed issue with summoning pets with unknown owners where it was breaking the summon of all the others pets. |cFF999999(thanks @ThunderLost-curse website)|r.\n\n|cFFFFFF00-|r Hot Corners isn't no more a part of Details!, instead of that, Hot Corner is now a standalone addon which needs to be installed separately for who wants to use it.\n\n|cFFFFFF00-|r Skin data is now stored inside the profiles, many code parts got rewrite, still may have few bugs but it's more reliable then before.\n\n|cFFFFFF00-|r Rework on Auras and Voidzones: now shows damage, dps and percentage. Also its tooltip got fixes and now shows the correct damage done to players.\n\n|cFFFFFF00-|r Tooltip for Enemies now shows damage taken from players |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Right clicking a real-time enemy bar, makes it back to Enemies display instead of show Bookmark panel |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00-|r Tank comparison from previous segment now uses the same percentage method from player comparison panel.\n\n|cFFFFFF00-|r Fix bug with the slash command 'show' where was ignoring the window limit set on options panel |cFF999999(thanks @Castiel-US-Azralon realm)|r.\n\n|cFFFFFF00-|r Fixed few bugs with scroll bars, including scrolls on dropdown menu and player detail window |cFF999999(thanks @Revi-mmochampion forum)|r.\n\n|cFFFFFF00v1.20.2 (|cFFFFCC00Aug 1, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a option under Miscellaneous section to provide spell link instead of spell name for helpful spells when reporting a death |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Improvements done on how deaths are handled, now latest events before death will be more precise.\n\n|cFFFFFF00-|r Implemented Damage Taken from environment like lava, gravity, etc.\n\n|cFFFFFF00-|r Added Warlock's Fire and Brimstone spell on customized spells." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " --> startup diff --git a/classes/classe_instancia.lua b/classes/classe_instancia.lua index f7b93e98..7721148b 100644 --- a/classes/classe_instancia.lua +++ b/classes/classe_instancia.lua @@ -644,13 +644,18 @@ function _detalhes:EstaAgrupada (esta_instancia, lado) --> lado //// 1 = encosto end function _detalhes:BaseFrameSnap() - for meu_id, instancia in _ipairs (_detalhes.tabela_instancias) do if (instancia:IsAtiva()) then instancia.baseframe:ClearAllPoints() end end + local group = self:GetInstanceGroup() + local scale = self.window_scale + for _, instance in _ipairs (group) do + instance:SetWindowScale (scale) + end + local my_baseframe = self.baseframe for lado, snap_to in _pairs (self.snap) do --print ("DEBUG instancia " .. snap_to .. " lado "..lado) @@ -774,12 +779,14 @@ end function _detalhes:agrupar_janelas (lados) local instancia = self - + for lado, esta_instancia in _pairs (lados) do if (esta_instancia) then instancia.baseframe:ClearAllPoints() esta_instancia = _detalhes.tabela_instancias [esta_instancia] + instancia:SetWindowScale (esta_instancia.window_scale) + if (lado == 3) then --> direita --> mover frame instancia.baseframe:SetPoint ("TOPRIGHT", esta_instancia.baseframe, "TOPLEFT") @@ -1624,7 +1631,24 @@ function _detalhes:SetBackgroundAlpha (alpha) end function _detalhes:GetSize() - return self.bgframe:GetWidth(), self.bgframe:GetHeight() + return self.baseframe:GetWidth(), self.baseframe:GetHeight() +end + +function _detalhes:GetRealSize() + return self.baseframe:GetWidth() * self.baseframe:GetScale(), self.baseframe:GetHeight() * self.baseframe:GetScale() +end + +function _detalhes:GetPositionOnScreen() + local xOfs, yOfs = self.baseframe:GetCenter() + if (not xOfs) then + return + end + -- credits to ckknight (http://www.curseforge.com/profiles/ckknight/) + local _scale = self.baseframe:GetEffectiveScale() + local _UIscale = UIParent:GetScale() + xOfs = xOfs*_scale - GetScreenWidth()*_UIscale/2 + yOfs = yOfs*_scale - GetScreenHeight()*_UIscale/2 + return xOfs/_UIscale, yOfs/_UIscale end --> alias diff --git a/classes/classe_instancia_include.lua b/classes/classe_instancia_include.lua index 5698d41c..b0dfa574 100644 --- a/classes/classe_instancia_include.lua +++ b/classes/classe_instancia_include.lua @@ -45,6 +45,8 @@ _detalhes.instance_defaults = { --skin skin = "Minimalistic v2", + --scale + window_scale = 1.0, --baseframe backdrop bg_alpha = 0.7, bg_r = 0.0941, diff --git a/core/util.lua b/core/util.lua index 8873be33..6abac793 100644 --- a/core/util.lua +++ b/core/util.lua @@ -655,6 +655,10 @@ end --> todo: remove the function creation everytime this function run. function gump:Fade (frame, tipo, velocidade, parametros) + --if (frame.GetObjectType and frame:GetObjectType() == "Frame" and frame.GetName and type (frame:GetName()) == "string" and frame:GetName():find ("DetailsBaseFrame")) then + -- print (debugstack()) + --end + if (_type (frame) == "table") then if (frame.meu_id) then --> ups, é uma instância if (parametros == "barras") then --> hida todas as barras da instância diff --git a/core/windows.lua b/core/windows.lua index b0406075..670a666c 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -133,34 +133,35 @@ end function _detalhes:AtualizaPontos() - local xOfs, yOfs = self.baseframe:GetCenter() - - if (not xOfs) then + local _x, _y = self:GetPositionOnScreen() + if (not _x) then return end - - -- credits to ckknight (http://www.curseforge.com/profiles/ckknight/) - local _scale = self.baseframe:GetEffectiveScale() - local _UIscale = _UIParent:GetScale() - xOfs = xOfs*_scale - _GetScreenWidth()*_UIscale/2 - yOfs = yOfs*_scale - _GetScreenHeight()*_UIscale/2 - local _x = xOfs/_UIscale - local _y = yOfs/_UIscale - local _w = self.baseframe:GetWidth() - local _h = self.baseframe:GetHeight() - + local _w, _h = self:GetRealSize() + local metade_largura = _w/2 local metade_altura = _h/2 local statusbar_y_mod = 0 if (not self.show_statusbar) then - statusbar_y_mod = 14 + statusbar_y_mod = 14 * self.baseframe:GetScale() end - self.ponto1 = {x = _x - metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topleft - self.ponto2 = {x = _x - metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomleft - self.ponto3 = {x = _x + metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomright - self.ponto4 = {x = _x + metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topright + if (not self.ponto1) then + self.ponto1 = {x = _x - metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topleft + self.ponto2 = {x = _x - metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomleft + self.ponto3 = {x = _x + metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomright + self.ponto4 = {x = _x + metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topright + else + self.ponto1.x = _x - metade_largura + self.ponto1.y = _y + metade_altura + (statusbar_y_mod*-1) + self.ponto2.x = _x - metade_largura + self.ponto2.y = _y - metade_altura + statusbar_y_mod + self.ponto3.x = _x + metade_largura + self.ponto3.y = _y - metade_altura + statusbar_y_mod + self.ponto4.x = _x + metade_largura + self.ponto4.y = _y + metade_altura + (statusbar_y_mod*-1) + end end function _detalhes:SaveMainWindowPosition (instance) @@ -178,21 +179,14 @@ end --> calc position - local xOfs, yOfs = self.baseframe:GetCenter() - if (not xOfs) then + local _x, _y = self:GetPositionOnScreen() + if (not _x) then return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self) end - local _scale = self.baseframe:GetEffectiveScale() - local _UIscale = _UIParent:GetScale() - -- - xOfs = xOfs*_scale - _GetScreenWidth()*_UIscale/2 - yOfs = yOfs*_scale - _GetScreenHeight()*_UIscale/2 - + --> save the position local _w = baseframe_width local _h = baseframe_height - local _x = xOfs/_UIscale - local _y = yOfs/_UIscale self.posicao[mostrando].x = _x self.posicao[mostrando].y = _y @@ -208,14 +202,25 @@ statusbar_y_mod = 14 end - self.ponto1 = {x = _x - metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topleft - self.ponto2 = {x = _x - metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomleft - self.ponto3 = {x = _x + metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomright - self.ponto4 = {x = _x + metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topright + if (not self.ponto1) then + self.ponto1 = {x = _x - metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topleft + self.ponto2 = {x = _x - metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomleft + self.ponto3 = {x = _x + metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomright + self.ponto4 = {x = _x + metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topright + else + self.ponto1.x = _x - metade_largura + self.ponto1.y = _y + metade_altura + (statusbar_y_mod*-1) + self.ponto2.x = _x - metade_largura + self.ponto2.y = _y - metade_altura + statusbar_y_mod + self.ponto3.x = _x + metade_largura + self.ponto3.y = _y - metade_altura + statusbar_y_mod + self.ponto4.x = _x + metade_largura + self.ponto4.y = _y + metade_altura + (statusbar_y_mod*-1) + end self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight() - end_window_spacement --> espaço para o final da janela - return {altura = self.baseframe:GetHeight(), largura = self.baseframe:GetWidth(), x = xOfs/_UIscale, y = yOfs/_UIscale} + return {altura = self.baseframe:GetHeight(), largura = self.baseframe:GetWidth(), x = _x, y = _y} end function _detalhes:RestoreMainWindowPosition (pre_defined) diff --git a/functions/profiles.lua b/functions/profiles.lua index b9910c5c..b2493723 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -485,6 +485,8 @@ function _detalhes:SaveProfile (saveas) exported.__snapV = instance.verticalSnap profile.instances [index] = exported end + + _detalhes:SaveLocalInstanceConfig() --> end return profile diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 3944a5dd..58eaa596 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -5531,7 +5531,21 @@ function window:CreateFrame6() g:NewLabel (frame6, _, "$parentStatusbarColorLabel", "statusbarColorLabel", Loc ["STRING_OPTIONS_INSTANCE_STATUSBARCOLOR"], "GameFontHighlightLeft") frame6.statusbarColorPick:SetPoint ("left", frame6.statusbarColorLabel, "right", 2, 0) window:CreateLineBackground2 (frame6, "statusbarColorPick", "statusbarColorLabel", Loc ["STRING_OPTIONS_INSTANCE_STATUSBARCOLOR_DESC"]) + + --> window scale + local s = g:NewSlider (frame6, _, "$parentWindowScaleSlider", "WindowScaleSlider", SLIDER_WIDTH, 20, 0.65, 1.5, 0.02, instance.window_scale, true) + s:SetBackdrop (slider_backdrop) + s:SetBackdropColor (unpack (slider_backdrop_color)) + s:SetThumbSize (50) + frame6.WindowScaleSlider:SetHook ("OnValueChange", function (self, instance, amount) + instance:SetWindowScale (amount, true) + end) + + g:NewLabel (frame6, _, "$parentWindowScaleLabel", "WindowScaleLabel", Loc ["STRING_OPTIONS_WINDOW_SCALE"], "GameFontHighlightLeft") + frame6.WindowScaleSlider:SetPoint ("left", frame6.WindowScaleLabel, "right", 2) + + window:CreateLineBackground2 (frame6, "WindowScaleSlider", "WindowScaleLabel", Loc ["STRING_OPTIONS_WINDOW_SCALE_DESC"]) --general anchor g:NewLabel (frame6, _, "$parentAdjustmentsAnchor", "AdjustmentsAnchorLabel", Loc ["STRING_OPTIONS_WINDOW_ANCHOR"], "GameFontNormal") @@ -5552,6 +5566,7 @@ function window:CreateFrame6() {"stretchAlwaysOnTopLabel", 7}, {"backdropLabel", 9}, {"strataLabel", 10}, + {"WindowScaleLabel", 11}, } window:arrange_menu (frame6, left_side, x, window.top_start_at) @@ -8106,6 +8121,9 @@ function window:update_all (editing_instance) _G.DetailsOptionsWindow6InstanceMicroDisplaysSideSlider.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow6InstanceMicroDisplaysSideSlider.MyObject:SetValue (editing_instance.micro_displays_side) + _G.DetailsOptionsWindow6WindowScaleSlider.MyObject:SetFixedParameter (editing_instance) + _G.DetailsOptionsWindow6WindowScaleSlider.MyObject:SetValue (editing_instance.window_scale) + --> window 7 _G.DetailsOptionsWindow7AutoHideLeftMenuSwitch.MyObject:SetFixedParameter (editing_instance) diff --git a/gumps/janela_principal.lua b/gumps/janela_principal.lua index 9cf78d92..1bcc09d1 100644 --- a/gumps/janela_principal.lua +++ b/gumps/janela_principal.lua @@ -386,9 +386,9 @@ end local function VPB (instancia, esta_instancia) --> conferir baixo - if (instancia.ponto1.y+20 < esta_instancia.ponto2.y-16) then --> a janela esta em baixo + if (instancia.ponto1.y+(20 * instancia.window_scale) < esta_instancia.ponto2.y - (16 * esta_instancia.window_scale)) then --> a janela esta em baixo if (instancia.ponto1.x > esta_instancia.ponto2.x-100 and instancia.ponto1.x < esta_instancia.ponto2.x+100) then --> a janela esta a 20 pixels de distância para a esquerda ou para a direita - if (instancia.ponto1.y+20 > esta_instancia.ponto2.y-16-20) then --> esta a 20 pixels de distância + if (instancia.ponto1.y+(20 * instancia.window_scale) > esta_instancia.ponto2.y - (36 * esta_instancia.window_scale)) then --> esta a 20 pixels de distância return 2 end end @@ -410,9 +410,9 @@ end local function VPT (instancia, esta_instancia) --> conferir cima - if (instancia.ponto3.y-16 > esta_instancia.ponto4.y+20) then --> a janela esta em cima + if (instancia.ponto3.y - (16 * instancia.window_scale) > esta_instancia.ponto4.y + (20 * esta_instancia.window_scale)) then --> a janela esta em cima if (instancia.ponto3.x > esta_instancia.ponto4.x-100 and instancia.ponto3.x < esta_instancia.ponto4.x+100) then --> a janela esta a 20 pixels de distância para a esquerda ou para a direita - if (esta_instancia.ponto4.y+20+20 > instancia.ponto3.y-16) then + if (esta_instancia.ponto4.y+(40 * esta_instancia.window_scale) > instancia.ponto3.y - (16 * instancia.window_scale)) then return 4 end end @@ -426,8 +426,11 @@ local color_green = {0.2, 1, 0.2} local update_line = function (self, target_frame) --> based on weak auras frame movement code - local selfX, selfY = target_frame:GetCenter() - local anchorX, anchorY = self:GetCenter() + --local selfX, selfY = target_frame:GetCenter() + local selfX, selfY = target_frame.instance:GetPositionOnScreen() + --local anchorX, anchorY = self:GetCenter() + local anchorX, anchorY = self.instance:GetPositionOnScreen() + selfX, selfY = selfX or 0, selfY or 0 anchorX, anchorY = anchorX or 0, anchorY or 0 @@ -647,6 +650,11 @@ local function move_janela (baseframe, iniciando, instancia) instancia:BaseFrameSnap() baseframe:StartMoving() + local group = instancia:GetInstanceGroup() + for _, this_instance in _ipairs (group) do + this_instance.baseframe:SetClampRectInsets (0, 0, 0, 0) + end + local _, ClampLeft, ClampRight = instancia:InstanciasHorizontais() local _, ClampBottom, ClampTop = instancia:InstanciasVerticais() @@ -793,7 +801,7 @@ local function move_janela (baseframe, iniciando, instancia) if (esquerda or baixo or direita or cima) then instancia:agrupar_janelas ({esquerda, baixo, direita, cima}) end - +--aqui for _, esta_instancia in _ipairs (_detalhes.tabela_instancias) do if (not esta_instancia:IsAtiva() and esta_instancia.iniciada) then esta_instancia:ResetaGump() @@ -4981,6 +4989,9 @@ function _detalhes:ChangeSkin (skin_name) end end + --> set the scale + self:SetWindowScale() + if (not just_updating or _detalhes.initializing) then if (this_skin.callback) then this_skin:callback (self, just_updating) @@ -5425,6 +5436,103 @@ function _detalhes:MicroDisplaysSide (side, fromuser) end +function _detalhes:IsGroupedWith (instance) + local id = instance:GetId() + for side, instanceId in _pairs (self.snap) do + if (instanceId == id) then + return true + end + end + return false +end + +function _detalhes:GetInstanceGroup (instance_id) + + local instance = self + + if (instance_id) then + instance = _detalhes:GetInstance (instance_id) + if (not instance or not instance:IsEnabled()) then + return + end + end + + local current_group = {instance} + + for side, insId in _pairs (instance.snap) do + if (insId < instance:GetId()) then + local last_id = instance:GetId() + for i = insId, 1, -1 do + local this_instance = _detalhes:GetInstance (i) + local got = false + if (this_instance and this_instance:IsEnabled()) then + for side, id in _pairs (this_instance.snap) do + if (id == last_id) then + tinsert (current_group, this_instance) + got = true + last_id = i + end + end + end + if (not got) then + break + end + end + else + local last_id = instance:GetId() + for i = insId, _detalhes.instances_amount do + local this_instance = _detalhes:GetInstance (i) + local got = false + if (this_instance and this_instance:IsEnabled()) then + for side, id in _pairs (this_instance.snap) do + if (id == last_id) then + tinsert (current_group, this_instance) + got = true + last_id = i + end + end + end + if (not got) then + break + end + end + end + end + + return current_group +end + +function _detalhes:SetWindowScale (scale, from_options) + if (not scale) then + scale = self.window_scale + end + + self.window_scale = scale + + self.baseframe:SetScale (scale) + self.rowframe:SetScale (scale) + + if (from_options) then + + local group = self:GetInstanceGroup() + + for _, instance in _ipairs (group) do + instance.baseframe:SetScale (scale) + instance.rowframe:SetScale (scale) + instance.window_scale = scale + end + + for _, instance in _ipairs (group) do + _detalhes.move_janela_func (instance.baseframe, true, instance) + _detalhes.move_janela_func (instance.baseframe, false, instance) + end + + for _, instance in _ipairs (group) do + instance:SaveMainWindowPosition() + end + end +end + function _detalhes:ToolbarSide (side) if (not side) then @@ -6642,8 +6750,13 @@ function gump:CriaCabecalho (baseframe, instancia) end if (ClosedInstances == 0) then - CoolTip:AddMenu (1, _detalhes.CriarInstancia, true, nil, nil, Loc ["STRING_NOCLOSED_INSTANCES"], _, true) - CoolTip:AddIcon ([[Interface\Buttons\UI-AttributeButton-Encourage-Up]], 1, 1, 16, 16) + if (_detalhes:GetNumInstancesAmount() == _detalhes:GetMaxInstancesAmount()) then + CoolTip:AddMenu (1, _detalhes.CriarInstancia, true, nil, nil, Loc ["STRING_NOMORE_INSTANCES"], _, true) + CoolTip:AddIcon ([[Interface\Buttons\UI-PlusButton-Up]], 1, 1, 16, 16) + else + CoolTip:AddMenu (1, _detalhes.CriarInstancia, true, nil, nil, Loc ["STRING_NOCLOSED_INSTANCES"], _, true) + CoolTip:AddIcon ([[Interface\Buttons\UI-AttributeButton-Encourage-Up]], 1, 1, 16, 16) + end end GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true) diff --git a/gumps/switch.lua b/gumps/switch.lua index 13c5daea..edfee9c2 100644 --- a/gumps/switch.lua +++ b/gumps/switch.lua @@ -143,6 +143,7 @@ function _detalhes.switch:ShowMe (instancia) _detalhes.switch:Resize() _detalhes.switch:Update() + _detalhes.switch.frame:SetScale (instancia.window_scale) _detalhes.switch.frame:Show() if (not _detalhes.tutorial.bookmark_tutorial) then diff --git a/startup.lua b/startup.lua index 4f8ebff7..04b42a26 100644 --- a/startup.lua +++ b/startup.lua @@ -157,18 +157,17 @@ function _G._detalhes:Start() self.RefreshAfterStartup = nil function _detalhes:CheckWallpaperAfterStartup() - for _, instance in ipairs (self.tabela_instancias) do - if (not instance.wallpaper.enabled) then - if (instance:IsAtiva()) then + for i = 1, self.instances_amount do + local instance = self:GetInstance (i) + if (instance and instance:IsEnabled()) then + if (not instance.wallpaper.enabled) then instance:InstanceWallpaper (false) end + self.move_janela_func (instance.baseframe, true, instance) + self.move_janela_func (instance.baseframe, false, instance) end - if (instance:IsEnabled()) then - _detalhes.move_janela_func (instance.baseframe, true, instance) - _detalhes.move_janela_func (instance.baseframe, false, instance) - end + self.CheckWallpaperAfterStartup = nil end - self.CheckWallpaperAfterStartup = nil end _detalhes:ScheduleTimer ("CheckWallpaperAfterStartup", 5)