Skip to content

Commit

Permalink
Merge pull request #14 from JasonDepp/JasonDepp-patch-20240801
Browse files Browse the repository at this point in the history
Jason depp patch 20240801
  • Loading branch information
Limmek authored Aug 2, 2024
2 parents c6d9146 + 5816ba3 commit f663bd1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
29 changes: 21 additions & 8 deletions Shitlist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,31 @@ function Shitlist:UnitPopup_ShowMenu(target, unit, menuList)
--@debug@
Shitlist:PrintDebug("Unit: ", unit, ", Target: ", target)
--@end-debug@
if target == "SELF" then
--if target == "SELF" then
-- return
--end
--if not (UnitIsPlayer(unit)) or (unit == nil and target == "FRIEND" or target == "COMMUNITIES_GUILD_MEMBER") then
-- return
--end

--local name, realm = self.name, GetRealmName()
--if unit ~= nil then
-- name, realm = UnitName(unit)
-- if realm == nil then realm = GetRealmName() end
--end
-- rewrite code statement to make it more clear for future enhancement - Jason 20240801
-- verify the target
if target == "SELF" or target == "FRIEND" or target == "COMMUNITIES_GUILD_MEMBER" then
return
end
if not (UnitIsPlayer(unit)) or (unit == nil and target == "FRIEND" or target == "COMMUNITIES_GUILD_MEMBER") then
-- verify the unit
if unit == nil or not UnitIsPlayer(unit) then
return
end

local name, realm = self.name, GetRealmName()
if unit ~= nil then
name, realm = UnitName(unit)
if realm == nil then realm = GetRealmName() end
end
-- retrieve name and realm from wow api
local name, realm = UnitName(unit)
-- if the unit is from the same realm then realm is empty, use current realm instead
if realm == nil then realm = GetRealmName() end
local listedPlayer = Shitlist:GetListedPlayer(name, realm)

--@debug@
Expand Down
4 changes: 2 additions & 2 deletions embeds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
..\FrameXML\UI.xsd">

<Script file="Libs\LibStub\LibStub.lua"/>
<Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>

<Script file="Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua"/>
<Script file="Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua"/>

<Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>

<Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/>
<Include file="Libs\AceEvent-3.0\AceEvent-3.0.xml"/>
<Include file="Libs\AceHook-3.0\AceHook-3.0.xml"/>
Expand Down

0 comments on commit f663bd1

Please sign in to comment.