Skip to content

Commit 6c9cca0

Browse files
authored
Merge pull request #55 from Puresyn/development
Released 1.2.0
2 parents 17751d2 + 251d7cd commit 6c9cca0

11 files changed

+897
-764
lines changed

Core/CharacterData.lua

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ function CharacterData:GetCharacterDataByGUID(playerGUID)
7777
end
7878

7979
local encodedCharacterData = KeyMaster_C_DB[playerGUID].data
80+
if not encodedCharacterData then return nil end
8081

8182
local decoded = LibDeflate:DecodeForWoWAddonChannel(encodedCharacterData)
8283
if not decoded then return end

Core/UI/PartyFrame.lua

+8-4
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,18 @@ end
2626

2727
local function portalButton_mouseover(self, event)
2828
local spellNameToCheckCooldown = self:GetParent():GetAttribute("portalSpellName")
29-
local start, dur, _ = GetSpellCooldown(spellNameToCheckCooldown);
30-
if (start == 0) then
29+
local cooldown = C_Spell.GetSpellCooldown(spellNameToCheckCooldown);
30+
if cooldown == nil then
31+
KeyMaster:_ErrorMsg("portalButton_mouseover", "PartyFrame", "Invalid spell name for portal button.")
32+
return
33+
end
34+
if (cooldown["startTime"] == 0) then
3135
local animFrame = self:GetParent():GetAttribute("portalFrame")
3236
animFrame.textureportal:SetTexture("Interface\\AddOns\\KeyMaster\\Assets\\Images\\portal-texture1", false)
3337
animFrame.animg:Play()
3438
else
3539
local cdFrame = self:GetParent():GetAttribute("portalCooldownFrame")
36-
cdFrame:SetCooldown(start ,dur)
40+
cdFrame:SetCooldown(cooldown["startTime"] ,cooldown["duration"])
3741
end
3842

3943
end
@@ -108,7 +112,7 @@ function PartyFrame:UpdatePortals(mapId)
108112
pButton:SetPoint("TOPLEFT", parent, "TOPLEFT", 0, 0)
109113
pButton:SetScript("OnEnter", portalButton_mouseover)
110114
pButton:SetScript("OnLeave", portalButton_mouseoout)
111-
115+
112116
parent:SetAttribute("portalSpellName", portalSpellName)
113117
end
114118

