diff --git a/boot.lua b/boot.lua index 78a53e7d..d4d4f89d 100644 --- a/boot.lua +++ b/boot.lua @@ -3,9 +3,9 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 4836 + _detalhes.build_counter = 4912 _detalhes.userversion = "v7.3.0." .. _detalhes.build_counter - _detalhes.realversion = 127 --core version + _detalhes.realversion = 128 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -50,6 +50,7 @@ do _detalhes.parser_frame:Hide() --> quais raides devem ser guardadas no histórico _detalhes.InstancesToStoreData = { + [1712] = true, --Antorus, the Burning Throne [1676] = true, --Tomb of Sargeras --[1648] = true, --Trial of Valor --[1530] = true, --Nighthold diff --git a/core/plugins.lua b/core/plugins.lua index 589f8ac3..65d4bb62 100644 --- a/core/plugins.lua +++ b/core/plugins.lua @@ -417,4 +417,287 @@ return options_frame end - end \ No newline at end of file + end + + + function _detalhes:CreatePluginWindowContainer() + + local f = CreateFrame ("frame", "DetailsPluginContainerWindow", UIParent) + f:EnableMouse (true) + f:SetMovable (true) + f:SetPoint ("center", UIParent, "center") + f:SetBackdrop (_detalhes.PluginDefaults and _detalhes.PluginDefaults.Backdrop or {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) + f:SetBackdropColor (0, 0, 0, 0.3) + + f:Hide() + + --> members + f.MenuX = -5 + f.MenuY = -26 + f.MenuButtonWidth = 150 + f.MenuButtonHeight = 20 + f.TitleHeight = 20 + f.FrameWidth = 925 + f.FrameHeight = 600 + + --> store button references for the left menu + f.MenuButtons = {} + --> store all plugins embed + f.EmbedPlugins = {} + + --> lib window + f:SetSize (f.FrameWidth, f.FrameHeight) + local LibWindow = LibStub ("LibWindow-1.1") + LibWindow.RegisterConfig (f, _detalhes.plugin_window_pos) + LibWindow.RestorePosition (f) + LibWindow.MakeDraggable (f) + LibWindow.SavePosition (f) + + --> menu background + local menuBackground = CreateFrame ("frame", nil, f) + _detalhes:FormatBackground (menuBackground) + + --> point + menuBackground:SetPoint ("topright", f, "topleft", -2, 0) + menuBackground:SetPoint ("bottomright", f, "bottomleft", -2, 0) + menuBackground:SetWidth (f.MenuButtonWidth + 6) + + --> plugins menu title bar + local titlebar_plugins = CreateFrame ("frame", nil, menuBackground) + titlebar_plugins:SetPoint ("topleft", menuBackground, "topleft", 2, -3) + titlebar_plugins:SetPoint ("topright", menuBackground, "topright", -2, -3) + titlebar_plugins:SetHeight (f.TitleHeight) + titlebar_plugins:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titlebar_plugins:SetBackdropColor (.5, .5, .5, 1) + titlebar_plugins:SetBackdropBorderColor (0, 0, 0, 1) + --> title + local titleLabel = _detalhes.gump:NewLabel (titlebar_plugins, titlebar_plugins, nil, "titulo", "Plugins", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) + titleLabel:SetPoint ("center", titlebar_plugins , "center") + titleLabel:SetPoint ("top", titlebar_plugins , "top", 0, -5) + + --> plugins menu title bar + local titlebar_tools = CreateFrame ("frame", nil, menuBackground) + titlebar_tools:SetHeight (f.TitleHeight) + titlebar_tools:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + titlebar_tools:SetBackdropColor (.5, .5, .5, 1) + titlebar_tools:SetBackdropBorderColor (0, 0, 0, 1) + --> title + local titleLabel = _detalhes.gump:NewLabel (titlebar_tools, titlebar_tools, nil, "titulo", "Tools", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) + titleLabel:SetPoint ("center", titlebar_tools , "center") + titleLabel:SetPoint ("top", titlebar_tools , "top", 0, -5) + + --> scripts + f:SetScript ("OnShow", function() + + end) + + f:SetScript ("OnHide", function() + + end) + + f:SetScript ("OnMouseDown", function (self, button) + if (button == "RightButton") then + f.ClosePlugin() + end + end) + + f.Debug = false + function f.DebugMsg (...) + if (f.Debug) then + print ("[Details! Debug]", ...) + end + end + + --> templates + _detalhes.gump:InstallTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE", + { + backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}, + backdropcolor = {0, 0, 0, .5}, + backdropbordercolor = {0, 0, 0, 1}, + } + ) + _detalhes.gump:InstallTemplate ("button", "DETAILS_PLUGINPANEL_BUTTONSELECTED_TEMPLATE", + { + backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}, + backdropcolor = {0, 0, 0, .5}, + backdropbordercolor = {1, 1, 0, 1}, + } + ) + + function f.OnMenuClick (_, _, pluginAbsName, callRefresh) + + --> get the plugin + local pluginObject = _detalhes:GetPlugin (pluginAbsName) + if (not pluginObject) then + for index, plugin in ipairs (f.EmbedPlugins) do + if (plugin.real_name == pluginAbsName) then + pluginObject = plugin + end + end + + if (not pluginObject) then + f.DebugMsg ("Plugin not found") + return + end + end + + --> hide or show plugin windows + for index, plugin in ipairs (f.EmbedPlugins) do + if (plugin ~= pluginObject) then + --> hide this plugin + if (plugin.Frame:IsShown()) then + plugin.Frame:Hide() + end + end + end + + --> re set the point of the frame within the main plugin window + f.RefreshFrame (pluginObject.__var_Frame) + C_Timer.After (0.016, function () + f.RefreshFrame (pluginObject.__var_Frame) + end) + + --> show the plugin window + if (pluginObject.RefreshWindow and callRefresh) then + local okay, errortext = pcall (pluginObject.RefreshWindow) + if (not okay) then + f.DebugMsg (errortext) + end + end + + --> highlight the plugin button on the menu + for index, button in ipairs (f.MenuButtons) do + button:Show() + + if (button.PluginAbsName == pluginAbsName) then + --> emphatizate this button + button:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTONSELECTED_TEMPLATE")) + else + --> make this button regular + button:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) + end + end + + --> show the container + f:Show() + + return true + end + + function f.CreatePluginMenuButton (pluginObject, isUtility) + --> create the button + local newButton = _detalhes.gump:CreateButton (f, f.OnMenuClick, f.MenuButtonWidth, f.MenuButtonHeight, pluginObject.__name, pluginObject.real_name, true) + newButton.PluginAbsName = pluginObject.real_name + newButton.PluginName = pluginObject.__name + newButton.IsUtility = isUtility + + --> add a template + newButton:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE")) + newButton:SetText (pluginObject.__name) + newButton.textsize = 10 + + --> set icon + newButton:SetIcon (pluginObject.__icon) + + --> add it to menu table + tinsert (f.MenuButtons, newButton) + + return newButton + end + + local on_hide = function (self) + DetailsPluginContainerWindow.ClosePlugin() + end + + function f.RefreshFrame (frame) + frame:EnableMouse (false) + frame:SetSize (f.FrameWidth, f.FrameHeight) + frame:SetScript ("OnMouseDown", nil) + frame:SetScript ("OnMouseUp", nil) + --frame:SetScript ("OnHide", on_hide) + frame:HookScript ("OnHide", on_hide) + frame:ClearAllPoints() + frame:SetPoint ("topleft", f, "topleft", 0, 0) + frame:Show() + end + + --> a plugin request to be embed into the main plugin window + function f.EmbedPlugin (pluginObject, frame, isUtility) + --> check if the plugin has a frame + if (not pluginObject.Frame) then + f.DebugMsg ("plugin doesn't have a frame.") + return + end + + --> create a button for this plugin + local newMenuButtom = f.CreatePluginMenuButton (pluginObject, isUtility) + + --> utility is true when the object isn't a real plugin, but instead a tool frame from the main addon being embed on this panel + if (isUtility) then + pluginObject.__var_Utility = true + end + pluginObject.__var_Frame = frame + + --> sort buttons alphabetically, put utilities at the end + table.sort (f.MenuButtons, function (t1, t2) + if (t1.IsUtility) then + return false + elseif (t2.IsUtility) then + return true + else + return t1.PluginName < t2.PluginName + end + end) + + --> reset the buttons points + local addingTools = false + for index, button in ipairs (f.MenuButtons) do + button:ClearAllPoints() + button:SetPoint ("center", menuBackground, "center") + + if (button.IsUtility) then + --> add -20 to add a gap between plugins and utilities + + if (not addingTools) then + --> add the header + addingTools = true + titlebar_tools:SetPoint ("topleft", menuBackground, "topleft", 2, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 20) + titlebar_tools:SetPoint ("topright", menuBackground, "topright", -2, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 20) + end + + button:SetPoint ("top", menuBackground, "top", 0, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 40) + else + button:SetPoint ("top", menuBackground, "top", 0, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index) + end + end + + --> format the plugin main frame + f.RefreshFrame (frame) + --> add the plugin to embed table + tinsert (f.EmbedPlugins, pluginObject) + + f.DebugMsg ("plugin added", pluginObject.__name) + end + + function f.OpenPlugin (pluginObject) + --> just simulate a click on the menu button + f.OnMenuClick (_, _, pluginObject.real_name) + end + + function f.ClosePlugin() + --> hide all embed plugins + for index, plugin in ipairs (f.EmbedPlugins) do + plugin.Frame:Hide() + end + --> hide the main frame + f:Hide() + end + + + end + + + + + +--stop auto complete: doe enda endb \ No newline at end of file diff --git a/core/windows.lua b/core/windows.lua index 8981561a..5a34526b 100644 --- a/core/windows.lua +++ b/core/windows.lua @@ -1164,18 +1164,36 @@ function _detalhes:OpenTranslateWindow() end + + --> raid history window ~history + + function _detalhes:InitializeRaidHistoryWindow() + local DetailsRaidHistoryWindow = CreateFrame ("frame", "DetailsRaidHistoryWindow", UIParent) + DetailsRaidHistoryWindow.Frame = DetailsRaidHistoryWindow + DetailsRaidHistoryWindow.__name = "Statistics" + DetailsRaidHistoryWindow.real_name = "DETAILS_STATISTICS" + DetailsRaidHistoryWindow.__icon = [[Interface\PvPRankBadges\PvPRank08]] + DetailsPluginContainerWindow.EmbedPlugin (DetailsRaidHistoryWindow, DetailsRaidHistoryWindow, true) + + function DetailsRaidHistoryWindow.RefreshWindow() + _detalhes:OpenRaidHistoryWindow() + end + end + function _detalhes:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild, _player_base, _player_name, _history_type) - if (not _G.DetailsRaidHistoryWindow) then + if (not DetailsRaidHistoryWindow or not DetailsRaidHistoryWindow.Initialized) then local db = _detalhes.storage:OpenRaidStorage() if (not db) then return _detalhes:Msg (Loc ["STRING_GUILDDAMAGERANK_DATABASEERROR"]) end + + DetailsRaidHistoryWindow.Initialized = true - local f = CreateFrame ("frame", "DetailsRaidHistoryWindow", UIParent, "ButtonFrameTemplate") + local f = DetailsRaidHistoryWindow or CreateFrame ("frame", "DetailsRaidHistoryWindow", UIParent) --, "ButtonFrameTemplate" f:SetPoint ("center", UIParent, "center") f:SetFrameStrata ("HIGH") f:SetToplevel (true) @@ -1187,6 +1205,46 @@ f.Mode = 2 + f.bg1 = f:CreateTexture (nil, "background") + f.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + f.bg1:SetAlpha (0.7) + f.bg1:SetVertexColor (0.27, 0.27, 0.27) + f.bg1:SetVertTile (true) + f.bg1:SetHorizTile (true) + f.bg1:SetSize (790, 454) + f.bg1:SetAllPoints() + + f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + f:SetBackdropColor (.5, .5, .5, .5) + f:SetBackdropBorderColor (0, 0, 0, 1) + + --> menu title bar + local titlebar = CreateFrame ("frame", nil, f) + titlebar:SetPoint ("topleft", f, "topleft", 2, -3) + titlebar:SetPoint ("topright", f, "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) + + --> menu title + local titleLabel = _detalhes.gump:NewLabel (titlebar, titlebar, nil, "titulo", "Statistics", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255}) + titleLabel:SetPoint ("center", titlebar , "center") + titleLabel:SetPoint ("top", titlebar , "top", 0, -5) + + --> close button + f.Close = CreateFrame ("button", "$parentCloseButton", f) + f.Close:SetPoint ("right", titlebar, "right", -2, 0) + f.Close:SetSize (16, 16) + f.Close:SetNormalTexture (_detalhes.gump.folder .. "icons") + f.Close:SetHighlightTexture (_detalhes.gump.folder .. "icons") + f.Close:SetPushedTexture (_detalhes.gump.folder .. "icons") + f.Close:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1) + f.Close:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1) + f.Close:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1) + f.Close:SetAlpha (0.7) + f.Close:SetScript ("OnClick", function() f:Hide() end) + if (not _detalhes:GetTutorialCVar ("HISTORYPANEL_TUTORIAL")) then local tutorialFrame = CreateFrame ("frame", "$parentTutorialFrame", f) tutorialFrame:SetPoint ("center", f, "center") @@ -1227,9 +1285,25 @@ --separate menu and main list local div = f:CreateTexture (nil, "artwork") div:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-MetalBorder-Left]]) - div:SetAlpha (0.3) + div:SetAlpha (0.1) div:SetPoint ("topleft", f, "topleft", 180, -64) - div:SetHeight (460) + div:SetHeight (574) + + local blackdiv = f:CreateTexture (nil, "artwork") + blackdiv:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) + blackdiv:SetVertexColor (0, 0, 0) + blackdiv:SetAlpha (1) + blackdiv:SetPoint ("topleft", f, "topleft", 187, -65) + blackdiv:SetHeight (507) + blackdiv:SetWidth (200) + + local blackdiv = f:CreateTexture (nil, "artwork") + blackdiv:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) + blackdiv:SetVertexColor (0, 0, 0) + blackdiv:SetAlpha (0.7) + blackdiv:SetPoint ("topleft", f, "topleft", 0, 0) + blackdiv:SetPoint ("bottomleft", f, "bottomleft", 0, 0) + blackdiv:SetWidth (200) --select history or guild rank local options_switch_template = _detalhes.gump:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE") @@ -1400,10 +1474,10 @@ f.LatestSelection.PlayerName = DetailsRaidHistoryWindow.select_player2.value end) - f.TitleText:SetText ("Details! Raid Ranking") + --f.TitleText:SetText ("Details! Raid Ranking") --f.portrait:SetTexture ([[Interface\AddOns\Details\images\icons2]]) - f.portrait:SetTexture ([[Interface\PVPFrame\PvPPrestigeIcons]]) - f.portrait:SetTexCoord (270/1024, 384/1024, 128/512, 256/512) + --f.portrait:SetTexture ([[Interface\PVPFrame\PvPPrestigeIcons]]) + --f.portrait:SetTexCoord (270/1024, 384/1024, 128/512, 256/512) --f.portrait:SetTexCoord (192/512, 258/512, 322/512, 388/512) local dropdown_size = 160 @@ -1434,6 +1508,7 @@ end local raid_dropdown = gump:CreateDropDown (f, build_raid_list, 1, dropdown_size, 20, "select_raid") local raid_string = gump:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_RAID"] .. ":", _, _, "GameFontNormal", "select_raid_label") + raid_dropdown:SetTemplate (gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --> select boss: local on_boss_select = function (_, _, boss) @@ -1444,6 +1519,7 @@ end local boss_dropdown = gump:CreateDropDown (f, build_boss_list, 1, dropdown_size, 20, "select_boss") local boss_string = gump:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_BOSS"] .. ":", _, _, "GameFontNormal", "select_boss_label") + boss_dropdown:SetTemplate (gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --> select difficulty: local on_diff_select = function (_, _, diff) @@ -1456,6 +1532,7 @@ end local diff_dropdown = gump:CreateDropDown (f, build_diff_list, 1, dropdown_size, 20, "select_diff") local diff_string = gump:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_DIFF"] .. ":", _, _, "GameFontNormal", "select_diff_label") + diff_dropdown:SetTemplate (gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --> select role: local on_role_select = function (_, _, role) @@ -1469,6 +1546,7 @@ end local role_dropdown = gump:CreateDropDown (f, build_role_list, 1, dropdown_size, 20, "select_role") local role_string = gump:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_ROLE"] .. ":", _, _, "GameFontNormal", "select_role_label") + role_dropdown:SetTemplate (gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --> select guild: local on_guild_select = function (_, _, guild) @@ -1479,7 +1557,8 @@ end local guild_dropdown = gump:CreateDropDown (f, build_guild_list, 1, dropdown_size, 20, "select_guild") local guild_string = gump:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_GUILD"] .. ":", _, _, "GameFontNormal", "select_guild_label") - + guild_dropdown:SetTemplate (gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + --> select playerbase: local on_player_select = function (_, _, player) on_select() @@ -1492,6 +1571,7 @@ end local player_dropdown = gump:CreateDropDown (f, build_player_list, 1, dropdown_size, 20, "select_player") local player_string = gump:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_PLAYERBASE"] .. ":", _, _, "GameFontNormal", "select_player_label") + player_dropdown:SetTemplate (gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) --> select player: local on_player2_select = function (_, _, player) @@ -1522,7 +1602,8 @@ end local player2_dropdown = gump:CreateDropDown (f, build_player2_list, 1, dropdown_size, 20, "select_player2") local player2_string = gump:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_PLAYERBASE_PLAYER"] .. ":", _, _, "GameFontNormal", "select_player2_label") - + player2_dropdown:SetTemplate (gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")) + function f:UpdateDropdowns (DoNotSelectRaid) local currentGuild = guild_dropdown.value @@ -1775,8 +1856,9 @@ end end - local fillpanel = gump:NewFillPanel (f, {}, "$parentFP", "fillpanel", 630, 400, false, false, true, nil) - fillpanel:SetPoint ("topleft", f, "topleft", 200, -65) + local fillpanel = gump:NewFillPanel (f, {}, "$parentFP", "fillpanel", 710, 501, false, false, true, nil) + fillpanel:SetPoint ("topleft", f, "topleft", 195, -65) + function f:BuildGuildRankTable (encounterTable, guild, role) @@ -2009,6 +2091,7 @@ end --> table means some button send the request - nil for other ways + if (type (_raid) == "table" or (not _raid and not _boss and not _difficulty and not _role and not _guild and not _player_base and not _player_name)) then local f = _G.DetailsRaidHistoryWindow if (f.LatestSelection) then @@ -2090,6 +2173,7 @@ _G.DetailsRaidHistoryWindow:Refresh (_player_name) end + DetailsPluginContainerWindow.OpenPlugin (DetailsRaidHistoryWindow) end --> feedback window @@ -6268,3 +6352,21 @@ end C_Timer.After (1, function() --Details:OpenOptionsWindow(Details:GetInstance(1)) end) + + +function _detalhes:FormatBackground (f) + f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + f:SetBackdropColor (.5, .5, .5, .5) + f:SetBackdropBorderColor (0, 0, 0, 1) + + if (not f.__background) then + f.__background = f:CreateTexture (nil, "background") + end + + f.__background:SetTexture ([[Interface\AddOns\Details\images\background]], true) + f.__background:SetAlpha (0.7) + f.__background:SetVertexColor (0.27, 0.27, 0.27) + f.__background:SetVertTile (true) + f.__background:SetHorizTile (true) + f.__background:SetAllPoints() +end diff --git a/functions/link.lua b/functions/link.lua index 664de821..674f6eda 100644 --- a/functions/link.lua +++ b/functions/link.lua @@ -2829,23 +2829,38 @@ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --> forge + function _detalhes:InitializeForge() + local DetailsForgePanel = _detalhes.gump:CreateSimplePanel (UIParent, 960, 600, "Aura Forge", "DetailsForgePanel") + DetailsForgePanel.Frame = DetailsForgePanel + DetailsForgePanel.__name = "Aura Forge" + DetailsForgePanel.real_name = "DETAILS_FORGE" + DetailsForgePanel.__icon = [[Interface\MINIMAP\Vehicle-HammerGold-3]] + DetailsPluginContainerWindow.EmbedPlugin (DetailsForgePanel, DetailsForgePanel, true) + + function DetailsForgePanel.RefreshWindow() + _detalhes:OpenForge() + end + end + function _detalhes:OpenForge() - if (not DetailsForgePanel) then + if (not DetailsForgePanel or not DetailsForgePanel.Initialized) then local fw = _detalhes:GetFramework() local lower = string.lower + DetailsForgePanel.Initialized = true + --main frame - local f = _detalhes.gump:CreateSimplePanel (UIParent, 960, 600, "Details! Forge", "DetailsForgePanel") + local f = DetailsForgePanel or _detalhes.gump:CreateSimplePanel (UIParent, 960, 600, "Details! Forge", "DetailsForgePanel") f:SetPoint ("center", UIParent, "center") f:SetFrameStrata ("HIGH") f:SetToplevel (true) f:SetMovable (true) f.Title:SetTextColor (1, .8, .2) - f:SetBackdropColor (unpack (_detalhes.default_backdropcolor)) - + + local have_plugins_enabled for id, instanceTable in pairs (_detalhes.EncounterInformation) do @@ -2906,6 +2921,21 @@ wipe (spell_already_added) end) + f.bg1 = f:CreateTexture (nil, "background") + f.bg1:SetTexture ([[Interface\AddOns\Details\images\background]], true) + f.bg1:SetAlpha (0.7) + f.bg1:SetVertexColor (0.27, 0.27, 0.27) + f.bg1:SetVertTile (true) + f.bg1:SetHorizTile (true) + f.bg1:SetSize (790, 454) + f.bg1:SetAllPoints() + + f:SetBackdropColor (unpack (_detalhes.default_backdropcolor)) + + f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true}) + f:SetBackdropColor (.5, .5, .5, .5) + f:SetBackdropBorderColor (0, 0, 0, 1) + local no_func = function()end local nothing_to_show = {} local current_module @@ -3276,7 +3306,7 @@ end, fill_name = "DetailsForgeAllSpellsFillPanel", } - + ----------------------------------------------- @@ -3688,6 +3718,32 @@ ----------------------------------------------- + fw:InstallTemplate ("button", "DETAILS_FORGE_TEXTENTRY_TEMPLATE", { + backdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true}, --edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, + backdropcolor = {0, 0, 0, .1}, + --backdropbordercolor = {0, 0, 0, 1}, + --width = 160, + --height = 18, + }) + + --scroll gradient + local blackdiv = f:CreateTexture (nil, "artwork") + blackdiv:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) + blackdiv:SetVertexColor (0, 0, 0) + blackdiv:SetAlpha (1) + blackdiv:SetPoint ("topleft", f, "topleft", 170, -100) + blackdiv:SetHeight (461) + blackdiv:SetWidth (200) + + --big gradient + local blackdiv = f:CreateTexture (nil, "artwork") + blackdiv:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) + blackdiv:SetVertexColor (0, 0, 0) + blackdiv:SetAlpha (0.7) + blackdiv:SetPoint ("topleft", f, "topleft", 0, 0) + blackdiv:SetPoint ("bottomleft", f, "bottomleft", 0, 0) + blackdiv:SetWidth (200) + local select_module = function (a, b, module_number) if (current_module ~= module_number) then @@ -3711,13 +3767,13 @@ local fillpanel = module.fill_panel if (not fillpanel) then - fillpanel = fw:NewFillPanel (f, module.header, module.fill_name, nil, 740, 480, module.fill_gettotal, module.fill_fillrows, false) + fillpanel = fw:NewFillPanel (f, module.header, module.fill_name, nil, 740, 481, module.fill_gettotal, module.fill_fillrows, false) fillpanel:SetPoint (170, -80) fillpanel.module = module local background = fillpanel:CreateTexture (nil, "background") background:SetAllPoints() - background:SetColorTexture (0, 0, 0, 0.8) + background:SetColorTexture (0, 0, 0, 0.2) module.fill_panel = fillpanel end @@ -3730,6 +3786,13 @@ fillpanel:Show() fillpanel:Refresh() + + for o = 1, #fillpanel.scrollframe.lines do + for i = 1, #fillpanel.scrollframe.lines [o].entry_inuse do + --> text entry + fillpanel.scrollframe.lines [o].entry_inuse [i]:SetTemplate (fw:GetTemplate ("button", "DETAILS_FORGE_TEXTENTRY_TEMPLATE")) + end + end end end @@ -3758,8 +3821,9 @@ local b = fw:CreateButton (f, select_module, 140, 20, module.name, i) b.tooltip = module.desc b.textalign = "<" + b.textsize = 10 - b:SetIcon ([[Interface\BUTTONS\UI-GuildButton-PublicNote-Up]]) + b:SetIcon ([[Interface\BUTTONS\UI-GuildButton-PublicNote-Up]], nil, nil, nil, nil, {1, 1, 1, 0.7}) b:SetTemplate (_detalhes.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")) if (lastButton) then @@ -3789,6 +3853,8 @@ DetailsForgePanel.FirstRun = true end + DetailsPluginContainerWindow.OpenPlugin (DetailsForgePanel) + end --_detalhes:ScheduleTimer ("OpenForge", 3) diff --git a/functions/profiles.lua b/functions/profiles.lua index f310e8b0..3f6f81f8 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1308,72 +1308,10 @@ local default_global_data = { make_overall_when_done = true, -- make_overall_boss_only = false, -- }, - - -- important auras - --[=[ - important_auras = { - [577] = {}, -- Havoc Demon Hunter - [581] = {}, -- Vengeance Demon Hunter + + --> plugin window positions + plugin_window_pos = {}, - [252] = {}, -- Unholy Death Knight - [251] = {}, -- Frost Death Knight - [250] = {}, -- Blood Death Knight - - [102] = {}, -- Balance Druid - [103] = {}, -- Feral Druid - [104] = {}, -- Guardian Druid - [105] = {}, -- Restoration Druid - - [253] = {}, -- Beast Mastery Hunter - [254] = {}, -- Marksmanship Hunter - [255] = {}, -- Survival Hunter - - [62] = { -- Arcane Mage - - }, - [63] = { -- Fire Mage - 157644, --Enhanced Pyrotechnics - 48107, --Heating Up - 48108, --Hot Streak! - 194329, --Pyretic Incantation - - }, - [64] = { -- Frost Mage - 44544, --fingers of frost - 195418, --chain reaction - 190446, --brain freeze - 12472, --icyveins - }, - - [268] = {}, -- Brewmaster Monk - [269] = {}, -- Windwalker Monk - [270] = {}, -- Mistweaver Monk - - [65] = {}, -- Holy Paladin - [66] = {}, -- Protection Paladin - [70] = {}, -- Retribution Paladin - - [256] = {}, -- Discipline Priest - [257] = {}, -- Holy Priest - [258] = {}, -- Shadow Priest - - [259] = {}, -- Assassination Rogue - [260] = {}, -- Outlaw Rogue - [261] = {}, -- Subtlety Rogue - - [262] = {}, -- Elemental Shaman - [263] = {}, -- Enhancement Shaman - [264] = {}, -- Restoration Shaman - - [265] = {}, -- Affliction Warlock - [266] = {}, -- Demonology Warlock - [267] = {}, -- Destruction Warlock - - [71] = {}, -- Arms Warrior - [72] = {}, -- Fury Warrior - [73] = {}, -- Protection Warrior - }, - --]=] } _detalhes.default_global_data = default_global_data diff --git a/functions/slash.lua b/functions/slash.lua index af2873a2..9b18aa20 100644 --- a/functions/slash.lua +++ b/functions/slash.lua @@ -25,7 +25,7 @@ function SlashCmdList.DETAILS (msg, editbox) elseif (command == Loc ["STRING_SLASH_NEW"] or command == "new") then _detalhes:CriarInstancia (nil, true) - elseif (command == Loc ["STRING_SLASH_HISTORY"] or command == "history" or command == "score" or command == "rank" or command == "ranking") then + elseif (command == Loc ["STRING_SLASH_HISTORY"] or command == "history" or command == "score" or command == "rank" or command == "ranking" or command == "statistics") then _detalhes:OpenRaidHistoryWindow() elseif (command == Loc ["STRING_SLASH_TOGGLE"] or command == "toggle") then diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index d5061e16..97406df4 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -76,6 +76,35 @@ function _detalhes:SetOptionsWindowTexture (texture) end end + +function _detalhes:InitializeOptionsWindow() + local DetailsOptionsWindow = g:NewPanel (UIParent, _, "DetailsOptionsWindow", _, 897, 592) + + local f = DetailsOptionsWindow.frame + + f.Frame = f + f.__name = "Options" + f.real_name = "DETAILS_OPTIONS" + f.__icon = [[Interface\Scenarios\ScenarioIcon-Interact]] + DetailsPluginContainerWindow.EmbedPlugin (f, f, true) + + function f.RefreshWindow() + if (not _G.DetailsOptionsWindow.instance) then + local lower_instance = _detalhes:GetLowerInstanceNumber() + if (not lower_instance) then + local instance = _detalhes:GetInstance (1) + _detalhes.CriarInstancia (_, _, 1) + _detalhes:OpenOptionsWindow (instance) + else + _detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance)) + end + else + _detalhes:OpenOptionsWindow (_G.DetailsOptionsWindow.instance) + end + end +end + + function _detalhes:OpenOptionsWindow (instance, no_reopen, section) if (not instance.meu_id) then @@ -96,10 +125,14 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) end if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow.full_created) then - return _G.DetailsOptionsWindow.MyObject:update_all (instance, section) + _detalhes:FormatBackground (_G.DetailsOptionsWindow) + + _G.DetailsOptionsWindow.MyObject:update_all (instance, section) + DetailsOptionsWindow.OpenInPluginPanel() + return end - if (not window) then + if (not window or not window.Initialized) then local options_button_template = g:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE") local options_dropdown_template = g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") @@ -133,7 +166,10 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) -- Most of details widgets have the same 6 first parameters: parent, container, global name, parent key, width, height - window = g:NewPanel (UIParent, _, "DetailsOptionsWindow", _, 897, 592) + window = DetailsOptionsWindow and DetailsOptionsWindow.MyObject or g:NewPanel (UIParent, _, "DetailsOptionsWindow", _, 897, 592) + window.Initialized = true + window.frame.Initialized = true + window.instance = instance tinsert (UISpecialFrames, "DetailsOptionsWindow") window:SetFrameStrata ("HIGH") @@ -164,30 +200,30 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) --x 9 897 y 9 592 - local background = g:NewImage (window, _detalhes.options_window_background, 897, 592, nil, nil, "background", "$parentBackground") - background:SetPoint (0, 0) - background:SetDrawLayer ("border") - background:SetTexCoord (0, 0.8759765625, 0, 0.578125) + --local background = g:NewImage (window, _detalhes.options_window_background, 897, 592, nil, nil, "background", "$parentBackground") + --background:SetPoint (0, 0) + --background:SetDrawLayer ("border") + --background:SetTexCoord (0, 0.8759765625, 0, 0.578125) - local sub_background = window:CreateTexture ("DetailsOptionsWindowBackgroundWallpaper", "background") + --local sub_background = window:CreateTexture ("DetailsOptionsWindowBackgroundWallpaper", "background") --sub_background:SetTexture ([[Interface\FrameGeneral\UI-Background-Marble]], true) - sub_background:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) - sub_background:SetPoint ("topleft", window.widget, "topleft", 192, -80) - sub_background:SetPoint ("bottomright", window.widget, "bottomright", -30, 27) + --sub_background:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) + --sub_background:SetPoint ("topleft", window.widget, "topleft", 192, -80) + --sub_background:SetPoint ("bottomright", window.widget, "bottomright", -30, 27) --sub_background:SetVertTile (true) --sub_background:SetHorizTile (true) --sub_background:SetAlpha (0.81) - sub_background:SetAlpha (0.85) + --sub_background:SetAlpha (0.85) --sub_background:Hide() - local menu_background = window:CreateTexture ("DetailsOptionsWindowBackgroundMenu", "background") + --local menu_background = window:CreateTexture ("DetailsOptionsWindowBackgroundMenu", "background") --menu_background:SetTexture ([[Interface\AddOns\Details\images\options_window]], true) - menu_background:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) - menu_background:SetPoint ("topleft", window.widget, "topleft", 29, -78) - menu_background:SetSize (164, 488) + --menu_background:SetTexture ([[Interface\DialogFrame\UI-DialogBox-Background-Dark]]) + --menu_background:SetPoint ("topleft", window.widget, "topleft", 29, -78) + --menu_background:SetSize (164, 488) --menu_background:SetTexCoord (327/1024, 488/1024, 627/1024, 663/1024) --menu_background:SetAlpha (0.81) - menu_background:SetAlpha (0.85) + --menu_background:SetAlpha (0.85) --menu_background:SetVertTile (true) --menu_background:Hide() @@ -215,8 +251,8 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) --> edit anchors editing.apoio_icone_esquerdo = window:CreateTexture (nil, "ARTWORK") editing.apoio_icone_direito = window:CreateTexture (nil, "ARTWORK") - editing.apoio_icone_esquerdo:SetTexture ("Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs") - editing.apoio_icone_direito:SetTexture ("Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs") + --editing.apoio_icone_esquerdo:SetTexture ("Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs") + --editing.apoio_icone_direito:SetTexture ("Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs") local apoio_altura = 13/256 editing.apoio_icone_esquerdo:SetTexCoord (0, 1, 0, apoio_altura) @@ -266,15 +302,16 @@ function _detalhes:OpenOptionsWindow (instance, no_reopen, section) local desc_background = g:NewImage (window, [[Interface\AddOns\Details\images\options_window]], 253, 198, "artwork", {0.3193359375, 0.56640625, 0.685546875, 0.87890625}, "descBackgroundImage", "$parentDescBackgroundImage") -- 327 702 580 900 desc_background:SetPoint ("topleft", info_text, "topleft", 0, 0) - - --> forge and history buttons - local forge_button = g:NewButton (window, _, "$parentForgeButton", "ForgeButton", 90, 20, function() _detalhes:OpenForge(); window:Hide() end, nil, nil, nil, "Open Forge", 1) --, g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - forge_button:SetIcon ([[Interface\AddOns\Details\images\icons]], nil, nil, nil, {396/512, 428/512, 243/512, 273/512}, nil, nil, 2) - forge_button:SetPoint ("topleft", 80, -61) - local history_button = g:NewButton (window, _, "$parentHistoryButton", "HistoryButton", 90, 20, function() _detalhes:OpenRaidHistoryWindow(); window:Hide() end, nil, nil, nil, "Guild Rank", 1) --, g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") - history_button:SetIcon ([[Interface\AddOns\Details\images\icons]], nil, nil, nil, {434/512, 466/512, 243/512, 273/512}, nil, nil, 2) - history_button:SetPoint ("topleft", 180, -61) +-- as it stands in the plugin panel, these buttons aren't required anymore + --> forge and history buttons +-- local forge_button = g:NewButton (window, _, "$parentForgeButton", "ForgeButton", 90, 20, function() _detalhes:OpenForge(); window:Hide() end, nil, nil, nil, "Open Forge", 1) --, g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") +-- forge_button:SetIcon ([[Interface\AddOns\Details\images\icons]], nil, nil, nil, {396/512, 428/512, 243/512, 273/512}, nil, nil, 2) +-- forge_button:SetPoint ("topleft", 80, -61) + +-- local history_button = g:NewButton (window, _, "$parentHistoryButton", "HistoryButton", 90, 20, function() _detalhes:OpenRaidHistoryWindow(); window:Hide() end, nil, nil, nil, "Guild Rank", 1) --, g:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE") +-- history_button:SetIcon ([[Interface\AddOns\Details\images\icons]], nil, nil, nil, {434/512, 466/512, 243/512, 273/512}, nil, nil, 2) +-- history_button:SetPoint ("topleft", 180, -61) --> select instance dropbox local onSelectInstance = function (_, _, instance) @@ -711,7 +748,7 @@ local menus2 = { mouse_over_texture:SetHeight (37) mouse_over_texture:Hide() mouse_over_texture:SetBlendMode ("ADD") - + --> menu anchor textures local menu_frame = CreateFrame("frame", "DetailsOptionsWindowMenuAnchor", window.widget) @@ -719,34 +756,37 @@ local menus2 = { menu_frame:SetSize (1, 1) --general settings + + local menuTitleAnchorX = 10 + local g_settings = g:NewButton (menu_frame, _, "$parentGeneralSettingsButton", "g_settings", 150, 33, function() end, 0x1) g:NewLabel (menu_frame, _, "$parentgeneral_settings_text", "GeneralSettingsLabel", Loc ["STRING_OPTIONS_GENERAL"], "GameFontNormal", 12) - menu_frame.GeneralSettingsLabel:SetPoint ("topleft", g_settings, "topleft", 35, -11) + menu_frame.GeneralSettingsLabel:SetPoint ("topleft", g_settings, "topleft", menuTitleAnchorX, -10) - local g_settings_texture = g:NewImage (menu_frame, [[Interface\AddOns\Details\images\options_window]], 160, 33, nil, nil, "GeneralSettingsTexture", "$parentGeneralSettingsTexture") - g_settings_texture:SetTexCoord (0, 0.15625, 0.685546875, 0.7177734375) - g_settings_texture:SetPoint ("topleft", g_settings, "topleft", 0, 0) + -- local g_settings_texture = g:NewImage (menu_frame, [[Interface\AddOns\Details\images\options_window]], 160, 33, nil, nil, "GeneralSettingsTexture", "$parentGeneralSettingsTexture") + -- g_settings_texture:SetTexCoord (0, 0.15625, 0.685546875, 0.7177734375) + -- g_settings_texture:SetPoint ("topleft", g_settings, "topleft", 0, 0) --apparance local g_appearance = g:NewButton (menu_frame, _, "$parentAppearanceButton", "g_appearance", 150, 33, function() end, 0x2) g:NewLabel (menu_frame, _, "$parentappearance_settings_text", "AppearanceSettingsLabel", Loc ["STRING_OPTIONS_APPEARANCE"], "GameFontNormal", 12) - menu_frame.AppearanceSettingsLabel:SetPoint ("topleft", g_appearance, "topleft", 35, -11) + menu_frame.AppearanceSettingsLabel:SetPoint ("topleft", g_appearance, "topleft", menuTitleAnchorX, -11) - local g_appearance_texture = g:NewImage (menu_frame, [[Interface\AddOns\Details\images\options_window]], 160, 33, nil, nil, "AppearanceSettingsTexture", "$parentAppearanceSettingsTexture") - g_appearance_texture:SetTexCoord (0, 0.15625, 0.71875, 0.7509765625) - g_appearance_texture:SetPoint ("topleft", g_appearance, "topleft", 0, 0) + -- local g_appearance_texture = g:NewImage (menu_frame, [[Interface\AddOns\Details\images\options_window]], 160, 33, nil, nil, "AppearanceSettingsTexture", "$parentAppearanceSettingsTexture") + -- g_appearance_texture:SetTexCoord (0, 0.15625, 0.71875, 0.7509765625) + -- g_appearance_texture:SetPoint ("topleft", g_appearance, "topleft", 0, 0) --advanced local g_advanced = g:NewButton (menu_frame, _, "$parentAdvancedButton", "g_advanced", 150, 33, function() end, 0x4) g:NewLabel (menu_frame, _, "$parentadvanced_settings_text", "AdvancedSettingsLabel", Loc ["STRING_OPTIONS_ADVANCED"], "GameFontNormal", 12) - menu_frame.AdvancedSettingsLabel:SetPoint ("topleft", g_advanced, "topleft", 35, -11) + menu_frame.AdvancedSettingsLabel:SetPoint ("topleft", g_advanced, "topleft", menuTitleAnchorX, -11) - local g_advanced_texture = g:NewImage (menu_frame, [[Interface\AddOns\Details\images\options_window]], 160, 33, nil, nil, "AdvancedSettingsTexture", "$parentAdvancedSettingsTexture") - g_advanced_texture:SetTexCoord (0, 0.15625, 0.8173828125, 0.849609375) - g_advanced_texture:SetPoint ("topleft", g_advanced, "topleft", 0, 0) + -- local g_advanced_texture = g:NewImage (menu_frame, [[Interface\AddOns\Details\images\options_window]], 160, 33, nil, nil, "AdvancedSettingsTexture", "$parentAdvancedSettingsTexture") + -- g_advanced_texture:SetTexCoord (0, 0.15625, 0.8173828125, 0.849609375) + -- g_advanced_texture:SetPoint ("topleft", g_advanced, "topleft", 0, 0) @@ -804,21 +844,31 @@ local menus2 = { return true end + local blackdiv = window:CreateTexture (nil, "artwork") + blackdiv:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-HorizontalShadow]]) + blackdiv:SetVertexColor (0, 0, 0) + blackdiv:SetAlpha (0.7) + blackdiv:SetPoint ("topleft", window.frame, "topleft", 0, 0) + blackdiv:SetPoint ("bottomleft", window.frame, "bottomleft", 0, 0) + blackdiv:SetWidth (200) + --move buttons creation to loading process function window:create_left_menu() for index, menulist in ipairs (menus) do - anchors [index]:SetPoint (23, y) + anchors [index]:SetPoint (10, y) local amount = #menulist y = y - 37 for i = 1, amount do - local texture = g:NewImage (menu_frame, [[Interface\ARCHEOLOGY\ArchaeologyParts]], 130, 14, nil, nil, nil, "$parentButton_" .. index .. "_" .. i .. "_texture") - texture:SetTexCoord (0.146484375, 0.591796875, 0.0546875, 0.26171875) - texture:SetPoint (38, y-2) + --local texture = g:NewImage (menu_frame, [[Interface\ARCHEOLOGY\ArchaeologyParts]], 130, 14, nil, nil, nil, "$parentButton_" .. index .. "_" .. i .. "_texture") + local texture = g:NewImage (menu_frame, [[Interface\Scenarios\ScenarioIcon-Combat]], 10, 10, nil, nil, nil, "$parentButton_" .. index .. "_" .. i .. "_texture") + texture:SetTexCoord (0.23, 0.87, 0.15, 0.73) + texture:SetPoint (24, y-5) texture:SetVertexColor (1, 1, 1, .5) + --texture:Hide() local button = g:NewButton (menu_frame, _, "$parentButton_" .. index .. "_" .. i, nil, 150, 18, select_options, menus_settings [true_index], true_index, "", menus [index] [i]) button:SetPoint (40, y) @@ -960,8 +1010,8 @@ local menus2 = { g:NewScrollBar (container_window, container_slave, 8, -10) container_window.slider:Altura (449) - container_window.slider:cimaPoint (0, 1) - container_window.slider:baixoPoint (0, -3) + container_window.slider:cimaPoint (20, 1) + container_window.slider:baixoPoint (20, -3) container_window.wheel_jump = 80 container_window.ultimo = 0 @@ -1075,8 +1125,8 @@ local menus2 = { f:SetSize (260, 16) f:SetScript ("OnEnter", background_on_enter) f:SetScript ("OnLeave", background_on_leave) - f:SetScript ("OnMouseDown", background_on_mouse_down) - f:SetScript ("OnMouseUp", background_on_mouse_up) + --f:SetScript ("OnMouseDown", background_on_mouse_down) + --f:SetScript ("OnMouseUp", background_on_mouse_up) f:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) f:SetBackdropColor (0, 0, 0, 0) f.parent = parent @@ -1167,8 +1217,8 @@ local menus2 = { f.is_button2 = is_button2 f:SetScript ("OnEnter", background_on_enter2) f:SetScript ("OnLeave", background_on_leave2) - f:SetScript ("OnMouseDown", background_on_mouse_down) - f:SetScript ("OnMouseUp", background_on_mouse_up) + --f:SetScript ("OnMouseDown", background_on_mouse_down) + --f:SetScript ("OnMouseUp", background_on_mouse_up) f:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}) f:SetBackdropColor (0, 0, 0, 0) f.parent = parent @@ -1244,7 +1294,7 @@ local menus2 = { window.title_y_pos2 = -50 window.left_start_at = 30 - window.right_start_at = 360 + window.right_start_at = 390 window.top_start_at = -90 window.buttons_width = 160 @@ -1332,8 +1382,8 @@ local menus2 = { close_button:GetNormalTexture():SetDesaturated (true) --> create a new background texture - background:SetTexture ([[Interface\AddOns\Details\images\background]]) - background:SetVertexColor (0.27, 0.27, 0.27, 0.7) + --background:SetTexture ([[Interface\AddOns\Details\images\background]]) + --background:SetVertexColor (0.27, 0.27, 0.27, 0.7) window:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1}) window:SetBackdropColor (1, 1, 1, 1) window:SetBackdropBorderColor (0, 0, 0, 1) @@ -1346,12 +1396,12 @@ local menus2 = { window_icon:Hide() --> decrease the width of menu background - menu_background:SetSize (163, 488) - menu_background:SetPoint ("topleft", window.widget, "topleft", 23, -78) - menu_background:Hide() - sub_background:SetPoint ("topleft", window.widget, "topleft", 192, -80) - sub_background:SetPoint ("bottomright", window.widget, "bottomright", -30, 27) - sub_background:Hide() + --menu_background:SetSize (163, 488) + --menu_background:SetPoint ("topleft", window.widget, "topleft", 23, -78) + --menu_background:Hide() + --sub_background:SetPoint ("topleft", window.widget, "topleft", 192, -80) + --sub_background:SetPoint ("bottomright", window.widget, "bottomright", -30, 27) + --sub_background:Hide() --> hide the dog and other stuff bigdog:Hide() @@ -1373,10 +1423,10 @@ local menus2 = { --> location fillbars:SetPoint ("bottomleft", window.widget, "bottomleft", 17, 16) - forge_button:SetTemplate (options_button_template) - forge_button:SetSize(120, 20) -- - history_button:SetTemplate (options_button_template) - history_button:SetSize(120, 20) +-- forge_button:SetTemplate (options_button_template) +-- forge_button:SetSize(120, 20) -- +-- history_button:SetTemplate (options_button_template) +-- history_button:SetSize(120, 20) fillbars:SetTemplate (options_button_template) fillbars:SetSize(120, 20) changelog:SetTemplate (options_button_template) @@ -1387,19 +1437,19 @@ local menus2 = { --feedback_button.textcolor = "white" --changelog.textcolor = "white" --fillbars.textcolor = "white" - history_button.textcolor = "C_OptionsButtonOrange" - forge_button.textcolor = "C_OptionsButtonOrange" +-- history_button.textcolor = "C_OptionsButtonOrange" +-- forge_button.textcolor = "C_OptionsButtonOrange" - history_button:SetHook ("OnEnter", extra_buttons_on_enter) - history_button:SetHook ("OnLeave", extra_buttons_on_leave) - forge_button:SetHook ("OnEnter", extra_buttons_on_enter) - forge_button:SetHook ("OnLeave", extra_buttons_on_leave) +-- history_button:SetHook ("OnEnter", extra_buttons_on_enter) +-- history_button:SetHook ("OnLeave", extra_buttons_on_leave) +-- forge_button:SetHook ("OnEnter", extra_buttons_on_enter) +-- forge_button:SetHook ("OnLeave", extra_buttons_on_leave) feedback_button.textsize = 10 changelog.textsize = 10 fillbars.textsize = 10 - history_button.textsize = 10 - forge_button.textsize = 10 +-- history_button.textsize = 10 +-- forge_button.textsize = 10 fillbars:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {323/512, 365/512, 42/512, 78/512}, {1, 1, 1, 0.6}, 4, 2) changelog:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {367/512, 399/512, 43/512, 76/512}, {1, 1, 1, 0.8}, 4, 2) @@ -1409,12 +1459,12 @@ local menus2 = { fillbars_image:Hide() feedback_image:Hide() - history_button:ClearAllPoints() - forge_button:ClearAllPoints() +-- history_button:ClearAllPoints() +-- forge_button:ClearAllPoints() --forge_button:SetPoint ("topright", -17, -47) - forge_button:SetPoint ("bottomleft", fillbars, "topleft", 0, 2) +-- forge_button:SetPoint ("bottomleft", fillbars, "topleft", 0, 2) --history_button:SetPoint ("right", forge_button, "left", -2, 0) - history_button:SetPoint ("bottomleft", changelog, "topleft", 0, 2) +-- history_button:SetPoint ("bottomleft", changelog, "topleft", 0, 2) --forge_button:Hide() --history_button:Hide() @@ -1456,7 +1506,7 @@ local menus2 = { local down = frame.baixo local slider = frame.slider - slider:SetPoint ("TOPLEFT", frame, "TOPRIGHT", 3, -20) + slider:SetPoint ("TOPLEFT", frame, "TOPRIGHT", 30, -20) slider:Altura (429) up:SetNormalTexture ([[Interface\Buttons\Arrow-Up-Up]]) @@ -11160,8 +11210,6 @@ end --> if not window ---------------------------------------------------------------------------------------- --> Show - - local strata = { ["BACKGROUND"] = "Background", ["LOW"] = "Low", @@ -11965,6 +12013,7 @@ end --> if not window end + if (_G.DetailsOptionsWindow.full_created) then _G.DetailsOptionsWindow.MyObject:update_all (instance) else @@ -11977,7 +12026,24 @@ end --> if not window end window.loading_check = _detalhes:ScheduleRepeatingTimer ("options_loading_done", 0.1) end - + window:Show() + + function DetailsOptionsWindow.OpenInPluginPanel() + for i = 1, #window.options do + local frame = window.options [i][1] + if (frame) then + frame:EnableMouse (false) + --frame:SetSize (DetailsPluginContainerWindow.FrameWidth, DetailsPluginContainerWindow.FrameHeight) + end + end + + --DetailsOptionsWindowBackground:SetSize (DetailsPluginContainerWindow.FrameWidth, DetailsPluginContainerWindow.FrameHeight) + _detalhes:FormatBackground (_G.DetailsOptionsWindow) + + DetailsPluginContainerWindow.OpenPlugin (DetailsOptionsWindow) + end + + DetailsOptionsWindow.OpenInPluginPanel() end --> OpenOptionsWindow diff --git a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua index 4c0563e6..95ac686e 100644 --- a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua +++ b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua @@ -473,11 +473,9 @@ local function CreatePluginFrames (data) end - - --> user clicked on button, need open or close window function EncounterDetails:OpenWindow() - if (EncounterDetails.open) then + if (EncounterDetails.Frame:IsShown()) then return EncounterDetails:CloseWindow() end @@ -508,6 +506,8 @@ local function CreatePluginFrames (data) C_Timer.After (3, function() EncounterDetails:ShowTutorial() end) + DetailsPluginContainerWindow.OpenPlugin (EncounterDetails) + return true end @@ -2103,6 +2103,11 @@ function EncounterDetails:OnEvent (_, event, ...) [7] = "MONSTER_YELL", } + --> embed the plugin into the plugin window + if (DetailsPluginContainerWindow) then + DetailsPluginContainerWindow.EmbedPlugin (EncounterDetails, EncounterDetails.Frame) + end + end end diff --git a/plugins/Details_EncounterDetails/frames.lua b/plugins/Details_EncounterDetails/frames.lua index e610fedb..dfb712c7 100644 --- a/plugins/Details_EncounterDetails/frames.lua +++ b/plugins/Details_EncounterDetails/frames.lua @@ -1982,7 +1982,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) local already_added = {} local build_dbm_bars = function() local t = {} - local db = _detalhes.global_plugin_database ["DETAILS_PLUGIN_ENCOUNTER_DETAILS"] + local db = _detalhes.boss_mods_timers if (db) then wipe (already_added) local encounter_id = EncounterDetails_SpellAurasScroll.encounter_id @@ -2015,7 +2015,7 @@ _detalhes.EncounterDetailsTempWindow = function (EncounterDetails) local build_bigwigs_bars = function() local t = {} - local db = _detalhes.global_plugin_database ["DETAILS_PLUGIN_ENCOUNTER_DETAILS"] + local db = _detalhes.boss_mods_timers if (db) then wipe (already_added) local encounter_id = EncounterDetails_SpellAurasScroll.encounter_id @@ -2485,14 +2485,14 @@ end local frame = BossFrame local mouse_down = function() - frame:StartMoving() - frame.isMoving = true + --frame:StartMoving() + --frame.isMoving = true end local mouse_up = function() if (frame.isMoving) then - frame:StopMovingOrSizing() - frame.isMoving = false + -- frame:StopMovingOrSizing() + -- frame.isMoving = false end end diff --git a/startup.lua b/startup.lua index e7dde065..8437f3a2 100644 --- a/startup.lua +++ b/startup.lua @@ -75,7 +75,13 @@ function _G._detalhes:Start() --> initialize --> build frames - + + --> plugin container + self:CreatePluginWindowContainer() + self:InitializeForge() --to install into the container plugin + self:InitializeRaidHistoryWindow() + self:InitializeOptionsWindow() + --> bookmarks if (self.switch.InitSwitch) then --self.switch:InitSwitch()