Skip to content

Commit

Permalink
Fixing the /dkp bid issue where the window was not reopening.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vapok committed Sep 6, 2020
1 parent 3a59023 commit de80f0d
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 40 deletions.
2 changes: 1 addition & 1 deletion CommunityDKP.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: |cff9900ffCommunity|r |cff595959DKP|r
## Author: Vapok-BloodsailBuccaneers
## Notes: Feature-rich DKP Management Tool
## Version: 3.2.2
## Version: 3.2.3
## DefaultState: enabled
## SavedVariables: CommDKP_DB, CommDKP_Loot, CommDKP_DKPTable, CommDKP_DKPHistory, CommDKP_MinBids, CommDKP_MaxBids, CommDKP_Whitelist, CommDKP_Standby, CommDKP_Archive, CommDKP_Profiles

Expand Down
7 changes: 4 additions & 3 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ core.EncounterList = { -- Event IDs must be in the exact same order as core
}

core.CommDKPUI = {} -- global storing entire Configuration UI to hide/show UI
core.MonVersion = "v3.2.2";
core.BuildNumber = 30202;
core.ReleaseNumber = 59
core.MonVersion = "v3.2.3";
core.BuildNumber = 30203;
core.ReleaseNumber = 60
core.defaultTable = "__default";
core.SemVer = core.MonVersion.."-r"..tostring(core.ReleaseNumber);
core.UpgradeSchema = false;
Expand All @@ -114,6 +114,7 @@ core.ShowState = false;
core.StandbyActive = false;
core.currentSort = "dkp" -- stores current sort selection
core.BidInProgress = false; -- flagged true if bidding in progress. else; false.
core.BidAuctioneer = false;
core.RaidInProgress = false;
core.RaidInPause = false;
core.NumLootItems = 0; -- updates on LOOT_OPENED event
Expand Down
2 changes: 1 addition & 1 deletion Localization/Localization.cn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ if GetLocale() == "zhCN" then
MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.", --TODO TRANSLATE:

--TODO TRANSLATE:
CHANGELOG1 = "CommunityDKP - v3.2.2",
CHANGELOG1 = "CommunityDKP - v3.2.3",
CHANGELOG2 = " - Upgraded and Refactored the MinBids Table",
CHANGELOG3 = " - Fixed a Minbid Save Issue on Disenchant that was removing the Minbid price",
CHANGELOG4 = " - Implemented PriceList API Support (contribution by styxhope)",
Expand Down
2 changes: 1 addition & 1 deletion Localization/Localization.de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ if GetLocale() == "deDE" then
MIGRATIONCOMPLETED = "Migration abgeschlossen.|n|nBitte deaktivieren Sie MonolithDKP und laden Sie das UI neu. (/reload)",

