Skip to content

Commit

Permalink
Merge pull request #181 from Vapok/2.5.2
Browse files Browse the repository at this point in the history
updating ace to r1253-alpha
  • Loading branch information
Taidtuskecyh authored Sep 2, 2021
2 parents 0609e86 + 506673b commit 5ebab68
Show file tree
Hide file tree
Showing 30 changed files with 2,960 additions and 281 deletions.
39 changes: 21 additions & 18 deletions CommunityDKP.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ local CommDKP = core.CommDKP;
local L = core.L;

local OptionsLoaded = false;
local LibDD = LibStub:GetLibrary("LibUIDropDownMenu-4.0");


function CommDKP_RestoreFilterOptions() -- restores default filter selections
CommDKP.UIConfig.search:SetText(L["SEARCH"])
Expand Down Expand Up @@ -372,29 +374,30 @@ function CommDKP:CreateMenu()
-- center column dropdown (class, rank, spec etc..)
SortButtons.class.t = CreateFrame("FRAME", "CommDKPSortColDropdown", SortButtons.class, "CommunityDKPTableHeaderDropDownMenuTemplate")
SortButtons.class.t:SetPoint("CENTER", SortButtons.class, "CENTER", 4, -3)
UIDropDownMenu_JustifyText(SortButtons.class.t, "CENTER")
UIDropDownMenu_SetWidth(SortButtons.class.t, 80)
UIDropDownMenu_SetText(SortButtons.class.t, L["CLASS"])
UIDropDownMenu_Initialize(SortButtons.class.t, function(self, level, menuList)
local reason = UIDropDownMenu_CreateInfo()
LibDD:UIDropDownMenu_JustifyText(SortButtons.class.t, "CENTER")
LibDD:UIDropDownMenu_SetWidth(SortButtons.class.t, 80)
LibDD:UIDropDownMenu_SetText(SortButtons.class.t, L["CLASS"])
LibDD:UIDropDownMenu_Initialize(SortButtons.class.t, function(self, level, menuList)

local reason = LibDD:UIDropDownMenu_CreateInfo()
reason.func = self.SetValue
reason.fontObject = "CommDKPSmallCenter"
reason.text, reason.arg1, reason.arg2, reason.checked, reason.isNotRadio = L["CLASS"], "class", L["CLASS"], "class" == core.CenterSort, true
UIDropDownMenu_AddButton(reason)
LibDD:UIDropDownMenu_AddButton(reason)
reason.text, reason.arg1, reason.arg2, reason.checked, reason.isNotRadio = L["SPEC"], "spec", L["SPEC"], "spec" == core.CenterSort, true
UIDropDownMenu_AddButton(reason)
LibDD:UIDropDownMenu_AddButton(reason)
reason.text, reason.arg1, reason.arg2, reason.checked, reason.isNotRadio = L["RANK"], "rank", L["RANK"], "rank" == core.CenterSort, true
UIDropDownMenu_AddButton(reason)
LibDD:UIDropDownMenu_AddButton(reason)
reason.text, reason.arg1, reason.arg2, reason.checked, reason.isNotRadio = L["ROLE"], "role", L["ROLE"], "role" == core.CenterSort, true
UIDropDownMenu_AddButton(reason)
LibDD:UIDropDownMenu_AddButton(reason)
reason.text, reason.arg1, reason.arg2, reason.checked, reason.isNotRadio = L["VERSION"], "version", L["VERSION"], "version" == core.CenterSort, true
UIDropDownMenu_AddButton(reason)
LibDD:UIDropDownMenu_AddButton(reason)
end)
-- Dropdown Menu Function
function SortButtons.class.t:SetValue(newValue, arg2)
core.CenterSort = newValue
SortButtons.class.Id = newValue;
UIDropDownMenu_SetText(SortButtons.class.t, arg2)
LibDD:UIDropDownMenu_SetText(SortButtons.class.t, arg2)
CommDKP:SortDKPTable(newValue, "reset")
core.currentSort = newValue;
CloseDropDownMenus()
Expand Down Expand Up @@ -522,14 +525,14 @@ function CommDKP:CreateMenu()
GameTooltip:Hide()
end
)
UIDropDownMenu_SetWidth(CommDKP.UIConfig.TeamViewChangerDropDown, 150)
UIDropDownMenu_SetText(CommDKP.UIConfig.TeamViewChangerDropDown, CommDKP:GetCurrentTeamName())
LibDD:UIDropDownMenu_SetWidth(CommDKP.UIConfig.TeamViewChangerDropDown, 150)
LibDD:UIDropDownMenu_SetText(CommDKP.UIConfig.TeamViewChangerDropDown, CommDKP:GetCurrentTeamName())

