From f5c5f452dc6871ab22983af9cbc3b02ca1a6507d Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Tue, 20 Aug 2024 23:08:46 +0200 Subject: [PATCH 01/17] Reintroduce `tierToken` var to history --- .vscode/settings.json | 2 +- Modules/History/lootHistory.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b69a6b17..26d8b178 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,7 +16,7 @@ "utf8": "disable" }, "Lua.workspace.library": [ - "~\\.vscode\\extensions\\ketho.wow-api-0.16.8\\Annotations" + "~\\.vscode\\extensions\\ketho.wow-api-0.17.4\\Annotations" ], "Lua.diagnostics.globals": [ "lfs" diff --git a/Modules/History/lootHistory.lua b/Modules/History/lootHistory.lua index d348d58c..a934ad16 100644 --- a/Modules/History/lootHistory.lua +++ b/Modules/History/lootHistory.lua @@ -136,7 +136,8 @@ end function LootHistory:OnHistoryReceived (name, history) if not addon:Getdb().enableHistory then return end -- v2.15 Add itemClass and itemSubClass locally: - local _, _, _, _, _, itemClassID, itemSubClassID = C_Item.GetItemInfoInstant(history.lootWon) + local itemID, _, _, _, _, itemClassID, itemSubClassID = C_Item.GetItemInfoInstant(history.lootWon) + history.tierToken = RCTokenTable[itemID] and true history.iClass = itemClassID history.iSubClass = itemSubClassID if addon.lootDB.factionrealm[name] then From 86bda7105883c8cf6c79b47fb23d01935adbaf7c Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Tue, 20 Aug 2024 23:21:18 +0200 Subject: [PATCH 02/17] Removed `tierLookup` from history. Now shows tokens per instance in more info --- Modules/History/lootHistory.lua | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Modules/History/lootHistory.lua b/Modules/History/lootHistory.lua index a934ad16..4c05c183 100644 --- a/Modules/History/lootHistory.lua +++ b/Modules/History/lootHistory.lua @@ -73,18 +73,6 @@ function LootHistory:OnInitialize() self:SubscribeToPermanentComms() end -local tierLookUpTable = { -- instanceMapID to Tier text - [1530] = L["Tier 19"], - [1676] = L["Tier 20"], - [1712] = L["Tier 21"], -} - -local difficultyLookupTable = { - [14] = L["tier_token_normal"], - [15] = L["tier_token_heroic"], - [16] = L["tier_token_mythic"], -} - function LootHistory:OnEnable() addon.Log("LootHistory:OnEnable()") moreInfo = true @@ -1076,9 +1064,9 @@ function LootHistory:UpdateMoreInfo(rowFrame, cellFrame, dat, cols, row, realrow tip:AddLine(" ") tip:AddLine(L["Tokens received"]) -- Add tier tokens - for _, v in pairs(moreInfoData[row.name].totals.tokens) do - if v.mapID and v.difficultyID and tierLookUpTable[v.mapID] then - tip:AddDoubleLine(tierLookUpTable[v.mapID].." "..difficultyLookupTable[v.difficultyID]..":", v.num, 1,1,1, 1,1,1) + for instance, v in pairs(moreInfoData[row.name].totals.tokens) do + if v.mapID and v.difficultyID then + tip:AddDoubleLine(instance..":", v.num, 1,1,1, 1,1,1) end end tip:AddLine(" ") From 9116197755b0cd747d60aa36e2c7781b03443c68 Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Wed, 21 Aug 2024 00:20:59 +0200 Subject: [PATCH 03/17] History tierToken backwardsCompat --- Utils/BackwardsCompat.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Utils/BackwardsCompat.lua b/Utils/BackwardsCompat.lua index d0e33a5d..3348361a 100644 --- a/Utils/BackwardsCompat.lua +++ b/Utils/BackwardsCompat.lua @@ -250,5 +250,20 @@ Compat.list = { func = function () addon:ResetUI() end + }, + + { + name = "Update 'tierToken' in history", + version = "3.14.0", + func = function () + local Item = addon.Require "Utils.Item" + for _, factionrealm in pairs(addon.lootDB.sv.factionrealm) do + for _, data in pairs(factionrealm) do + for _, v in ipairs(data) do + v.tierToken = RCTokenTable[Item:GetItemIDFromLink(v.lootWon)] and true + end + end + end + end } } From 7722433cc5194097fdb0b0cdf24db513324a7e14 Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Wed, 21 Aug 2024 00:22:37 +0200 Subject: [PATCH 04/17] Reintroduce tierToken stats to moreInfo. Sorted token sources in history moreInfo. Allow tierToken responses to count as singular responses --- Modules/History/lootHistory.lua | 10 +++++++--- core.lua | 8 +++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Modules/History/lootHistory.lua b/Modules/History/lootHistory.lua index 4c05c183..91beea97 100644 --- a/Modules/History/lootHistory.lua +++ b/Modules/History/lootHistory.lua @@ -1063,9 +1063,13 @@ function LootHistory:UpdateMoreInfo(rowFrame, cellFrame, dat, cols, row, realrow end tip:AddLine(" ") tip:AddLine(L["Tokens received"]) + local tokensSorted = {} + for n in pairs(moreInfoData[row.name].totals.tokens) do tinsert(tokensSorted, n) end + table.sort(tokensSorted) -- Add tier tokens - for instance, v in pairs(moreInfoData[row.name].totals.tokens) do - if v.mapID and v.difficultyID then + for _, instance in pairs(tokensSorted) do + local v = moreInfoData[row.name].totals.tokens[instance] + if v.mapID and v.difficultyID and v.num > 0 then tip:AddDoubleLine(instance..":", v.num, 1,1,1, 1,1,1) end end @@ -1106,7 +1110,7 @@ function LootHistory:UpdateMoreInfo(rowFrame, cellFrame, dat, cols, row, realrow tip:AddDoubleLine("difficultyID:", data.difficultyID, 1,1,1, 1,1,1) tip:AddDoubleLine("mapID", data.mapID, 1,1,1, 1,1,1) tip:AddDoubleLine("groupSize", data.groupSize, 1,1,1, 1,1,1) - tip:AddDoubleLine("tierToken", data.tierToken, 1,1,1, 1,1,1) + tip:AddDoubleLine("tierToken", tostring(data.tierToken), 1,1,1, 1,1,1) tip:AddDoubleLine("tokenRoll", tostring(data.tokenRoll), 1,1,1, 1,1,1) tip:AddDoubleLine("relicRoll", tostring(data.relicRoll), 1,1,1, 1,1,1) tip:AddLine(" ") diff --git a/core.lua b/core.lua index a9f66807..9200dc39 100644 --- a/core.lua +++ b/core.lua @@ -1861,14 +1861,13 @@ function RCLootCouncil:GetLootDBStatistics() id = entry.responseID if type(id) == "number" then -- ID may be string, e.g. "PASS" if entry.isAwardReason then id = id + 100 end -- Bump to distingush from normal awards - if entry.tokenRoll then id = id + 200 end - if entry.relicRoll then id = id + 300 end + if entry.tierToken then id = id + 200 end end -- We assume the mapID and difficultyID is available on any item if at all. if not numTokens[entry.instance] then numTokens[entry.instance] = {num = 0, mapID = entry.mapID, difficultyID = entry.difficultyID} end - if entry.tierToken then -- If it's a tierToken, increase the count + if entry.tierToken and not entry.isAwardReason then -- If it's a tierToken, increase the count numTokens[entry.instance].num = numTokens[entry.instance].num + 1 end count[id] = count[id] and count[id] + 1 or 1 @@ -1877,8 +1876,7 @@ function RCLootCouncil:GetLootDBStatistics() color[id] = #entry.color ~= 0 and #entry.color == 4 and entry.color or {1, 1, 1} end if lastestAwardFound < 5 and type(id) == "number" and not entry.isAwardReason - and (id <= db.numMoreInfoButtons or (entry.tokenRoll and id - 200 <= db.numMoreInfoButtons) - or (entry.relicRoll and id - 300 <= db.numMoreInfoButtons)) then + and (id <= db.numMoreInfoButtons or (entry.tierToken and id - 200 <= db.numMoreInfoButtons)) then tinsert(lootDBStatistics[name], { entry.lootWon, --[[entry.response .. ", "..]] format(L["'n days' ago"], self:ConvertDateToString(self:GetNumberOfDaysFromNow(entry.date))), From 5c5e3337e698aa7607751a0da7ca1865ab079b03 Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Wed, 21 Aug 2024 00:28:55 +0200 Subject: [PATCH 05/17] Removed unused fields from statistics numTokens --- Modules/History/lootHistory.lua | 6 +++--- core.lua | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/History/lootHistory.lua b/Modules/History/lootHistory.lua index 91beea97..acceb561 100644 --- a/Modules/History/lootHistory.lua +++ b/Modules/History/lootHistory.lua @@ -1068,9 +1068,9 @@ function LootHistory:UpdateMoreInfo(rowFrame, cellFrame, dat, cols, row, realrow table.sort(tokensSorted) -- Add tier tokens for _, instance in pairs(tokensSorted) do - local v = moreInfoData[row.name].totals.tokens[instance] - if v.mapID and v.difficultyID and v.num > 0 then - tip:AddDoubleLine(instance..":", v.num, 1,1,1, 1,1,1) + local num = moreInfoData[row.name].totals.tokens[instance] + if num > 0 then + tip:AddDoubleLine(instance..":", num, 1,1,1, 1,1,1) end end tip:AddLine(" ") diff --git a/core.lua b/core.lua index 9200dc39..31f61bff 100644 --- a/core.lua +++ b/core.lua @@ -1865,10 +1865,10 @@ function RCLootCouncil:GetLootDBStatistics() end -- We assume the mapID and difficultyID is available on any item if at all. if not numTokens[entry.instance] then - numTokens[entry.instance] = {num = 0, mapID = entry.mapID, difficultyID = entry.difficultyID} + numTokens[entry.instance] = 0 end if entry.tierToken and not entry.isAwardReason then -- If it's a tierToken, increase the count - numTokens[entry.instance].num = numTokens[entry.instance].num + 1 + numTokens[entry.instance] = numTokens[entry.instance] + 1 end count[id] = count[id] and count[id] + 1 or 1 responseText[id] = responseText[id] and responseText[id] or entry.response From 80d28da8986f097c8aacc6ceb817f571403b1631 Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Wed, 21 Aug 2024 00:30:40 +0200 Subject: [PATCH 06/17] Also fix comment --- core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core.lua b/core.lua index 31f61bff..e293abc8 100644 --- a/core.lua +++ b/core.lua @@ -1863,7 +1863,7 @@ function RCLootCouncil:GetLootDBStatistics() if entry.isAwardReason then id = id + 100 end -- Bump to distingush from normal awards if entry.tierToken then id = id + 200 end end - -- We assume the mapID and difficultyID is available on any item if at all. + -- Tier Tokens if not numTokens[entry.instance] then numTokens[entry.instance] = 0 end From 39ee09fe8a68c8c8de86b0489fca781bb15ad282 Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Wed, 21 Aug 2024 01:13:04 +0200 Subject: [PATCH 07/17] Fixed accessor error --- Modules/votingFrame.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/votingFrame.lua b/Modules/votingFrame.lua index a0a1944b..f06d60db 100644 --- a/Modules/votingFrame.lua +++ b/Modules/votingFrame.lua @@ -1005,7 +1005,7 @@ function RCVotingFrame:UpdateMoreInfo(row, data) end if moreInfoData[name].totals.tokens[addon.currentInstanceName] then tip:AddLine(" ") - tip:AddDoubleLine(L["Tier tokens received from here:"], moreInfoData[name].totals.tokens[addon.currentInstanceName].num, 1,1,1, 1,1,1) + tip:AddDoubleLine(L["Tier tokens received from here:"], moreInfoData[name].totals.tokens[addon.currentInstanceName], 1,1,1, 1,1,1) end tip:AddDoubleLine(L["Number of raids received loot from:"], moreInfoData[name].totals.raids.num, 1,1,1, 1,1,1) tip:AddDoubleLine(L["Total items received:"], moreInfoData[name].totals.total, 0,1,1, 0,1,1) From 669ed0dea5e6bb64a55c8536fa3a7798988dd85f Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Sun, 1 Sep 2024 17:55:51 +0200 Subject: [PATCH 08/17] Update trinket data --- Utils/TrinketData.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Utils/TrinketData.lua b/Utils/TrinketData.lua index 0c4da907..584ae572 100644 --- a/Utils/TrinketData.lua +++ b/Utils/TrinketData.lua @@ -242,7 +242,8 @@ _G.RCTrinketCategories = { ["3092776070010"] = DAMAGER .. ", " .. ITEM_MOD_INTELLECT_SHORT, -- Damage + Healers, Intellect ["1010671040000"] = DAMAGER .. ", " .. ITEM_MOD_INTELLECT_SHORT, -- Damage, Intellect (direct damage, no affliction warlock and shadow priest) ["5010771040000"] = DAMAGER .. ", " .. ITEM_MOD_INTELLECT_SHORT, -- Damage, Intellect (no discipline) - ["1134773647743"] = DAMAGER, -- Damage + ["1134773647743"] = DAMAGER, -- Damage (Pre augmentation evoker) + ["5134773647743"] = DAMAGER, -- Damage ["0325002007700"] = ITEM_MOD_AGILITY_SHORT, -- Agility (DPS + vengance and brewmaster)?? ["73F7777077710"] = ITEM_MOD_AGILITY_SHORT .. "/" .. ITEM_MOD_INTELLECT_SHORT, -- Agility/Intellect ["0000000700077"] = ITEM_MOD_STRENGTH_SHORT, -- Strength @@ -1927,7 +1928,7 @@ _G.RCTrinketSpecs = { -- Nerub-ar Palace Normal (id: 1273). [212451] = "5010771040000", -- Aberrant Spellforge, Damage, Intellect [219915] = "0241000100024", -- Foul Behemoth's Chelicera, Tank - [212454] = "73F7777777777", -- Mad Queen's Mandate, All Classes + [212454] = "5134773647743", -- Mad Queen's Mandate, Damage [212449] = "0124002607443", -- Sikran's Endless Arsenal, Damage, Melee [212453] = "0000000700067", -- Skyterror's Corrosive Organ, Strength [212450] = "0241000100024", -- Swarmlord's Authority, Tank From a923f24d129e0aab87b014ab317b98e9e0a162ef Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:50:54 +0200 Subject: [PATCH 09/17] Don't clamp moreInfo to screen --- .vscode/settings.json | 40 ++++++++++++++++++++++++++++++++- Modules/History/lootHistory.lua | 1 + Modules/votingFrame.lua | 1 + changelog.md | 4 ++++ 4 files changed, 45 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 26d8b178..53558799 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,6 +19,44 @@ "~\\.vscode\\extensions\\ketho.wow-api-0.17.4\\Annotations" ], "Lua.diagnostics.globals": [ - "lfs" + "lfs", + "ChatFrame_AddMessageEventFilter", + "INVSLOT_LAST_EQUIPPED", + "UIParent", + "WOW_PROJECT_MAINLINE", + "WOW_PROJECT_ID", + "RAID_CLASS_COLORS", + "GameTooltip", + "getglobal", + "tIndexOf", + "tInvert", + "GetClassColorObj", + "Settings", + "SettingsPanel", + "CLASS_ICON_TCOORDS", + "CreateAtlasMarkup", + "CreateSimpleTextureMarkup", + "tContains", + "FindValueInTableIf", + "escapePatternSymbols", + "ITEM_BNETACCOUNTBOUND", + "PLAYER_LIST_DELIMITER", + "BIND_TRADE_TIME_REMAINING", + "ITEM_SOULBOUND", + "ITEM_ACCOUNTBOUND", + "LIST_DELIMITER", + "INT_SPELL_DURATION_SEC", + "INT_SPELL_DURATION_HOURS", + "TIME_UNIT_DELIMITER", + "INT_SPELL_DURATION_MIN", + "GetUnitName", + "FauxScrollFrame_OnVerticalScroll", + "CopyTable", + "tDeleteItem", + "Clamp", + "HandleModifiedItemClick", + "REQUEST_ROLL", + "CreateColor", + "AccumulateOp" ] } \ No newline at end of file diff --git a/Modules/History/lootHistory.lua b/Modules/History/lootHistory.lua index acceb561..f412669c 100644 --- a/Modules/History/lootHistory.lua +++ b/Modules/History/lootHistory.lua @@ -920,6 +920,7 @@ function LootHistory:GetFrame() self.moreInfo = CreateFrame("GameTooltip", "RCLootHistoryMoreInfo", f.content, "GameTooltipTemplate") self.moreInfo:SetIgnoreParentScale(true) + self.moreInfo:SetClampedToScreen(false) f.content:SetScript("OnSizeChanged", function() self.moreInfo:SetScale(Clamp(f:GetScale() * 0.6, .4, .9)) end) diff --git a/Modules/votingFrame.lua b/Modules/votingFrame.lua index f06d60db..0ccd0f96 100644 --- a/Modules/votingFrame.lua +++ b/Modules/votingFrame.lua @@ -1193,6 +1193,7 @@ function RCVotingFrame:GetFrame() f.moreInfo = CreateFrame( "GameTooltip", "RCVotingFrameMoreInfo", f.content, "GameTooltipTemplate" ) f.moreInfo:SetIgnoreParentScale(true) + f.moreInfo:SetClampedToScreen(false) f.content:SetScript("OnSizeChanged", function() f.moreInfo:SetScale(Clamp(f:GetScale() * 0.6, .4, .9)) end) diff --git a/changelog.md b/changelog.md index 7a2d9b12..81b94057 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +## Changes + +More info frames is no longer clamped to screen. + # 3.13.1 ## Changes From 1b54804b1cb40bc0174eeb42a299e20e7cac0736 Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:03:55 +0200 Subject: [PATCH 10/17] Check for string response before comparing with number --- .vscode/settings.json | 73 +++++++++++++++++++++++++++++++++ Modules/History/lootHistory.lua | 3 +- 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 53558799..8b80a0e6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,79 @@ "Lua.runtime.path": [ "${workspace}/__tests/?.lua" ], +<<<<<<< Updated upstream +======= + + "Lua.workspace.library": [ + "${3rd}/luassert/library", + "~/AppData/Roaming/Code/User/globalStorage/sumneko.lua/addonManager/addons/luassert/module/library", + "~/AppData/Roaming/Code/User/globalStorage/sumneko.lua/addonManager/addons/busted/module/library", + "${3rd}/lfs/library", + "~\\.vscode\\extensions\\ketho.wow-api-0.17.6\\Annotations" + ], + "Lua.diagnostics.globals": [ + "lfs", + "GUILD_BANK_LOG_TIME", + "Settings", + "SettingsPanel", + "CLASS_ICON_TCOORDS", + "CreateSimpleTextureMarkup", + "FindValueInTableIf", + "ITEM_BNETACCOUNTBOUND", + "PLAYER_LIST_DELIMITER", + "ITEM_ACCOUNTBOUND", + "LIST_DELIMITER", + "INT_SPELL_DURATION_SEC", + "INT_SPELL_DURATION_HOURS", + "INT_SPELL_DURATION_MIN", + "ChatFrame1", + "ALL_CLASSES", + "ExportUtil", + "PlayerUtil", + "escapePatternSymbols", + "ChatFrame_AddMessageEventFilter", + "BIND_TRADE_TIME_REMAINING", + "ITEM_SOULBOUND", + "TIME_UNIT_DELIMITER", + "ReloadUI", + "RELIC_TOOLTIP_TYPE", + "ITEM_MOD_STRENGTH_SHORT", + "MELEE", + "ITEM_MOD_AGILITY_SHORT", + "ITEM_MOD_INTELLECT_SHORT", + "TANK", + "HEALER", + "DAMAGER", + "BLOCK", + "PARRY", + "RANGED", + "AccumulateOp", + "FauxScrollFrame_OnVerticalScroll", + "HandleModifiedItemClick", + "REQUEST_ROLL", + "NAME", + "require", + "tInsertUnique", + "CLOSE", + "LOOT_ITEM", + "ToggleDropDownMenu", + "UIDropDownMenu_HandleGlobalMouseEvent", + "CloseMenus", + "ColorPickerFrame", + "VIDEO_QUALITY_LABEL6", + "DEFAULT_CHAT_FRAME", + "RANDOM_ROLL_RESULT" + ], + "Lua.diagnostics.disable": [ + "undefined-doc-name", + "missing-parameter" + ], + + "Lua.workspace.ignoreDir": [ + ".vscode", + "__tests" + ], +>>>>>>> Stashed changes "Lua.runtime.version": "Lua 5.1", "Lua.runtime.builtin": { "basic": "disable", diff --git a/Modules/History/lootHistory.lua b/Modules/History/lootHistory.lua index f412669c..a2d98357 100644 --- a/Modules/History/lootHistory.lua +++ b/Modules/History/lootHistory.lua @@ -467,7 +467,7 @@ function LootHistory.SetCellResponse(rowFrame, frame, data, cols, row, realrow, if args.color and type(args.color) == "table" and type(args.color[1]) == "number" then -- Never version saves the color with the entry frame.text:SetTextColor(unpack(args.color)) - elseif args.responseID and args.responseID > 0 then -- try to recreate color from ID + elseif args.responseID and (type(args.responseID) == "string" or args.responseID > 0) then -- try to recreate color from ID frame.text:SetTextColor(unpack(addon:GetResponse("default", args.responseID).color)) else -- default to white frame.text:SetTextColor(1,1,1,1) @@ -1114,6 +1114,7 @@ function LootHistory:UpdateMoreInfo(rowFrame, cellFrame, dat, cols, row, realrow tip:AddDoubleLine("tierToken", tostring(data.tierToken), 1,1,1, 1,1,1) tip:AddDoubleLine("tokenRoll", tostring(data.tokenRoll), 1,1,1, 1,1,1) tip:AddDoubleLine("relicRoll", tostring(data.relicRoll), 1,1,1, 1,1,1) + tip:AddDoubleLine("typeCode", tostring(data.typeCode)) tip:AddLine(" ") tip:AddDoubleLine("Total LootDB entries:", #self.frame.rows, 1,1,1, 0,0,1) end From 894ef4751b4110272357aa44583457e028f4b5db Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:33:31 +0200 Subject: [PATCH 11/17] Annotation stuff --- .vscode/settings.json | 87 ++++++------------------------------------- core.lua | 2 +- 2 files changed, 12 insertions(+), 77 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8b80a0e6..871b86b6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,81 +1,7 @@ { - "todo-tree.tree.showCountsInTree": false, "Lua.runtime.path": [ "${workspace}/__tests/?.lua" ], -<<<<<<< Updated upstream -======= - - "Lua.workspace.library": [ - "${3rd}/luassert/library", - "~/AppData/Roaming/Code/User/globalStorage/sumneko.lua/addonManager/addons/luassert/module/library", - "~/AppData/Roaming/Code/User/globalStorage/sumneko.lua/addonManager/addons/busted/module/library", - "${3rd}/lfs/library", - "~\\.vscode\\extensions\\ketho.wow-api-0.17.6\\Annotations" - ], - "Lua.diagnostics.globals": [ - "lfs", - "GUILD_BANK_LOG_TIME", - "Settings", - "SettingsPanel", - "CLASS_ICON_TCOORDS", - "CreateSimpleTextureMarkup", - "FindValueInTableIf", - "ITEM_BNETACCOUNTBOUND", - "PLAYER_LIST_DELIMITER", - "ITEM_ACCOUNTBOUND", - "LIST_DELIMITER", - "INT_SPELL_DURATION_SEC", - "INT_SPELL_DURATION_HOURS", - "INT_SPELL_DURATION_MIN", - "ChatFrame1", - "ALL_CLASSES", - "ExportUtil", - "PlayerUtil", - "escapePatternSymbols", - "ChatFrame_AddMessageEventFilter", - "BIND_TRADE_TIME_REMAINING", - "ITEM_SOULBOUND", - "TIME_UNIT_DELIMITER", - "ReloadUI", - "RELIC_TOOLTIP_TYPE", - "ITEM_MOD_STRENGTH_SHORT", - "MELEE", - "ITEM_MOD_AGILITY_SHORT", - "ITEM_MOD_INTELLECT_SHORT", - "TANK", - "HEALER", - "DAMAGER", - "BLOCK", - "PARRY", - "RANGED", - "AccumulateOp", - "FauxScrollFrame_OnVerticalScroll", - "HandleModifiedItemClick", - "REQUEST_ROLL", - "NAME", - "require", - "tInsertUnique", - "CLOSE", - "LOOT_ITEM", - "ToggleDropDownMenu", - "UIDropDownMenu_HandleGlobalMouseEvent", - "CloseMenus", - "ColorPickerFrame", - "VIDEO_QUALITY_LABEL6", - "DEFAULT_CHAT_FRAME", - "RANDOM_ROLL_RESULT" - ], - "Lua.diagnostics.disable": [ - "undefined-doc-name", - "missing-parameter" - ], - - "Lua.workspace.ignoreDir": [ - ".vscode", - "__tests" - ], ->>>>>>> Stashed changes "Lua.runtime.version": "Lua 5.1", "Lua.runtime.builtin": { "basic": "disable", @@ -89,7 +15,7 @@ "utf8": "disable" }, "Lua.workspace.library": [ - "~\\.vscode\\extensions\\ketho.wow-api-0.17.4\\Annotations" + "~\\.vscode\\extensions\\ketho.wow-api-0.17.6\\Annotations" ], "Lua.diagnostics.globals": [ "lfs", @@ -130,6 +56,15 @@ "HandleModifiedItemClick", "REQUEST_ROLL", "CreateColor", - "AccumulateOp" + "AccumulateOp", + "BACKPACK_CONTAINER", + "NUM_BAG_SLOTS", + "GUILD_BANK_LOG_TIME", + "SecondsToTime", + "RANDOM_ROLL_RESULT", + "FindInTableIf", + "tFilter", + "tCompare", + "ContainsIf" ] } \ No newline at end of file diff --git a/core.lua b/core.lua index e293abc8..8c779710 100644 --- a/core.lua +++ b/core.lua @@ -46,7 +46,7 @@ ]] -- GLOBALS: GetLootMethod, C_AddOns.GetAddOnMetadata, UnitClass local addonname, addontable = ... ---- @class RCLootCouncil : AceAddon-3.0, AceConsole-3.0, AceEvent-3.0, AceHook-3.0, AceTimer-3.0, AceBucket-3.0 +--- @class RCLootCouncil : AceAddon, AceConsole-3.0, AceEvent-3.0, AceHook-3.0, AceTimer-3.0, AceBucket-3.0 _G.RCLootCouncil = LibStub("AceAddon-3.0"):NewAddon(addontable, addonname, "AceConsole-3.0", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0", "AceBucket-3.0"); local LibDialog = LibStub("LibDialog-1.1") From 125fd55ef49bf98c0829c7b892fc48a50a3484bb Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:37:31 +0200 Subject: [PATCH 12/17] Award Later during session counts as awarded --- Modules/votingFrame.lua | 19 ++++++++++--------- changelog.md | 4 ++++ ml_core.lua | 6 ++++-- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Modules/votingFrame.lua b/Modules/votingFrame.lua index 0ccd0f96..9a5eb13b 100644 --- a/Modules/votingFrame.lua +++ b/Modules/votingFrame.lua @@ -593,9 +593,10 @@ function RCVotingFrame:OnBaggedReceived (s) self:UpdateItemAwardHistory() end, 1) -- Make sure we've received the history data before updating if not lootTable[s] then return end -- We might not have lootTable - e.g. if we just reloaded - lootTable[s].bagged = true lootTable[s].baggedInSession = true - if addon.isMasterLooter and session ~= #lootTable then -- ML should move to the next item on award + lootTable[s].awarded = true + local nextSession = self:FetchUnawardedSession() + if addon.isMasterLooter and nextSession then -- ML should move to the next item on award self:SwitchSession(session + 1) else self:SwitchSession(session) -- Use switch session to update awardstring @@ -836,7 +837,12 @@ function RCVotingFrame:Update(forceUpdate) self.frame.st:SortData() self.frame.st:SortData() -- It appears that there is a bug in lib-st that only one SortData() does not use the "sortnext" to correct sort the rows. -- update awardString - if lootTable[session] and lootTable[session].awarded then + if lootTable[session] and lootTable[session].baggedInSession then + self.frame.awardString:SetText(L["The item will be awarded later"]) + self.frame.awardString:Show() + self.frame.awardStringPlayer:Hide() + self.frame.awardStringPlayer.classIcon:Hide() + elseif lootTable[session] and lootTable[session].awarded then self.frame.awardString:SetText(L["Item was awarded to"]) self.frame.awardString:Show() local name = lootTable[session].awarded @@ -847,11 +853,6 @@ function RCVotingFrame:Update(forceUpdate) -- Hack-reuse the SetCellClassIcon function addon.SetCellClassIcon(nil,self.frame.awardStringPlayer.classIcon,nil,nil,nil,nil,nil,nil,nil, lootTable[session].candidates[name].class) self.frame.awardStringPlayer.classIcon:Show() - elseif lootTable[session] and lootTable[session].baggedInSession then - self.frame.awardString:SetText(L["The item will be awarded later"]) - self.frame.awardString:Show() - self.frame.awardStringPlayer:Hide() - self.frame.awardStringPlayer.classIcon:Hide() else self.frame.awardString:Hide() self.frame.awardStringPlayer:Hide() @@ -1984,7 +1985,7 @@ do text = L["Award later"], notCheckable = true, disabled = function() - return not lootTable[session] or lootTable[session].bagged or lootTable[session].awarded + return not lootTable[session] or lootTable[session].baggedInSession or lootTable[session].awarded end, func = function() LibDialog:Spawn("RCLOOTCOUNCIL_CONFIRM_AWARD_LATER", {session=session, link=lootTable[session].link}) diff --git a/changelog.md b/changelog.md index 81b94057..5145ac76 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,10 @@ More info frames is no longer clamped to screen. +## Bugfixes + +- *Selecting an item for "Award Later" during a session will now properly count the item as awarded.* + # 3.13.1 ## Changes diff --git a/ml_core.lua b/ml_core.lua index 99da57d5..511f47e0 100644 --- a/ml_core.lua +++ b/ml_core.lua @@ -22,7 +22,7 @@ ]] --- @type RCLootCouncil local addon = select(2, ...) ---- @class RCLootCouncilML +--- @class RCLootCouncilML : AceModule, AceEvent-3.0, AceBucket-3.0, AceTimer-3.0, AceHook-3.0 _G.RCLootCouncilML = addon:NewModule("RCLootCouncilML", "AceEvent-3.0", "AceBucket-3.0", "AceTimer-3.0", "AceHook-3.0") local L = LibStub("AceLocale-3.0"):GetLocale("RCLootCouncil") @@ -842,8 +842,10 @@ local function registerAndAnnounceBagged(session) self.lootTable[session].lootSlot = nil -- Now the item is bagged and no longer in the loot window. self.lootTable[session].bagged = Item if self.running then -- Award later can be done when actually loot session hasn't been started yet. - self.lootTable[session].baggedInSession = true -- REVIEW This variable is never used? + self.lootTable[session].baggedInSession = true -- Used in VotingFrame + self.lootTable[session].awarded = true self:Send("group", "bagged", session, addon.playerName) + if self:HasAllItemsBeenAwarded() then self:ScheduleTimer("EndSession", 1) end end return false end From a213b0a6aa7852b32b542aa148e516b1de6a59c8 Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:39:03 +0200 Subject: [PATCH 13/17] Changelog for tier token change --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 5145ac76..935d1170 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ More info frames is no longer clamped to screen. ## Bugfixes - *Selecting an item for "Award Later" during a session will now properly count the item as awarded.* +- *Tier token items are now properly registered as such for usage in more info tooltips.* # 3.13.1 From ab80b998accf2a2ec0c56295701a56fd78056d1a Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:51:13 +0200 Subject: [PATCH 14/17] Fixed WuE registering as tradable --- .vscode/settings.json | 3 ++- core.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 871b86b6..a76673e3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -65,6 +65,7 @@ "FindInTableIf", "tFilter", "tCompare", - "ContainsIf" + "ContainsIf", + "ITEM_ACCOUNTBOUND_UNTIL_EQUIP" ] } \ No newline at end of file diff --git a/core.lua b/core.lua index 8c779710..d4097e8a 100644 --- a/core.lua +++ b/core.lua @@ -1310,7 +1310,7 @@ function RCLootCouncil:GetContainerItemTradeTimeRemaining(container, slot) local line = getglobal(tooltipForParsing:GetName() .. 'TextLeft' .. i) if line and line.GetText then local text = line:GetText() or "" - if text == ITEM_SOULBOUND or text == ITEM_ACCOUNTBOUND or text == ITEM_BNETACCOUNTBOUND then bounded = true end + if text == ITEM_SOULBOUND or text == ITEM_ACCOUNTBOUND or text == ITEM_BNETACCOUNTBOUND or text == ITEM_ACCOUNTBOUND_UNTIL_EQUIP then bounded = true end local timeText = text:match(bindTradeTimeRemainingPattern) if timeText then -- Within 2h trade window, parse the time text From 4cf9093655bf8f2b65cc058feac3ae9bbf7d721c Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:53:42 +0200 Subject: [PATCH 15/17] Don't print session help --- ml_core.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ml_core.lua b/ml_core.lua index 511f47e0..5ca9e508 100644 --- a/ml_core.lua +++ b/ml_core.lua @@ -70,6 +70,7 @@ function RCLootCouncilML:OnEnable() self.combatQueue = {} -- The functions that will be executed when combat ends. format: [num] = {func, arg1, arg2, ...} self.timers = {} -- Table to hold timer references. Each value is the name of a timer, whose value is the timer id. self.groupSize = 0 + self.printSessionHelp = false -- Print help message when session starts self:RegisterEvent("CHAT_MSG_WHISPER", "OnEvent") self:RegisterEvent("PLAYER_REGEN_ENABLED", "OnEvent") @@ -250,7 +251,7 @@ function RCLootCouncilML:StartSession() self:AnnounceItems(self.lootTable) -- Print some help messages for not direct mode. - if not addon.testMode then + if not addon.testMode and self.printSessionHelp then -- Use the first entry in lootTable to determinte mode if not self.lootTable[1].lootSlot then addon:ScheduleTimer("Print", 1, L["session_help_not_direct"]) -- Delay a bit, so annouceItems are printed first. From 4d07fb172e28083292955b560c1eece089be2f02 Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:19:44 +0200 Subject: [PATCH 16/17] Updated references to LE_ITEM_* to the enum. Fixes BoEs not being recognized --- .vscode/settings.json | 3 ++- __tests/wow_api.lua | 23 ++++++++++++----------- changelog.md | 1 + core.lua | 7 +++---- ml_core.lua | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index a76673e3..77f5f940 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -66,6 +66,7 @@ "tFilter", "tCompare", "ContainsIf", - "ITEM_ACCOUNTBOUND_UNTIL_EQUIP" + "ITEM_ACCOUNTBOUND_UNTIL_EQUIP", + "ChatFrame1" ] } \ No newline at end of file diff --git a/__tests/wow_api.lua b/__tests/wow_api.lua index a987e44d..5d59cb98 100644 --- a/__tests/wow_api.lua +++ b/__tests/wow_api.lua @@ -1079,17 +1079,6 @@ TOOLTIP_DEFAULT_BACKGROUND_COLOR = { r = 0.09, g = 0.09, b = 0.19, }; _G.INVSLOT_FIRST_EQUIPPED = 1 _G.INVSLOT_LAST_EQUIPPED = 18 NORMAL_FONT_COLOR = CreateColor(255, 209, 0, 255) --ffd100 -NUM_LE_ITEM_QUALITYS = 9 -LE_ITEM_QUALITY_POOR = 0 -LE_ITEM_QUALITY_COMMON = 1 -LE_ITEM_QUALITY_UNCOMMON = 2 -LE_ITEM_QUALITY_RARE = 3 -LE_ITEM_QUALITY_EPIC = 4 -LE_ITEM_QUALITY_LEGENDARY = 5 -LE_ITEM_QUALITY_ARTIFACT = 6 -LE_ITEM_QUALITY_HEIRLOOM = 7 -LE_ITEM_QUALITY_WOW_TOKEN = 8 - ------------------------------------------ -- Global Strings @@ -1242,4 +1231,16 @@ Enum = { Keystone = 1, ContextToken = 2, }, + ItemBind = { + None = 0, + OnAcquire = 1, + OnEquip = 2, + OnUse = 3, + Quest = 4, + Unused1 = 5, + Unused2 = 6, + ToWoWAccount = 7, + ToBnetAccount = 8, + ToBnetAccountUntilEquipped = 9, + } } diff --git a/changelog.md b/changelog.md index 935d1170..4aad4728 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,7 @@ More info frames is no longer clamped to screen. - *Selecting an item for "Award Later" during a session will now properly count the item as awarded.* - *Tier token items are now properly registered as such for usage in more info tooltips.* +- *BoE's are recognized once again.* # 3.13.1 diff --git a/core.lua b/core.lua index d4097e8a..26716965 100644 --- a/core.lua +++ b/core.lua @@ -1071,7 +1071,7 @@ function RCLootCouncil:PrepareLootTable(lootTable) v.subType = subType -- Subtype should be in our locale v.texture = texture v.token = itemID and RCTokenTable[itemID] - v.boe = bindType == _G.LE_ITEM_BIND_ON_EQUIP + v.boe = bindType == Enum.ItemBind.OnEquip v.typeID = typeID v.subTypeID = subTypeID v.session = v.session or ses @@ -1365,14 +1365,13 @@ end function RCLootCouncil:IsItemBoE(item) if not item then return false end - -- Item binding type: 0 - none; 1 - on pickup; 2 - on equip; 3 - on use; 4 - quest. - return select(14, C_Item.GetItemInfo(item)) == LE_ITEM_BIND_ON_EQUIP + return select(14, C_Item.GetItemInfo(item)) == Enum.ItemBind.OnEquip end function RCLootCouncil:IsItemBoP(item) if not item then return false end -- Item binding type: 0 - none; 1 - on pickup; 2 - on equip; 3 - on use; 4 - quest. - return select(14, C_Item.GetItemInfo(item)) == LE_ITEM_BIND_ON_ACQUIRE + return select(14, C_Item.GetItemInfo(item)) == Enum.ItemBind.OnAcquire end function RCLootCouncil:GetPlayersGuildRank() diff --git a/ml_core.lua b/ml_core.lua index 5ca9e508..878252ea 100644 --- a/ml_core.lua +++ b/ml_core.lua @@ -673,7 +673,7 @@ function RCLootCouncilML:CanGiveLoot(slot, item, winner) local bindType = select(14, C_Item.GetItemInfo(item)) if not found then - if bindType ~= LE_ITEM_BIND_ON_ACQUIRE then + if bindType ~= Enum.ItemBind.OnAcquire then return false, "not_bop" else return false, "not_ml_candidate" From ddcc64cd478b854b4106234206fdb5e786736e6d Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Thu, 12 Sep 2024 02:25:34 +0200 Subject: [PATCH 17/17] v3.13.2 --- RCLootCouncil.toc | 4 ++-- Utils/BackwardsCompat.lua | 2 +- changelog.md | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RCLootCouncil.toc b/RCLootCouncil.toc index 12a72586..17af42f1 100644 --- a/RCLootCouncil.toc +++ b/RCLootCouncil.toc @@ -1,8 +1,8 @@ ## Author: Potdisc ## Interface: 110002 -## Notes: Interface for running a Loot Council v3.13.1 +## Notes: Interface for running a Loot Council v3.13.2 ## Title: RCLootCouncil -## Version: 3.13.1 +## Version: 3.13.2 ## SavedVariables: RCLootCouncilDB, RCLootCouncilLootDB ## OptionalDeps: LibStub, CallbackHandler-1.0, Ace3, lib-st, LibWindow-1.1, LibDialog-1.0 ## X-Curse-Project-ID: 39928 diff --git a/Utils/BackwardsCompat.lua b/Utils/BackwardsCompat.lua index 3348361a..9ccccf37 100644 --- a/Utils/BackwardsCompat.lua +++ b/Utils/BackwardsCompat.lua @@ -254,7 +254,7 @@ Compat.list = { { name = "Update 'tierToken' in history", - version = "3.14.0", + version = "3.13.2", func = function () local Item = addon.Require "Utils.Item" for _, factionrealm in pairs(addon.lootDB.sv.factionrealm) do diff --git a/changelog.md b/changelog.md index 4aad4728..19082921 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,5 @@ +# 3.13.2 + ## Changes More info frames is no longer clamped to screen.