From 904c5abc5a72b80c407e041b5c19d5c6914c557f Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sat, 19 Dec 2020 20:39:26 -0500 Subject: [PATCH 1/3] Add !keys command --- MyAddon.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/MyAddon.lua b/MyAddon.lua index 8f3712c..69986ed 100755 --- a/MyAddon.lua +++ b/MyAddon.lua @@ -9,10 +9,18 @@ StaticPopupDialogs["REPAIR_ALERT"] = { preferredIndex = 3 } +MyAddon.keyItemID = 138019 + function MyAddon.OnEvent(self, event, ...) events[event](self, ...) end +function events:CHAT_MSG_PARTY(message, ...) + if text == '!keys' then + MyAddon.announceKey() + end +end + function events:PLAYER_LOGIN(...) -- found from some forums local b=ActionButton8 _MH=_MH or(b:SetAttribute("*type5","macro")or SecureHandlerWrapScript(b,"PreClick",b,'Z=IsAltKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute("macrotext5","/wm [nomod]"..Z)'))or 1 @@ -38,6 +46,19 @@ function events:PLAYER_ROLES_ASSIGNED(...) if MyAddon.amTankInParty() then MyAddon.markSelfSquare() end end +function MyAddon.announceKey() + for bag = 0, NUM_BAG_SLOTS do + for slot = 1, GetContainerNumSlots(bag)do + if GetContainerItemID(bag, slot) == MyAddon.keyItemID then + local link = GetContainerItemLink(bag, slot) + SendChatMessage(link, "PARTY") + + return + end + end + end +end + function MyAddon.needsRepair() local slots = { "HeadSlot", "ShoulderSlot", "ChestSlot", "WristSlot", "HandsSlot", -- 2.45.2 From 90a020f37599e0fb72fac7b6d30de463d4aaf6b1 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Mon, 11 Jan 2021 20:58:23 -0500 Subject: [PATCH 2/3] Working version of keys --- MyAddon.lua | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/MyAddon.lua b/MyAddon.lua index 69986ed..7418bff 100755 --- a/MyAddon.lua +++ b/MyAddon.lua @@ -9,14 +9,20 @@ StaticPopupDialogs["REPAIR_ALERT"] = { preferredIndex = 3 } -MyAddon.keyItemID = 138019 +MyAddon.keyItemID = 180653 function MyAddon.OnEvent(self, event, ...) events[event](self, ...) end +function events:CHAT_MSG_PARTY_LEADER(message, ...) + if message == '!keys' then + MyAddon.announceKey() + end +end + function events:CHAT_MSG_PARTY(message, ...) - if text == '!keys' then + if message == '!keys' then MyAddon.announceKey() end end @@ -49,6 +55,7 @@ end function MyAddon.announceKey() for bag = 0, NUM_BAG_SLOTS do for slot = 1, GetContainerNumSlots(bag)do + itemID = GetContainerItemID(bag, slot) if GetContainerItemID(bag, slot) == MyAddon.keyItemID then local link = GetContainerItemLink(bag, slot) SendChatMessage(link, "PARTY") @@ -112,3 +119,22 @@ f:SetScript("OnEvent", MyAddon.OnEvent) --[[ hooksecurefunc("TalkingHeadFrame_PlayCurrent", function() TalkingHeadFrame:Hide() end) ]]-- + +function PaperDollFrame_SetMovementSpeed(statFrame, unit) + statFrame.wasSwimming = nil + statFrame.unit = unit + MovementSpeed_OnUpdate(statFrame) + + statFrame.onEnterFunc = MovementSpeed_OnEnter + statFrame:SetScript("OnUpdate", MovementSpeed_OnUpdate) + statFrame:Show() +end + +CharacterStatsPane.statsFramePool.resetterFunc = + function(pool, frame) + frame:SetScript("OnUpdate", nil) + frame.onEnterFunc = nil + frame.UpdateTooltip = nil + FramePool_HideAndClearAnchors(pool, frame) + end +table.insert(PAPERDOLL_STATCATEGORIES[1].stats, { stat = "MOVESPEED"}) -- 2.45.2 From 356c26c627d8bfac7b11d9bd60fdfeb804640c34 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Mon, 11 Jan 2021 21:08:24 -0500 Subject: [PATCH 3/3] Update version in toc --- MyAddon.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MyAddon.toc b/MyAddon.toc index f2da509..ae17caf 100755 --- a/MyAddon.toc +++ b/MyAddon.toc @@ -1,4 +1,4 @@ -## Interface: 80100 +## Interface: 90002 ## Title: MyAddon ## Author: Andrew Tomaka ## Version: 0.1 -- 2.45.2