-- Create and bind the initialization function to the dropdown menu
UIDropDownMenu_Initialize(CommDKP.UIConfig.TeamViewChangerDropDown,
LibDD:UIDropDownMenu_Initialize(CommDKP.UIConfig.TeamViewChangerDropDown,
function(self, level, menuList)

local dropDownMenuItem = UIDropDownMenu_CreateInfo()
local dropDownMenuItem = LibDD:UIDropDownMenu_CreateInfo()
dropDownMenuItem.func = self.SetValue
dropDownMenuItem.fontObject = "CommDKPSmallCenter"

Expand All @@ -541,7 +544,7 @@ function CommDKP:CreateMenu()
dropDownMenuItem.arg2 = teamList[i][1] -- index
dropDownMenuItem.checked = teamList[i][1] == tonumber(CommDKP:GetCurrentTeamIndex())
dropDownMenuItem.isNotRadio = true
UIDropDownMenu_AddButton(dropDownMenuItem)
LibDD:UIDropDownMenu_AddButton(dropDownMenuItem)
end
end
)
Expand All @@ -553,7 +556,7 @@ function CommDKP:CreateMenu()
if core.RaidInProgress == false and core.RaidInPause == false then
CommDKP:SetCurrentTeam(arg2)
CommDKP:SortDKPTable(core.currentSort, "reset")
UIDropDownMenu_SetText(CommDKP.UIConfig.TeamViewChangerDropDown, arg1)
LibDD:UIDropDownMenu_SetText(CommDKP.UIConfig.TeamViewChangerDropDown, arg1)
else
StaticPopupDialogs["RAID_IN_PROGRESS"] = {
text = L["TEAMCHANGERAIDINPROGRESS"],
Expand Down
4 changes: 2 additions & 2 deletions CommunityDKP.toc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Interface: 11307
## Interface-Classic: 11307
## Interface-BCC: 20501
## Interface-BCC: 20502
## Title: |cff9900ffCommunity|r |cff595959DKP|r
## Author: Vapok-BloodsailBuccaneers
## Notes: Feature-rich DKP Management Tool
## Version: 3.2.7
## Version: 3.2.9
## 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
8 changes: 4 additions & 4 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,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.8";
core.BuildNumber = 30208;
core.ReleaseNumber = 69
core.MonVersion = "v3.2.9";
core.BuildNumber = 30209;
core.ReleaseNumber = 70
core.defaultTable = "__default";
core.SemVer = core.MonVersion.."-r"..tostring(core.ReleaseNumber);
core.UpgradeSchema = false;
Expand Down Expand Up @@ -818,7 +818,7 @@ end
function CommDKP:SetCurrentTeam(index)
CommDKP:GetTable(CommDKP_DB, false)["defaults"]["CurrentTeam"] = tostring(index);
CommDKP:StatusVerify_Update();
UIDropDownMenu_SetText(CommDKP.UIConfig.TeamViewChangerDropDown, CommDKP:GetCurrentTeamName());
LibDD:UIDropDownMenu_SetText(CommDKP.UIConfig.TeamViewChangerDropDown, CommDKP:GetCurrentTeamName());

-- reset dkp table and update it
core.WorkingTable = CommDKP:GetTable(CommDKP_DKPTable, true);
Expand Down
18 changes: 14 additions & 4 deletions Libs/AceAddon-3.0/AceAddon-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
-- end
-- @class file
-- @name AceAddon-3.0.lua
-- @release $Id: AceAddon-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-- @release $Id: AceAddon-3.0.lua 1238 2020-08-28 16:18:42Z nevcairiel $

local MAJOR, MINOR = "AceAddon-3.0", 12
local MAJOR, MINOR = "AceAddon-3.0", 13
local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR)

if not AceAddon then return end -- No Upgrade needed.
Expand Down Expand Up @@ -601,10 +601,20 @@ function AceAddon:IterateAddonStatus() return pairs(self.statuses) end
function AceAddon:IterateEmbedsOnAddon(addon) return pairs(self.embeds[addon]) end
function AceAddon:IterateModulesOfAddon(addon) return pairs(addon.modules) end

-- Blizzard AddOns which can load very early in the loading process and mess with Ace3 addon loading
local BlizzardEarlyLoadAddons = {
Blizzard_DebugTools = true,
Blizzard_TimeManager = true,
Blizzard_BattlefieldMap = true,
Blizzard_MapCanvas = true,
Blizzard_SharedMapDataProviders = true,
Blizzard_CombatLog = true,
}

-- Event Handling
local function onEvent(this, event, arg1)
-- 2011-08-17 nevcairiel - ignore the load event of Blizzard_DebugTools, so a potential startup error isn't swallowed up
if (event == "ADDON_LOADED" and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then
-- 2020-08-28 nevcairiel - ignore the load event of Blizzard addons which occur early in the loading process
if (event == "ADDON_LOADED" and (arg1 == nil or not BlizzardEarlyLoadAddons[arg1])) or event == "PLAYER_LOGIN" then
-- if a addon loads another addon, recursion could happen here, so we need to validate the table on every iteration
while(#AceAddon.initializequeue > 0) do
local addon = tremove(AceAddon.initializequeue, 1)
Expand Down
2 changes: 1 addition & 1 deletion Libs/AceComm-3.0/ChatThrottleLib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ local next = next
local strlen = string.len
local GetFramerate = GetFramerate
local strlower = string.lower
local unpack,type,pairs,wipe = unpack,type,pairs,wipe
local unpack,type,pairs,wipe = unpack,type,pairs,table.wipe
local UnitInRaid,UnitInParty = UnitInRaid,UnitInParty


Expand Down
44 changes: 44 additions & 0 deletions Libs/LibUIDropDownMenu/LibEasyMenu.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--$Id: LibEasyMenu.lua 64 2020-11-18 13:13:15Z arithmandar $
-- //////////////////////////////////////////////////////////////
-- Notes:
-- Functions have been moved to under LibUIDropDownMenu.lua
-- New function calls are as below:
--
-- - lib:EasyMenu(menuList, menuFrame, anchor, x, y, displayMode, autoHideDelay )
-- - lib:EasyMenu_Initialize( frame, level, menuList )
--
-- //////////////////////////////////////////////////////////////
-- Simplified Menu Display System
-- This is a basic system for displaying a menu from a structure table.
--
-- See UIDropDownMenu.lua for the menuList details.
--
-- Args:
-- menuList - menu table
-- menuFrame - the UI frame to populate
-- anchor - where to anchor the frame (e.g. CURSOR)
-- x - x offset
-- y - y offset
-- displayMode - border type
-- autoHideDelay - how long until the menu disappears
--
--
--[[
function EasyMenu(menuList, menuFrame, anchor, x, y, displayMode, autoHideDelay )
if ( displayMode == "MENU" ) then
menuFrame.displayMode = displayMode;
end
UIDropDownMenu_Initialize(menuFrame, EasyMenu_Initialize, displayMode, nil, menuList);
ToggleDropDownMenu(1, nil, menuFrame, anchor, x, y, menuList, nil, autoHideDelay);
end
function EasyMenu_Initialize( frame, level, menuList )
for index = 1, #menuList do
local value = menuList[index]
if (value.text) then
value.index = index;
UIDropDownMenu_AddButton( value, level );
end
end
end
]]
Loading

0 comments on commit 5ebab68

Please sign in to comment.