--TODO TRANSLATE:
CHANGELOG1 = "CommunityDKP - v3.2.2",
CHANGELOG1 = "CommunityDKP - v3.2.3",
CHANGELOG2 = " - Upgraded and Refactored the MinBids Table",
CHANGELOG3 = " - Fixed a Minbid Save Issue on Disenchant that was removing the Minbid price",
CHANGELOG4 = " - Implemented PriceList API Support (contribution by styxhope)",
Expand Down
2 changes: 1 addition & 1 deletion Localization/Localization.en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ core.L = {
MIGRATIONCANCELED = "Migration canceled.|n|nPlease disable MonolithDKP and /reload the UI if you want to continue with CommunityDKP without using your current tables and settings.",
MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.",

CHANGELOG1 = "CommunityDKP - v3.2.2",
CHANGELOG1 = "CommunityDKP - v3.2.3",
CHANGELOG2 = " - Upgraded and Refactored the MinBids Table",
CHANGELOG3 = " - Fixed a Minbid Save Issue on Disenchant that was removing the Minbid price",
CHANGELOG4 = " - Implemented PriceList API Support (contribution by styxhope)",
Expand Down
2 changes: 1 addition & 1 deletion Localization/Localization.es.lua
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ if GetLocale() == "esES" or GetLocale() == "esMX" then
MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.", --TODO TRANSLATE:

--TODO TRANSLATE:
CHANGELOG1 = "CommunityDKP - v3.2.2",
CHANGELOG1 = "CommunityDKP - v3.2.3",
CHANGELOG2 = " - Upgraded and Refactored the MinBids Table",
CHANGELOG3 = " - Fixed a Minbid Save Issue on Disenchant that was removing the Minbid price",
CHANGELOG4 = " - Implemented PriceList API Support (contribution by styxhope)",
Expand Down
2 changes: 1 addition & 1 deletion Localization/Localization.fr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ if GetLocale() == "frFR" then

--TODO TRANSLATE:
--TODO TRANSLATE:
CHANGELOG1 = "CommunityDKP - v3.2.2",
CHANGELOG1 = "CommunityDKP - v3.2.3",
CHANGELOG2 = " - Upgraded and Refactored the MinBids Table",
CHANGELOG3 = " - Fixed a Minbid Save Issue on Disenchant that was removing the Minbid price",
CHANGELOG4 = " - Implemented PriceList API Support (contribution by styxhope)",
Expand Down
2 changes: 1 addition & 1 deletion Localization/Localization.kr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ if GetLocale() == "koKR" then
MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.", --TODO TRANSLATE:

--TODO TRANSLATE:
CHANGELOG1 = "CommunityDKP - v3.2.2",
CHANGELOG1 = "CommunityDKP - v3.2.3",
CHANGELOG2 = " - Upgraded and Refactored the MinBids Table",
CHANGELOG3 = " - Fixed a Minbid Save Issue on Disenchant that was removing the Minbid price",
CHANGELOG4 = " - Implemented PriceList API Support (contribution by styxhope)",
Expand Down
2 changes: 1 addition & 1 deletion Localization/Localization.ru.lua
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ if GetLocale() == "ruRU" then
MIGRATIONCOMPLETED = "Миграция завершена.|n|nПожалуйста отключите MonolithDKP и перезагрузите интерфейс.",

--TODO TRANSLATE:
CHANGELOG1 = "CommunityDKP - v3.2.2",
CHANGELOG1 = "CommunityDKP - v3.2.3",
CHANGELOG2 = " - Upgraded and Refactored the MinBids Table",
CHANGELOG3 = " - Fixed a Minbid Save Issue on Disenchant that was removing the Minbid price",
CHANGELOG4 = " - Implemented PriceList API Support (contribution by styxhope)",
Expand Down
2 changes: 1 addition & 1 deletion Localization/Localization.se.lua
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ core.L = {
MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.",

--TODO TRANSLATE:
CHANGELOG1 = "CommunityDKP - v3.2.2",
CHANGELOG1 = "CommunityDKP - v3.2.3",
CHANGELOG2 = " - Upgraded and Refactored the MinBids Table",
CHANGELOG3 = " - Fixed a Minbid Save Issue on Disenchant that was removing the Minbid price",
CHANGELOG4 = " - Implemented PriceList API Support (contribution by styxhope)",
Expand Down
2 changes: 1 addition & 1 deletion Localization/Localization.tw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ if GetLocale() == "zhTW" then
MIGRATIONCOMPLETED = "Migration complete.|n|nPlease disable MonolithDKP and /reload the UI.", --TODO TRANSLATE:

--TODO TRANSLATE:
CHANGELOG1 = "CommunityDKP - v3.2.2",
CHANGELOG1 = "CommunityDKP - v3.2.3",
CHANGELOG2 = " - Upgraded and Refactored the MinBids Table",
CHANGELOG3 = " - Fixed a Minbid Save Issue on Disenchant that was removing the Minbid price",
CHANGELOG4 = " - Implemented PriceList API Support (contribution by styxhope)",
Expand Down
57 changes: 32 additions & 25 deletions Modules/Bidding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -415,43 +415,47 @@ function CommDKP:GetMaxBid(itemLink)
end

function CommDKP:ToggleBidWindow(loot, lootIcon, itemName)
local minBid, maxBid;
local _, _, Color, Ltype, itemID, Enchant, Gem1, Gem2, Gem3, Gem4, Suffix, Unique, LinkLvl, Name = string.find(loot,"|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*):?(%d*):?(%-?%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")
local minBid, maxBid, itemID;

mode = core.DB.modes.mode;

if core.IsOfficer then
if core.BiddingWindow == nil then
print("Bidding Window is Nil")
end

core.BiddingWindow = core.BiddingWindow or CommDKP:CreateBidWindow();

if core.DB.bidpos then
if core.DB.bidpos then
core.BiddingWindow:ClearAllPoints()
local a = core.DB.bidpos
core.BiddingWindow:SetPoint(a.point, a.relativeTo, a.relativePoint, a.x, a.y)
end

core.BiddingWindow:SetShown(true)
core.BiddingWindow:SetFrameLevel(10)
core.BiddingWindow:SetFrameLevel(10)

if core.DB.modes.mode == "Zero Sum" then
core.ZeroSumBank = core.ZeroSumBank or CommDKP:ZeroSumBank_Create()
core.ZeroSumBank:SetShown(true)
core.ZeroSumBank:SetFrameLevel(10)
if core.DB.modes.mode == "Zero Sum" then
core.ZeroSumBank = core.ZeroSumBank or CommDKP:ZeroSumBank_Create()
core.ZeroSumBank:SetShown(true)
core.ZeroSumBank:SetFrameLevel(10)

CommDKP:ZeroSumBank_Update();
CommDKP:ZeroSumBank_Update();
end

if core.ModesWindow then core.ModesWindow:SetFrameLevel(6) end
if CommDKP.UIConfig then CommDKP.UIConfig:SetFrameLevel(2) end

if loot then
if loot then
_, _, _, _, itemID, _, _, _, _, _, _, _, _, _ = string.find(loot,"|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*):?(%d*):?(%-?%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")
Bids_Submitted = {}
if core.DB.modes.BroadcastBids then
if core.DB.modes.BroadcastBids then
CommDKP.Sync:SendData("CommDKPBidShare", Bids_Submitted)
end

CurrItemForBid = loot;
CurrItemIcon = lootIcon
CurZone = GetRealZoneText()
CurrItemIcon = lootIcon
CurZone = GetRealZoneText()


if mode == "Minimum Bid Values" or (mode == "Zero Sum" and core.DB.modes.ZeroSumBidType == "Minimum Bid") then
Expand Down Expand Up @@ -546,26 +550,26 @@ function CommDKP:ToggleBidWindow(loot, lootIcon, itemName)
end
end

core.BiddingWindow.cost:SetText(CommDKP_round(minBid, core.DB.modes.rounding))
core.BiddingWindow.itemName:SetText(itemName)
core.BiddingWindow.bidTimer:SetText(core.DB.DKPBonus.BidTimer)
core.BiddingWindow.boss:SetText(core.LastKilledBoss)
UpdateBidWindow()
core.BiddingWindow.ItemTooltipButton:SetSize(core.BiddingWindow.itemIcon:GetWidth() + core.BiddingWindow.item:GetStringWidth() + 10, core.BiddingWindow.item:GetHeight());
core.BiddingWindow.ItemTooltipButton:SetScript("OnEnter", function(self)
ActionButton_ShowOverlayGlow(core.BiddingWindow.ItemIconButton)
core.BiddingWindow.cost:SetText(CommDKP_round(minBid, core.DB.modes.rounding))
core.BiddingWindow.itemName:SetText(itemName)
core.BiddingWindow.bidTimer:SetText(core.DB.DKPBonus.BidTimer)
core.BiddingWindow.boss:SetText(core.LastKilledBoss)
UpdateBidWindow()
core.BiddingWindow.ItemTooltipButton:SetSize(core.BiddingWindow.itemIcon:GetWidth() + core.BiddingWindow.item:GetStringWidth() + 10, core.BiddingWindow.item:GetHeight());
core.BiddingWindow.ItemTooltipButton:SetScript("OnEnter", function(self)
ActionButton_ShowOverlayGlow(core.BiddingWindow.ItemIconButton)
GameTooltip:SetOwner(self:GetParent(), "ANCHOR_BOTTOMRIGHT", 0, 500);
GameTooltip:SetHyperlink(CurrItemForBid)
end)
core.BiddingWindow.ItemTooltipButton:SetScript("OnLeave", function(self)
ActionButton_HideOverlayGlow(core.BiddingWindow.ItemIconButton)
GameTooltip:Hide()
end)
else
UpdateBidWindow()
end
else
UpdateBidWindow()
end

CommDKP:BidScrollFrame_Update()
CommDKP:BidScrollFrame_Update()
else
CommDKP:Print(L["NOPERMISSION"])
end
Expand Down Expand Up @@ -698,9 +702,11 @@ local function ToggleTimerBtn(self)
timerToggle = 1;
self:SetText(L["ENDBIDDING"])
StartBidding()
core.BidAuctioneer = true;
else
timerToggle = 0;
core.BidInProgress = false;
core.BidAuctioneer = false;
self:SetText(L["STARTBIDDING"])
SendChatMessage(L["BIDDINGCLOSED"], "RAID_WARNING")
events:UnregisterEvent("CHAT_MSG_SYSTEM")
Expand Down Expand Up @@ -1106,6 +1112,7 @@ local function SortBidTable() -- sorts the Loot History Table by dat
end

function CommDKP:BidScrollFrame_Update()
print("Updating bidscroll");
local numOptions = #Bids_Submitted;
local index, row
local offset = FauxScrollFrame_GetOffset(core.BiddingWindow.bidTable) or 0
Expand Down
8 changes: 6 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ CommDKP.Commands = {
CommDKP:StatusVerify_Update()

if core.IsOfficer then
if ... == nil then
CommDKP.ToggleBidWindow()
if ... == nil then
if core.BidAuctioneer then
CommDKP:ToggleBidWindow()
else
CommDKP:BidInterface_Toggle()
end
else
local itemName,_,_,_,_,_,_,_,_,itemIcon = GetItemInfo(item)
CommDKP:Print("Opening Bid Window for: ".. item)
Expand Down

0 comments on commit de80f0d

Please sign in to comment.