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 12, 2024
1 parent c0106f4 commit 2583926
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 103 deletions.
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
"StaticPopup_Show",
"C_UI",
"CreateColor",
"next"
"next",
"SettingsPanel"
],
"Lua.runtime.builtin": {
"basic": "disable",
Expand All @@ -143,6 +144,6 @@
"utf8": "disable"
},
"Lua.workspace.library": [
"c:\\Users\\jim_a\\.vscode\\extensions\\ketho.wow-api-0.15.5\\Annotations"
"$USERPROFILE\\.vscode\\extensions\\ketho.wow-api-0.15.7\\Annotations"
],
}
35 changes: 8 additions & 27 deletions PersonalPlayerNotes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,10 @@ function PersonalPlayerNotes:OnInitialize()
-- https://www.wowace.com/projects/ace3/pages/api/ace-console-3-0
self:RegisterChatCommand("slm", "ToggleMiniMapIcon")

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

local loaded, reason = LoadAddOn("Shitlist")
if not loaded then
self:Print("Failed to load Shitlist because", reason)
else
if loaded then
self:GetOldConfigData()
end
self:LoadConfig()
Expand Down Expand Up @@ -99,11 +95,9 @@ function PersonalPlayerNotes:LoadConfig()
LibDBIcon:Show(personalPlayerNotes)
end

--@debug@
self:PrintDebug(L["SHITLIST_CONFIG_REFRESH"])
self:PrintDebug("Debug:", _G["GREEN_FONT_COLOR_CODE"], self.db.profile.debug)
self:PrintDebug("Debug mode:", _G["GREEN_FONT_COLOR_CODE"], self.db.profile.debug)
self:PrintDebug("Mini Map Icon:", _G["GREEN_FONT_COLOR_CODE"], not self.db.profile.minimap.hide)
--@end-debug@
end

function PersonalPlayerNotes:GetOldConfigData()
Expand Down Expand Up @@ -174,12 +168,12 @@ function PersonalPlayerNotes:GetOldConfigData()

