diff --git a/boot.lua b/boot.lua index d33becfb..51944a0f 100644 --- a/boot.lua +++ b/boot.lua @@ -4,7 +4,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 1095 --it's 1095 for release - _detalhes.userversion = "v3.15.5a" + _detalhes.userversion = "v3.15.6" _detalhes.realversion = 70 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -43,7 +43,7 @@ do -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.15.5a (|cFFFFCC00Jun 12, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue where sometimes tooltips wasn't being shown.\n\n|cFFFFFF00-|r Fixed a problem with overall data where it was using, even on dungoens, the raid-only 30 delay rule.\n\n|cFFFFFF00-|r Fixed an issue with spec detection (now it may detect even faster).\n\n|cFFFFFF00v3.15.5 (|cFFFFCC00Jun 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a problem with auto hide feature not hiding plugins hosted by the window.\n\n|cFFFFFF00-|r Fixed an issue with stretch feature when the anchor button was anchored at the bottom side of the window.\n\n|cFFFFFF00-|r Small interface tweaks on tooltips, bookmark and player detail window.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show amount of casts and uptime.\n\n|cFFFFFF00-|r Added an extra tooltip for the class icon at the player's bar.\n\n|cFFFFFF00-|r Activity time now has only 3 seconds inactivity tolerance on battlegrounds and arenas.\n\n|cFFFFFF00-|r Effective time will automatically be used when inside a battleground and using sync from the score board.\n\n|cFFFFFF00-|r Added 'hide all' option on the minimap menu.\n\n|cFFFFFF00-|r Added support for battlegrounds.\n\n|cFFFFFF00-|r Added option for disable showing battleground enemies when the window is in group mode.\n\n|cFFFFFF00-|r Added option to disable the sync from battleground score board.\n\n|cFFFFFF00-|r Enemies from a battleground match segment won't be erased when the player logout.\n\n|cFFFFFF00v3.14.4 (|cFFFFCC00May 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r TimeLine (plugin): now also shows marks symbolizing the player death.\n\n|cFFFFFF00-|r Added raid history panel. Open it through bookmark or /details history.\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n|cFFFFFF00-|r Added report history on report button.\n\n|cFFFFFF00-|r Added key bindings settings for report what is shown on window #1 or #2.\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." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.15.6a (|cFFFFCC00Jun 18, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added support for embed on Chat Tabs.\n\n|cFFFFFF00v3.15.5a (|cFFFFCC00Jun 12, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue where sometimes tooltips wasn't being shown.\n\n|cFFFFFF00-|r Fixed a problem with overall data where it was using, even on dungoens, the raid-only 30 delay rule.\n\n|cFFFFFF00-|r Fixed an issue with spec detection (now it may detect even faster).\n\n|cFFFFFF00v3.15.5 (|cFFFFCC00Jun 09, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a problem with auto hide feature not hiding plugins hosted by the window.\n\n|cFFFFFF00-|r Fixed an issue with stretch feature when the anchor button was anchored at the bottom side of the window.\n\n|cFFFFFF00-|r Small interface tweaks on tooltips, bookmark and player detail window.\n\n|cFFFFFF00-|r Custom display 'My Spells' now also show amount of casts and uptime.\n\n|cFFFFFF00-|r Added an extra tooltip for the class icon at the player's bar.\n\n|cFFFFFF00-|r Activity time now has only 3 seconds inactivity tolerance on battlegrounds and arenas.\n\n|cFFFFFF00-|r Effective time will automatically be used when inside a battleground and using sync from the score board.\n\n|cFFFFFF00-|r Added 'hide all' option on the minimap menu.\n\n|cFFFFFF00-|r Added support for battlegrounds.\n\n|cFFFFFF00-|r Added option for disable showing battleground enemies when the window is in group mode.\n\n|cFFFFFF00-|r Added option to disable the sync from battleground score board.\n\n|cFFFFFF00-|r Enemies from a battleground match segment won't be erased when the player logout.\n\n|cFFFFFF00v3.14.4 (|cFFFFCC00May 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r TimeLine (plugin): now also shows marks symbolizing the player death.\n\n|cFFFFFF00-|r Added raid history panel. Open it through bookmark or /details history.\n\n|cFFFFFF00-|r Added support for skins for Player Detail Window.\n\n|cFFFFFF00-|r Added report history on report button.\n\n|cFFFFFF00-|r Added key bindings settings for report what is shown on window #1 or #2.\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." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/core/gears.lua b/core/gears.lua index cb3ba9c8..b043da99 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -17,6 +17,262 @@ function _detalhes:UpdateGears() end +------------------------------------------------------------------------------------------------------------ +--> chat hooks + + _detalhes.chat_embed = _detalhes:CreateEventListener() + _detalhes.chat_embed.startup = true + + _detalhes.chat_embed.hook_settabname = function (frame, name, doNotSave) + if (not doNotSave) then + if (_detalhes.chat_tab_embed.enabled and _detalhes.chat_tab_embed.tab_name ~= "") then + if (_detalhes.chat_tab_embed_onframe == frame) then + _detalhes.chat_tab_embed.tab_name = name + _detalhes:DelayOptionsRefresh (_detalhes:GetInstance(1)) + end + end + end + end + _detalhes.chat_embed.hook_closetab = function (frame, fallback) + if (_detalhes.chat_tab_embed.enabled and _detalhes.chat_tab_embed.tab_name ~= "") then + if (_detalhes.chat_tab_embed_onframe == frame) then + _detalhes.chat_tab_embed.enabled = false + _detalhes.chat_tab_embed.tab_name = "" + _detalhes.chat_tab_embed_onframe = nil + _detalhes:DelayOptionsRefresh (_detalhes:GetInstance(1)) + _detalhes.chat_embed:ReleaseEmbed() + end + end + end + hooksecurefunc ("FCF_SetWindowName", _detalhes.chat_embed.hook_settabname) + hooksecurefunc ("FCF_Close", _detalhes.chat_embed.hook_closetab) + + function _detalhes.chat_embed:SetTabSettings (tab_name, is_enabled, is_single) + + local current_enabled_state = _detalhes.chat_tab_embed.enabled + local current_name = _detalhes.chat_tab_embed.tab_name + + tab_name = tab_name or _detalhes.chat_tab_embed.tab_name + if (is_enabled == nil) then + is_enabled = _detalhes.chat_tab_embed.enabled + end + if (is_single == nil) then + is_single = _detalhes.chat_tab_embed.single_window + end + + _detalhes.chat_tab_embed.tab_name = tab_name or "" + _detalhes.chat_tab_embed.enabled = is_enabled + _detalhes.chat_tab_embed.single_window = is_single + + if (current_name ~= tab_name) then + --> rename the tab on chat frame + local ChatFrame = _detalhes.chat_embed:GetTab (current_name) + if (ChatFrame) then + FCF_SetWindowName (ChatFrame, tab_name, false) + end + end + + if (is_enabled) then + --> need to make the embed + _detalhes.chat_embed:DoEmbed() + else + --> need to release the frame + if (current_enabled_state) then + _detalhes.chat_embed:ReleaseEmbed() + end + end + end + + function _detalhes.chat_embed:CheckChatEmbed (is_startup) + if (_detalhes.chat_tab_embed.enabled) then + _detalhes.chat_embed:DoEmbed (is_startup) + end + end + + --dom +-- /run _detalhes.chat_embed:SetTabSettings ("Dano", true, false) +-- /run _detalhes.chat_embed:SetTabSettings (nil, false, false) +-- /dump _detalhes.chat_tab_embed.tab_name + + function _detalhes.chat_embed:DelayedChatEmbed (is_startup) + _detalhes.chat_embed.startup = nil + _detalhes.chat_embed:DoEmbed() + end + + function _detalhes.chat_embed:DoEmbed (is_startup) + if (_detalhes.chat_embed.startup and not is_startup) then + if (_detalhes.AddOnStartTime + 5 < GetTime()) then + _detalhes.chat_embed.startup = nil + else + return + end + end + if (is_startup) then + return _detalhes.chat_embed:ScheduleTimer ("DelayedChatEmbed", 5) + end + local tabname = _detalhes.chat_tab_embed.tab_name + + if (_detalhes.chat_tab_embed.enabled and tabname ~= "") then + local ChatFrame, ChatFrameTab, ChatFrameBackground = _detalhes.chat_embed:GetTab (tabname) + + if (not ChatFrame) then + FCF_OpenNewWindow (tabname) + ChatFrame, ChatFrameTab, ChatFrameBackground = _detalhes.chat_embed:GetTab (tabname) + end + + if (ChatFrame) then + for index, t in pairs (ChatFrame.messageTypeList) do + ChatFrame_RemoveMessageGroup (ChatFrame, t) + ChatFrame.messageTypeList [index] = nil + end + + _detalhes.chat_tab_embed_onframe = ChatFrame + + if (_detalhes.chat_tab_embed.single_window) then + --> only one window + local window1 = _detalhes:GetInstance (1) + + window1:UngroupInstance() + window1.baseframe:ClearAllPoints() + + window1.baseframe:SetParent (ChatFrame) + window1.rowframe:SetParent (window1.baseframe) + window1.rowframe:ClearAllPoints() + window1.rowframe:SetAllPoints() + + local y_up = window1.toolbar_side == 1 and -20 or 0 + local y_down = (window1.show_statusbar and 14 or 0) + (window1.toolbar_side == 2 and 20 or 0) + + window1.baseframe:SetPoint ("topleft", ChatFrameBackground, "topleft", 0, y_up) + window1.baseframe:SetPoint ("bottomright", ChatFrameBackground, "bottomright", 0, y_down) + + window1:LockInstance (true) + window1:SaveMainWindowPosition() + + local window2 = _detalhes:GetInstance (2) + if (window2) then + if (window2.baseframe:GetParent() == ChatFrame) then + --> need to detach + _detalhes.chat_embed:ReleaseEmbed (true) + end + end + + else + --> window #1 and #2 + local window1 = _detalhes:GetInstance (1) + local window2 = _detalhes:GetInstance (2) + if (not window2) then + window2 = _detalhes:CriarInstancia() + end + + window1:UngroupInstance() + window2:UngroupInstance() + window1.baseframe:ClearAllPoints() + window2.baseframe:ClearAllPoints() + + window1.baseframe:SetParent (ChatFrame) + window2.baseframe:SetParent (ChatFrame) + window1.rowframe:SetParent (window1.baseframe) + window2.rowframe:SetParent (window2.baseframe) + + window1:LockInstance (true) + window2:LockInstance (true) + + local statusbar_enabled1 = window1.show_statusbar + local statusbar_enabled2 = window2.show_statusbar + + table.wipe (window1.snap); table.wipe (window2.snap) + window1.snap [3] = 2; window2.snap [1] = 1; + window1.horizontalSnap = true; window2.horizontalSnap = true + + local y_up = window1.toolbar_side == 1 and -20 or 0 + local y_down = (window1.show_statusbar and 14 or 0) + (window1.toolbar_side == 2 and 20 or 0) + + local width = ChatFrameBackground:GetWidth() / 2 + local height = ChatFrameBackground:GetHeight() - y_down + y_up + + window1.baseframe:SetSize (width, height) + window2.baseframe:SetSize (width, height) + + window1.baseframe:SetPoint ("topleft", ChatFrameBackground, "topleft", 0, y_up) + window2.baseframe:SetPoint ("topright", ChatFrameBackground, "topright", 0, y_up) + + window1:SaveMainWindowPosition() + window2:SaveMainWindowPosition() + + -- /dump ChatFrame3Background:GetSize() +--[[ + _detalhes.move_janela_func (window1.baseframe, true, window1) + _detalhes.move_janela_func (window1.baseframe, false, window1) + _detalhes.move_janela_func (window2.baseframe, true, window2) + _detalhes.move_janela_func (window2.baseframe, false, window2) +--]] + end + end + end + end + + function _detalhes.chat_embed:ReleaseEmbed (second_window) + --> release + local window1 = _detalhes:GetInstance (1) + local window2 = _detalhes:GetInstance (2) + + if (second_window) then + window2.baseframe:ClearAllPoints() + window2.baseframe:SetParent (UIParent) + window2.rowframe:SetParent (UIParent) + window2.baseframe:SetPoint ("center", UIParent, "center", 200, 0) + window2.rowframe:SetPoint ("center", UIParent, "center", 200, 0) + window2:LockInstance (false) + return + end + + window1.baseframe:ClearAllPoints() + window1.baseframe:SetParent (UIParent) + window1.rowframe:SetParent (UIParent) + window1.baseframe:SetPoint ("center", UIParent, "center") + window1.rowframe:SetPoint ("center", UIParent, "center") + window1:LockInstance (false) + + if (not _detalhes.chat_tab_embed.single_window and window2) then + window2.baseframe:ClearAllPoints() + window2.baseframe:SetParent (UIParent) + window2.rowframe:SetParent (UIParent) + window2.baseframe:SetPoint ("center", UIParent, "center", 200, 0) + window2.rowframe:SetPoint ("center", UIParent, "center", 200, 0) + window2:LockInstance (false) + end + end + + function _detalhes.chat_embed:GetTab (tabname) + tabname = tabname or _detalhes.chat_tab_embed.tab_name + for i = 1, 20 do + local tabtext = _G ["ChatFrame" .. i .. "TabText"] + if (tabtext) then + if (tabtext:GetText() == tabname) then + return _G ["ChatFrame" .. i], _G ["ChatFrame" .. i .. "Tab"], _G ["ChatFrame" .. i .. "Background"], i + end + end + end + end + +--[[ + --create a tab on chat + --FCF_OpenNewWindow(name) + --rename it? perhaps need to hook + --FCF_SetWindowName(chatFrame, name, true) --FCF_SetWindowName(3, "DDD", true) + --/run local chatFrame = _G["ChatFrame3"]; FCF_SetWindowName(chatFrame, "DDD", true) + + --FCF_SetWindowName(frame, name, doNotSave) + --API SetChatWindowName(frame:GetID(), name); -- set when doNotSave is false + + -- need to store the chat frame reference + -- hook set window name and check if the rename was on our window + + --FCF_Close + -- ^ when the window is closed +--]] + ------------------------------------------------------------------------------------------------------------ function _detalhes:SetDeathLogLimit (limit) diff --git a/functions/profiles.lua b/functions/profiles.lua index a3929164..05709a4a 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -946,6 +946,12 @@ local default_profile = { profile_save_pos = true, options_group_edit = true, + chat_tab_embed = { + enabled = false, + tab_name = "", + single_window = false, + }, + --> tooltip tooltip = { fontface = "Friz Quadrata TT", diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index aee8ff3c..3b740407 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -1278,7 +1278,7 @@ function window:CreateFrame20() -- text size g:NewLabel (frame20, _, "$parentTooltipTextSizeLabel", "TooltipTextSizeLabel", Loc ["STRING_OPTIONS_TOOLTIPS_FONTSIZE"], "GameFontHighlightLeft") - local s = g:NewSlider (frame20, _, "$parentTooltipTextSizeSlider", "TooltipTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 8, 32, 1, tonumber (_detalhes.tooltip.fontsize)) + local s = g:NewSlider (frame20, _, "$parentTooltipTextSizeSlider", "TooltipTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, tonumber (_detalhes.tooltip.fontsize)) config_slider (s) frame20.TooltipTextSizeSlider:SetPoint ("left", frame20.TooltipTextSizeLabel, "right", 2) @@ -2274,7 +2274,7 @@ function window:CreateFrame18() --> menu text size g:NewLabel (frame18, _, "$parentMenuTextSizeLabel", "MenuTextSizeLabel", Loc ["STRING_OPTIONS_MENU_FONT_SIZE"], "GameFontHighlightLeft") - local s = g:NewSlider (frame18, _, "$parentMenuTextSizeSlider", "MenuTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 8, 32, 1, _detalhes.font_sizes.menus) + local s = g:NewSlider (frame18, _, "$parentMenuTextSizeSlider", "MenuTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, _detalhes.font_sizes.menus) config_slider (s) frame18.MenuTextSizeSlider:SetPoint ("left", frame18.MenuTextSizeLabel, "right", 2) @@ -3501,7 +3501,7 @@ function window:CreateFrame14() --size g:NewLabel (frame14, _, "$parentAttributeTextSizeLabel", "attributeTextSizeLabel", Loc ["STRING_OPTIONS_MENU_ATTRIBUTE_TEXTSIZE"], "GameFontHighlightLeft") - local s = g:NewSlider (frame14, _, "$parentAttributeTextSizeSlider", "attributeTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 8, 32, 1, tonumber ( instance.attribute_text.text_size)) + local s = g:NewSlider (frame14, _, "$parentAttributeTextSizeSlider", "attributeTextSizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, tonumber ( instance.attribute_text.text_size)) config_slider (s) frame14.attributeTextSizeSlider:SetPoint ("left", frame14.attributeTextSizeLabel, "right", 2) @@ -5292,11 +5292,50 @@ function window:CreateFrame3() 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) + + --> chat tab embed + g:NewLabel (frame3, _, "$parentChatTabEmbedAnchor", "ChatTabEmbedAnchor", Loc ["STRING_OPTIONS_TABEMB_ANCHOR"], "GameFontNormal") + + --> enabled + g:NewSwitch (frame3, _, "$parentChatTabEmbedEnabledSlider", "ChatTabEmbedEnabledSlider", 60, 20, _, _, _detalhes.chat_tab_embed.enabled) + g:NewLabel (frame3, _, "$parentChatTabEmbedEnabledLabel", "ChatTabEmbedEnabledLabel", Loc ["STRING_ENABLED"], "GameFontHighlightLeft") + + frame3.ChatTabEmbedEnabledSlider:SetPoint ("left", frame3.ChatTabEmbedEnabledLabel, "right", 2) + frame3.ChatTabEmbedEnabledSlider.OnSwitch = function (self, instance, value) + _detalhes.chat_embed:SetTabSettings (_, value) + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame3, "ChatTabEmbedEnabledSlider", "ChatTabEmbedEnabledLabel", Loc ["STRING_OPTIONS_TABEMB_ENABLED_DESC"]) + + --> window name + local tab_on_press_enter = function (_, _, text) + _detalhes.chat_embed:SetTabSettings (text) + end + local tabname = g:NewTextEntry (frame3, _, "$parentChatTabEmbedNameEntry", "ChatTabEmbedNameEntry", SLIDER_WIDTH, SLIDER_HEIGHT, tab_on_press_enter) + g:NewLabel (frame3, _, "$parentChatTabEmbedNameLabel", "ChatTabEmbedNameLabel", Loc ["STRING_OPTIONS_TABEMB_TABNAME"], "GameFontHighlightLeft") + tabname:SetPoint ("left", frame3.ChatTabEmbedNameLabel, "right", 2) + + window:CreateLineBackground2 (frame3, "ChatTabEmbedNameEntry", "ChatTabEmbedNameLabel", Loc ["STRING_OPTIONS_TABEMB_TABNAME_DESC"]) + tabname.text = _detalhes.chat_tab_embed.tab_name + + --> one or two windows + g:NewSwitch (frame3, _, "$parentChatTabEmbed2WindowsSlider", "ChatTabEmbed2WindowsSlider", 60, 20, _, _, _detalhes.chat_tab_embed.single_window) + g:NewLabel (frame3, _, "$parentChatTabEmbed2WindowsLabel", "ChatTabEmbed2WindowsLabel", Loc ["STRING_OPTIONS_TABEMB_SINGLE"], "GameFontHighlightLeft") + + frame3.ChatTabEmbed2WindowsSlider:SetPoint ("left", frame3.ChatTabEmbed2WindowsLabel, "right", 2) + frame3.ChatTabEmbed2WindowsSlider.OnSwitch = function (self, instance, value) + _detalhes.chat_embed:SetTabSettings (_, _, value) + _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) + end + + window:CreateLineBackground2 (frame3, "ChatTabEmbed2WindowsSlider", "ChatTabEmbed2WindowsLabel", Loc ["STRING_OPTIONS_TABEMB_SINGLE_DESC"]) + - --> extra Options + --> extra Options -~-extra g:NewLabel (frame3, _, "$parentSkinExtraOptionsAnchor", "SkinExtraOptionsAnchor", Loc ["STRING_OPTIONS_SKIN_EXTRA_OPTIONS_ANCHOR"], "GameFontNormal") --frame3.SkinExtraOptionsAnchor:Hide() - frame3.SkinExtraOptionsAnchor:SetPoint (window.right_start_at, -90) + --frame3.SkinExtraOptionsAnchor:SetPoint (window.right_start_at, -90) frame3.ExtraOptions = {} --> Anchors @@ -5328,10 +5367,19 @@ function window:CreateFrame3() {"PDWAnchor", 12, true}, {"PDWSkinLabel", 13}, + } + + local right_side = { + {"ChatTabEmbedAnchor", 1, true}, + {"ChatTabEmbedEnabledLabel", 2}, + {"ChatTabEmbedNameLabel", 3}, + {"ChatTabEmbed2WindowsLabel", 4}, + {"SkinExtraOptionsAnchor", 5, true}, } window:arrange_menu (frame3, left_side, x, -90) + window:arrange_menu (frame3, right_side, window.right_start_at, -90) end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -5988,7 +6036,7 @@ function window:CreateFrame5() window:CreateLineBackground2 (frame5, "fixedTextColor", "fixedTextColorLabel", Loc ["STRING_OPTIONS_TEXT_FIXEDCOLOR_DESC"]) --> text size - local s = g:NewSlider (frame5, _, "$parentSliderFontSize", "fonsizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 8, 32, 1, tonumber (instance.row_info.font_size)) + local s = g:NewSlider (frame5, _, "$parentSliderFontSize", "fonsizeSlider", SLIDER_WIDTH, SLIDER_HEIGHT, 5, 32, 1, tonumber (instance.row_info.font_size)) config_slider (s) g:NewLabel (frame5, _, "$parentFontSizeLabel", "fonsizeLabel", Loc ["STRING_OPTIONS_TEXT_SIZE"], "GameFontHighlightLeft") @@ -10141,6 +10189,10 @@ end --> if not window local skin_object = editing_instance:GetSkin() local skin_name_formated = skin:gsub (" ", "") + _G.DetailsOptionsWindow3ChatTabEmbedEnabledSlider.MyObject:SetValue (_detalhes.chat_tab_embed.enabled) + _G.DetailsOptionsWindow3ChatTabEmbedNameEntry.MyObject.text = _detalhes.chat_tab_embed.tab_name + _G.DetailsOptionsWindow3ChatTabEmbed2WindowsSlider.MyObject:SetValue (_detalhes.chat_tab_embed.single_window) + --> hide all for name, _ in pairs (_detalhes.skins) do local name = name:gsub (" ", "") @@ -10154,13 +10206,14 @@ end --> if not window frame:Hide() end - --> create or show options if necessary + --> create or show options if necessary ~extra if (skin_object.skin_options and not skin_object.options_created) then skin_object.options_created = true local f = CreateFrame ("frame", "DetailsSkinOptions" .. skin_name_formated, frame3) frame3.ExtraOptions [skin_name_formated] = f f:SetPoint ("topleft", frame3, "topleft", window.right_start_at, window.top_start_at + (25 * -1)) + f:SetPoint ("topleft", frame3.SkinExtraOptionsAnchor.widget, "bottomleft", 0, -10) f:SetSize (250, 400) g:BuildMenu (f, skin_object.skin_options, 0, 0, 400) diff --git a/startup.lua b/startup.lua index fd32b6de..bfa28d47 100644 --- a/startup.lua +++ b/startup.lua @@ -542,6 +542,11 @@ function _G._detalhes:Start() wipe (_detalhes.cached_specs) wipe (_detalhes.cached_talents) end + + + _detalhes.chat_embed:CheckChatEmbed (true) + + _detalhes.AddOnStartTime = GetTime() --[[ function _detalhes:TestResize()