From 028f5464272af836a8c5dfa981ceb7c84a98da6a Mon Sep 17 00:00:00 2001 From: atomaka Date: Tue, 12 Jan 2021 02:35:31 +0000 Subject: [PATCH] Grab some stuff from game (#1) --- MyAddon.lua | 47 +++++++++++++++++++++++++++++++++++++++++++++++ MyAddon.toc | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/MyAddon.lua b/MyAddon.lua index 8f3712c..7418bff 100755 --- a/MyAddon.lua +++ b/MyAddon.lua @@ -9,10 +9,24 @@ StaticPopupDialogs["REPAIR_ALERT"] = { preferredIndex = 3 } +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 message == '!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 +52,20 @@ 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 + itemID = GetContainerItemID(bag, slot) + 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", @@ -91,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"}) 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