diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 9d6af8ee0..2a3b0bcc9 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 284 +local dversion = 285 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary (major, minor) diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index e3b17b113..bff07f430 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -1986,27 +1986,69 @@ function DF:CreateScaleBar (frame, config) local scaleBar, text = DF:CreateSlider (frame, 120, 14, 0.6, 1.6, 0.1, config.scale, true, "ScaleBar", nil, "Scale:", DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE"), DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) scaleBar.thumb:SetWidth(24) scaleBar:SetValueStep(0.1) - scaleBar:SetObeyStepOnDrag() + scaleBar:SetObeyStepOnDrag(true) scaleBar.mouseDown = false + rawset(scaleBar, "lockdown", true) + + --> create a custom editbox to enter the scale from text + local editbox = CreateFrame("editbox", nil, scaleBar.widget, "BackdropTemplate") + editbox:SetSize(40, 20) + editbox:SetJustifyH("center") + editbox:SetBackdrop({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], + edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", --edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], + tile = true, edgeSize = 8, tileSize = 5}) + editbox:SetFontObject("GameFontHighlightSmall") + + editbox:SetScript("OnEnterPressed", function() + editbox:ClearFocus() + editbox:Hide() + local text = editbox:GetText() + local newScale = DF.TextToFloor(text) - text:SetPoint ("topleft", frame, "topleft", 12, -7) - scaleBar:SetFrameLevel (DF.FRAMELEVEL_OVERLAY) - scaleBar.OnValueChanged = function (_, _, value) - if (scaleBar.mouseDown) then - config.scale = value - end - end + if (newScale) then + config.scale = newScale + scaleBar:SetValue(newScale) + frame:SetScale(newScale) + end + end) + + editbox:SetScript("OnEscapePressed", function() + editbox:ClearFocus() + editbox:Hide() + editbox:SetText(editbox.defaultValue) + end) - scaleBar:SetHook ("OnMouseDown", function() - scaleBar.mouseDown = true + editbox:SetScript("OnTextChanged", function() + end) + + scaleBar:SetScript("OnMouseDown", function(_, mouseButton) + if (mouseButton == "RightButton") then + editbox:Show() + editbox:SetAllPoints() + editbox:SetText(config.scale) + editbox.defaultValue = config.scale + + elseif (mouseButton == "LeftButton") then + scaleBar.mouseDown = true + end end) - scaleBar:SetHook ("OnMouseUp", function() - frame:SetScale(config.scale) - scaleBar.mouseDown = false + scaleBar:SetScript("OnMouseUp", function(_, mouseButton) + if (mouseButton == "LeftButton") then + scaleBar.mouseDown = false + frame:SetScale(config.scale) + end end) + + text:SetPoint("topleft", frame, "topleft", 12, -7) + scaleBar:SetFrameLevel(DF.FRAMELEVEL_OVERLAY) + scaleBar.OnValueChanged = function(_, _, value) + if (scaleBar.mouseDown) then + config.scale = value + end + end - scaleBar:SetAlpha (0.70) + scaleBar:SetAlpha(0.70) return scaleBar end @@ -9916,15 +9958,14 @@ DF.TimeLineFunctions = { } --creates a regular scroll in horizontal position -function DF:CreateTimeLineFrame (parent, name, options, timelineOptions) - +function DF:CreateTimeLineFrame(parent, name, options, timelineOptions) local width = options and options.width or timeline_options.width local height = options and options.height or timeline_options.height local scrollWidth = 800 --placeholder until the timeline receives data local scrollHeight = 800 --placeholder until the timeline receives data - local frameCanvas = CreateFrame ("scrollframe", name, parent, "BackdropTemplate") - DF:Mixin (frameCanvas, DF.TimeLineFunctions) + local frameCanvas = CreateFrame("scrollframe", name, parent, "BackdropTemplate") + DF:Mixin(frameCanvas, DF.TimeLineFunctions) frameCanvas.data = {} frameCanvas.lines = {} @@ -9951,10 +9992,11 @@ function DF:CreateTimeLineFrame (parent, name, options, timelineOptions) frameCanvas.elapsedTimeFrame = DF:CreateElapsedTimeFrame (frameBody, frameCanvas:GetName() and frameCanvas:GetName() .. "ElapsedTimeFrame", timelineOptions) --create horizontal slider - local horizontalSlider = CreateFrame ("slider", nil, parent, "BackdropTemplate") + local horizontalSlider = CreateFrame ("slider", frameCanvas:GetName() .. "HorizontalSlider", parent, "BackdropTemplate") horizontalSlider.bg = horizontalSlider:CreateTexture (nil, "background") horizontalSlider.bg:SetAllPoints (true) horizontalSlider.bg:SetTexture (0, 0, 0, 0.5) + frameCanvas.horizontalSlider = horizontalSlider horizontalSlider:SetBackdrop (frameCanvas.options.slider_backdrop) horizontalSlider:SetBackdropColor (unpack (frameCanvas.options.slider_backdrop_color)) @@ -9980,11 +10022,9 @@ function DF:CreateTimeLineFrame (parent, name, options, timelineOptions) frameCanvas:SetHorizontalScroll (stepValue) end end) - - frameCanvas.horizontalSlider = horizontalSlider --create scale slider - local scaleSlider = CreateFrame ("slider", nil, parent, "BackdropTemplate") + local scaleSlider = CreateFrame("slider", frameCanvas:GetName() .. "ScaleSlider", parent, "BackdropTemplate") scaleSlider.bg = scaleSlider:CreateTexture (nil, "background") scaleSlider.bg:SetAllPoints (true) scaleSlider.bg:SetTexture (0, 0, 0, 0.5) @@ -10018,10 +10058,11 @@ function DF:CreateTimeLineFrame (parent, name, options, timelineOptions) end) --create vertical slider - local verticalSlider = CreateFrame ("slider", nil, parent, "BackdropTemplate") + local verticalSlider = CreateFrame ("slider", frameCanvas:GetName() .. "VerticalSlider", parent, "BackdropTemplate") verticalSlider.bg = verticalSlider:CreateTexture (nil, "background") verticalSlider.bg:SetAllPoints (true) verticalSlider.bg:SetTexture (0, 0, 0, 0.5) + frameCanvas.verticalSlider = verticalSlider verticalSlider:SetBackdrop (frameCanvas.options.slider_backdrop) verticalSlider:SetBackdropColor (unpack (frameCanvas.options.slider_backdrop_color)) @@ -10042,8 +10083,6 @@ function DF:CreateTimeLineFrame (parent, name, options, timelineOptions) verticalSlider:SetScript ("OnValueChanged", function (self) frameCanvas:SetVerticalScroll (self:GetValue()) end) - - frameCanvas.verticalSlider = verticalSlider --mouse scroll frameCanvas:EnableMouseWheel (true) diff --git a/Libs/DF/slider.lua b/Libs/DF/slider.lua index 7b2455533..5166ede6f 100644 --- a/Libs/DF/slider.lua +++ b/Libs/DF/slider.lua @@ -644,6 +644,7 @@ local DFSliderMetaFunctions = _G[DF.GlobalWidgetControlNames ["slider"]] return tonumber (text) end + DF.TextToFloor = do_precision function DFSliderMetaFunctions:TypeValue() if (not self.isSwitch) then @@ -761,14 +762,14 @@ local DFSliderMetaFunctions = _G[DF.GlobalWidgetControlNames ["slider"]] if (slider.MyObject.useDecimals) then amt = slider:GetValue() else - amt = do_precision (slider:GetValue()) + amt = do_precision(slider:GetValue()) end - + if (slider.MyObject.typing_value and not slider.MyObject.typing_can_change) then slider.MyObject:SetValue (slider.MyObject.typing_value_started) return end - + table_insert (slider.MyObject.previous_value, 1, amt) table_remove (slider.MyObject.previous_value, 4) diff --git a/boot.lua b/boot.lua index ccb011022..cc00dd9f9 100644 --- a/boot.lua +++ b/boot.lua @@ -6,13 +6,13 @@ local version, build, date, tocversion = GetBuildInfo() - _detalhes.build_counter = 9213 - _detalhes.alpha_build_counter = 9213 --if this is higher than the regular counter, use it instead + _detalhes.build_counter = 9688 + _detalhes.alpha_build_counter = 9688 --if this is higher than the regular counter, use it instead _detalhes.bcc_counter = 31 _detalhes.dont_open_news = true _detalhes.game_version = version _detalhes.userversion = version .. _detalhes.build_counter - _detalhes.realversion = 145 --core version, this is used to check API version for scripts and plugins (see alias below) + _detalhes.realversion = 146 --core version, this is used to check API version for scripts and plugins (see alias below) _detalhes.APIVersion = _detalhes.realversion --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" --simple stirng to show to players @@ -56,6 +56,27 @@ do New API: Details:ShowDeathTooltip(combatObject, deathTable) for Cooltip tooltips. ]=] + {"v9.1.5.9213.146", "February 15th, 2022"}, + "Added an option to change your own bar color.", + "Added 'Ignore this Npc' into the Npc list under the spell list section.", + "Bookmark window now uses the same scale than the options panel.", + "Class Color window now uses the same scale than the options panel.", + "If not casted on the player itself Power Infusion now shows in the buff list of the target.", + "Allowed nicknames on custom displays (by Flamanis).", + "Aligned Text Columns enabled is now default for new installs.", + "Fodder to the flames DH ability won't count damage done by the player on the add summoned.", + "Fixed the load time for the Npc Ids panel on the spell list section.", + "Fixed all issues with the options panel scale.", + "Fixed tooltips overlap when the window is positioned at the top of the screen (fix by Flamanis).", + "Fixed auto hide windows which wasn't saving its group when unhiding (fix by Flamanis).", + "Fixed some XML Headers which was giving errors on loading (fix by github user h0tw1r3).", + "Fixed '/details me' on TBC, which wasn't working correctly (fix by github user Baugstein).", + "Fixed a typo on Vanguard plugin (fix by github user cruzerthebruzer).", + "Fixed font 'NuevaStd' where something the font didn't work at all.", + "Fixed an issue where for some characters the options panel won't open showing an error in the chat instead.", + "New API: combat:GetPlayerDeaths(deadPlayerName).", + "New API: Details:ShowDeathTooltip(combatObject, deathTable) for Cooltip tooltips.", + {"v9.1.5.9213.145", "December 9th, 2021"}, "Fixed an issue where after reloading, overall data won't show the players nickname.", "Fixed overkill damage on death log tooltip.", diff --git a/core/control.lua b/core/control.lua index 3e97b1401..a9c4a82ee 100644 --- a/core/control.lua +++ b/core/control.lua @@ -422,6 +422,7 @@ Details.tabela_vigente.IsBeingCreated = nil Details:SendEvent ("COMBAT_PLAYER_ENTER", nil, Details.tabela_vigente, Details.encounter_table and Details.encounter_table.id) + if (Details.tabela_vigente.is_boss) then --> the encounter was found through encounter_start event Details:SendEvent ("COMBAT_BOSS_FOUND", nil, Details.tabela_vigente.is_boss.index, Details.tabela_vigente.is_boss.name)