Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jason depp patch 20240801 #14

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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