Skip to content

Commit

Permalink
-Fixed the Disenchants sorting column on the Pricing tab
Browse files Browse the repository at this point in the history
removed some debugging statements.
  • Loading branch information
Vapok committed May 19, 2020
1 parent 448f113 commit f39e968
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 41 deletions.
4 changes: 2 additions & 2 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions Localization/Localization.en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "",
}
50 changes: 20 additions & 30 deletions Modules/LootPriceTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f39e968

Please sign in to comment.