Skip to content

Commit

Permalink
Changes needed to not violate CurseForge ToS #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Limmek committed Aug 22, 2024
1 parent 922d5a4 commit d46193f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 24 deletions.
File renamed without changes
34 changes: 15 additions & 19 deletions PersonalPlayerNotes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ function Shitlist:OnInitialize()

-- https://www.wowace.com/projects/ace3/pages/api/ace-console-3-0
self:RegisterChatCommand("slm", "ToggleMiniMapIcon")

--@debug@
self:RegisterChatCommand("sldebug", "ToggleDebug")
--@end-debug@

self:GetOldConfigData()
self:RefreshConfig()
Expand All @@ -56,13 +59,12 @@ function Shitlist:OnEnable()
self:Print(L["SHITLIST_CONFIG_REASONS"], _G["GREEN_FONT_COLOR_CODE"], #self:GetReasons())
self:Print(L["SHITLIST_CONFIG_LISTEDPLAYERS"], _G["GREEN_FONT_COLOR_CODE"], #self:GetListedPlayers())

-- Retail 10.0.2 https://wowpedia.fandom.com/wiki/Patch_10.0.2/API_changes#Tooltip_Changes
if (self.IsRetail) then
-- New Menu System in Retail 11.0.0
-- https://warcraft.wiki.gg/wiki/Patch_11.0.0/API_changes
-- https://www.townlong-yak.com/framexml/latest/Blizzard_Menu/11_0_0_MenuImplementationGuide.lua
self.DropDownMenuInitialize()

self:DropDownMenuInitialize()
-- Retail 10.0.2 https://wowpedia.fandom.com/wiki/Patch_10.0.2/API_changes#Tooltip_Changes
TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Unit, self.GameTooltip)
else
if not self:IsHooked("UnitPopup_ShowMenu") then
Expand Down Expand Up @@ -95,6 +97,7 @@ function Shitlist:RefreshConfig()
end

function Shitlist:GetOldConfigData()
-- TODO: Add support to use the new PersonalPlayerNotesDB and move old data to the new DB.
if _G.ShitlistDB.ListedPlayers == nil and _G.ShitlistDB.Reasons == nil then
return
end
Expand Down Expand Up @@ -164,10 +167,13 @@ end

function Shitlist:DropDownMenuInitialize()
local DropDownMenu = function(ownerRegion, rootDescription, contextData)
local name, realm = contextData.name, nil
if contextData.unit ~= nil then
name, realm = UnitName(contextData.unit)
-- verify the unit
if contextData.unit == nil or not UnitIsPlayer(contextData.unit) then
return
end
-- retrieve name and realm from wow api
local name, realm = UnitName(contextData.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)
Expand Down Expand Up @@ -246,19 +252,7 @@ function Shitlist:UnitPopup_ShowMenu(target, unit, menuList)
--@debug@
Shitlist:PrintDebug("Unit: ", unit, ", Target: ", target)
--@end-debug@
--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
Expand Down Expand Up @@ -505,7 +499,9 @@ function Shitlist:ToggleMiniMapIcon()
self:RefreshConfig()
end

--@debug@
function Shitlist:ToggleDebug()
self.db.profile.debug = not self.db.profile.debug
self:RefreshConfig()
end
--@end-debug@
4 changes: 2 additions & 2 deletions PersonalPlayerNotes.toc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
## DefaultState: enabled
## X-Category: Tooltip, Miscellaneous, PvP, Quests & Leveling, Unit Frames
## X-Curse-Project-ID: 344967
## X-Localizations: enUS
## X-Localizations: enUS, zhCN
## X-Website: https://github.com/Limmek/Shitlist
## X-License: MIT
## IconTexture: Interface\AddOns\Shitlist\Images\shitlist.png
## IconTexture: Interface\AddOns\Shitlist\Images\icon.png

embeds.xml

Expand Down
1 change: 0 additions & 1 deletion PersonalPlayerNotesUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,4 @@ function Shitlist:PrintDebug(...)
self:Print(...)
end
end

--@end-debug@
2 changes: 1 addition & 1 deletion PersonalPlayerNotes_Vanilla.toc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## DefaultState: enabled
## X-Category: Tooltip, Miscellaneous, PvP, Quests & Leveling, Unit Frames
## X-Curse-Project-ID: 344967
## X-Localizations: enUS
## X-Localizations: enUS, zhCN
## X-Website: https://github.com/Limmek/Shitlist
## X-License: MIT

Expand Down
2 changes: 1 addition & 1 deletion PersonalPlayerNotes_Wrath.toc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## DefaultState: enabled
## X-Category: Tooltip, Miscellaneous, PvP, Quests & Leveling, Unit Frames
## X-Curse-Project-ID: 344967
## X-Localizations: enUS
## X-Localizations: enUS, zhCN
## X-Website: https://github.com/Limmek/Shitlist
## X-License: MIT

Expand Down

0 comments on commit d46193f

Please sign in to comment.