first commit
This commit is contained in:
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2024 Protuhj
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
47
OnlyMyLoot.lua
Normal file
47
OnlyMyLoot.lua
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
-- OnlyMyLoot.lua
|
||||||
|
-- Checks the GUID from CHAT_MSG_LOOT events to see if it matches the local account's GUID.
|
||||||
|
|
||||||
|
local addonName, addon = ...
|
||||||
|
|
||||||
|
local enabled = true
|
||||||
|
local numberFiltered = 0
|
||||||
|
|
||||||
|
local function onlyMyLoot_OnEvent(self, event, ...)
|
||||||
|
-- If this is disabled, don't filter it
|
||||||
|
if (not enabled) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
guid = select(12, ...)
|
||||||
|
-- If it's my loot, don't filter it, otherwise filter it. guid apparently can be nil
|
||||||
|
if (C_AccountInfo.IsGUIDRelatedToLocalAccount(guid or "")) then
|
||||||
|
return false, ...
|
||||||
|
else
|
||||||
|
numberFiltered = numberFiltered + 1
|
||||||
|
return true, ...
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
ChatFrame_AddMessageEventFilter("CHAT_MSG_LOOT", onlyMyLoot_OnEvent)
|
||||||
|
|
||||||
|
local function handle(msg)
|
||||||
|
msg = msg or ""
|
||||||
|
if (msg == "stats" or msg == "?") then
|
||||||
|
print("OnlyMyLoot has filtered " .. tostring(numberFiltered) .. " since last interface load.")
|
||||||
|
else
|
||||||
|
enabled = not(enabled)
|
||||||
|
if (enabled) then
|
||||||
|
print("OnlyMyLoot enabled; hiding loot that isn't yours!")
|
||||||
|
else
|
||||||
|
print("OnlyMyLoot disabled.")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
SLASH_ONLYMYLOOT1 = "/ONLYMYLOOT";
|
||||||
|
SLASH_ONLYMYLOOT2 = "/OML";
|
||||||
|
|
||||||
|
SlashCmdList["ONLYMYLOOT"] = handle
|
||||||
|
SlashCmdList["OML"] = handle
|
||||||
|
|
||||||
|
print("OnlyMyLoot is hiding others' loot!")
|
||||||
7
OnlyMyLoot.toc
Normal file
7
OnlyMyLoot.toc
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
## Interface: 100207
|
||||||
|
## Title: OnlyMyLoot
|
||||||
|
## Notes: Hides other users' loot messages from your chat.
|
||||||
|
## Author: Protuhj
|
||||||
|
## SavedVariables: addonConfig
|
||||||
|
## Version: 100207_03
|
||||||
|
OnlyMyLoot.lua
|
||||||
Reference in New Issue
Block a user