-- Move old shitlist profiles data to new Personal Player Notes database
if ShitlistDB and ShitlistDB.profiles then
self:Print(L["SHITLIST_CONFIG_MIGRATE_OLD_DATA"])
StaticPopupDialogs["MIGRATE_PROFILES"] = {
text = "Do you want to migrate profiles from Shitlist?",
button1 = "Yes",
button2 = "No",
OnAccept = function()
PersonalPlayerNotes:Print(L["SHITLIST_CONFIG_MIGRATE_OLD_DATA"])
for profileName, profileData in pairs(ShitlistDB.profiles) do
PersonalPlayerNotes.db.profiles[profileName] = profileData
end
Expand Down Expand Up @@ -260,10 +254,7 @@ end

-- Classic Deprecated
function PersonalPlayerNotes:UnitPopup_ShowMenu(target, unit, menuList)
--@debug@
PersonalPlayerNotes:PrintDebug("Unit: ", unit, ", Target: ", target)
--@end-debug@

-- verify the target
if target == "SELF" or target == "FRIEND" or target == "COMMUNITIES_GUILD_MEMBER" then
return
Expand All @@ -278,9 +269,7 @@ function PersonalPlayerNotes:UnitPopup_ShowMenu(target, unit, menuList)
if realm == nil then realm = GetRealmName() end
local listedPlayer = PersonalPlayerNotes:GetListedPlayer(name, realm)

--@debug@
PersonalPlayerNotes:PrintDebug("Name: ", name, ", Realm: ", realm)
--@end-debug@

-- Check if this is the root level of the dropdown menu
if UIDROPDOWNMENU_MENU_LEVEL == 1 then
Expand Down Expand Up @@ -370,12 +359,10 @@ function PersonalPlayerNotes:GameTooltip()
local _reason = reason
local _listedPlayer = listedPlayer

--@debug@
PersonalPlayerNotes:PrintDebug("|cffff0000<GameTooltip>|cffffffff Playername:", name, "Realm:", realm, "Reason:",
_reason
.reason,
"Note:", _listedPlayer.description)
--@end-debug@

-- Tooltip
if not (_reason.reason == "None" and _listedPlayer.description == "") then
Expand All @@ -394,20 +381,16 @@ function PersonalPlayerNotes:GameTooltip()
alert.last[name] = time + alert.delay
PersonalPlayerNotes:ScheduleTimer("AlertDelayTimer", alert.delay, name)
PersonalPlayerNotes:PlayAlertSoundEffect()
--@debug@
PersonalPlayerNotes:PrintDebug("|cffff0000<ALERT>|cffffffff Sound effect disabled for player", name, "for",
alert.delay,
"seconds.")
--@end-debug@
end
end
end

function PersonalPlayerNotes:AlertDelayTimer(name)
-- Called within ScheduleTimer and fires when timer ends.
--@debug@
PersonalPlayerNotes:PrintDebug("|cffff0000<ALERT>|cffffffff Sound effect is now enabled for player", name)
--@end-debug@
PersonalPlayerNotes.db.profile.alert.last[name] = nil
end

Expand All @@ -416,15 +399,16 @@ function PersonalPlayerNotes:MiniMapIcon()
-- https://github.com/tekkub/libdatabroker-1-1/wiki/How-to-provide-a-dataobject
return LibDataBroker:NewDataObject(personalPlayerNotes, {
type = "launcher",
text = personalPlayerNotes,
text = L["SHITLIST"],
icon = PersonalPlayerNotes.db.profile.icon,
OnClick = function(clickedframe, button)
AceConfigDialog:Close("PersonalPlayerNotesSettings Options")
HideUIPanel(SettingsPanel)
HideUIPanel(GameMenuFrame)
AceConfigDialog:CloseAll()
local AceGUI = PersonalPlayerNotes:AceGUIDefaults()
if button == "RightButton" then
InterfaceOptionsFrame_OpenToCategory(personalPlayerNotes)
Settings.OpenToCategory(personalPlayerNotes, "PersonalPlayerNotesSettings Info")
elseif button == "LeftButton" then
local AceGUI = PersonalPlayerNotes:AceGUIDefaults()
if IsShiftKeyDown() then
AceGUI:SetTitle(L["SHITLIST_REASONS_TITLE"])
AceConfigDialog:SetDefaultSize("PersonalPlayerNotesSettings Reasons", 500, 200)
Expand Down Expand Up @@ -458,10 +442,7 @@ function PersonalPlayerNotes:ToggleMiniMapIcon()
self:LoadConfig()
end

--@debug@
function PersonalPlayerNotes:ToggleDebug()
self.db.profile.debug = not self.db.profile.debug
self:LoadConfig()
end

--@end-debug@
6 changes: 5 additions & 1 deletion PersonalPlayerNotes.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
## Interface: 110002
## Interface-Classic: 11503
## Interface-Wrath: 30403
## Interface-Cata: 40400
## Title : Personal Player Notes
## Notes: Set a personal comment on players and adding it to player information tooltip.
## Author: Limmek
## Notes-zhCN: Set a personal comment on players and adding it to player information tooltip.
## Author: Limmek, JasonDepp
## Version: @project-version@
## Dependencies:
## OptionalDeps: Shitlist, Ace3, LibStub, LibDataBroker-1.1, LibDBIcon-1.0, CallbackHandler-1.0
Expand Down
14 changes: 7 additions & 7 deletions PersonalPlayerNotesConfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ PersonalPlayerNotes.defaults = {
time = 0
},
reasons = {
{ id = 1, reason = "None", color = { r = 1, g = 1, b = 1 }, alert = false, },
{ id = 2, reason = "Kill Stealing", color = { r = 0, g = 0, b = 1 }, alert = true, },
{ id = 3, reason = "Ninja Looting", color = { r = 1, g = 0, b = 0 }, alert = true, },
{ id = 4, reason = "Spamming", color = { r = 0, g = 1, b = 0 }, alert = true, },
{ id = 1, reason = "None", color = { r = 1, g = 1, b = 1 }, alert = false, },
},
reason = { id = 1, reason = "None", color = { r = 1, g = 1, b = 1 } },
listedPlayer = {
Expand Down Expand Up @@ -279,7 +276,8 @@ PersonalPlayerNotes.options = {
cmdHidden = true,
name = L["SHITLIST_REASON_REMOVE"],
confirm = function()
return L["SHITLIST_REASON_REMOVE_CONFIRMATION"] .. PersonalPlayerNotes.db.profile.reason.reason .. "|cffffffff?";
return L["SHITLIST_REASON_REMOVE_CONFIRMATION"] ..
PersonalPlayerNotes.db.profile.reason.reason .. "|cffffffff?";
end,
func = "RemoveReason",
disabled = function()
Expand Down Expand Up @@ -409,7 +407,8 @@ PersonalPlayerNotes.options = {
get = "GetListedPlayerAlert",
set = "SetListedPlayerAlert",
disabled = function()
return not PersonalPlayerNotes.db.profile.reasons[PersonalPlayerNotes.db.profile.listedPlayer.reason].alert
return not PersonalPlayerNotes.db.profile.reasons
[PersonalPlayerNotes.db.profile.listedPlayer.reason].alert
end,
},
}
Expand Down Expand Up @@ -438,7 +437,8 @@ end
function PersonalPlayerNotes:PlayAlertSoundEffect(effect, channel)
PlaySoundFile(
"Interface\\AddOns\\" ..
personalPlayerNotes .. "\\Sounds\\" .. PersonalPlayerNotes.db.profile.alert.sounds[effect or self:GetAlertSoundEffect()] .. ".ogg",
personalPlayerNotes ..
"\\Sounds\\" .. PersonalPlayerNotes.db.profile.alert.sounds[effect or self:GetAlertSoundEffect()] .. ".ogg",
channel or "master"
)
end
Expand Down
22 changes: 0 additions & 22 deletions PersonalPlayerNotes_Cata.toc

This file was deleted.

22 changes: 0 additions & 22 deletions PersonalPlayerNotes_Vanilla.toc

This file was deleted.

22 changes: 0 additions & 22 deletions PersonalPlayerNotes_Wrath.toc

This file was deleted.

0 comments on commit 2583926

Please sign in to comment.