From 258392658371baee3cf14f9a065eb7640009ab58 Mon Sep 17 00:00:00 2001 From: Limmek Date: Mon, 12 Aug 2024 17:00:40 +0200 Subject: [PATCH] Changes needed to not violate CurseForge ToS #16 --- .vscode/settings.json | 5 +++-- PersonalPlayerNotes.lua | 35 ++++++++------------------------- PersonalPlayerNotes.toc | 6 +++++- PersonalPlayerNotesConfig.lua | 14 ++++++------- PersonalPlayerNotes_Cata.toc | 22 --------------------- PersonalPlayerNotes_Vanilla.toc | 22 --------------------- PersonalPlayerNotes_Wrath.toc | 22 --------------------- 7 files changed, 23 insertions(+), 103 deletions(-) delete mode 100644 PersonalPlayerNotes_Cata.toc delete mode 100644 PersonalPlayerNotes_Vanilla.toc delete mode 100644 PersonalPlayerNotes_Wrath.toc diff --git a/.vscode/settings.json b/.vscode/settings.json index 2928959..85f7bc9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -129,7 +129,8 @@ "StaticPopup_Show", "C_UI", "CreateColor", - "next" + "next", + "SettingsPanel" ], "Lua.runtime.builtin": { "basic": "disable", @@ -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" ], } \ No newline at end of file diff --git a/PersonalPlayerNotes.lua b/PersonalPlayerNotes.lua index 9f64183..118b43d 100644 --- a/PersonalPlayerNotes.lua +++ b/PersonalPlayerNotes.lua @@ -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() @@ -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() @@ -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 @@ -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 @@ -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 @@ -370,12 +359,10 @@ function PersonalPlayerNotes:GameTooltip() local _reason = reason local _listedPlayer = listedPlayer - --@debug@ PersonalPlayerNotes:PrintDebug("|cffff0000|cffffffff Playername:", name, "Realm:", realm, "Reason:", _reason .reason, "Note:", _listedPlayer.description) - --@end-debug@ -- Tooltip if not (_reason.reason == "None" and _listedPlayer.description == "") then @@ -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|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|cffffffff Sound effect is now enabled for player", name) - --@end-debug@ PersonalPlayerNotes.db.profile.alert.last[name] = nil end @@ -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) @@ -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@ diff --git a/PersonalPlayerNotes.toc b/PersonalPlayerNotes.toc index 634a7b0..97d4765 100644 --- a/PersonalPlayerNotes.toc +++ b/PersonalPlayerNotes.toc @@ -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 diff --git a/PersonalPlayerNotesConfig.lua b/PersonalPlayerNotesConfig.lua index 0ebbde3..2c78b65 100644 --- a/PersonalPlayerNotesConfig.lua +++ b/PersonalPlayerNotesConfig.lua @@ -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 = { @@ -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() @@ -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, }, } @@ -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 diff --git a/PersonalPlayerNotes_Cata.toc b/PersonalPlayerNotes_Cata.toc deleted file mode 100644 index 2419622..0000000 --- a/PersonalPlayerNotes_Cata.toc +++ /dev/null @@ -1,22 +0,0 @@ -## Interface: 40400 -## Title : Personal Player Notes -## Notes: Set a personal comment on players and adding it to player information tooltip. -## Author: Limmek -## Version: @project-version@ -## Dependencies: -## OptionalDeps: Ace3, LibStub, LibDataBroker-1.1, LibDBIcon-1.0, CallbackHandler-1.0 -## SavedVariables: PersonalPlayerNotesDB, ShitlistDB -## DefaultState: enabled -## X-Category: Tooltip, Miscellaneous, PvP, Quests & Leveling, Unit Frames -## X-Curse-Project-ID: 344967 -## X-Localizations: enUS, zhCN -## X-Website: https://github.com/Limmek/Shitlist -## X-License: MIT - -embeds.xml - -Locales\Locales.xml - -PersonalPlayerNotes.lua -PersonalPlayerNotesUtils.lua -PersonalPlayerNotesConfig.lua diff --git a/PersonalPlayerNotes_Vanilla.toc b/PersonalPlayerNotes_Vanilla.toc deleted file mode 100644 index 98f8ae9..0000000 --- a/PersonalPlayerNotes_Vanilla.toc +++ /dev/null @@ -1,22 +0,0 @@ -## Interface: 11503 -## Title : Personal Player Notes -## Notes: Set a personal comment on players and adding it to player information tooltip. -## Author: Limmek -## Version: @project-version@ -## Dependencies: -## OptionalDeps: Ace3, LibStub, LibDataBroker-1.1, LibDBIcon-1.0, CallbackHandler-1.0 -## SavedVariables: PersonalPlayerNotesDB, ShitlistDB -## DefaultState: enabled -## X-Category: Tooltip, Miscellaneous, PvP, Quests & Leveling, Unit Frames -## X-Curse-Project-ID: 344967 -## X-Localizations: enUS, zhCN -## X-Website: https://github.com/Limmek/Shitlist -## X-License: MIT - -embeds.xml - -Locales\Locales.xml - -PersonalPlayerNotes.lua -PersonalPlayerNotesUtils.lua -PersonalPlayerNotesConfig.lua diff --git a/PersonalPlayerNotes_Wrath.toc b/PersonalPlayerNotes_Wrath.toc deleted file mode 100644 index e6d3508..0000000 --- a/PersonalPlayerNotes_Wrath.toc +++ /dev/null @@ -1,22 +0,0 @@ -## Interface: 30403 -## Title : Personal Player Notes -## Notes: Set a personal comment on players and adding it to player information tooltip. -## Author: Limmek -## Version: @project-version@ -## Dependencies: -## OptionalDeps: Ace3, LibStub, LibDataBroker-1.1, LibDBIcon-1.0, CallbackHandler-1.0 -## SavedVariables: PersonalPlayerNotesDB, ShitlistDB -## DefaultState: enabled -## X-Category: Tooltip, Miscellaneous, PvP, Quests & Leveling, Unit Frames -## X-Curse-Project-ID: 344967 -## X-Localizations: enUS, zhCN -## X-Website: https://github.com/Limmek/Shitlist -## X-License: MIT - -embeds.xml - -Locales\Locales.xml - -PersonalPlayerNotes.lua -PersonalPlayerNotesUtils.lua -PersonalPlayerNotesConfig.lua