From f39e968db411348eb6e6c2c01e715f75f1837e12 Mon Sep 17 00:00:00 2001 From: Vapok Date: Tue, 19 May 2020 01:40:02 -0400 Subject: [PATCH] -Fixed the Disenchants sorting column on the Pricing tab removed some debugging statements. --- Core.lua | 4 +-- Localization/Localization.en.lua | 18 ++++++------ Modules/LootPriceTab.lua | 50 +++++++++++++------------------- 3 files changed, 31 insertions(+), 41 deletions(-) diff --git a/Core.lua b/Core.lua index 9f14d413..c7cc868e 100644 --- a/Core.lua +++ b/Core.lua @@ -89,8 +89,8 @@ core.EncounterList = { -- Event IDs must be in the exact same order as core } core.MonDKPUI = {} -- global storing entire Configuration UI to hide/show UI -core.MonVersion = "v2.2.3 - LJT"; -core.BuildNumber = 20203; +core.MonVersion = "v2.2.4 - LJT"; +core.BuildNumber = 20204; core.TableWidth, core.TableRowHeight, core.TableNumRows, core.PriceNumRows = 500, 18, 27, 22; -- width, row height, number of rows core.SelectedData = { player="none"}; -- stores data of clicked row for manipulation. core.classFiltered = {}; -- tracks classes filtered out with checkboxes diff --git a/Localization/Localization.en.lua b/Localization/Localization.en.lua index 0f4c12cd..88de49a3 100644 --- a/Localization/Localization.en.lua +++ b/Localization/Localization.en.lua @@ -759,14 +759,14 @@ core.L = { VALIDATEWARN = "This will recalculate all players dkp, lifetime earned and lifetime spent based on their complete history. Make sure to back up your saved variables file in the event the result is improper due to missing history entries. You should reset previous dkp (context menu > select all > reset previous dkp) for all players prior to running so you can see how much they changed. Would you like to continue?", PASS = "Pass", - CHANGELOG1 = "- Improved broadcast system with interface accessible by clicking the status indicator icon in the lower left corner of main DKP interface.", - CHANGELOG2 = " - Full Broadcast option will broadcast all data and overwrite the recipients tables with identical copies of yours. Any data they had that you did not will be lost (Works the same as the broadcast button in 1.6 and earlier).", - CHANGELOG3 = " - Merge Last 2 Weeks option will broadcast any entries created in the last two weeks (but no earlier than when 2.1 was installed to prevent the possibility of data duplication) and will only apply entries the recipients do not have. Useful for merging multiple raid party data.", - CHANGELOG4 = "- Table repair function available to officers. To use it, please view the video linked on the Curse page or go to https://www.youtube.com/watch?v =dwnNnppFF2I. It is recommended only one officer use it on tables with the most accurate data and then do a full broadcast of the repaired data to the rest of the guild or officers to pass along. Back up your saved variables files prior.", - CHANGELOG5 = "- Broadcasting entries during raid will still be instant as they were in 2.0. There is no waiting for entries to broadcast with fear of overwriting data.", - CHANGELOG6 = "- The seed determining if your tables are out of date are now propagated naturally within the addon (no more GM public note)", - CHANGELOG7 = "- This new data structure is not compatible with the current data management on www.warcraftdkp.com until the developer there is able to update the logic.", - CHANGELOG8 = "- Validate Tables option available to officers in the context menu. This will rebuild all players DKP tables (dkp, lifetime earned and spent) based on their history. Recommended you back up your saved variables file before running as it can return incorrect values if you are missing any history entries. Resetting all previous DKP values for players (context menu > select all > reset previous dkp) will allow you to see exactly how much each players DKP changed from the validation.", - CHANGELOG9 = "", + CHANGELOG1 = "Laughing Jester Tavern - Monolith DKP Edition - 2.2.4", + CHANGELOG2 = " -Fixed the Disenchants sorting column on the Pricing tab", + CHANGELOG3 = "", + CHANGELOG4 = "Laughing Jester Tavern - Monolith DKP Edition - 2.2.3", + CHANGELOG5 = " -Added Disenchant functionality per LJT rules and added a column to Pricing tab", + CHANGELOG6 = "", + CHANGELOG7 = "Laughing Jester Tavern - Monolith DKP Edition - 2.2.2", + CHANGELOG8 = " -Added Loot Pricing tab to view DKP of all managed items", + CHANGELOG9 = " - Fixed the anti-snipe issue in Zeor Sum bidding", CHANGELOG10 = "", } \ No newline at end of file diff --git a/Modules/LootPriceTab.lua b/Modules/LootPriceTab.lua index aa01478e..5aa81524 100644 --- a/Modules/LootPriceTab.lua +++ b/Modules/LootPriceTab.lua @@ -36,10 +36,6 @@ local function CreateRow(parent, id) -- Create 3 buttons for each row in the lis f.PriceInfo[1]:SetPoint("LEFT", 30, 0); f.PriceInfo[2]:SetPoint("CENTER", 155, 0) f.PriceInfo[3]:SetPoint("RIGHT", 15, 0) - - - - --f:SetScript("OnMouseDown", function(self, button) -- if button == "RightButton" then @@ -65,13 +61,13 @@ function MonDKP:ProcessDisenchant(loot) core.BidInProgress = false; MonDKP:BroadcastStopBidTimer() - print("Got here"); + if mode == "Static Item Values" or mode == "Roll Based Bidding" or (mode == "Zero Sum" and MonDKP_DB.modes.ZeroSumBidType == "Static") then local search = MonDKP:Table_Search(MonDKP_MinBids, itemName) local numOfDisenchants = MonDKP_MinBids[search[1][1]].disenchants or 0 local updatedDisenchants = numOfDisenchants + 1 local cost = core.BiddingWindow.cost:GetNumber(); - print("Got here 2"); + SendChatMessage("No votes for ".." "..itemLink.." for "..cost.." "..L["DKP"].." and will be disenchanted. This will be disenchant number "..updatedDisenchants, "RAID_WARNING"); --If cost is 0, dont' track. @@ -86,33 +82,33 @@ function MonDKP:ProcessDisenchant(loot) cost = 5 end end - print("Got here 3"); + local newItem = {item=itemName, minbid=cost, link=itemLink, icon=itemIcon, disenchant=updatedDisenchants}; - print("Got here 4"); + if not search then - print("Got here 5"); + tinsert(MonDKP_MinBids, newItem) core.BiddingWindow.CustomMinBid:SetShown(true); core.BiddingWindow.CustomMinBid:SetChecked(true); else - print("Got here 6"); + MonDKP_MinBids[search[1][1]].minbid = cost; MonDKP_MinBids[search[1][1]].link = itemLink; MonDKP_MinBids[search[1][1]].icon = itemIcon; MonDKP_MinBids[search[1][1]].disenchants = updatedDisenchants; newItem = MonDKP_MinBids[search[1][1]]; end - print("Got here 7"); + MonDKP.Sync:SendData("MonDKPSetPrice", newItem); else - print("Got here 8"); + SendChatMessage("No votes for ".." "..itemLink.." for "..-cost.." "..L["DKP"].." and will be disenchanted.", "RAID_WARNING") end - print("Got here 9"); + core.BiddingWindow:Hide() - print("Got here 10"); + ClearBidWindow() - print("Got here 11"); + end end @@ -141,6 +137,8 @@ function MonDKP:PriceTable_Update(scrollOffset) if core.PriceTable[index]["disenchants"] ~= nil then curDisenchants = core.PriceTable[index].disenchants; + else + core.PriceTable[index]["disenchants"] = curDisenchants; end if core.PriceTable[index]["link"] ~= nil then @@ -202,11 +200,7 @@ function MonDKP:PriceListSort(id, reset) local button; -- passing "reset" forces it to do initial sort (A to Z repeatedly instead of A to Z then Z to A toggled) local PriceSortButtons = core.PriceSortButtons - if id == "disenchants" then - button = PriceSortButtons["item"] - else - button = PriceSortButtons[id] - end + button = PriceSortButtons[id] if reset and reset ~= "Clear" then -- reset is useful for check boxes when you don't want it repeatedly reversing the sort button.Ascend = button.Ascend @@ -220,16 +214,16 @@ function MonDKP:PriceListSort(id, reset) end table.sort(core.PriceTable, function(a, b) if button.Ascend then - if id == "minbid" then - return a[button.Id] > b[button.Id] - else + if id == "item" then return a[button.Id] < b[button.Id] + else + return a[button.Id] > b[button.Id] end else - if id == "minbid" then - return a[button.Id] < b[button.Id] - else + if id == "item" then return a[button.Id] > b[button.Id] + else + return a[button.Id] < b[button.Id] end end end) @@ -318,10 +312,6 @@ function MonDKP:PriceTab_Create() v:SetScript("OnClick", function(self) MonDKP:PriceListSort(self.Id, "Clear") end) end - --PriceSortButtons.item:SetSize((370), core.TableRowHeight) - --PriceSortButtons.disenchants:SetSize((70), core.TableRowHeight) - --PriceSortButtons.minbid:SetSize((60), core.TableRowHeight) - PriceSortButtons.item.t = PriceSortButtons.item:CreateFontString(nil, "OVERLAY") PriceSortButtons.item.t:SetFontObject("MonDKPNormal") PriceSortButtons.item.t:SetTextColor(1, 1, 1, 1);