Core/UI/WhatsNew.lua

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ local function setWhatsNewContent(parent)
2626
<p>]]..KeyMasterLocals.DISPLAYVERSION..KM_AUTOVERSION.." "..KM_VERSION_STATUS..[[</p>
2727
<br/>
2828
<h2>|cff]]..h2Color..[[Updates:|r</h2>
29-
<p>Added 简体中文 (CN) - Chinese Translation</p>
30-
<p>Added preliminary TWW S1 Data</p>
31-
<p>Updated to WoW Build version 11.0.0Updated to WoW Build version 11.0.0</p>
29+
<p>Added ability to auto insert mythic keystone in a mythic plus dungeon</p>
30+
<p>Updated to Wow Build version 11.0.2</p>
3231
<br/>
3332
<h2>|cff]]..h2Color..[[Fixes:|r</h2>
34-
<p>Fixed bug where fortified ratings on the party screen did not correctly display decimal places.</p>
33+
<p>None</p>
3534
<br/>
3635
<h2>|cff]]..h2Color..[[Open Items:|r</h2>
3736
<p>None</p>

Core/UnitData.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ function UnitData:SetUnitData(unitData)
9595
unitInformation[unitData.GUID] = unitData
9696

9797
-- Store/Update Unit Data in Saved Variables
98-
if unitData.GUID == UnitGUID("player") and UnitLevel("PLAYER") == GetMaxPlayerLevel() then
98+
local maxLevel = 70
99+
-- local maxLevel = GetMaxPlayerLevel()
100+
if unitData.GUID == UnitGUID("player") and UnitLevel("PLAYER") == maxLevel then
99101
CharacterData:SetCharacterData(unitData.GUID, unitData)
100102
UnitData:UpdateListCharacter(unitData.GUID, unitData) -- todo: move out of this file
101103
end

KeyMaster.lua

+46-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ local PartyFrame = KeyMaster.PartyFrame
1616

1717
-- Global Variables
1818
KM_ADDON_NAME = KeyMasterLocals.ADDONNAME
19-
KM_AUTOVERSION = GetAddOnMetadata("KeyMaster", "Version")
20-
KM_VERSION_STATUS = KeyMasterLocals.BUILDRELEASE -- BUILDALPHA BUILDBETA BUILDRELEASE - for display and update notification purposes
19+
--KM_AUTOVERSION = GetAddOnMetadata("KeyMaster", "Version") GetAddOnMetadata is depreciated in "The War Within" expansion.
20+
KM_AUTOVERSION = C_AddOns.GetAddOnMetadata("KeyMaster", "Version")
21+
22+
KM_VERSION_STATUS = KeyMasterLocals.BUILDBETA -- BUILDALPHA BUILDBETA BUILDRELEASE - for display and update notification purposes
2123

2224
--------------------------------
2325
-- Slash Commands and command menu
@@ -254,4 +256,45 @@ end
254256

255257
local playerEnterEvents = CreateFrame("Frame")
256258
playerEnterEvents:RegisterEvent("PLAYER_ENTERING_WORLD")
257-
playerEnterEvents:SetScript("OnEvent", onEvent_PlayerEnterWorld)
259+
playerEnterEvents:SetScript("OnEvent", onEvent_PlayerEnterWorld)
260+
261+
local function OnEvent_OnKeystoneOpen(ev)
262+
KeyMaster:_DebugMsg("OnKeystoneOpen", "DungeonTools", "Keystone frame opened.")
263+
264+
local difficulty = select(3, GetInstanceInfo())
265+
if difficulty ~= 8 and difficulty ~= 23 then
266+
return
267+
end
268+
269+
local found = nil
270+
for bagIndex = 0, NUM_BAG_SLOTS do
271+
for invIndex = 1, C_Container.GetContainerNumSlots(bagIndex) do
272+
local itemID = C_Container.GetContainerItemID(bagIndex, invIndex)
273+
274+
if itemID and C_Item.IsItemKeystoneByID(itemID) then
275+
KeyMaster:_DebugMsg("OnKeystoneOpen", "DungeonTools", "Key found at ("
276+
.. bagIndex .. "," .. invIndex .. ")")
277+
278+
found = {
279+
bagIndex = bagIndex,
280+
invIndex = invIndex
281+
}
282+
283+
break
284+
end
285+
end
286+
287+
if found ~= nil then break end
288+
end
289+
290+
if found ~= nil then
291+
KeyMaster:_DebugMsg("OnKeystoneOpen", "DungeonTools", "Slotting keystone from ("
292+
.. found.bagIndex .. "," .. found.invIndex .. ")")
293+
294+
C_Container.UseContainerItem(found.bagIndex, found.invIndex)
295+
end
296+
end
297+
298+
local keystoneOpenEvents = CreateFrame("Frame")
299+
keystoneOpenEvents:RegisterEvent("CHALLENGE_MODE_KEYSTONE_RECEPTABLE_OPEN")
300+
keystoneOpenEvents:SetScript("OnEvent", OnEvent_OnKeystoneOpen)

KeyMaster.toc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## Interface: 110000
2-
## X-Max-Interface: 110000
1+
## Interface: 110002
2+
## X-Max-Interface: 110002
33
## X-Min-Interface: 100205
44

5-
## Version: 1.1.8
5+
## Version: 1.2.0
66
## Title: |cffb09c60Key Master|r
77
## Title-ptBR: |cffb09c60Key Master|r
88
## Title-ruRU: |cffb09c60Key Master|r [|cffe6b080Мастер ключей|r]

0 commit comments

Comments
 (0)