From ad76abfd00328bea0a0f2d64c5b6cf8e0239664e Mon Sep 17 00:00:00 2001 From: Tercio Date: Fri, 6 Feb 2015 20:34:21 -0200 Subject: [PATCH] - All the changes required for the Chart Viewer 2.0. - Fixed the options panel open bug. --- boot.lua | 10 ++-- framework/panel.lua | 124 ++++++++++++++++++++++++++------------- framework/textentry.lua | 11 +++- functions/events.lua | 4 ++ functions/timedata.lua | 14 +++++ gumps/janela_options.lua | 7 ++- 6 files changed, 119 insertions(+), 51 deletions(-) diff --git a/boot.lua b/boot.lua index 5d26e801..3478f760 100644 --- a/boot.lua +++ b/boot.lua @@ -4,8 +4,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 509 --it's 509 for release - _detalhes.userversion = "v3.9.7" - _detalhes.realversion = 58 --core version + _detalhes.userversion = "v3.9.8" + _detalhes.realversion = 59 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -20,7 +20,7 @@ do local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) --[[ -|cFFFFFF00v3.9.7 (|cFFFFCC00Feb 05, 2015|r|cFFFFFF00)|r:\n\n +|cFFFFFF00v3.9.8 (|cFFFFCC00Feb 05, 2015|r|cFFFFFF00)|r:\n\n |cFFFFFF00-|r Enemies display now shows damage taken instead of damage done.\n\n |cFFFFFF00-|r Tooltip for enemies display now also show damage and healing done by the enemy.\n\n |cFFFFFF00-|r Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.\n\n @@ -45,9 +45,9 @@ do |cFFFFFF00-|r Fixed the window ungroup button (above the resize one).\n\n --]] --- |cFFFFFF00v3.9.7 (|cFFFFCC00Feb 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Enemies display now shows damage taken instead of damage done.\n\n|cFFFFFF00-|r Tooltip for enemies display now also show damage and healing done by the enemy.\n\n|cFFFFFF00-|r Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.\n\n|cFFFFFF00-|r Added an option to ignore nicknames and always use character names.\n\n|cFFFFFF00-|r Enabling the display icon on title bar now makes the title text automatically move slightly to right.\n\n|cFFFFFF00-|r Fixed issue with skin changing when the window has the statusbar enabled.\n\n +-- |cFFFFFF00v3.9.8 (|cFFFFCC00Feb 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Enemies display now shows damage taken instead of damage done.\n\n|cFFFFFF00-|r Tooltip for enemies display now also show damage and healing done by the enemy.\n\n|cFFFFFF00-|r Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.\n\n|cFFFFFF00-|r Added an option to ignore nicknames and always use character names.\n\n|cFFFFFF00-|r Enabling the display icon on title bar now makes the title text automatically move slightly to right.\n\n|cFFFFFF00-|r Fixed issue with skin changing when the window has the statusbar enabled.\n\n -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.9.7 (|cFFFFCC00Feb 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Enemies display now shows damage taken instead of damage done.\n\n|cFFFFFF00-|r Tooltip for enemies display now also show damage and healing done by the enemy.\n\n|cFFFFFF00-|r Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.\n\n|cFFFFFF00-|r Added an option to ignore nicknames and always use character names.\n\n|cFFFFFF00-|r Enabling the display icon on title bar now makes the title text automatically move slightly to right.\n\n|cFFFFFF00-|r Fixed issue with skin changing when the window has the statusbar enabled.\n\n|cFFFFFF00v3.9.4 (|cFFFFCC00Feb 03, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option 'Ignore Mass Toggle', when enabled the window won't be affected when hiding, showing or toggling all windows.\n\n|cFFFFFF00-|r Added window number for slash commands 'hide', 'show' and 'toggle'. Usage: '/details hide 1' to hide window 1.\n\n|cFFFFFF00-|r Removed keybinds for Open and Close, added toggle instead.\n\n|cFFFFFF00-|r Added slash command 'toggle'.\n\n|cFFFFFF00-|r Added display icons for all skins which still didn't have they.\n\n|cFFFFFF00-|r Improved 'Align with right chat' tool, now it also supports Forced Square skin.\n\n|cFFFFFF00-|r Improvements on Bookmark panel.\n\n|cFFFFFF00-|r Improvements on spec icons with transparency.\n\n|cFFFFFF00-|r Created custom spell for Living Bomb explosion.\n\n|cFFFFFF00-|r Fixed statusbar textures and mini displays.\n\n|cFFFFFF00-|r Fixed an issue with title bar buttons when toggling the titlebar anchor from bottom to top position.\n\n|cFFFFFF00-|r Fixed an issue with title bar text when toggling the statusbar position from bottom to top.\n\n|cFFFFFF00-|r Fixed yet another bug with avoidance tab on player detail window.\n\n|cFFFFFF00-|r Fixed the window ungroup button (above the resize one).\n\n|cFFFFFF00v3.8.13 (|cFFFFCC00Jan 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r RaidCheck (plugin): added an option to be able to use the report panel.\n\n|cFFFFFF00-|r You Are Not Prepared (plugin): added Auto Close the window, can be disabled through its options panel.\n\n|cFFFFFF00-|r Vanguard (plugin): Added Options Panel.\n\n|cFFFFFF00-|r Details! is now using 'LibWindow-1.1' to save and restore the positioning of the windows, bug might appear, please report if something weird happen.\n\n|cFFFFFF00-|r Improved specialization detection in order to try detect spec changes.\n\n|cFFFFFF00-|r Added options to change the brackets and the separator for dps/percent block.\n\n|cFFFFFF00-|r Added options for show (or hide) totals, dps and percent amount.\n\n|cFFFFFF00-|r Added Segments shortcut menu pressing Shift + Right click.\n\n|cFFFFFF00-|r Fixed positioning after reopen a window previously closed on last logon.\n\n|cFFFFFF00-|r Fixed enemies display where sometimes the bars were black instead of red.\n\n|cFFFFFF00-|r Fixed few places where spec icons wasn't being used on.\n\n|cFFFFFF00-|r Fixed avoidance panel on Player Details Window where sometimes was giving errors.\n\n|cFFFFFF00-|r Fixed priest shadow and holy detection.\n\n|cFFFFFF00-|r Fixed blood and unholy spec icons.\n\n|cFFFFFF00-|r Fixed an issue with 'Always Show me' feature where it was showing the player on Enemies display.\n\n|cFFFFFF00v3.8.1 (|cFFFFCC00Jan 17, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin Vanguard: got full rewrite and now it is more easy to use.\n\n|cFFFFFF00-|r Plugin TimeAttack: fixed problem where sometimes required a reload to start a new time.\n\n|cFFFFFF00-|r Plugin Damage the Game!: fixed a problem where sometimes the time didn't started after level 2.\n\n|cFFFFFF00-|r Added specialization icons.\n\n|cFFFFFF00-|r Fixed Auto-Hide where it wasn't hiding the wallpaper of the window.\n\n|cFFFFFF00-|r Added 'Editing Group' check box on option panel, when enabled, settings changed also are modified on all windows in the group.\n\n|cFFFFFF00-|r Changing window's skin, doesn't change any more settings not related with appearance, for example, Auto-Hide, Switches.\n\n|cFFFFFF00-|r Custom display 'Health Potion & Stone' now also track Healing Tonic.\n\n|cFFFFFF00-|r Custom display 'Damage Taken by Spell' now tracks more spells and also melee hits.\n\n|cFFFFFF00-|r Menus now uses 'Friz Quadrata TT' font as default, also added an option to change it on options panel -> miscellaneous.\n\n|cFFFFFF00-|r 'Switch to Current' feature now switches all windows which have this option enabled.\n\n|cFFFFFF00-|r The message telling to use '/details reinstall' now only shows if a problem happen during the addon load process.\n\n|cFFFFFF00-|r Segments Saved option now can be set to 25, up from 5.\n\n|cFFFFFF00-|r Attempt to fix the bug with the monk spell 'Storm, Earth, and Fire'.\n\n|cFFFFFF00-|r Fixed 'Icon Pick' panel.\n\n|cFFFFFF00-|r Fixed bug when reporting friendly fire through player detail window.\n\n|cFFFFFF00-|r Fixed bug with report window where sometimes it was reporting on a wrong channel.\n\n|cFFFFFF00v3.7.1 (|cFFFFCC00Jan 08, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin 'Damage Rank': is now called 'Damage, the Game!' and had its levels adjusted for WoD.\n\n|cFFFFFF00-|r Plugin 'Tiny Threat': fixed player name where it was showing the realm name too.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed frame details (clicking on a bar) shown behind the Vanguard panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed a problem when clicking with right button wasn't opening the bookmark panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': incoming heals now count shield amount on the player too.\n\n|cFFFFFF00-|r Plugin 'Vanguard' Known Bug: incoming damage and melee vs avoidance seems to be inaccurate by now, we need more time to study and fix it.\n\n|cFFFFFF00-|r Added Twins Ogron's Charge as custom spells, one for the charge by him self and other for the copies (mythic only).\n\n|cFFFFFF00-|r Added option panel for Raid Check plugin.\n\n|cFFFFFF00-|r Added key bindings for open a window, close a window and select a bookmark.\n\n|cFFFFFF00-|r Added 'CTRL + RightClick' closes a window.\n\n|cFFFFFF00-|r Fixed wallpaper transparency after releasing the window from a stretch.|cFFFFFF00-|r Fixed few issues when using class text colors.\n\n|cFFFFFF00-|r Fixed characters name outside instances, now it replaces the realm name with a * and show the complete name on tooltip.\n\n|cFFFFFF00-|r Fixed damage mitigation on damage taken, this affects only specific classes like monk tank.\n\n|cFFFFFF00-|r Fixed auto erase poping up when the player enters on its garrison.\n\n|cFFFFFF00-|r Fixed combat on garrison training dummies which was being marked as Trash Segment.\n\n|cFFFFFF00-|r Fixed command /details disable, wasn't disabling the capture of cooldowns.\n\n|cFFFFFF00-|r Fixed a problem with fast dps/hps when the window is in a empty segment.\n\n|cFFFFFF00-|r Fixed an issue using bookmark panel where it wasn't changing the display when the window is in a plugin mode.\n\n|cFFFFFF00-|r Fixed a bug when bars isn't using class colors on Frags, Auras & Void Zones, Resources and Deaths.\n\n|cFFFFFF00-|r Fixed bar animations when 'Sort Direction' is set to bottom.\n\n|cFFFFFF00-|r Fixed the spam 'you are not in a guild' when checking for new versions.\n\n|cFFFFFF00-|r Fixed translations for Auto Hide Settings bracket under options panel.\n\n|cFFFFFF00-|r Fixed Auto Hide -> Mouse Interaction tool where wans't able to work okey during combat.\n\n|cFFFFFF00v3.6.14b (|cFFFFCC00Jan 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'My Spells' which shows your spells in the window.\n\n|cFFFFFF00-|r Added new custom display: Health Potion & Stone.\n\n|cFFFFFF00-|r Added overkill on death's tooltip.\n\n|cFFFFFF00-|r Created custom spells for Twin Ogron's Pulverize. Now it has 3 spells one for each wave.\n\n|cFFFFFF00-|r Created custom spells for Ko'ragh Overflowing Energy. Now it has 2 spells one for when the ball is catched and other when it reaches the ground and explodes.\n\n|cFFFFFF00-|r Changed healing multistrike to use the same format as damage done.\n\n|cFFFFFF00-|r Few improvements on Tiny Threat plugin: color gradient green-red is fixed, texts and bar texture now correctly uses the window settings.\n\n|cFFFFFF00-|r Damage Taken by Spell won't show pets in its tooltip any more.\n\n|cFFFFFF00-|r Enemies display won't show any more mirror images and spirit link totems.\n\n|cFFFFFF00-|r Enemies's tooltip now only show players and show all players instead of only 6.\n\n|cFFFFFF00-|r Few cooldowns shown as raid wide now shows as personal cooldowns.\n\n|cFFFFFF00-|r Fixed dispell tagets on dispell's tooltip.\n\n|cFFFFFF00-|r Fixed 'First Hit' raid tool.\n\n|cFFFFFF00-|r Fixed 'Open Options Panel' from interface panel." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v3.9.8 (|cFFFFCC00Feb 06, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Enemies display now shows damage taken instead of damage done.\n\n|cFFFFFF00-|r Tooltip for enemies display now also show damage and healing done by the enemy.\n\n|cFFFFFF00-|r Added an option under miscellaneous to show neutral and hostile creatures on damage taken display.\n\n|cFFFFFF00-|r Added an option to ignore nicknames and always use character names.\n\n|cFFFFFF00-|r Enabling the display icon on title bar now makes the title text automatically move slightly to right.\n\n|cFFFFFF00-|r Fixed issue with skin changing when the window has the statusbar enabled.\n\n|cFFFFFF00v3.9.4 (|cFFFFCC00Feb 03, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option 'Ignore Mass Toggle', when enabled the window won't be affected when hiding, showing or toggling all windows.\n\n|cFFFFFF00-|r Added window number for slash commands 'hide', 'show' and 'toggle'. Usage: '/details hide 1' to hide window 1.\n\n|cFFFFFF00-|r Removed keybinds for Open and Close, added toggle instead.\n\n|cFFFFFF00-|r Added slash command 'toggle'.\n\n|cFFFFFF00-|r Added display icons for all skins which still didn't have they.\n\n|cFFFFFF00-|r Improved 'Align with right chat' tool, now it also supports Forced Square skin.\n\n|cFFFFFF00-|r Improvements on Bookmark panel.\n\n|cFFFFFF00-|r Improvements on spec icons with transparency.\n\n|cFFFFFF00-|r Created custom spell for Living Bomb explosion.\n\n|cFFFFFF00-|r Fixed statusbar textures and mini displays.\n\n|cFFFFFF00-|r Fixed an issue with title bar buttons when toggling the titlebar anchor from bottom to top position.\n\n|cFFFFFF00-|r Fixed an issue with title bar text when toggling the statusbar position from bottom to top.\n\n|cFFFFFF00-|r Fixed yet another bug with avoidance tab on player detail window.\n\n|cFFFFFF00-|r Fixed the window ungroup button (above the resize one).\n\n|cFFFFFF00v3.8.13 (|cFFFFCC00Jan 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r RaidCheck (plugin): added an option to be able to use the report panel.\n\n|cFFFFFF00-|r You Are Not Prepared (plugin): added Auto Close the window, can be disabled through its options panel.\n\n|cFFFFFF00-|r Vanguard (plugin): Added Options Panel.\n\n|cFFFFFF00-|r Details! is now using 'LibWindow-1.1' to save and restore the positioning of the windows, bug might appear, please report if something weird happen.\n\n|cFFFFFF00-|r Improved specialization detection in order to try detect spec changes.\n\n|cFFFFFF00-|r Added options to change the brackets and the separator for dps/percent block.\n\n|cFFFFFF00-|r Added options for show (or hide) totals, dps and percent amount.\n\n|cFFFFFF00-|r Added Segments shortcut menu pressing Shift + Right click.\n\n|cFFFFFF00-|r Fixed positioning after reopen a window previously closed on last logon.\n\n|cFFFFFF00-|r Fixed enemies display where sometimes the bars were black instead of red.\n\n|cFFFFFF00-|r Fixed few places where spec icons wasn't being used on.\n\n|cFFFFFF00-|r Fixed avoidance panel on Player Details Window where sometimes was giving errors.\n\n|cFFFFFF00-|r Fixed priest shadow and holy detection.\n\n|cFFFFFF00-|r Fixed blood and unholy spec icons.\n\n|cFFFFFF00-|r Fixed an issue with 'Always Show me' feature where it was showing the player on Enemies display.\n\n|cFFFFFF00v3.8.1 (|cFFFFCC00Jan 17, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin Vanguard: got full rewrite and now it is more easy to use.\n\n|cFFFFFF00-|r Plugin TimeAttack: fixed problem where sometimes required a reload to start a new time.\n\n|cFFFFFF00-|r Plugin Damage the Game!: fixed a problem where sometimes the time didn't started after level 2.\n\n|cFFFFFF00-|r Added specialization icons.\n\n|cFFFFFF00-|r Fixed Auto-Hide where it wasn't hiding the wallpaper of the window.\n\n|cFFFFFF00-|r Added 'Editing Group' check box on option panel, when enabled, settings changed also are modified on all windows in the group.\n\n|cFFFFFF00-|r Changing window's skin, doesn't change any more settings not related with appearance, for example, Auto-Hide, Switches.\n\n|cFFFFFF00-|r Custom display 'Health Potion & Stone' now also track Healing Tonic.\n\n|cFFFFFF00-|r Custom display 'Damage Taken by Spell' now tracks more spells and also melee hits.\n\n|cFFFFFF00-|r Menus now uses 'Friz Quadrata TT' font as default, also added an option to change it on options panel -> miscellaneous.\n\n|cFFFFFF00-|r 'Switch to Current' feature now switches all windows which have this option enabled.\n\n|cFFFFFF00-|r The message telling to use '/details reinstall' now only shows if a problem happen during the addon load process.\n\n|cFFFFFF00-|r Segments Saved option now can be set to 25, up from 5.\n\n|cFFFFFF00-|r Attempt to fix the bug with the monk spell 'Storm, Earth, and Fire'.\n\n|cFFFFFF00-|r Fixed 'Icon Pick' panel.\n\n|cFFFFFF00-|r Fixed bug when reporting friendly fire through player detail window.\n\n|cFFFFFF00-|r Fixed bug with report window where sometimes it was reporting on a wrong channel.\n\n|cFFFFFF00v3.7.1 (|cFFFFCC00Jan 08, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Plugin 'Damage Rank': is now called 'Damage, the Game!' and had its levels adjusted for WoD.\n\n|cFFFFFF00-|r Plugin 'Tiny Threat': fixed player name where it was showing the realm name too.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed frame details (clicking on a bar) shown behind the Vanguard panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': fixed a problem when clicking with right button wasn't opening the bookmark panel.\n\n|cFFFFFF00-|r Plugin 'Vanguard': incoming heals now count shield amount on the player too.\n\n|cFFFFFF00-|r Plugin 'Vanguard' Known Bug: incoming damage and melee vs avoidance seems to be inaccurate by now, we need more time to study and fix it.\n\n|cFFFFFF00-|r Added Twins Ogron's Charge as custom spells, one for the charge by him self and other for the copies (mythic only).\n\n|cFFFFFF00-|r Added option panel for Raid Check plugin.\n\n|cFFFFFF00-|r Added key bindings for open a window, close a window and select a bookmark.\n\n|cFFFFFF00-|r Added 'CTRL + RightClick' closes a window.\n\n|cFFFFFF00-|r Fixed wallpaper transparency after releasing the window from a stretch.|cFFFFFF00-|r Fixed few issues when using class text colors.\n\n|cFFFFFF00-|r Fixed characters name outside instances, now it replaces the realm name with a * and show the complete name on tooltip.\n\n|cFFFFFF00-|r Fixed damage mitigation on damage taken, this affects only specific classes like monk tank.\n\n|cFFFFFF00-|r Fixed auto erase poping up when the player enters on its garrison.\n\n|cFFFFFF00-|r Fixed combat on garrison training dummies which was being marked as Trash Segment.\n\n|cFFFFFF00-|r Fixed command /details disable, wasn't disabling the capture of cooldowns.\n\n|cFFFFFF00-|r Fixed a problem with fast dps/hps when the window is in a empty segment.\n\n|cFFFFFF00-|r Fixed an issue using bookmark panel where it wasn't changing the display when the window is in a plugin mode.\n\n|cFFFFFF00-|r Fixed a bug when bars isn't using class colors on Frags, Auras & Void Zones, Resources and Deaths.\n\n|cFFFFFF00-|r Fixed bar animations when 'Sort Direction' is set to bottom.\n\n|cFFFFFF00-|r Fixed the spam 'you are not in a guild' when checking for new versions.\n\n|cFFFFFF00-|r Fixed translations for Auto Hide Settings bracket under options panel.\n\n|cFFFFFF00-|r Fixed Auto Hide -> Mouse Interaction tool where wans't able to work okey during combat.\n\n|cFFFFFF00v3.6.14b (|cFFFFCC00Jan 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added custom display 'My Spells' which shows your spells in the window.\n\n|cFFFFFF00-|r Added new custom display: Health Potion & Stone.\n\n|cFFFFFF00-|r Added overkill on death's tooltip.\n\n|cFFFFFF00-|r Created custom spells for Twin Ogron's Pulverize. Now it has 3 spells one for each wave.\n\n|cFFFFFF00-|r Created custom spells for Ko'ragh Overflowing Energy. Now it has 2 spells one for when the ball is catched and other when it reaches the ground and explodes.\n\n|cFFFFFF00-|r Changed healing multistrike to use the same format as damage done.\n\n|cFFFFFF00-|r Few improvements on Tiny Threat plugin: color gradient green-red is fixed, texts and bar texture now correctly uses the window settings.\n\n|cFFFFFF00-|r Damage Taken by Spell won't show pets in its tooltip any more.\n\n|cFFFFFF00-|r Enemies display won't show any more mirror images and spirit link totems.\n\n|cFFFFFF00-|r Enemies's tooltip now only show players and show all players instead of only 6.\n\n|cFFFFFF00-|r Few cooldowns shown as raid wide now shows as personal cooldowns.\n\n|cFFFFFF00-|r Fixed dispell tagets on dispell's tooltip.\n\n|cFFFFFF00-|r Fixed 'First Hit' raid tool.\n\n|cFFFFFF00-|r Fixed 'Open Options Panel' from interface panel." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/framework/panel.lua b/framework/panel.lua index 9161bb44..437bf3b2 100644 --- a/framework/panel.lua +++ b/framework/panel.lua @@ -16,6 +16,8 @@ local cleanfunction = function() end local PanelMetaFunctions = {} local APIFrameFunctions +simple_panel_counter = 1 + ------------------------------------------------------------------------------------------------------------ --> metatables @@ -1223,6 +1225,49 @@ function gump:IconPick (callback, close_when_select) end +function gump:CreateSimplePanel (parent, w, h, title, name) + + if (not name) then + name = "DetailsSimplePanel" .. simple_panel_counter + simple_panel_counter = simple_panel_counter + 1 + end + if (not parent) then + parent = UIParent + end + + local f = CreateFrame ("frame", name, UIParent) + f:SetSize (w or 400, h or 250) + f:SetPoint ("center", UIParent, "center", 0, 0) + f:SetFrameStrata ("FULLSCREEN") + f:EnableMouse() + f:SetMovable (true) + tinsert (UISpecialFrames, name) + + f:SetScript ("OnMouseDown", simple_panel_mouse_down) + f:SetScript ("OnMouseUp", simple_panel_mouse_up) + + local bg = f:CreateTexture (nil, "background") + bg:SetAllPoints (f) + bg:SetTexture ([[Interface\AddOns\Details\images\welcome]]) + + local close = CreateFrame ("button", name .. "Close", f, "UIPanelCloseButton") + close:SetSize (32, 32) + close:SetPoint ("topright", f, "topright", 0, -12) + + f.title = gump:CreateLabel (f, title or "", 12, nil, "GameFontNormal") + f.title:SetPoint ("top", f, "top", 0, -22) + + f.SetTitle = simple_panel_settitle + + simple_panel_counter = simple_panel_counter + 1 + + return f +end + + +------------------------------------------------------------------------------------------------------------------------------------------------ +--> chart panel + local chart_panel_backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", edgeSize = 32, insets = {left = 5, right = 5, top = 5, bottom = 5}} @@ -1383,13 +1428,13 @@ local create_box = function (self, next_box) local thisbox = {} self.BoxLabels [next_box] = thisbox - local box = gump:NewImage (self, nil, 16, 16, "border") - local text = gump:CreateLabel (self, nil, nil, nil, "GameFontNormal") + local box = gump:NewImage (self.Graphic, nil, 16, 16, "border") + local text = gump:CreateLabel (self.Graphic, nil, nil, nil, "GameFontNormal") - local border = gump:NewImage (self, [[Interface\DialogFrame\UI-DialogBox-Gold-Corner]], 30, 30, "artwork") + local border = gump:NewImage (self.Graphic, [[Interface\DialogFrame\UI-DialogBox-Gold-Corner]], 30, 30, "artwork") border:SetPoint ("center", box, "center", -3, -4) - local checktexture = gump:NewImage (self, [[Interface\Buttons\UI-CheckBox-Check]], 18, 18, "overlay") + local checktexture = gump:NewImage (self.Graphic, [[Interface\Buttons\UI-CheckBox-Check]], 18, 18, "overlay") checktexture:SetPoint ("center", box, "center", -1, -1) thisbox.box = box @@ -1398,7 +1443,7 @@ local create_box = function (self, next_box) thisbox.check = checktexture thisbox.enabled = true - local button = gump:CreateButton (self, chart_panel_enable_line, 20, 20, "", self, thisbox) + local button = gump:CreateButton (self.Graphic, chart_panel_enable_line, 20, 20, "", self, thisbox) button:SetPoint ("center", box, "center") thisbox.button = button @@ -1415,6 +1460,36 @@ local create_box = function (self, next_box) end +local realign_labels = function (self) + + local width = self:GetWidth() - 108 + + local first_box = self.BoxLabels [1] + first_box.text:SetPoint ("topright", self, "topright", -35, -16) + + local line_width = first_box.text:GetStringWidth() + 26 + + for i = 2, #self.BoxLabels do + + local box = self.BoxLabels [i] + + if (box.box:IsShown()) then + + line_width = line_width + box.text:GetStringWidth() + 26 + + if (line_width > width) then + line_width = box.text:GetStringWidth() + 26 + box.text:SetPoint ("topright", self, "topright", -35, -40) + else + box.text:SetPoint ("right", self.BoxLabels [i-1].box, "left", -7, 0) + end + else + break + end + end + +end + local chart_panel_add_label = function (self, color, name, type, number) local next_box = self.BoxLabelsAmount @@ -1441,6 +1516,8 @@ local chart_panel_add_label = function (self, color, name, type, number) thisbox.showing = true thisbox.enabled = true + realign_labels (self) + end local line_default_color = {1, 1, 1} @@ -1883,40 +1960,3 @@ local simple_panel_settitle = function (self, title) self.title:SetText (title) end -function gump:CreateSimplePanel (parent, w, h, title, name) - - if (not name) then - name = "DetailsSimplePanel" .. simple_panel_counter - end - if (not parent) then - parent = UIParent - end - - local f = CreateFrame ("frame", name, UIParent) - f:SetSize (w or 400, h or 250) - f:SetPoint ("center", UIParent, "center", 0, 0) - f:SetFrameStrata ("FULLSCREEN") - f:EnableMouse() - f:SetMovable (true) - tinsert (UISpecialFrames, name) - - f:SetScript ("OnMouseDown", simple_panel_mouse_down) - f:SetScript ("OnMouseUp", simple_panel_mouse_up) - - local bg = f:CreateTexture (nil, "background") - bg:SetAllPoints (f) - bg:SetTexture ([[Interface\AddOns\Details\images\welcome]]) - - local close = CreateFrame ("button", name .. "Close", f, "UIPanelCloseButton") - close:SetSize (32, 32) - close:SetPoint ("topright", f, "topright", 0, -12) - - f.title = gump:CreateLabel (f, title or "", 12, nil, "GameFontNormal") - f.title:SetPoint ("top", f, "top", 0, -22) - - f.SetTitle = simple_panel_settitle - - simple_panel_counter = simple_panel_counter + 1 - - return f -end \ No newline at end of file diff --git a/framework/textentry.lua b/framework/textentry.lua index 6f7bd34c..62abb789 100644 --- a/framework/textentry.lua +++ b/framework/textentry.lua @@ -15,6 +15,8 @@ local cleanfunction = function() end local APITextEntryFunctions = false local TextEntryMetaFunctions = {} +gump.TextEntryCounter = 1 + ------------------------------------------------------------------------------------------------------------ --> metatables @@ -470,13 +472,20 @@ local TextEntryMetaFunctions = {} ------------------------------------------------------------------------------------------------------------ --> object constructor +function gump:CreateTextEntry (parent, func, w, h, member, name) + return gump:NewTextEntry (parent, parent, name, member, w, h, func) +end + function gump:NewTextEntry (parent, container, name, member, w, h, func, param1, param2, space) if (not name) then - return nil + name = "DetailsTextEntryNumber" .. gump.TextEntryCounter + gump.TextEntryCounter = gump.TextEntryCounter + 1 + elseif (not parent) then return nil end + if (not container) then container = parent end diff --git a/functions/events.lua b/functions/events.lua index a6ff7b67..fd3099ca 100644 --- a/functions/events.lua +++ b/functions/events.lua @@ -37,6 +37,8 @@ ["COMBAT_BOSS_FOUND"] = {}, ["COMBAT_INVALID"] = {}, ["COMBAT_PREPOTION_UPDATED"] = {}, + ["COMBAT_CHARTTABLES_CREATING"] = {}, + ["COMBAT_CHARTTABLES_CREATED"] = {}, --> area ["ZONE_TYPE_CHANGED"] = {}, @@ -84,6 +86,8 @@ local common_events = { ["COMBAT_BOSS_FOUND"] = true, ["COMBAT_INVALID"] = true, ["COMBAT_PREPOTION_UPDATED"] = true, + ["COMBAT_CHARTTABLES_CREATING"] = true, + ["COMBAT_CHARTTABLES_CREATED"] = true, ["GROUP_ONENTER"] = true, ["GROUP_ONLEAVE"] = true, ["ZONE_TYPE_CHANGED"] = true, diff --git a/functions/timedata.lua b/functions/timedata.lua index 67f1c322..0318ac03 100644 --- a/functions/timedata.lua +++ b/functions/timedata.lua @@ -177,6 +177,8 @@ local exec = {} _detalhes.timeContainer.Exec = exec + _detalhes:SendEvent ("COMBAT_CHARTTABLES_CREATING") + --> build the exec table for index, t in ipairs (_detalhes.savedTimeCaptures) do if (t [INDEX_ENABLED]) then @@ -197,6 +199,8 @@ end end + + _detalhes:SendEvent ("COMBAT_CHARTTABLES_CREATED") tick_time = 0 @@ -477,4 +481,14 @@ function _detalhes:BrokerTick() _detalhes.databroker.text = parse_broker_text() end + + function _detalhes:SetDataBrokerText (text) + if (type (text) == "string") then + _detalhes.data_broker_text = text + _detalhes:BrokerTick() + elseif (text == nil or (type (text) == "boolean" and not text)) then + _detalhes.data_broker_text = "" + _detalhes:BrokerTick() + end + end \ No newline at end of file diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index c23ad659..21ded2e9 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -1,6 +1,8 @@ --[[ options panel file --]] --[[ + search for "~number" without the quotes to quick access the page: + 1 - general 2 - combat 3 - skin @@ -1658,8 +1660,7 @@ function window:CreateFrame19() broker_entry.text = _detalhes.data_broker_text broker_entry:SetHook ("OnTextChanged", function (self, byUser) - _detalhes.data_broker_text = broker_entry.text - _detalhes:BrokerTick() + _detalhes:SetDataBrokerText (broker_entry.text) _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) end) @@ -9966,7 +9967,7 @@ end --> if not window _G.DetailsOptionsWindow3SkinDropdown.MyObject:SetFixedParameter (editing_instance) _G.DetailsOptionsWindow3SkinDropdown.MyObject:Select (skin) - local skin_object = _detalhes:GetSkin (skin) + local skin_object = editing_instance:GetSkin() local skin_name_formated = skin:gsub (" ", "") --> hide all