From a24c1ac50814a475236cb6d7eb9cb0cdf92fc709 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Wed, 31 Jul 2024 18:53:54 -0300 Subject: [PATCH] Fixed an issue with the loot on the end of the mythic plus panel --- Libs/DF/buildmenu.lua | 9 +++-- Libs/DF/charts.lua | 34 +++++++++++++++++++ Libs/DF/definitions.lua | 5 ++- Libs/DF/fw.lua | 2 +- boot.lua | 4 +-- core/parser.lua | 23 ++++++++----- .../window_mythicplus/window_end_of_run.lua | 5 +-- functions/mythicdungeon/data_capture.lua | 4 +-- functions/mythicdungeon/mythicdungeon.lua | 2 +- luaserver.lua | 13 +++++-- 10 files changed, 77 insertions(+), 24 deletions(-) diff --git a/Libs/DF/buildmenu.lua b/Libs/DF/buildmenu.lua index fc3928dcb..9bcfb86ad 100644 --- a/Libs/DF/buildmenu.lua +++ b/Libs/DF/buildmenu.lua @@ -550,13 +550,16 @@ local setColorProperties = function(parent, widget, widgetTable, currentXOffset, label:ClearAllPoints() if (bAlignAsPairs) then - PixelUtil.SetPoint(label, "topleft", widget:GetParent(), "topleft", currentXOffset, currentYOffset) - PixelUtil.SetPoint(widget.widget, "left", label, "left", nAlignAsPairsLength, 0) - if (not widget.highlightFrame) then local highlightFrame = createOptionHighlightFrame(widget, label, (widgetWidth or 140) + nAlignAsPairsLength + 5) widget.highlightFrame = highlightFrame end + + ---- + widget._valueChangeHook = valueChangeHook + --widget.highlightFrame:SetScript("OnClick", highlightFrameOnClickToggle) --todo make this function for color picker color pick start + PixelUtil.SetPoint(label, "topleft", widget:GetParent(), "topleft", currentXOffset, currentYOffset) + PixelUtil.SetPoint(widget.widget, "right", widget.highlightFrame, "right", -3, 0) else if (widgetTable.boxfirst or bUseBoxFirstOnAllWidgets) then label:SetPoint("left", widget.widget, "right", 2, 0) diff --git a/Libs/DF/charts.lua b/Libs/DF/charts.lua index 27d0ac76c..ba3bc5174 100644 --- a/Libs/DF/charts.lua +++ b/Libs/DF/charts.lua @@ -87,6 +87,11 @@ end ---@field lines line[] ---@field fixedLineWidth number ---@field chartName string +---@field dataPoint_OnEnterFunc fun(self: df_chart, onEnterFunc: function, ...) set the function to be called when the mouse hover over a data point in the chart +---@field dataPoint_OnEnterPayload any[] set the payload to be passed to the function set by DataPoint_OnEnterFunc +---@field dataPoint_OnLeaveFunc fun(self: df_chart, onLeaveFunc: function, ...) set the function to be called when the mouse leaves a data point in the chart +---@field dataPoint_OnLeavePayload any[] set the payload to be passed to the function set by DataPoint_OnLeaveFunc +---@field GetOnEnterLeaveFunctions fun(self: df_chart) : function, any[], function, any[] return the functions and payloads set by DataPoint_OnEnterFunc and DataPoint_OnLeaveFunc ---@field ChartFrameConstructor fun(self: df_chart) set the default values for the chart frame ---@field GetLine fun(self: df_chart) : line return a line and also internally handle next line ---@field GetLines fun(self: df_chart) : line[] return a table with all lines already created @@ -684,6 +689,31 @@ detailsFramework.ChartFrameMixin = { self:UpdateFrameSizeCache() end, + ---when the mouse hover over a data point in the chart, this function will be called + ---@param self df_chart + SetOnEnterFunction = function(self, onEnterFunc, ...) + self.dataPoint_OnEnterFunc = onEnterFunc + self.dataPoint_OnEnterPayload = {...} + end, + + ---when the mouse leaves a data point in the chart, this function will be called + ---@param self df_chart + SetOnLeaveFunction = function(self, onLeaveFunc, ...) + self.dataPoint_OnLeaveFunc = onLeaveFunc + self.dataPoint_OnLeavePayload = {...} + end, + + ---get the data point on enter and on leave function + ---@param self df_chart + ---@return function onEnterFunc + ---@return any[] onEnterPayload + ---@return function onLeaveFunc + ---@return any[] onLeavePayload + GetOnEnterLeaveFunctions = function(self) + return self.dataPoint_OnEnterFunc, self.dataPoint_OnEnterPayload, self.dataPoint_OnLeaveFunc, self.dataPoint_OnLeavePayload + end, + + ---this function will draw the chart lines ---@param self df_chart ---@param yPointScale number|nil ---@param bUpdateLabels boolean|nil @@ -709,6 +739,8 @@ detailsFramework.ChartFrameMixin = { self:ResetDataIndex() + print(maxLines) + for i = 1, maxLines do local line = self:GetLine() @@ -798,6 +830,8 @@ local createChartFrame = function(parent, name) return chartFrame end + + function detailsFramework:CreateGraphicLineFrame(parent, name) ---@type df_chart local newGraphicFrame = createChartFrame(parent, name) diff --git a/Libs/DF/definitions.lua b/Libs/DF/definitions.lua index 0c9ad3fe8..07128d275 100644 --- a/Libs/DF/definitions.lua +++ b/Libs/DF/definitions.lua @@ -330,10 +330,9 @@ ---@field CreateSearchBox fun(self:table, parent:frame, callback:function) : df_searchbox ---@field ConvertAnchorPointToInside fun(self:table, anchorPoint:anchorid) : anchorid ---@field CreateHeader fun(self:table, parent:frame, headerTable:df_headercolumndata[], options:table?, frameName:string?) : df_headerframe +---@field CreateGraphicMultiLineFrame fun(self:table, parent:frame, name:string) : df_chartmulti +---@field CreateGraphicLineFrame fun(self:table, parent:frame, name:string) : df_chart ---@field ----@field - - --[=[ Wrapped objects: when using the following functions, the object will be wrapped in a table, e.g. detailsFramework:CreateButton() will return a table with the button, the button will be accessible through the "button" key. diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index d41464aa6..07964f4de 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 555 +local dversion = 556 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary(major, minor) diff --git a/boot.lua b/boot.lua index a3f10fc97..d1bc25eac 100644 --- a/boot.lua +++ b/boot.lua @@ -19,8 +19,8 @@ local addonName, Details222 = ... local version, build, date, tvs = GetBuildInfo() - Details.build_counter = 12822 - Details.alpha_build_counter = 12822 --if this is higher than the regular counter, use it instead + Details.build_counter = 12823 + Details.alpha_build_counter = 12823 --if this is higher than the regular counter, use it instead Details.dont_open_news = true Details.game_version = version Details.userversion = version .. " " .. Details.build_counter diff --git a/core/parser.lua b/core/parser.lua index 1e12a7023..f357fa650 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -628,14 +628,18 @@ --146739 is corruption that doesn't expire local spells_cant_start_combat = { - [387846] = true, - [352561] = true, - [111400] = true, - [371070] = true, - [368637] = true, - [401394] = true, - [146739] = true, + [368637] = true, --The Third Rune + [371070] = true, --Rotting from Within + [146739] = true, --Corruption + [387846] = true, --Fel Armor + [352561] = true, --Undulating Maneuvers + [401394] = true, --Unstable Flames + [111400] = true, --Burning Rush + [12654] = true, --Ignite + [419800] = true, --Intensifying Flame + [448744] = true, --Authority of Radiant Power } + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --internal functions @@ -937,6 +941,8 @@ end end + --local spellInfo = C_Spell.GetSpellInfo(spellId) + --print("1 spell:", spellId, spellInfo.name) Details222.StartCombat(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags) else --entrar em combate se for dot e for do jogador e o ultimo combate ter sido a mais de 10 segundos atr�s @@ -945,8 +951,9 @@ return end - --faz o calculo dos 10 segundos + --can't start a combat with a dot with the latest combat finished less than 10 seconds ago if (Details.last_combat_time + 10 < _tempo) then + --print("2 spell:", spellId) Details222.StartCombat(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags) end end diff --git a/frames/window_mythicplus/window_end_of_run.lua b/frames/window_mythicplus/window_end_of_run.lua index 663fbb33c..8a6d636d0 100644 --- a/frames/window_mythicplus/window_end_of_run.lua +++ b/frames/window_mythicplus/window_end_of_run.lua @@ -53,7 +53,7 @@ end --debug _G.MythicDungeonFrames = mythicDungeonFrames ---/run _G.MythicDungeonFrames.ShowEndOfMythicPlusPanel(true) +--/run _G.MythicDungeonFrames.ShowEndOfMythicPlusPanel() ---@class animatedtexture : texture, df_frameshake ---@field CreateRandomBounceSettings function @@ -170,7 +170,8 @@ function lootFrame.UpdateUnitLoot(unitBanner) local rarityColor = --[[GLOBAL]]ITEM_QUALITY_COLORS[itemQuality] lootSquare.LootIconBorder:SetVertexColor(rarityColor.r, rarityColor.g, rarityColor.b, 1) - lootSquare.LootIcon:SetTexture(GetItemIcon(itemID)) + lootSquare.LootIcon:SetTexture(C_Item.GetItemIconByID(itemID)) + --lootSquare.LootIcon:SetTexture(GetItemIcon(itemID)) --deprecated on wow11 lootSquare.LootItemLevel:SetText(effectiveILvl or "0") mythicDungeonFrames.ReadyFrame.StopTextDotAnimation() diff --git a/functions/mythicdungeon/data_capture.lua b/functions/mythicdungeon/data_capture.lua index ef23c565b..cf3983ae2 100644 --- a/functions/mythicdungeon/data_capture.lua +++ b/functions/mythicdungeon/data_capture.lua @@ -170,8 +170,8 @@ function mythicDungeonCharts:OnBossDefeated() if (mythicLevel and mythicLevel > 0) then if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.Running and bossInfo) then - local copiedBossInfo = Details:GetFramework().table.copy({}, bossInfo) - table.insert(mythicDungeonCharts.ChartTable.BossDefeated, {time() - mythicDungeonCharts.ChartTable.StartTime, copiedBossInfo, currentCombat:GetCombatTime()}) + local tCopiedBossInfo = Details:GetFramework().table.copy({}, bossInfo) + table.insert(mythicDungeonCharts.ChartTable.BossDefeated, {time() - mythicDungeonCharts.ChartTable.StartTime, tCopiedBossInfo, currentCombat:GetCombatTime()}) mythicDungeonCharts:Debug("Boss defeated, time saved", currentCombat:GetCombatTime()) else if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.EndTime ~= -1) then diff --git a/functions/mythicdungeon/mythicdungeon.lua b/functions/mythicdungeon/mythicdungeon.lua index fd58dd511..74b4c4b8e 100644 --- a/functions/mythicdungeon/mythicdungeon.lua +++ b/functions/mythicdungeon/mythicdungeon.lua @@ -49,7 +49,7 @@ function DetailsMythicPlusFrame.BossDefeated(this_is_end_end, encounterID, encou end --local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo() - Details222.MythicPlus.OnBossDefeated(encounterID, encounterName) + Details222.MythicPlus.OnBossDefeated(encounterID, encounterName) --data capture --increase the segment number for the mythic run Details.MythicPlus.SegmentID = Details.MythicPlus.SegmentID + 1 diff --git a/luaserver.lua b/luaserver.lua index 00bb6fa50..7122df605 100644 --- a/luaserver.lua +++ b/luaserver.lua @@ -822,7 +822,17 @@ function C_Item.IsBoundToAccountUntilEquip() end function C_Item.LockItem() end function C_Item.DoesItemMatchTargetEnchantingSpell() end function C_Item.IsItemCorruptionRelated() end -function C_Item.GetItemIconByID() end + +---return the item's icon texture +---@param itemInfo number|string +---@return number +function C_Item.GetItemIconByID(itemInfo) return 0 end + +---return the item's icon texture +---@param itemLocation table +---@return number +function C_Item.GetItemIcon(itemLocation) return 0 end + function C_Item.ConfirmOnUse() end function C_Item.GetItemIDForItemInfo() end function C_Item.IsCorruptedItem() end @@ -879,7 +889,6 @@ function C_Item.GetItemClassInfo() end function C_Item.GetItemUniquenessByID() end function C_Item.GetItemGemID() end function C_Item.IsHarmfulItem() end -function C_Item.GetItemIcon() end function C_Item.DropItemOnUnit() end ---@param itemInfo number|string