From de80f0dd0ea36f3cc55bc5b47dea0b627d1b5781 Mon Sep 17 00:00:00 2001 From: Vapok Date: Sun, 6 Sep 2020 00:43:06 -0400 Subject: [PATCH] Fixing the /dkp bid issue where the window was not reopening. --- CommunityDKP.toc | 2 +- Core.lua | 7 ++-- Localization/Localization.cn.lua | 2 +- Localization/Localization.de.lua | 2 +- Localization/Localization.en.lua | 2 +- Localization/Localization.es.lua | 2 +- Localization/Localization.fr.lua | 2 +- Localization/Localization.kr.lua | 2 +- Localization/Localization.ru.lua | 2 +- Localization/Localization.se.lua | 2 +- Localization/Localization.tw.lua | 2 +- Modules/Bidding.lua | 57 ++++++++++++++++++-------------- init.lua | 8 +++-- 13 files changed, 52 insertions(+), 40 deletions(-) diff --git a/CommunityDKP.toc b/CommunityDKP.toc index f6d0c7db..b35858bf 100644 --- a/CommunityDKP.toc +++ b/CommunityDKP.toc @@ -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 diff --git a/Core.lua b/Core.lua index 3b98a4fd..11bb88c3 100644 --- a/Core.lua +++ b/Core.lua @@ -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; @@ -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 diff --git a/Localization/Localization.cn.lua b/Localization/Localization.cn.lua index d2507ab0..7161968d 100644 --- a/Localization/Localization.cn.lua +++ b/Localization/Localization.cn.lua @@ -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)", diff --git a/Localization/Localization.de.lua b/Localization/Localization.de.lua index 010d1f51..f124d083 100644 --- a/Localization/Localization.de.lua +++ b/Localization/Localization.de.lua @@ -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)", diff --git a/Localization/Localization.en.lua b/Localization/Localization.en.lua index 249edaaa..b15c10ea 100644 --- a/Localization/Localization.en.lua +++ b/Localization/Localization.en.lua @@ -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)", diff --git a/Localization/Localization.es.lua b/Localization/Localization.es.lua index 6e6e637d..6b37059b 100644 --- a/Localization/Localization.es.lua +++ b/Localization/Localization.es.lua @@ -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)", diff --git a/Localization/Localization.fr.lua b/Localization/Localization.fr.lua index b8d8df57..01a52270 100644 --- a/Localization/Localization.fr.lua +++ b/Localization/Localization.fr.lua @@ -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)", diff --git a/Localization/Localization.kr.lua b/Localization/Localization.kr.lua index a3042d61..6dc3d1dc 100644 --- a/Localization/Localization.kr.lua +++ b/Localization/Localization.kr.lua @@ -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)", diff --git a/Localization/Localization.ru.lua b/Localization/Localization.ru.lua index feb9a7f5..53ceed94 100644 --- a/Localization/Localization.ru.lua +++ b/Localization/Localization.ru.lua @@ -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)", diff --git a/Localization/Localization.se.lua b/Localization/Localization.se.lua index da1b4b55..33052c20 100644 --- a/Localization/Localization.se.lua +++ b/Localization/Localization.se.lua @@ -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)", diff --git a/Localization/Localization.tw.lua b/Localization/Localization.tw.lua index 442f2367..b0031ce8 100644 --- a/Localization/Localization.tw.lua +++ b/Localization/Localization.tw.lua @@ -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)", diff --git a/Modules/Bidding.lua b/Modules/Bidding.lua index 21148891..9bf7bfaa 100644 --- a/Modules/Bidding.lua +++ b/Modules/Bidding.lua @@ -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 @@ -546,14 +550,14 @@ 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) @@ -561,11 +565,11 @@ function CommDKP:ToggleBidWindow(loot, lootIcon, itemName) 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 @@ -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") @@ -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 diff --git a/init.lua b/init.lua index 79bc636e..fdd69fd5 100644 --- a/init.lua +++ b/init.lua @@ -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)