diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml
new file mode 100644
index 0000000..b3d2bf0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yaml
@@ -0,0 +1,68 @@
+name: Bug Report
+description: File a bug report
+title: "🐛 "
+labels: ["🐛 Bug"]
+body:
+ - type: checkboxes
+ attributes:
+ label: Is there an existing issue for this?
+ description: Please [search for existing issues](https://github.com/Limmek/Shitlist/issues) to see if an open or closed one already exists for the bug you encountered. If a bug exists and it is closed you can create a new bug report.
+ options:
+ - label: I have searched the existing open and closed issues.
+ required: true
+
+ - type: textarea
+ attributes:
+ label: Description
+ description: What did you expect to happen and what happened instead?
+ validations:
+ required: true
+
+ - type: dropdown
+ id: flavor
+ attributes:
+ label: World of Warcraft Flavor
+ description: What version of World of Warcraft are are you running?
+ options:
+ - Retail (Default)
+ - Classic
+ - Wrath of the Lich King Classic
+ validations:
+ required: true
+
+ - type: checkboxes
+ id: testing
+ attributes:
+ label: Tested with only Shitlist
+ description: Did you try having Shitlist as the only enabled addon and everything else disabled?
+ options:
+ - label: "Yes"
+ required: true
+
+ - type: textarea
+ attributes:
+ label: Lua Error
+ description: |
+ Do you have an error log of what happened? If you don't see any errors, make sure that error reporting is enabled (`/console scriptErrors 1`) or install [BugSack](https://www.curseforge.com/wow/addons/bugsack) & [BugGrabber](https://www.curseforge.com/wow/addons/bug-grabber), yes both are needed.
+ render: Text
+ validations:
+ required: false
+
+ - type: textarea
+ attributes:
+ label: Reproduction Steps
+ description: Please list out the steps to reproduce your bug. Please verify that your reproduction steps are enough to reproduce the problem.
+ placeholder: |
+ 1. Go to '...'
+ 2. Click on '....'
+ 3. See error
+ validations:
+ required: true
+
+ - type: textarea
+ attributes:
+ label: Screenshots
+ description: If applicable, add screenshots to help explain your problem.
+ placeholder: Click here to attach your screenshots via the editor button in the top right.
+ validations:
+ required: false
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..3ba13e0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1 @@
+blank_issues_enabled: false
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..13d858b
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,9 @@
+version: 2
+updates:
+- package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "weekly"
+ open-pull-requests-limit: 10
+ assignees:
+ - Limmek
diff --git a/.github/issue-rules.yml b/.github/issue-rules.yml
new file mode 100644
index 0000000..3305cd6
--- /dev/null
+++ b/.github/issue-rules.yml
@@ -0,0 +1,6 @@
+nomatches:
+- contains: "Which version of WeakAuras are you using?" # Checks the entire issue for a substring match.
+ addLabels: ["\U0001F41B Bug"]
+
+- contains: "Is your feature request related to a problem? Please describe."
+ addLabels: ["\U0001F3A8 Feature Request"]
diff --git a/.github/workflows/release.yml b/.github/workflows/build.yml
similarity index 83%
rename from .github/workflows/release.yml
rename to .github/workflows/build.yml
index 10c3de5..014c970 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/build.yml
@@ -7,7 +7,8 @@ on:
- "**"
jobs:
- release:
+ run:
+ name: Package and release
runs-on: ubuntu-latest
env:
@@ -23,4 +24,4 @@ jobs:
- name: Package and release
uses: BigWigsMods/packager@v2
with:
- args: -S -w 0 -a 0 -p 0 -m .pkgmeta -d
+ args: -p 344967 -w 0 -a 0 -m .pkgmeta
diff --git a/.github/workflows/interface-version.yml b/.github/workflows/interface-version.yml
new file mode 100644
index 0000000..d3f5a90
--- /dev/null
+++ b/.github/workflows/interface-version.yml
@@ -0,0 +1,42 @@
+name: Update TOC Interface version(s)
+
+on:
+ workflow_dispatch:
+ workflow_run:
+ workflows: ['Luacheck']
+ types:
+ - completed
+ #schedule:
+ #- cron: "0 * * * *"
+
+jobs:
+ run:
+ name: TOCcheck
+ runs-on: ubuntu-latest
+ steps:
+ - name: Clone project
+ uses: actions/checkout@v3
+
+ - name: Checking Vanilla
+ uses: p3lim/toc-interface-updater@v3
+ with:
+ flavor: classic_era
+ future: false
+
+ - name: Checking Wrath
+ uses: p3lim/toc-interface-updater@v3
+ with:
+ flavor: classic
+ future: false
+
+ - name: Checking Retail
+ uses: p3lim/toc-interface-updater@v3
+ with:
+ flavor: retail
+ future: false
+
+ - name: Commit changes
+ uses: EndBug/add-and-commit@v9
+ with:
+ message: 'Update TOC interface version(s)'
+ add: '.'
diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml
new file mode 100644
index 0000000..ea05c0f
--- /dev/null
+++ b/.github/workflows/issues.yml
@@ -0,0 +1,18 @@
+name: Issue Template Check
+
+on:
+ issues:
+ types: [opened, edited]
+
+jobs:
+ auto_close_issues:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: "Automatically close issues that don't follow the issue template"
+ uses: damccorm/tag-ur-it@master
+ with:
+ repo-token: "${{ secrets.GITHUB_TOKEN }}"
+ configuration-path: "./.github/issue-rules.yml"
diff --git a/.github/workflows/formating.yml b/.github/workflows/luacheck.yml
similarity index 63%
rename from .github/workflows/formating.yml
rename to .github/workflows/luacheck.yml
index 36cc68f..ae74b25 100644
--- a/.github/workflows/formating.yml
+++ b/.github/workflows/luacheck.yml
@@ -1,15 +1,15 @@
-name: Check formating
+name: Luacheck
on:
workflow_dispatch:
pull_request:
-
-defaults:
- run:
- working-directory: ./Shitlist
+ push:
+ branches:
+ - master
jobs:
- luacheck:
+ run:
+ name: Luacheck
runs-on: ubuntu-latest
steps:
- name: Clone project
@@ -21,4 +21,8 @@ jobs:
uses: nebularg/actions-luacheck@v1
with:
args: "--no-color -q"
- config: https://raw.githubusercontent.com/Limmek/Shitlist/master/.luacheckrc
+
+ - name: wow-lint
+ uses: davidcraig/action-wow-lint@v1.0.1
+ with:
+ path-to-files: '*.lua'
diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml
deleted file mode 100644
index 95cc910..0000000
--- a/.github/workflows/update.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: Update Interface version(s)
-
-on:
- workflow_dispatch:
- schedule:
- - cron: "0 * * * *"
-
-defaults:
- run:
- working-directory: ./Shitlist
-
-jobs:
- run:
- runs-on: ubuntu-latest
- steps:
- - name: Clone project
- uses: actions/checkout@v3
-
- - name: Update TOC Interface version
- uses: p3lim/toc-interface-updater@v2
-
- - name: Create pull request
- uses: peter-evans/create-pull-request@v4
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- title: Update Interface version
- branch: bump-version
- delete-branch: true
- assignees: Limmek
diff --git a/.gitignore b/.gitignore
index e9aa6bc..0b4ea5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,16 @@
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+!.vscode/*.code-snippets
+
+# Local History for Visual Studio Code
+.history/
+
+# Built Visual Studio Code Extensions
+*.vsix
+
# Compiled Lua sources
luac.out
@@ -39,18 +52,9 @@ luac.out
*.x86_64
*.hex
-X VSCode
-.vscode/*
-!.vscode/settings.json
-!.vscode/tasks.json
-!.vscode/launch.json
-!.vscode/extensions.json
-!.vscode/*.code-snippets
-
-# Local History for Visual Studio Code
-.history/
-
-# Built Visual Studio Code Extensions
-*.vsix
+# Build Files
+*.bat
-*.code-workspace
+# Addon dependencies
+Libs/*
+!Libs/libs.txt
diff --git a/.luacheckrc b/.luacheckrc
index c0b3424..c3997b2 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -1,31 +1,402 @@
-globals = {
- "_G",
- "Shitlist",
- "ShitlistDB",
- "ShitlistSettings",
- "GameTooltip",
+std = "lua51"
+-- self = false
+-- unused_args = false
+max_line_length = false
+-- max_code_line_length = false
+-- max_string_line_length = false
+-- max_comment_line_length = false
+
+-- include_files = {
+-- "Shitlist.lua",
+-- "ShitlistConfig.lua",
+-- "ShitlistUtils.lua",
+-- "Locales/*.lua"
+-- }
+
+exclude_files = {
+ "libs/",
+ ".luacheckrc"
}
-max_line_length = 2823 -- fixme
+
ignore = {
- "11./SLASH_.*", -- Setting an undefined (Slash handler) global variable
- "11./BINDING_.*", -- Setting an undefined (Keybinding header) global variable
- "113/LE_.*", -- Accessing an undefined (Lua ENUM type) global variable
- "113/NUM_LE_.*", -- Accessing an undefined (Lua ENUM type) global variable
- "211", -- Unused local variable
- "211/L", -- Unused local variable "CL"
- "211/CL", -- Unused local variable "CL"
- "212", -- Unused argument
- "213", -- Unused loop variable
- -- "231", -- Set but never accessed
- "311", -- Value assigned to a local variable is unused
- "314", -- Value of a field in a table literal is unused
- "42.", -- Shadowing a local variable, an argument, a loop variable.
- "43.", -- Shadowing an upvalue, an upvalue argument, an upvalue loop variable.
- "542", -- An empty if branch
- "611", -- A line consists of nothing but whitespace.
- "612", -- A line contains trailing whitespace.
- "613", -- Trailing whitespace in a string.
- "614", -- Trailing whitespace in a comment.
+ "111", -- Setting an undefined global variable.
+ "112", -- Mutating an undefined global variable.
+ "113", -- Accessing an undefined global variable.
+ "211", -- Unused local variable
+ "212", -- Unused argument
+ "213", -- Unused loop variable
+ "311", -- Value assigned to a local variable is unused
+ "432", -- Shadowing an upvalue argument
+ "512", -- Loop is executed at most once
+ "542", -- empty if branch
+}
+
+globals = {
+ "Shitlist"
+}
+
+read_globals = {
+ "bit",
+ "math",
+ "ceil", "floor",
+ "abs", "mod", "max",
+ "sin", "cos", "tan",
+ "hooksecurefunc",
+ "table", "tinsert", "tContains", "tAppendAll", "tDeleteItem", "wipe", "MergeTable",
+ "string", "tostringall", "strtrim", "strmatch", "strjoin", "strsplit", "strlower",
+ "time",
+
+ -- our own globals
+
+ -- misc custom, third party libraries
+ "LibStub", "tekDebug",
+ "AceGUIWidgetLSMlists",
+ "ChatThrottleLib",
+ "GetAuctionBuyout",
+ "TomTom",
+ "DBM",
+
+ -- API functions
+ "C_AreaPoiInfo",
+ "C_Calendar",
+ "C_ChatInfo",
+ "C_Covenants",
+ "C_CovenantSanctumUI",
+ "C_CurrencyInfo",
+ "C_DateAndTime",
+ "C_GamePad",
+ "C_Garrison",
+ "C_Item",
+ "C_MajorFactions",
+ "C_Map",
+ "C_Minimap",
+ "C_MountJournal",
+ "C_NamePlate",
+ "C_PetJournal",
+ "C_QuestLog",
+ "C_Spell",
+ "C_SuperTrack",
+ "C_TaskQuest",
+ "C_Texture",
+ "C_Timer",
+ "C_TooltipInfo",
+ "C_ToyBox",
+ "C_Transmog",
+ "C_TransmogCollection",
+ "C_UnitAuras",
+ "C_VignetteInfo",
+ "TransmogUtil",
+ "UiMapPoint",
+ "Debug",
+ "Enum",
+ "BankButtonIDToInvSlotID",
+ "ContainerIDToInventoryID",
+ "ReagentBankButtonIDToInvSlotID",
+ "Ambiguate",
+ "CombatLogGetCurrentEventInfo",
+ "CreateColor",
+ "CreateColorFromBytes",
+ "CreateMacro",
+ "CursorHasItem",
+ "DeleteCursorItem",
+ "EditMacro",
+ "EnumerateServerChannels",
+ "FlashClientIcon",
+ "GetAddOnInfo",
+ "GetAddOnMetadata",
+ "GetAchievementCriteriaInfo",
+ "GetAchievementCriteriaInfoByID",
+ "GetAchievementInfo",
+ "GetAchievementLink",
+ "GetAchievementNumCriteria",
+ "GetAuctionItemSubClasses",
+ "GetBuildInfo",
+ "GetBackpackAutosortDisabled",
+ "GetBagSlotFlag",
+ "GetBankAutosortDisabled",
+ "GetBankBagSlotFlag",
+ "GetChannelName",
+ "GetContainerNumFreeSlots",
+ "GetContainerNumSlots",
+ "GetContainerItemID",
+ "GetContainerItemInfo",
+ "GetContainerItemLink",
+ "GetCurrentGuildBankTab",
+ "GetCurrentMapAreaID",
+ "GetCursorInfo",
+ "GetCVar",
+ "GetFactionInfoByID",
+ "GetGuildBankItemInfo",
+ "GetGuildBankItemLink",
+ "GetGuildBankTabInfo",
+ "GetGuildBankNumSlots",
+ "GetInventoryItemLink",
+ "GetItemClassInfo",
+ "GetItemCount",
+ "GetItemFamily",
+ "GetItemInfo",
+ "GetItemInfoInstant",
+ "GetItemQualityColor",
+ "GetItemSpecInfo",
+ "GetLocale",
+ "GetMacroIndexByName",
+ "GetNumGroupMembers",
+ "GetNumMacros",
+ "GetRealmName",
+ "GetPlayerAuraBySpellID",
+ "GetPlayerFacing",
+ "GetRaidTargetIndex",
+ "GetScreenHeight",
+ "GetScreenWidth",
+ "GetSpellInfo",
+ "GetTime",
+ "GetZoneText",
+ "InCinematic",
+ "InCombatLockdown",
+ "IsAddOnLoaded",
+ "IsAltKeyDown",
+ "IsControlKeyDown",
+ "IsCosmeticItem",
+ "IsInCinematicScene",
+ "IsInGroup",
+ "IsInGuild",
+ "IsInInstance",
+ "IsInRaid",
+ "IsModifiedClick",
+ "IsModifierKeyDown",
+ "IsReagentBankUnlocked",
+ "IsShiftKeyDown",
+ "IsSpellKnown",
+ "LoadAddOn",
+ "MouseIsOver",
+ "OpenWorldMap",
+ "PlaySound",
+ "PlaySoundFile",
+ "PlayerHasToy",
+ "PickupContainerItem",
+ "PickupGuildBankItem",
+ "QueryGuildBankTab",
+ "SendChatMessage",
+ "SetCVar",
+ "SetMapByID",
+ "SetMapToCurrentZone",
+ "SetRaidTarget",
+ "SetRaidTargetIconTexture",
+ "SplitContainerItem",
+ "SplitGuildBankItem",
+ "StopSound",
+ "UnitClass",
+ "UnitClassification",
+ "UnitCreatureType",
+ "UnitExists",
+ "UnitFactionGroup",
+ "UnitFullName",
+ "UnitGUID",
+ "UnitHealth",
+ "UnitHealthMax",
+ "UnitInRange",
+ "UnitIsAFK",
+ "UnitIsDead",
+ "UnitIsGroupLeader",
+ "UnitIsPlayer",
+ "UnitIsVisible",
+ "UnitLevel",
+ "UnitName",
+ "UnitOnTaxi",
+ "UnitPlayerControlled",
+ "UseContainerItem",
+
+ -- FrameXML frames
+ "BankFrame",
+ "MerchantFrame",
+ "GameTooltip",
+ "UIParent",
+ "WorldFrame",
+ "Minimap",
+ "WorldMapFrame",
+ "MountJournal",
+ "DEFAULT_CHAT_FRAME",
+ "GameFontHighlightSmall",
+
+ -- FrameXML API
+ "ChatEdit_InsertLink",
+ "ChatFrame_OpenChat",
+ "CopyTable",
+ "CreateAtlasMarkup",
+ "CreateTextureMarkup",
+ "CreateFrame",
+ "CreateFramePool",
+ "CreateObjectPool",
+ "CreateFromMixins",
+ "CreateAndInitFromMixin",
+ "Mixin",
+ "Item",
+ "ContinuableContainer",
+ "InterfaceOptionsFrame_OpenToCategory",
+ "CloseDropDownMenus",
+ "ToggleDropDownMenu",
+ "UIDropDownMenu_AddButton",
+ "UIDropDownMenu_CreateInfo",
+ "UISpecialFrames",
+ "ScrollingEdit_OnCursorChanged",
+ "ScrollingEdit_OnUpdate",
+ "GameTooltip_Hide",
+ "GameTooltip_OnLoad",
+ "GameTooltip_OnTooltipSetItem",
+ "GameTooltip_OnTooltipSetSpell",
+ "GameTooltip_OnTooltipSetUnit",
+ "GameTooltip_OnTooltipSetShoppingItem",
+ "GameTooltip_OnUpdate",
+ "GameTooltip_SetTitle",
+ "GameTooltip_SetDefaultAnchor",
+ "HandleModifiedItemClick",
+ "MapCanvasDataProviderMixin",
+ "MapCanvasPinMixin",
+ "Vector2DMixin",
+ "VignettePinMixin",
+ "WorldMapPOIQuantizerMixin",
+ "RegionUtil",
+ "FramePool_HideAndClearAnchors",
+ "OpenAchievementFrameToAchievement",
+ "ToggleWorldMap",
+ "SetItemButtonTexture",
+ "TooltipDataProcessor",
+ "TooltipUtil",
+
+ -- FrameXML Constants
+ "ACHIEVEMENTS",
+ "ACTION_PARTY_KILL",
+ "ADD",
+ "ALL",
+ "ALT_KEY_TEXT",
+ "AZERITE_ESSENCE_TOOLTIP_NAME_RANK",
+ "BACKPACK_CONTAINER",
+ "BACKPACK_TOOLTIP",
+ "BAG_CLEANUP_BAGS",
+ "BAG_FILTER_ICONS",
+ "BAGSLOT",
+ "BANK",
+ "BANK_BAG_PURCHASE",
+ "BANK_CONTAINER",
+ "BOSS_DEAD",
+ "CHAT_MSG_SAY",
+ "CHAT_MSG_YELL",
+ "CHAT_MSG_PARTY",
+ "CHAT_MSG_RAID",
+ "CHAT_MSG_GUILD",
+ "CHAT_MSG_OFFICER",
+ "CLASS_ICON_TCOORDS",
+ "CLICK_FOR_DETAILS",
+ "CLOSE",
+ "COLOR",
+ "COMMUNITIES_DEFAULT_CHANNEL_NAME",
+ "COMMUNITIES_INVITE_MANAGER_LINK_TO_CHAT",
+ "COMPLETE",
+ "CONFIRM_BUY_BANK_SLOT",
+ "COVENANT_COLORS",
+ "CRITERIA_COMPLETED",
+ "CTRL_KEY_TEXT",
+ "DEFAULT",
+ "DRAG_MODEL",
+ "DONE",
+ "EMOTE88_CMD1",
+ "EMOTE410_CMD1",
+ "ENABLE",
+ "ENCOUNTER_JOURNAL_ITEM",
+ "ERR_USE_LOCKED_WITH_ITEM_S",
+ "EQUIP_CONTAINER",
+ "GREEN_FONT_COLOR",
+ "HIDE",
+ "ICON_LIST",
+ "ID",
+ "IGNORE",
+ "INCOMPLETE",
+ "ITEM_BIND_QUEST",
+ "ITEM_BNETACCOUNTBOUND",
+ "ITEM_CONJURED",
+ "ITEM_PET_KNOWN",
+ "ITEM_REQ_SKILL",
+ "ITEM_SET_NAME",
+ "ITEM_SOULBOUND",
+ "LE_BAG_FILTER_FLAG_EQUIPMENT",
+ "LE_BAG_FILTER_FLAG_IGNORE_CLEANUP",
+ "LE_EXPANSION_LEVEL_CURRENT",
+ "LE_EXPANSION_CLASSIC",
+ "LE_EXPANSION_BURNING_CRUSADE",
+ "LE_EXPANSION_WRATH_OF_THE_LICH_KING",
+ "LE_EXPANSION_CATACLYSM",
+ "LE_EXPANSION_MISTS_OF_PANDARIA",
+ "LE_EXPANSION_WARLORDS_OF_DRAENOR",
+ "LE_EXPANSION_LEGION",
+ "LE_EXPANSION_BATTLE_FOR_AZEROTH",
+ "LE_EXPANSION_SHADOWLANDS",
+ "LE_EXPANSION_DRAGONFLIGHT",
+ "LE_ITEM_CLASS_WEAPON",
+ "LE_ITEM_CLASS_ARMOR",
+ "LE_ITEM_CLASS_CONTAINER",
+ "LE_ITEM_CLASS_GEM",
+ "LE_ITEM_CLASS_ITEM_ENHANCEMENT",
+ "LE_ITEM_CLASS_CONSUMABLE",
+ "LE_ITEM_CLASS_GLYPH",
+ "LE_ITEM_CLASS_TRADEGOODS",
+ "LE_ITEM_CLASS_RECIPE",
+ "LE_ITEM_CLASS_BATTLEPET",
+ "LE_ITEM_CLASS_QUESTITEM",
+ "LE_ITEM_CLASS_MISCELLANEOUS",
+ "LE_ITEM_QUALITY_POOR",
+ "LE_PARTY_CATEGORY_HOME",
+ "LE_PARTY_CATEGORY_INSTANCE",
+ "LOCALIZED_CLASS_NAMES_FEMALE",
+ "LOCALIZED_CLASS_NAMES_MALE",
+ "LOCATION_COLON",
+ "LOOT",
+ "MAP_PIN",
+ "MAP_PIN_HYPERLINK",
+ "MAX_ACCOUNT_MACROS",
+ "MAX_CONTAINER_ITEMS",
+ "MOUNT",
+ "MOVE_FRAME",
+ "NEED",
+ "NEVER",
+ "NEW_ITEM_ATLAS_BY_QUALITY",
+ "NO",
+ "NONE",
+ "NUM_BAG_SLOTS",
+ "NUM_BANKBAGSLOTS",
+ "NUM_CONTAINER_FRAMES",
+ "NUM_LE_BAG_FILTER_FLAGS",
+ "OBJECTIVES_VIEW_ACHIEVEMENT",
+ "PARENS_TEMPLATE",
+ "PREVIEW",
+ "QUESTS_COLON",
+ "RAID_CLASS_COLORS",
+ "REAGENT_BANK",
+ "REAGENTBANK_CONTAINER",
+ "REAGENTBANK_DEPOSIT",
+ "RED_FONT_COLOR",
+ "REMOVE",
+ "RETRIEVING_ITEM_INFO",
+ "SEARCH_LOADING_TEXT",
+ "SHIFT_KEY_TEXT",
+ "SOUNDKIT",
+ "STATICPOPUP_NUMDIALOGS",
+ "SUBTITLE_FORMAT",
+ "TARGET",
+ "TEXTURE_ITEM_QUEST_BANG",
+ "TEXTURE_ITEM_QUEST_BORDER",
+ "TEXTURES_SUBHEADER",
+ "TOOLTIP_BATTLE_PET",
+ "TOY",
+ "TRADESKILL_POST",
+ "UIDROPDOWNMENU_MENU_VALUE",
+ "UIDROPDOWNMENU_MENU_LEVEL",
+ "UI_SCALE",
+ "UNKNOWN",
+ "UNKNOWNOBJECT",
+ "USED",
+ "WOW_PROJECT_ID",
+ "WOW_PROJECT_MAINLINE",
+ "WOW_PROJECT_CLASSIC",
+ "YES",
+ "ZONE",
}
-self=false
-global=false
diff --git a/.pkgmeta b/.pkgmeta
index e39644b..09bf7d6 100644
--- a/.pkgmeta
+++ b/.pkgmeta
@@ -1,17 +1,40 @@
package-as: Shitlist
manual-changelog:
- filename: CHANGELOG.md
- markup-type: markdown
+ filename: changelog.txt
+ markup-type: plain
enable-nolib-creation: no
-enable-toc-creation: yes
+enable-toc-creation: no
-# Ignore takes place before folder's moving takes place
ignore:
- - README.md
- - luaformat.cfg
+ - .gitignore
+ - .luacheckrc
+ - .vscode
+ - .github
+ - .pkgmeta
+ - Libs/libs.txt
-move-folders:
- Shitlist/Shitlist: Shitlist
+required-dependencies:
+
+externals:
+ Libs/AceAddon-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceAddon-3.0
+ Libs/AceComm-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceComm-3.0
+ Libs/AceConfig-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConfig-3.0
+ Libs/AceConsole-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConsole-3.0
+ Libs/AceDB-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0
+ Libs/AceDBOptions-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDBOptions-3.0
+ Libs/AceEvent-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceEvent-3.0
+ Libs/AceGUI-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceGUI-3.0
+ Libs/AceHook-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceHook-3.0
+ Libs/AceLocale-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceLocale-3.0
+ Libs/AceSerializer-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceSerializer-3.0
+ Libs/AceTab-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceTab-3.0
+ Libs/AceTimer-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceTimer-3.0
+ Libs/CallbackHandler-1.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/CallbackHandler-1.0
+ Libs/LibDBIcon-1.0: svn://svn.wowace.com/wow/libdbicon-1-0/mainline/trunk/LibDBIcon-1.0
+ Libs/LibStub: svn://svn.wowace.com/wow/libstub/mainline/tags/1.0
+ Libs/LibDataBroker-1.1:
+ url: http://github.com/tekkub/libdatabroker-1-1.git
+ tag: latest
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 0000000..1bf1a0d
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,10 @@
+{
+ "recommendations": [
+ "stylelint.vscode-stylelint",
+ "sumneko.lua",
+ "rog2.luacheck",
+ "ketho.wow-api",
+ "stanzilla.vscode-wow-toc",
+ "file-icons.file-icons"
+ ]
+}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..75f06f6
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,126 @@
+{
+ "luacheck.useLuacheck": true,
+ "editor.wordWrapColumn": 133,
+ "editor.rulers": [
+ 132
+ ],
+ "editor.wordWrap": "off",
+ "editor.defaultFormatter": "Ketho.wow-api",
+ "Lua.diagnostics.enable": true,
+ "Lua.runtime.version": "Lua 5.1",
+ "Lua.completion.callSnippet": "Both",
+ "Lua.diagnostics.disable": [
+ "undefined-field",
+ "unused-local",
+ "missing-fields",
+ "inject-field",
+ "need-check-nil",
+ "duplicate-set-field",
+ "param-type-mismatch",
+ "redundant-parameter"
+ ],
+ "Lua.diagnostics.globals": [
+ "UnitIsPlayer",
+ "RegisterChatCommand",
+ "UIDROPDOWNMENU_MAXBUTTONS",
+ "ChatFontNormal",
+ "TooltipDataProcessor",
+ "UIDROPDOWNMENU_MENU_LEVEL",
+ "ShitlistSettings",
+ "Settings",
+ "NOT_BOUND",
+ "GetLocale",
+ "UIDropDownMenu_AddButton",
+ "tremove",
+ "DEFAULT_CHAT_FRAME",
+ "FONT_COLOR_CODE_CLOSE",
+ "GetCursorPosition",
+ "InterfaceOptions_AddCategory",
+ "Enum",
+ "GetItemInfo",
+ "UIDropDownMenu_CreateInfo",
+ "SlashCmdList",
+ "AddDoubleLine",
+ "GameTooltip",
+ "NORMAL_FONT_COLOR",
+ "_L",
+ "UIParentLoadAddOn",
+ "SetTooltipMoney",
+ "CreateFrame",
+ "ACCEPT",
+ "hash_SlashCmdList",
+ "RegisterCallback",
+ "NORMAL_FONT_COLOR_CODE",
+ "GameFontNormalSmall",
+ "OKAY",
+ "NUM_CHAT_WINDOWS",
+ "FriendsFrame",
+ "GameFontHighlightLarge",
+ "GetRealmName",
+ "UnitName",
+ "GetUnit",
+ "CLOSE",
+ "geterrorhandler",
+ "testDB",
+ "OpacitySliderFrame",
+ "IsSecureCmd",
+ "Shitlist",
+ "AddLine",
+ "SELECTED_CHAT_FRAME",
+ "GameFontHighlightSmall",
+ "SetDesaturation",
+ "ColorPickerFrame",
+ "ChatEdit_GetActiveWindow",
+ "UnitPopupMenus",
+ "ItemRefTooltip",
+ "IsControlKeyDown",
+ "print",
+ "LibStub",
+ "CANCEL",
+ "SHITLIST_ID",
+ "GetMouseFocus",
+ "ShitlistDB",
+ "IsShiftKeyDown",
+ "GameFontDisableSmall",
+ "UnitPopup_ShowMenu",
+ "InterfaceOptionsFrame_OpenToCategory",
+ "GameFontNormal",
+ "ReloadUI",
+ "pairs",
+ "C_Timer",
+ "GameFontHighlight",
+ "AuctionDB",
+ "_G",
+ "tinsert",
+ "UIDropDownMenu_AddSeparator",
+ "time",
+ "EasyMenu",
+ "UIDropDownMenu_SetWidth",
+ "UIDropDownMenu_SetText",
+ "UIDropDownMenu_Initialize",
+ "CloseDropDownMenus",
+ "ToggleDropDownMenu",
+ "PlayerFrameDropDown",
+ "UIDropDownMenu_GetText",
+ "ChatFrame1EditBox",
+ "TargetFrame",
+ "PlayerFrame",
+ "UIDropDownMenu_GetCurrentDropDown",
+ "UISpecialFrames",
+ "ChatFrame1",
+ "GameTooltip_SetDefaultAnchor",
+ "HIGHLIGHT_FONT_COLOR",
+ "WorldFrame",
+ "TooltipBackdropTemplateMixin",
+ "GameMenuFrame",
+ "UIDROPDOWNMENU_INIT_MENU",
+ "UIDROPDOWNMENU_MENU_VALUE",
+ "GetText",
+ "UIDropDownMenu_GetSelectedName",
+ "tostring",
+ "SendChatMessage",
+ "ipairs",
+ "UnitFullName",
+ "PlaySoundFile"
+ ],
+}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 6fcb445..0000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Changelog
-
-### 1.1.2
-- Changed config Backdrop
-- Fixed Classic and WOTLK backwards compatibility.
-
-### 1.1.1
-- Fixed a issue in settings where Listed Players not saved new players correctly.
-
-### 1.1.0
-- Updated to work with
- * *Retail* 10.0.2
- * *Wrath of the Lich King* 3.4.0
- * *Classic* 1.14.3
-- UI improvements
diff --git a/Images/shitlist.png b/Images/shitlist.png
new file mode 100644
index 0000000..159ae5c
Binary files /dev/null and b/Images/shitlist.png differ
diff --git a/Libs/libs.txt b/Libs/libs.txt
new file mode 100644
index 0000000..e69de29
diff --git a/Locales/Locales.xml b/Locales/Locales.xml
new file mode 100644
index 0000000..adf2216
--- /dev/null
+++ b/Locales/Locales.xml
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/Locales/enUS.lua b/Locales/enUS.lua
new file mode 100644
index 0000000..319f3ec
--- /dev/null
+++ b/Locales/enUS.lua
@@ -0,0 +1,117 @@
+local L = LibStub("AceLocale-3.0"):NewLocale("Shitlist", "enUS", true)
+
+-- White |cffffffff
+-- Red |cffff0000
+-- Light Blue |c0000ffff
+-- Yellow |cffffd700
+-- Orange |cffff8c00
+-- Black |c00000000
+-- GOLDENROD |cFFDAA520
+-- TAN |cFFD2B48C
+
+L["SHITLIST"] = "Shitlist";
+L["SHITLIST_DEBUG"] = "|cffff0000[Shitlist]|cffffffff";
+L["SHITLIST_PRINT"] = "|cffffd700[Shitlist]|cffffffff";
+
+L["SHITLIST_NA"] = "N/A";
+
+L["SHITLIST_DISABLE"] = "Unloading...";
+
+L["SHITLIST_MENU_TITLE"] = "Shitlist";
+L["SHITLIST_MENU_SETTINGS"] = "Options";
+L["SHITLIST_MENU_REASONS"] = "Reasons";
+L["SHITLIST_MENU_LISTED_PLAYERS"] = "Listed Players";
+L["SHITLIST_MENU_PROFILES"] = "Profiles";
+
+L["SHITLIST_CONFIG_LOADING"] = "Loading...";
+L["SHITLIST_CONFIG_LOADED"] = "Loaded.";
+L["SHITLIST_CONFIG_VERSION"] = "Version:";
+L["SHITLIST_CONFIG_REASONS"] = "Reasons:";
+L["SHITLIST_CONFIG_LISTEDPLAYERS"] = "Players:";
+L["SHITLIST_CONFIG_REFRESH"] = "Reloading configuration...";
+L["SHITLIST_CONFIG_CHECK_OLD_DATA"] = "Checking for old player data...";
+L["SHITLIST_CONFIG_ADDED_OLD_DATA"] = "Added old player:";
+L["SHITLIST_CONFIG_DUPLICATE_DATA"] = "Found duplicate:";
+
+L["SHITLIST_INFO_COMMANDS_TITLE"] = "Commands";
+L["SHITLIST_INFO_COMMANDS_DESC"] = "All available slash commands.";
+L["SHITLIST_INFO_COMMANDS_1"] = "|cFFD2B48C/sli|cffffffff - Show information.";
+L["SHITLIST_INFO_COMMANDS_2"] = "|cFFD2B48C/slo|cffffffff - Change options.";
+L["SHITLIST_INFO_COMMANDS_3"] = "|cFFD2B48C/slr|cffffffff - Edit reasons.";
+L["SHITLIST_INFO_COMMANDS_4"] = "|cFFD2B48C/slp|cffffffff - Edit player information.";
+L["SHITLIST_INFO_COMMANDS_5"] = "|cFFD2B48C/slm|cffffffff - Toggle minimap icon.";
+L["SHITLIST_INFO_ABOUT_TITLE"] = "About";
+L["SHITLIST_INFO_ABOUT_VERSION"] = "Version";
+L["SHITLIST_INFO_ABOUT_AUTHOR"] = "Author";
+L["SHITLIST_INFO_ABOUT_CATEGORY"] = "Category";
+L["SHITLIST_INFO_ABOUT_LOCALIZATION"] = "Localizations";
+L["SHITLIST_INFO_ABOUT_LICENSE"] = "License";
+L["SHITLIST_INFO_ABOUT_WEB"] = "Website";
+
+L["SHITLIST_SETTINGS"] = "Options";
+L["SHITLIST_SETTINGS_TITLE"] = "Shitlist - Options";
+L["SHITLIST_SETTINGS_MINIMAP"] = "Minimap";
+L["SHITLIST_SETTINGS_MINIMAP_ICON"] = "Hide the icon.";
+L["SHITLIST_SETTINGS_MINIMAP_ICON_DESC"] = "Show or hide the minimap icon.";
+L["SHITLIST_SETTINGS_MINIMAP_POS"] = "Position";
+L["SHITLIST_SETTINGS_MINIMAP_POS_DESC"] = "Set the position of the minimap icon.";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT"] = "Announcement";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT_DESC"] = "Set which chat channels you can send player info to.";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT_PARY"] = "Party";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT_PARY_DESC"] = "";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT_RAID"] = "Raid";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT_RAID_DESC"] = "";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT_INSTANCE"] = "Instance";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT_INSTANCE_DESC"] = "";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT_GUILD"] = "Guild";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT_GUILD_DESC"] = "";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT_DELAY"] = "Delay";
+L["SHITLIST_SETTINGS_ANNOUNCEMENT_DELAY_DESC"] = "";
+
+L["SHITLIST_SETTINGS_ALERT"] = "Alert";
+L["SHITLIST_SETTINGS_ALERT_DESC"] = "Alert when a listed player is found.";
+L["SHITLIST_SETTINGS_ALERT_ENABLED"] = "Enabled";
+L["SHITLIST_SETTINGS_ALERT_ENABLED_DESC"] = "";
+L["SHITLIST_SETTINGS_ALERT_SOUNDS"] = "Sounds";
+L["SHITLIST_SETTINGS_ALERT_SOUNDS_DESC"] = "Select the sound to be played.";
+L["SHITLIST_SETTINGS_ALERT_DELAY"] = "Delay";
+L["SHITLIST_SETTINGS_ALERT_DELAY_DESC"] = "How many seconds to sleep before a new alert for the same player is played.";
+
+L["SHITLIST_REASONS_TITLE"] = "Shitlist - Reasons";
+L["SHITLIST_REASONS"] = "Reasons";
+L["SHITLIST_REASON"] = "Reason";
+L["SHITLIST_REASON_DESCRIPTION"] = "Here you can Edit, Add or Remove differrent reasons.\n";
+L["SHITLIST_REASON_REMOVE"] = "Remove Reason";
+L["SHITLIST_REASON_REMOVE_CONFIRMATION"] = "Do you really want to remove reason:\n|cffffd700";
+L["SHITLIST_REASON_COLOR"] = "Select a color";
+L["SHITLIST_REASON_ALERT_ENABLED"] = "Alert"
+L["SHITLIST_REASON_ALERT_ENABLED_DESC"] = "Toggle sound effect for all players with this reason."
+
+L["SHITLIST_LISTED_PLAYERS_TITLE"] = "Shitlist - Listed Players";
+L["SHITLIST_LISTED_PLAYERS"] = "Listed Players";
+L["SHITLIST_LISTED_PLAYER"] = "Listed Player";
+L["SHITLIST_LISTED_PLAYER_REMOVE"] = "Remove Player";
+L["SHITLIST_LISTED_PLAYER_REMOVE_CONFIRMATION"] = "Do you really want to remove player:\n|cffffd700";
+L["SHITLIST_LISTED_PLAYER_NAME"] = "Player Name";
+L["SHITLIST_LISTED_PLAYER_REALM"] = "Realm";
+L["SHITLIST_LISTED_PLAYER_REASON"] = "Reason";
+L["SHITLIST_LISTED_PLAYER_DESCRIPTION"] = "Description";
+L["SHITLIST_LISTED_PLAYER_COLOR"] = "Color";
+L["SHITLIST_LISTED_PLAYER_ALERT_ENABLED"] = "Alert"
+L["SHITLIST_LISTED_PLAYER_ALERT_ENABLED_DESC"] =
+"Toggle sound effect for a specific player. If a sound effect is disabled on a pre defined reason then this has no effect."
+
+L["SHITLIST_POPUP_ADD"] = "Add to Shitlist";
+L["SHITLIST_POPUP_EDIT"] = "Edit Player";
+L["SHITLIST_POPUP_ANNOUNCEMENT"] = "Announcement";
+L["SHITLIST_POPUP_NEW_ADDED"] = "Added";
+
+L["SHITLIST_MINIMAP_TOOLTIP_TITLE"] = "Shitlist"
+L["SHITLIST_MINIMAP_TOOLTIP_RIGHT_CLICK"] = "|cFFD2B48C Right-Click|cff00ff00 to open Blizzard options."
+L["SHITLIST_MINIMAP_TOOLTIP_LEFT_CLICK"] = "|cFFD2B48C Left-Click|cff00ff00 to open options."
+L["SHITLIST_MINIMAP_TOOLTIP_SHIFT_LEFT_CLICK"] = "|cFFD2B48C SHIFT + Left-Click|cff00ff00 to open reasons."
+L["SHITLIST_MINIMAP_TOOLTIP_CTRL_LEFT_CLICK"] = "|cFFD2B48C CTRL + Left-Click|cff00ff00 to open listed players."
+
+L["SHITLIST_CHAT_PLAYER"] = "Player:";
+L["SHITLIST_CHAT_REASON"] = "Reason:";
+L["SHITLIST_CHAT_DESCRIPTION"] = "Description:";
diff --git a/README.md b/README.md
index a95be79..5a6a50f 100644
--- a/README.md
+++ b/README.md
@@ -1,29 +1,34 @@
[![Check formating](https://github.com/Limmek/Shitlist/actions/workflows/formating.yml/badge.svg)](https://github.com/Limmek/Shitlist/actions/workflows/formating.yml)
[![Package and release](https://github.com/Limmek/Shitlist/actions/workflows/release.yml/badge.svg)](https://github.com/Limmek/Shitlist/actions/workflows/release.yml)
-# Shitlist
-Are you tired of getting in groups with players you have had a bad experience with before and want a reminder of it.
-Or do you and your friends or guild keep a list of good/bad players and keep the names write down on a piece of paper or in text file?
-Then this is the addon for you, **#Shitlist** will let you set a note on a player from a list of pre set messages and a optional text.
-The player note will then be displayed on the player information tooltip.
+# Shitlist
-##### **How to use?**
+Tired of encountering players who've made your gaming experiences less enjoyable? Whether remembering the heroes or the not-so-great allies, #Shitlist is the solution. This WoW addon lets you create reasons on players, tracking the good, the bad, and everything in between.
-_Right click on the targeted player frame you want to set a note on and you will have a option add or remove from Shitlist._
+## Features to Enhance Your Gaming Experience
-##### **How to edit pre set message (Reason)?**
+- **Player Reason Tracking**: Assign custom reasons, alerts, and colors to players, conveniently displayed on tooltips.
+- **Personalized Player Notes**: Craft colored notes with alerts and preset reasons to tailor your gaming experiences.
+- **Effortless Player Management**: Easily add, edit, or remove players and their associated reasons, even if they're offline or not your current target.
+- **Accessible Minimap Icon**: Swiftly access Shitlist options, reasons, and listed players through the minimap icon for seamless on-the-go management.
+- **Alert System**: Set up sound alerts for listed players, ensuring you're promptly informed when encountering them.
-_To add a pre set message (Reason) go to **Interface Options -> Addons -> Shitlist -> Reasons**._
+## How to Utilize
-##### **Can i edit or remove a player if i do not have it as target or if the player is offline?**
+- **Adding/Editing Players**: Right-click a player to add or remove them from the #Shitlist. Alternatively, navigate to **Interface Options -> Addons -> Shitlist -> Listed Players** for comprehensive player management.
+- **Customizing Reasons**: Modify preset reasons by visiting **Interface Options -> Addons -> Shitlist -> Reasons**.
-_Yes in **Interface Options -> Addons -> Shitlist -> Listed Players** you can add/edit and remove players and their reason/comment._
+## Versatile Applications
-##### **When this Add-on is useful?**
+This addon proves invaluable across various in-game scenarios:
-_Literally on any part of the game that includes Questing, Raids & Dungeons, World & PvP, getting corpse camped or a player steel a item and leave the party.
-This is very useful if you want to blacklist some or just to put a note to be remind of something about that player._
+- **Questing**: Recall helpful or troublesome players encountered during quests.
+- **Raids & Dungeons**: Track valuable teammates or identify those causing issues.
+- **World & PvP**: Easily identify players during intense battles or tricky situations.
+- **Preventing Hassles**: Avoid repeated encounters with troublesome players.
+- **Blacklisting Capability**: Use #Shitlist as a blacklist, steering clear of unwanted interactions.
-##### **Can i use this addon to blacklist people?**
+## Download & Contribution
-_Yes, you can._
+- **Download Now**: [Get the addon](https://github.com/Limmek/Shitlist/releases)
+- **Contribute to Development**: Join the open-source community! Contribute and suggest enhancements [here](https://github.com/Limmek/Shitlist).
diff --git a/Shitlist.lua b/Shitlist.lua
new file mode 100644
index 0000000..1767c4a
--- /dev/null
+++ b/Shitlist.lua
@@ -0,0 +1,391 @@
+local shitlist = ...
+Shitlist = LibStub("AceAddon-3.0"):NewAddon(shitlist, "AceConsole-3.0", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0"
+, "AceSerializer-3.0")
+local L = LibStub("AceLocale-3.0"):GetLocale(shitlist, true)
+local AceConfig = LibStub("AceConfig-3.0")
+local AceConfigDialog = LibStub("AceConfigDialog-3.0")
+local AceConfigRegistry = LibStub("AceConfigRegistry-3.0")
+local LibDataBroker = LibStub("LibDataBroker-1.1")
+local LibDBIcon = LibStub("LibDBIcon-1.0")
+
+function Shitlist:OnInitialize()
+ -- uses the "Default" profile instead of character-specific profiles
+ -- https://www.wowace.com/projects/ace3/pages/api/ace-db-3-0
+ self.db = LibStub("AceDB-3.0"):New("ShitlistDB", self.defaults, true)
+ self.db.RegisterCallback(self, "OnNewProfile", "RefreshConfig")
+ self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig")
+ self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig")
+ self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig")
+
+ -- registers an options table and adds it to the Blizzard options window
+ -- https://www.wowace.com/projects/ace3/pages/api/ace-config-3-0
+ AceConfig:RegisterOptionsTable("ShitlistSettings Info", self.options.Info)
+ AceConfigDialog:AddToBlizOptions("ShitlistSettings Info", shitlist)
+
+ AceConfig:RegisterOptionsTable("ShitlistSettings Options", self.options.Settings, { "slo" })
+ AceConfigDialog:AddToBlizOptions("ShitlistSettings Options", L["SHITLIST_MENU_SETTINGS"], shitlist)
+
+ AceConfig:RegisterOptionsTable("ShitlistSettings Reasons", self.options.Reasons, { "slr" })
+ AceConfigDialog:AddToBlizOptions("ShitlistSettings Reasons", L["SHITLIST_MENU_REASONS"], shitlist)
+
+ AceConfig:RegisterOptionsTable("ShitlistSettings Listed_Players", self.options.ListedPlayers, { "slp" })
+ AceConfigDialog:AddToBlizOptions("ShitlistSettings Listed_Players", L["SHITLIST_MENU_LISTED_PLAYERS"], shitlist)
+
+ -- adds a child options table, in this case our profiles panel
+ local profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db)
+ AceConfig:RegisterOptionsTable("ShitlistSettings Profiles", profiles)
+ AceConfigDialog:AddToBlizOptions("ShitlistSettings Profiles", L["SHITLIST_MENU_PROFILES"], shitlist)
+
+ LibDBIcon:Register(shitlist, self:MiniMapIcon(), self.db.profile.minimap)
+
+ -- https://www.wowace.com/projects/ace3/pages/api/ace-console-3-0
+ self:RegisterChatCommand("slm", "ToggleMiniMapIcon")
+ self:RegisterChatCommand("sldebug", "ToggleDebug")
+
+ self:GetOldConfigData()
+ self:RefreshConfig()
+end
+
+function Shitlist:OnEnable()
+ self:Print(L["SHITLIST_CONFIG_LOADING"])
+ self:Print(L["SHITLIST_CONFIG_VERSION"], _G["ORANGE_FONT_COLOR_CODE"], self:GetVersion())
+ 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())
+
+ if not self:IsHooked("UnitPopup_ShowMenu") then
+ self:SecureHook("UnitPopup_ShowMenu", self.UnitPopup_ShowMenu)
+ end
+
+ -- Retail 10.0.2 https://wowpedia.fandom.com/wiki/Patch_10.0.2/API_changes#Tooltip_Changes
+ if (TooltipDataProcessor) then
+ TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Unit, self.GameTooltip)
+ else
+ -- Backwards compatibility WOTLK, Classic
+ GameTooltip:HookScript("OnTooltipSetUnit", self.GameTooltip)
+ end
+ self:Print(L["SHITLIST_CONFIG_LOADED"])
+end
+
+function Shitlist:OnDisable()
+ self:Print(L["SHITLIST_DISABLE"])
+end
+
+function Shitlist:RefreshConfig()
+ self.db.profile.alert.last = {}
+
+ if self.db.profile.minimap.hide then
+ LibDBIcon:Hide(shitlist)
+ else
+ LibDBIcon:Show(shitlist)
+ end
+
+ --@debug@
+ self:PrintDebug(L["SHITLIST_CONFIG_REFRESH"])
+ self:PrintDebug("Debug:", _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 Shitlist:GetOldConfigData()
+ if _G.ShitlistDB.ListedPlayers == nil and _G.ShitlistDB.Reasons == nil then
+ return
+ end
+ self:Print(L["SHITLIST_CONFIG_CHECK_OLD_DATA"])
+
+ local oldReasons = _G.ShitlistDB.Reasons
+ local oldListedPlayers = _G.ShitlistDB.ListedPlayers
+ local reasons = self:GetReasons()
+ local listedPlayers = self:GetListedPlayers()
+ local newPlayers = {}
+
+ -- Check old listed player list
+ if oldListedPlayers ~= nil then
+ for _, player in pairs(listedPlayers) do
+ newPlayers[player.name .. "-" .. player.realm] = true
+ end
+
+ for key, value in pairs(oldListedPlayers) do
+ local name, realm = key:match("([^-]+)-([^-]+)")
+ if name and realm then
+ if not newPlayers[name .. "-" .. realm] then
+ local reason = value[1]
+ local description = value[2]
+
+ -- Check if the reason exist already and get it's id.
+ local reasonId = nil
+ for _, r in ipairs(reasons) do
+ if r.reason == reason then
+ reasonId = r.id
+ break
+ end
+ end
+ -- If the reason do not exist add it to the reason data.
+ if not reasonId then
+ reasonId = #reasons + 1
+ reasons[reasonId] = {
+ id = reasonId,
+ reason = reason,
+ color = { r = 1, g = 1, b = 1 },
+ alert = true,
+ }
+ end
+
+ -- Add the old player to the new listed players
+ listedPlayers[#listedPlayers + 1] = {
+ id = #listedPlayers + 1,
+ name = name,
+ realm = realm,
+ reason = reasonId,
+ description = description,
+ color = { r = 1, g = 1, b = 1 },
+ alert = true,
+ }
+
+ self:Print(L["SHITLIST_CONFIG_ADDED_OLD_DATA"], name .. "-" .. realm)
+ else
+ self:Print(L["SHITLIST_CONFIG_DUPLICATE_DATA"], name .. "-" .. realm)
+ end
+ end
+ end
+
+ -- remove the old listed players from the database
+ _G.ShitlistDB.ListedPlayers = nil
+ _G.ShitlistDB.Reasons = nil
+ end
+end
+
+function Shitlist:UnitPopup_ShowMenu(target, unit, menuList)
+ local name, realm = self.name, GetRealmName()
+ local listedPlayer = Shitlist:GetListedPlayer(name, realm)
+
+ -- Check if this is the root level of the dropdown menu
+ if UIDROPDOWNMENU_MENU_LEVEL == 1 and UnitIsPlayer(unit) and target ~= "SELF" then
+ if (listedPlayer) then
+ UIDropDownMenu_AddButton({
+ text = shitlist,
+ notCheckable = true,
+ hasArrow = true,
+ keepShownOnClick = true,
+ }, UIDROPDOWNMENU_MENU_LEVEL)
+ else
+ UIDropDownMenu_AddButton({
+ text = L["SHITLIST_POPUP_ADD"],
+ notCheckable = true,
+ icon = Shitlist.db.profile.icon,
+ value = { name, realm },
+ func = function()
+ Shitlist:Print(L["SHITLIST_POPUP_NEW_ADDED"], name, realm)
+ local new_player = Shitlist:NewListedPlayer(name, realm)
+ Shitlist.db.profile.listedPlayer.id = new_player.id
+ Shitlist.db.profile.listedPlayer.name = new_player.name
+ Shitlist.db.profile.listedPlayer.realm = new_player.realm
+ Shitlist.db.profile.listedPlayer.reason = new_player.reason
+ Shitlist.db.profile.listedPlayer.description = new_player.description
+ Shitlist.db.profile.listedPlayer.color = new_player.color
+ Shitlist.db.profile.listedPlayer.alert = new_player.alert
+
+ AceConfigDialog:CloseAll()
+ local AceGUI = Shitlist:AceGUIDefaults()
+ AceGUI:SetTitle(L["SHITLIST_LISTED_PLAYERS_TITLE"])
+ AceConfigDialog:SetDefaultSize("ShitlistSettings Listed_Players", 500, 300)
+ AceConfigDialog:Open("ShitlistSettings Listed_Players")
+ end,
+ }, UIDROPDOWNMENU_MENU_LEVEL)
+ end
+ elseif UIDROPDOWNMENU_MENU_VALUE == shitlist then
+ Shitlist:AddSubMenu(listedPlayer)
+ end
+end
+
+function Shitlist:AddSubMenu(player)
+ local menuItem = UIDropDownMenu_CreateInfo()
+ menuItem.text = shitlist
+ menuItem.notCheckable = true
+ menuItem.keepShownOnClick = true
+ menuItem.hasArrow = false
+ menuItem.isTitle = true
+ menuItem.disabled = true
+ menuItem.icon = Shitlist.db.profile.icon
+ UIDropDownMenu_AddButton(menuItem, UIDROPDOWNMENU_MENU_LEVEL)
+
+ menuItem = UIDropDownMenu_CreateInfo()
+ menuItem.text = L["SHITLIST_POPUP_EDIT"]
+ menuItem.notCheckable = true
+ menuItem.hasArrow = false
+ menuItem.value = player
+ menuItem.func = function()
+ if (player) then
+ Shitlist.db.profile.listedPlayer.id = player.id
+ Shitlist.db.profile.listedPlayer.name = player.name
+ Shitlist.db.profile.listedPlayer.realm = player.realm
+ Shitlist.db.profile.listedPlayer.reason = player.reason
+ Shitlist.db.profile.listedPlayer.description = player.description
+ Shitlist.db.profile.listedPlayer.color = player.color
+ Shitlist.db.profile.listedPlayer.alert = player.alert
+
+ AceConfigDialog:CloseAll()
+ local AceGUI = Shitlist:AceGUIDefaults()
+ AceGUI:SetTitle(L["SHITLIST_LISTED_PLAYERS_TITLE"])
+ AceConfigDialog:SetDefaultSize("ShitlistSettings Listed_Players", 500, 300)
+ AceConfigDialog:Open("ShitlistSettings Listed_Players")
+ end
+ end
+ UIDropDownMenu_AddButton(menuItem, UIDROPDOWNMENU_MENU_LEVEL)
+
+ menuItem = UIDropDownMenu_CreateInfo()
+ menuItem.text = L["SHITLIST_POPUP_ANNOUNCEMENT"]
+ menuItem.notCheckable = true
+ menuItem.isTitle = true
+ local a = Shitlist.db.profile.announcement
+ if a.guild or a.party or a.instance or a.raid then
+ UIDropDownMenu_AddButton(menuItem, UIDROPDOWNMENU_MENU_LEVEL)
+ end
+
+ local function _SendChatMessage(chat)
+ SendChatMessage(L["SHITLIST_CHAT_PLAYER"] .. player.name .. "-" .. player.realm, chat, nil, nil)
+ if self.db.profile.reasons[player.reason].reason ~= "None" then
+ SendChatMessage(L["SHITLIST_CHAT_REASON"] .. self.db.profile.reasons[player.reason].reason, chat, nil, nil)
+ end
+ if player.description ~= "" then
+ SendChatMessage(L["SHITLIST_CHAT_DESCRIPTION"] .. player.description, chat, nil, nil)
+ end
+ end
+ local options = {
+ {
+ text = "Guild",
+ notCheckable = true,
+ func = function() _SendChatMessage("GUILD") end,
+ disabled = not self.db.profile.announcement.guild
+ },
+ {
+ text = "Party",
+ notCheckable = true,
+ func = function() _SendChatMessage("PARTY") end,
+ disabled = not self.db.profile.announcement.party
+ },
+ {
+ text = "Instance",
+ notCheckable = true,
+ func = function() _SendChatMessage("INSTANCE_CHAT") end,
+ disabled = not self.db.profile.announcement.instance
+ },
+ {
+ text = "Raid",
+ notCheckable = true,
+ func = function() _SendChatMessage("RAID") end,
+ disabled = not self.db.profile.announcement.raid
+ },
+ }
+
+ for _, option in ipairs(options) do
+ if not option.disabled then
+ UIDropDownMenu_AddButton(option, UIDROPDOWNMENU_MENU_LEVEL)
+ end
+ end
+end
+
+function Shitlist:GameTooltip()
+ local _name, unit = self:GetUnit()
+ if not (unit and UnitIsPlayer(unit)) then return end
+
+ local name, realm = UnitFullName(unit)
+ if (_name ~= name) then return end
+
+ if (realm == nil) then realm = GetRealmName() end
+
+ local listedPlayer = Shitlist:GetListedPlayer(name, realm)
+ if (not listedPlayer) then return end
+
+ local reason = Shitlist:GetReasons()[listedPlayer.reason]
+ local _reason = reason
+ local _listedPlayer = listedPlayer
+
+ --@debug@
+ Shitlist: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
+ self:AddLine("\n")
+ self:AddDoubleLine(_reason.reason:gsub("None", ""), "|T" .. Shitlist.db.profile.icon .. ":0|t",
+ _reason.color.r or 1, _reason.color.g or 1, _reason.color.b or 1)
+ self:AddLine(_listedPlayer.description, _listedPlayer.color.r or 1, _listedPlayer.color.g or 1,
+ _listedPlayer.color.b or 1, false)
+ end
+
+ -- Alert
+ local time = time()
+ local alert = Shitlist.db.profile.alert
+ if (alert.enabled and reason.alert) then
+ if (listedPlayer.alert and not alert.last[name]) then
+ alert.last[name] = time + alert.delay
+ Shitlist:ScheduleTimer("AlertDelayTimer", alert.delay, name)
+ Shitlist:PlayAlertEffect()
+ --@debug@
+ Shitlist:PrintDebug("|cffff0000|cffffffff Sound effect disabled for player", name, "for", alert.delay,
+ "seconds.")
+ --@end-debug@
+ end
+ end
+end
+
+-- Called within ScheduleTimer and fires when timer ends.
+function Shitlist:AlertDelayTimer(name)
+ --@debug@
+ Shitlist:PrintDebug("|cffff0000|cffffffff Sound effect is now enabled for player", name)
+ --@end-debug@
+ Shitlist.db.profile.alert.last[name] = nil
+end
+
+function Shitlist:MiniMapIcon()
+ -- Create minimap launcher
+ -- https://github.com/tekkub/libdatabroker-1-1/wiki/How-to-provide-a-dataobject
+ return LibDataBroker:NewDataObject(shitlist, {
+ type = "launcher",
+ text = shitlist,
+ icon = Shitlist.db.profile.icon,
+ OnClick = function(clickedframe, button)
+ AceConfigDialog:Close("ShitlistSettings Options")
+ AceConfigDialog:CloseAll()
+ local AceGUI = Shitlist:AceGUIDefaults()
+ if button == "RightButton" then
+ InterfaceOptionsFrame_OpenToCategory(shitlist)
+ elseif button == "LeftButton" then
+ if IsShiftKeyDown() then
+ AceGUI:SetTitle(L["SHITLIST_REASONS_TITLE"])
+ AceConfigDialog:SetDefaultSize("ShitlistSettings Reasons", 500, 200)
+ AceConfigDialog:Open("ShitlistSettings Reasons")
+ elseif IsControlKeyDown() then
+ AceGUI:SetTitle(L["SHITLIST_LISTED_PLAYERS_TITLE"])
+ AceConfigDialog:SetDefaultSize("ShitlistSettings Listed_Players", 500, 300)
+ AceConfigDialog:Open("ShitlistSettings Listed_Players")
+ else
+ AceGUI:SetTitle(L["SHITLIST_SETTINGS_TITLE"])
+ AceConfigDialog:SetDefaultSize("ShitlistSettings Options", 500, 350)
+ AceConfigDialog:Open("ShitlistSettings Options")
+ end
+ end
+ end,
+ OnTooltipShow = function(tooltip)
+ tooltip:AddDoubleLine("|T" .. Shitlist.db.profile.icon .. ":0|t " .. L["SHITLIST_MINIMAP_TOOLTIP_TITLE"],
+ Shitlist:GetVersion())
+ tooltip:AddLine("\n")
+ tooltip:AddLine(L["SHITLIST_MINIMAP_TOOLTIP_RIGHT_CLICK"])
+ tooltip:AddLine(L["SHITLIST_MINIMAP_TOOLTIP_LEFT_CLICK"])
+ tooltip:AddLine(L["SHITLIST_MINIMAP_TOOLTIP_SHIFT_LEFT_CLICK"])
+ tooltip:AddLine(L["SHITLIST_MINIMAP_TOOLTIP_CTRL_LEFT_CLICK"])
+ end,
+ })
+end
+
+function Shitlist:ToggleMiniMapIcon()
+ self.db.profile.minimap.hide = not self.db.profile.minimap.hide
+ self:RefreshConfig()
+end
+
+function Shitlist:ToggleDebug()
+ self.db.profile.debug = not self.db.profile.debug
+ self:RefreshConfig()
+end
diff --git a/Shitlist.toc b/Shitlist.toc
new file mode 100644
index 0000000..4331605
--- /dev/null
+++ b/Shitlist.toc
@@ -0,0 +1,23 @@
+## Interface: 100200
+## Title : Shitlist
+## Notes: Set a personal comment on players and adding it to player information tooltip window.
+## Author: Limmek
+## Version: @project-version@
+## Dependencies:
+## OptionalDeps: Ace3, LibStub, LibDataBroker-1.1, LibDBIcon-1.0, LibUIDropDownMenu, CallbackHandler-1.0
+## SavedVariables: ShitlistDB
+## DefaultState: enabled
+## X-Category: Tooltip, Miscellaneous, PvP, Quests & Leveling, Unit Frames
+## X-Curse-Project-ID: 344967
+## X-Localizations: enUS
+## X-Website: https://github.com/Limmek/Shitlist
+## X-License: MIT
+## IconTexture: Interface\AddOns\Shitlist\Images\shitlist.png
+
+embeds.xml
+
+Locales\Locales.xml
+
+Shitlist.lua
+ShitlistUtils.lua
+ShitlistConfig.lua
diff --git a/Shitlist/Config.lua b/Shitlist/Config.lua
deleted file mode 100644
index e749aca..0000000
--- a/Shitlist/Config.lua
+++ /dev/null
@@ -1,79 +0,0 @@
-local _, config = ...;
-
-ShitlistDB = {}
-ShitlistSettings = {}
-
-config.Reasons = {"Ninja Looting", "Kill Stealing", "Spamming"}
-
-config.ListedPlayers = {}
-
-config.AlertLastSentName = ""
-config.Start = 0
-config.IgnoreTime = 30
-config.AlertEnable = false
-
-config.SoundChannel = "Master"
-config.Sound = "Interface\\AddOns\\Shitlist\\Sounds\\alarmbuzz.ogg"
-config.SoundID = 2
-config.Sounds = {
- ["alarmbeep"] = "Interface\\AddOns\\Shitlist\\Sounds\\alarmbeep.ogg",
- ["alarmbuzz"] = "Interface\\AddOns\\Shitlist\\Sounds\\alarmbuzz.ogg",
- ["alarmbuzzer"] = "Interface\\AddOns\\Shitlist\\Sounds\\alarmbuzzer.ogg",
- ["alarmdouble"] = "Interface\\AddOns\\Shitlist\\Sounds\\alarmdouble.ogg"
-}
-
-config.PartyAlertLastSentName = ""
-config.PartyStart = 0
-config.PartyIgnoreTime = 30
-config.PartyAlertEnable = false
-
-config.TooltipTitle = "#Shitlist"
-config.TooltipTitleColor = "Red"
-config.TooltipTitleColorID = 1
-
-config.ReasonColor = "Gold"
-config.ReasonColorID = 7
-
-config.DefaultColor = "White"
-config.DefaultColorID = 4
-
-config.Colors = {
- ["Red"] = {red = 1, green = 0, blue = 0, alpha = 1},
- ["Green"] = {red = 0, green = 1, blue = 0, alpha = 1},
- ["Blue"] = {red = 0, green = 0, blue = 1, alpha = 1},
- ["White"] = {red = 1, green = 1, blue = 1, alpha = 1},
- ["Black"] = {red = 0, green = 0, blue = 0, alpha = 1},
- ["Grey"] = {red = 0.9, green = 0.9, blue = 0.9, alpha = 1},
- ["Yellow"] = {red = 1, green = 1, blue = 0, alpha = 1},
- ["Gold"] = {red = 1, green = 0.82, blue = 0, alpha = 1},
- ["Light_Blue"] = {red = 0, green = 0.44, blue = 0.87, alpha = 1}
-}
-
-config.Font = "Interface\\AddOns\\Shitlist\\Fonts\\Inconsolata-Bold.ttf"
-
-config.Backdrop = {
- bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
- edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
- tile = false,
- tileEdge = true,
- tileSize = 0,
- edgeSize = 16,
- insets = {left = 4, right = 4, top = 4, bottom = 4}
-}
-
-config.Icon = "Interface\\TargetingFrame\\UI-RaidTargetingIcon_8.png"
-
-config.MenuOptions = {
- ["icon"] = true,
- ["add_color"] = "|cffff0000",
- ["remove_color"] = "|cff00ff00"
-}
-
-config.PopupMenus = {["target"] = true, ["chat"] = true}
-
-function getConfigColors(color)
- for k, v in pairs(config.Colors) do
- if color == k then return v.red, v.green, v.blue, v.alpha end
- end
- return 1, 1, 1, 1
-end
diff --git a/Shitlist/Fonts/Inconsolata-Bold.ttf b/Shitlist/Fonts/Inconsolata-Bold.ttf
deleted file mode 100644
index 15eb599..0000000
Binary files a/Shitlist/Fonts/Inconsolata-Bold.ttf and /dev/null differ
diff --git a/Shitlist/Fonts/Inconsolata-Regular.ttf b/Shitlist/Fonts/Inconsolata-Regular.ttf
deleted file mode 100644
index 4ea3681..0000000
Binary files a/Shitlist/Fonts/Inconsolata-Regular.ttf and /dev/null differ
diff --git a/Shitlist/Settings/ListedPlayers.lua b/Shitlist/Settings/ListedPlayers.lua
deleted file mode 100644
index e762f1f..0000000
--- a/Shitlist/Settings/ListedPlayers.lua
+++ /dev/null
@@ -1,255 +0,0 @@
-local _, config = ...
-
--- Shitlist Settings Listed Players
-
--- Make a child panel
-ShitlistSettings.listedPlayersPanel = CreateFrame("Frame",
- "ShitlistSettingsListedPlayers",
- ShitlistSettings.panel)
-ShitlistSettings.listedPlayersPanel.name = "Listed Players" -- Add localization
-
--- Specify childness of this panel (this puts it under the little red [+], instead of giving it a normal AddOn category)
-ShitlistSettings.listedPlayersPanel.parent = ShitlistSettings.panel.name
--- Add the child to the Interface Options
-InterfaceOptions_AddCategory(ShitlistSettings.listedPlayersPanel)
-
--- Listed Players tabb
-local TabbListedPlayersTitle =
- ShitlistSettings.listedPlayersPanel:CreateFontString(
- "SettingsTabbListedPlayersTitle", "OVERLAY", "GameFontNormal")
-TabbListedPlayersTitle:SetPoint("TOPLEFT", ShitlistSettings.listedPlayersPanel,
- 10, -10)
-TabbListedPlayersTitle:SetFont(config.Font, 18)
-TabbListedPlayersTitle:SetTextColor(getConfigColors("Gold"))
-TabbListedPlayersTitle:SetText("Shitlist - Listed Players") -- Add localization
-
--- Listed Players settings
-local ListedPlayersFrame = CreateFrame("Frame", "SettingsListedPlayersFrame",
- ShitlistSettings.listedPlayersPanel,
- BackdropTemplateMixin and
- "BackdropTemplate")
-ListedPlayersFrame:SetPoint("TOPLEFT", ShitlistSettings.listedPlayersPanel, 10,
- -35)
-ListedPlayersFrame:SetSize(250, 380)
-
--- Title
-local ListedPlayerTitle = ListedPlayersFrame:CreateFontString(
- "SettingsListedPlayerTitle", "OVERLAY",
- "GameFontNormal")
-ListedPlayerTitle:SetPoint("TOPLEFT", ListedPlayersFrame, 10, -10)
-ListedPlayerTitle:SetFont(config.Font, 14)
-ListedPlayerTitle:SetText("Listed Players") -- Add localization
-
--- Info
-local ListedPlayerInfo = ListedPlayersFrame:CreateFontString(
- "SettingsListedPlayerInfo", "OVERLAY",
- "GameFontWhite")
-ListedPlayerInfo:SetPoint("TOPLEFT", ListedPlayersFrame, 30, -30)
-ListedPlayerInfo:SetTextColor(getConfigColors("White"))
-ListedPlayerInfo:SetText("Edit or Remove a player") -- Add localization
-
--- Listed player
-local ListedPlayerDropDown = CreateFrame("Button",
- "SettingsListedPlayerDropDown",
- ListedPlayersFrame,
- "UIDropDownMenuTemplate")
-ListedPlayerDropDown:SetPoint("TOPLEFT", ListedPlayersFrame, 15, -50)
--- ListedPlayerDropDown:info.hasArrow = false;
-
-local function ListedPlayerOnClick(self)
- UIDropDownMenu_SetSelectedID(ListedPlayerDropDown, self:GetID())
- SettingsListedPlayerEditBox:SetText(self:GetText())
- SettingsListedPlayerDescriptionEditBox:SetText(
- config.ListedPlayers[self:GetText()][2])
- local index = {}
- for k, v in pairs(config.Reasons) do index[v] = k end
- local a = config.ListedPlayers[self:GetText()][1]
-
- UIDropDownMenu_Initialize(SettingsListedPlayerReasonDropDown,
- initializeReason)
- UIDropDownMenu_SetSelectedID(SettingsListedPlayerReasonDropDown, index[a])
-end
-
-function initializePlayer(self)
- local info = UIDropDownMenu_CreateInfo()
- for k, v in pairs(config.ListedPlayers) do
- info = UIDropDownMenu_CreateInfo()
- info.text = k
- info.value = v
- info.func = ListedPlayerOnClick
- UIDropDownMenu_AddButton(info)
- end
-end
-
-UIDropDownMenu_Initialize(ListedPlayerDropDown, initializePlayer)
-UIDropDownMenu_SetWidth(ListedPlayerDropDown, 270)
-UIDropDownMenu_SetButtonWidth(ListedPlayerDropDown, 295)
-UIDropDownMenu_SetSelectedID(ListedPlayerDropDown, 1)
-UIDropDownMenu_JustifyText(ListedPlayerDropDown, "LEFT")
-
--- Player
-local ListedPlayerEditBox = CreateFrame("EditBox",
- "SettingsListedPlayerEditBox",
- ListedPlayersFrame,
- BackdropTemplateMixin and
- "BackdropTemplate")
-ListedPlayerEditBox:SetPoint("TOPLEFT", ListedPlayersFrame, 25, -85)
-ListedPlayerEditBox:SetSize(300, 30)
-ListedPlayerEditBox:SetTextInsets(10, 0, 0, 0)
-ListedPlayerEditBox:SetBackdrop(config.Backdrop)
-ListedPlayerEditBox:SetBackdropColor(getConfigColors("Black"))
-ListedPlayerEditBox:SetBackdropBorderColor(getConfigColors("White"))
-ListedPlayerEditBox:SetMultiLine(false)
-ListedPlayerEditBox:SetMaxLetters(255)
-ListedPlayerEditBox:SetAutoFocus(false) -- dont automatically focus
-ListedPlayerEditBox:SetFontObject(GameFontWhite)
-ListedPlayerEditBox:SetScript("OnEscapePressed",
- function(self) self:ClearFocus() end)
-ListedPlayerEditBox:SetScript("OnEnterPressed",
- function(self) self:ClearFocus() end)
-
--- Title Reason
-local ListedPlayerReasonDropDownTitle = ListedPlayersFrame:CreateFontString(
- "SettingsListedPlayerReasonDropDownTitle",
- "OVERLAY", "GameFontNormal")
-ListedPlayerReasonDropDownTitle:SetPoint("TOPLEFT", ListedPlayersFrame, 35, -125)
-ListedPlayerReasonDropDownTitle:SetFont(config.Font, 14)
-ListedPlayerReasonDropDownTitle:SetText("Reason") -- Add localization
-
--- Reason
-local ListedPlayerReasonDropDown = CreateFrame("Button",
- "SettingsListedPlayerReasonDropDown",
- ListedPlayersFrame,
- "UIDropDownMenuTemplate")
-ListedPlayerReasonDropDown:SetPoint("TOPLEFT", ListedPlayersFrame, 15, -140)
-
-local function OnClick(self)
- UIDropDownMenu_SetSelectedID(ListedPlayerReasonDropDown, self:GetID())
-end
-
-function initializeReason(self)
- local info = UIDropDownMenu_CreateInfo()
- for k, v in pairs(config.Reasons) do
- info = UIDropDownMenu_CreateInfo()
- info.text = v
- info.value = v
- info.func = OnClick
- UIDropDownMenu_AddButton(info)
- end
-end
-
-UIDropDownMenu_Initialize(ListedPlayerReasonDropDown, initializeReason)
-UIDropDownMenu_SetWidth(ListedPlayerReasonDropDown, 270)
-UIDropDownMenu_SetButtonWidth(ListedPlayerReasonDropDown, 295)
-UIDropDownMenu_SetSelectedID(ListedPlayerReasonDropDown, 1)
-UIDropDownMenu_JustifyText(ListedPlayerReasonDropDown, "LEFT")
-
--- Title
-local ListedPlayerEditBoxTitle = ListedPlayersFrame:CreateFontString(
- "SettingsListedPlayerEditBoxTitle",
- "OVERLAY", "GameFontNormal")
-ListedPlayerEditBoxTitle:SetPoint("TOPLEFT", ListedPlayersFrame, 35, -180)
-ListedPlayerEditBoxTitle:SetFont(config.Font, 14)
-ListedPlayerEditBoxTitle:SetText("Description") -- Add localization
-
--- Info
-local ListedPlayerEditBoxInfo = ListedPlayersFrame:CreateFontString(
- "SettingsListedPlayerEditBoxInfo",
- "OVERLAY", "GameFontWhite")
-ListedPlayerEditBoxInfo:SetPoint("TOPLEFT", ListedPlayersFrame, 170, -180)
-ListedPlayerEditBoxInfo:SetFont(config.Font, 11)
-ListedPlayerEditBoxInfo:SetText("Optional") -- Add localization
-
--- Player Description EditBox
-local ListedPlayerDescriptionEditBoxFrame =
- CreateFrame("Frame", "SettingsListedPlayerDescriptionEditBoxFrame",
- ListedPlayersFrame)
-ListedPlayerDescriptionEditBoxFrame:SetPoint("TOPLEFT", ListedPlayersFrame, 25,
- -195)
-ListedPlayerDescriptionEditBoxFrame:SetSize(300, 120)
-
-local ListedPlayerDescriptionEditBox = CreateFrame("EditBox",
- "SettingsListedPlayerDescriptionEditBox",
- ListedPlayerDescriptionEditBoxFrame,
- BackdropTemplateMixin and
- "BackdropTemplate")
-ListedPlayerDescriptionEditBox:SetBackdrop(config.Backdrop)
-ListedPlayerDescriptionEditBox:SetBackdropColor(getConfigColors("Black"))
-ListedPlayerDescriptionEditBox:SetBackdropBorderColor(getConfigColors("White"))
-ListedPlayerDescriptionEditBox:SetTextInsets(10, 10, 10, 10)
-ListedPlayerDescriptionEditBox:SetMaxLetters(255)
-ListedPlayerDescriptionEditBox:SetMultiLine(true)
-ListedPlayerDescriptionEditBox:SetAutoFocus(false)
-ListedPlayerDescriptionEditBox:SetFontObject(GameFontWhite)
-ListedPlayerDescriptionEditBox:SetAllPoints()
-ListedPlayerDescriptionEditBox:SetScript("OnEscapePressed",
- function(self) self:ClearFocus() end)
-ListedPlayerDescriptionEditBox:SetScript("OnEnterPressed",
- function(self) self:ClearFocus() end)
-
--- Button save player data
-local ListedPlayerSaveBtn = CreateFrame("Button", "SettingsListedPlayerSaveBtn",
- ListedPlayersFrame,
- "UIPanelButtonTemplate")
-ListedPlayerSaveBtn:SetPoint("BOTTOMLEFT", ListedPlayersFrame, 40, 15)
-ListedPlayerSaveBtn:SetSize(80, 30)
-ListedPlayerSaveBtn:SetText("Save") -- Add localization
-ListedPlayerSaveBtn:SetNormalFontObject(GameFontNormal)
-ListedPlayerSaveBtn:SetHighlightFontObject(GameFontHighlight)
-ListedPlayerSaveBtn:SetScript("OnMouseDown", function(self, button)
- if button == "LeftButton" and SettingsListedPlayerEditBox:GetText() ~= "" then
- if config.ListedPlayers[SettingsListedPlayerEditBox:GetText()] then
- config.ListedPlayers[SettingsListedPlayerEditBox:GetText()] = {
- SettingsListedPlayerReasonDropDown.Text:GetText(),
- SettingsListedPlayerDescriptionEditBox:GetText()
- }
- print("Edited player: " .. SettingsListedPlayerEditBox:GetText()) -- Add localization
- else
- config.ListedPlayers[SettingsListedPlayerEditBox:GetText()] =
- {
- SettingsListedPlayerReasonDropDown.Text:GetText(),
- SettingsListedPlayerDescriptionEditBox:GetText()
- }
- print("Added player: " .. SettingsListedPlayerEditBox:GetText()) -- Add localization
- end
-
- SettingsListedPlayerEditBox:SetText("")
- SettingsListedPlayerDescriptionEditBox:SetText("")
- UIDropDownMenu_Initialize(SettingsListedPlayerDropDown, initializePlayer)
- UIDropDownMenu_SetSelectedID(SettingsListedPlayerDropDown, 1)
- UIDropDownMenu_Initialize(SettingsListedPlayerReasonDropDown,
- initializeReason)
- UIDropDownMenu_SetSelectedID(SettingsListedPlayerReasonDropDown, 1)
- end
-end)
-
--- Button remove player
-local ListedPlayerRemoveBtn = CreateFrame("Button",
- "SettingsListedPlayerRemoveBtn",
- ListedPlayersFrame,
- "UIPanelButtonTemplate")
-ListedPlayerRemoveBtn:SetPoint("BOTTOMLEFT", ListedPlayersFrame, 230, 15)
-ListedPlayerRemoveBtn:SetSize(80, 30)
-ListedPlayerRemoveBtn:SetText("Remove") -- Add localization
-ListedPlayerRemoveBtn:SetNormalFontObject(GameFontNormal)
-ListedPlayerRemoveBtn:SetHighlightFontObject(GameFontHighlight)
-ListedPlayerRemoveBtn:SetScript("OnMouseDown", function(self, button)
- if button == "LeftButton" then
- for k, v in pairs(config.ListedPlayers) do
- if SettingsListedPlayerDropDown.Text:GetText() == k then
- config.ListedPlayers[k] = nil
- print("Removed player: " .. k) -- Add localization
- UIDropDownMenu_Initialize(SettingsListedPlayerDropDown,
- initializePlayer)
- UIDropDownMenu_SetSelectedID(SettingsListedPlayerDropDown, 1)
- UIDropDownMenu_Initialize(SettingsListedPlayerReasonDropDown,
- initializeReason)
- UIDropDownMenu_SetSelectedID(SettingsListedPlayerReasonDropDown,
- 1)
- SettingsListedPlayerEditBox:SetText("")
- SettingsListedPlayerDescriptionEditBox:SetText("")
- break
- end
- end
- end
-end)
diff --git a/Shitlist/Settings/Reasons.lua b/Shitlist/Settings/Reasons.lua
deleted file mode 100644
index bcb7d2f..0000000
--- a/Shitlist/Settings/Reasons.lua
+++ /dev/null
@@ -1,163 +0,0 @@
-local _, config = ...;
-
--- Shitlist Settings - Reasons
-
--- Make a child panel
-ShitlistSettings.reasonPanel = CreateFrame("Frame", "ShitlistSettingsReasons",
- ShitlistSettings.panel)
-ShitlistSettings.reasonPanel.name = "Reasons" -- Add localization
-
--- Specify childness of this panel (this puts it under the little red [+], instead of giving it a normal AddOn category)
-ShitlistSettings.reasonPanel.parent = ShitlistSettings.panel.name
-
--- Add the child to the Interface Options
-InterfaceOptions_AddCategory(ShitlistSettings.reasonPanel)
-
--- Tabb Title
-local TabbReasonTitle = ShitlistSettings.reasonPanel:CreateFontString(
- "SettingsTabbReasonTitle", "OVERLAY",
- "GameFontNormal");
-TabbReasonTitle:SetPoint("TOPLEFT", ShitlistSettings.reasonPanel, 10, -10);
-TabbReasonTitle:SetFont(config.Font, 18);
-TabbReasonTitle:SetTextColor(getConfigColors("Gold"))
-TabbReasonTitle:SetText("Shitlist - Reasons"); -- Add localization
-
--- Reason settings
-local ReasonFrame = CreateFrame("Frame", "SettingsReasonFrame",
- ShitlistSettings.reasonPanel)
-ReasonFrame:SetPoint("TOPLEFT", ShitlistSettings.reasonPanel, 10, -35);
-ReasonFrame:SetSize(500, 200)
-
--- Title
-local ReasonTitle = ReasonFrame:CreateFontString("SettingsReasonTitle",
- "OVERLAY", "GameFontNormal");
-ReasonTitle:SetPoint("TOPLEFT", ReasonFrame, 10, -10);
-ReasonTitle:SetFont(config.Font, 14);
-ReasonTitle:SetText("Reasons"); -- Add localization
-
--- Info
-local ReasonInfo = ReasonFrame:CreateFontString("SettingsReasonInfo", "OVERLAY",
- "GameFontWhite");
-ReasonInfo:SetPoint("TOPLEFT", ReasonFrame, 30, -30);
-ReasonInfo:SetTextColor(getConfigColors("White"))
-ReasonInfo:SetText("Edit reasons"); -- Add localization
-
--- Reasons
-local ReasonDropDown = CreateFrame("Button", "SettingsReasonDropDown",
- ReasonFrame, "UIDropDownMenuTemplate")
-ReasonDropDown:SetPoint("TOPLEFT", ReasonFrame, 15, -50)
-
-local function ReasonOnClick(self)
- UIDropDownMenu_SetSelectedID(ReasonDropDown, self:GetID())
- SettingsReasonEditBox:SetText(self:GetText())
-end
-
-function initializeReasons(self)
- local info = UIDropDownMenu_CreateInfo()
- for k, v in pairs(config.Reasons) do
- info = UIDropDownMenu_CreateInfo()
- info.text = v
- info.value = v
- info.func = ReasonOnClick
- UIDropDownMenu_AddButton(info)
- end
-end
-
-UIDropDownMenu_Initialize(ReasonDropDown, initializeReasons)
-UIDropDownMenu_SetWidth(ReasonDropDown, 170);
-UIDropDownMenu_SetButtonWidth(ReasonDropDown, 195)
-UIDropDownMenu_SetSelectedID(ReasonDropDown, 1)
-UIDropDownMenu_JustifyText(ReasonDropDown, "LEFT")
-
--- Info
-local ReasonColorInfo = ReasonFrame:CreateFontString("SettingsReasonColorInfo",
- "OVERLAY", "GameFontWhite")
-ReasonColorInfo:SetPoint("TOPLEFT", ReasonFrame, ReasonDropDown:GetWidth() + 65,
- -30)
-ReasonColorInfo:SetTextColor(getConfigColors("White"))
-ReasonColorInfo:SetText("Reason text color") -- Add localization
-
--- Reason Color
-local ReasonColorDropDown = CreateFrame("Button", "SettingsReasonColorDropDown",
- ReasonFrame, "UIDropDownMenuTemplate")
-ReasonColorDropDown:SetPoint("TOPLEFT", ReasonFrame,
- ReasonDropDown:GetWidth() + 50, -50)
-
-local function OnClick(self)
- UIDropDownMenu_SetSelectedID(ReasonColorDropDown, self:GetID())
- config.ReasonColor = self:GetText()
- config.ReasonColorID = self:GetID()
-end
-
-function initializeReasonColor(self)
- local info = UIDropDownMenu_CreateInfo()
- for k, v in pairs(config.Colors) do
- info = UIDropDownMenu_CreateInfo()
- info.text = k
- info.value = getConfigColors(v)
- info.func = OnClick
- UIDropDownMenu_AddButton(info)
- end
-end
-
-UIDropDownMenu_Initialize(ReasonColorDropDown, initializeReasonColor)
-UIDropDownMenu_SetWidth(ReasonColorDropDown, 100)
-UIDropDownMenu_SetButtonWidth(ReasonColorDropDown, 115)
-UIDropDownMenu_SetSelectedID(ReasonColorDropDown, 1)
-UIDropDownMenu_JustifyText(ReasonColorDropDown, "LEFT")
-
--- Reason Text EditBox
-local ReasonEditBox = CreateFrame("EditBox", "SettingsReasonEditBox",
- ReasonFrame,
- BackdropTemplateMixin and "BackdropTemplate")
-ReasonEditBox:SetPoint("TOPLEFT", ReasonFrame, 25, -85)
-ReasonEditBox:SetSize(200, 30)
-ReasonEditBox:SetTextInsets(10, 0, 0, 0)
-ReasonEditBox:SetBackdrop(config.Backdrop)
-ReasonEditBox:SetBackdropColor(getConfigColors("Black"))
-ReasonEditBox:SetBackdropBorderColor(getConfigColors("White"))
-ReasonEditBox:SetMultiLine(false)
-ReasonEditBox:SetMaxLetters(255)
-ReasonEditBox:SetAutoFocus(false) -- dont automatically focus
-ReasonEditBox:SetFontObject(GameFontWhite)
-ReasonEditBox:SetScript("OnEscapePressed", function(self) self:ClearFocus() end)
-ReasonEditBox:SetScript("OnEnterPressed", function(self) self:ClearFocus() end)
-
--- Button save new reason
-local ReasonAddBtn = CreateFrame("Button", "SettingsReasonAddBtn", ReasonFrame,
- "UIPanelButtonTemplate");
-ReasonAddBtn:SetPoint("TOPLEFT", ReasonFrame, 40, -120)
-ReasonAddBtn:SetSize(80, 30);
-ReasonAddBtn:SetText("Add"); -- Add localization
-ReasonAddBtn:SetNormalFontObject(GameFontNormal);
-ReasonAddBtn:SetHighlightFontObject(GameFontHighlight);
-ReasonAddBtn:SetScript("OnMouseDown", function(self, button)
- if button == "LeftButton" then
- table.insert(config.Reasons, ReasonEditBox:GetText())
- ReasonEditBox:SetText("")
- UIDropDownMenu_Initialize(ReasonDropDown, initializeReasons)
- UIDropDownMenu_SetSelectedID(ReasonDropDown, 1)
- end
-end)
-
--- Button remove reason
-local ReasonRemoveBtn = CreateFrame("Button", "SettingsReasonRemoveBtn",
- ReasonFrame, "UIPanelButtonTemplate");
-ReasonRemoveBtn:SetPoint("TOPLEFT", ReasonFrame, 130, -120)
-ReasonRemoveBtn:SetSize(80, 30);
-ReasonRemoveBtn:SetText("Remove"); -- Add localization
-ReasonRemoveBtn:SetNormalFontObject(GameFontNormal);
-ReasonRemoveBtn:SetHighlightFontObject(GameFontHighlight);
-ReasonRemoveBtn:SetScript("OnMouseDown", function(self, button)
- if button == "LeftButton" then
- for k, v in ipairs(config.Reasons) do
- if ReasonEditBox:GetText() == v then
- print("Removed Reason: " .. v)
- table.remove(config.Reasons, k)
- ReasonEditBox:SetText("")
- UIDropDownMenu_Initialize(ReasonDropDown, initializeReasons)
- UIDropDownMenu_SetSelectedID(ReasonDropDown, 1)
- end
- end
- end
-end)
diff --git a/Shitlist/Settings/Shitlist.lua b/Shitlist/Settings/Shitlist.lua
deleted file mode 100644
index 81a20b1..0000000
--- a/Shitlist/Settings/Shitlist.lua
+++ /dev/null
@@ -1,367 +0,0 @@
-local _, config = ...
-
--- Shitlist Settings - General
-
-ShitlistSettings.panel = CreateFrame("Frame", "ShitlistSettingsPanel", UIParent)
-
--- Register in the Interface Addon Options GUI
--- Set the name for the Category for the Options Panel
-ShitlistSettings.panel.name = "Shitlist"
-
--- Add the panel to the Interface Options
-InterfaceOptions_AddCategory(ShitlistSettings.panel)
-
--- Tabb Title
-local GeneralTabbTitle = ShitlistSettings.panel:CreateFontString(
- "SettingsGeneralTabbTitle", "OVERLAY",
- "GameFontNormal")
-GeneralTabbTitle:SetPoint("TOPLEFT", ShitlistSettings.panel, 10, -10)
-GeneralTabbTitle:SetFont(config.Font, 18)
-GeneralTabbTitle:SetTextColor(getConfigColors("Gold"))
-GeneralTabbTitle:SetText("Shitlist - General") -- Add localization
-
--- Version
-local version = ShitlistSettings.panel:CreateFontString(nil, "OVERLAY",
- "GameFontNormal")
-version:SetPoint("BOTTOMRIGHT", ShitlistSettings.panel, -5, 5)
-version:SetFont(config.Font, 11)
-version:SetTextColor(getConfigColors("White"))
-version:SetText("Version: " .. GetAddOnMetadata("Shitlist", "Version")) -- Add localization
-
----------
-
--- Tooltip settings
-local TooltipFrame = CreateFrame("Frame", "SettingsTooltipFrame",
- ShitlistSettings.panel)
-TooltipFrame:SetPoint("TOPLEFT", ShitlistSettings.panel, 10, -35)
-TooltipFrame:SetSize(500, 125)
-
--- Title
-local TooltipTitle = TooltipFrame:CreateFontString("SettingsTooltipTitle",
- "OVERLAY", "GameFontNormal")
-TooltipTitle:SetPoint("TOPLEFT", TooltipFrame, 10, -10)
-TooltipTitle:SetFont(config.Font, 14)
-TooltipTitle:SetText("Tooltip") -- Add localization
-
--- Info
-local TooltipInfo = TooltipFrame:CreateFontString("SettingsTooltipInfo",
- "OVERLAY", "GameFontWhite")
-TooltipInfo:SetPoint("TOPLEFT", TooltipFrame, 15, -30)
-TooltipInfo:SetTextColor(getConfigColors("White"))
-TooltipInfo:SetText("Set title in the Tooltip message. #Shitlist") -- Add localization
-
--- Tooltip text
-local TooltipTitleEditBox = CreateFrame("EditBox",
- "SettingsTooltipTitleEditBox",
- TooltipFrame, BackdropTemplateMixin and
- "BackdropTemplate")
-TooltipTitleEditBox:SetPoint("TOPLEFT", 15, -50)
-TooltipTitleEditBox:SetSize(200, 30)
-TooltipTitleEditBox:SetTextInsets(10, 0, 0, 0)
-TooltipTitleEditBox:SetBackdrop(config.Backdrop)
-TooltipTitleEditBox:SetBackdropColor(getConfigColors("Black"))
-TooltipTitleEditBox:SetBackdropBorderColor(getConfigColors("White"))
-TooltipTitleEditBox:SetMultiLine(false)
-TooltipTitleEditBox:SetMaxLetters(50)
-TooltipTitleEditBox:SetAutoFocus(false)
-TooltipTitleEditBox:SetFontObject(GameFontWhite)
-TooltipTitleEditBox:SetScript("OnEscapePressed", function(self)
- config.TooltipTitle = self:GetText()
- self:ClearFocus()
-end)
-TooltipTitleEditBox:SetScript("OnEnterPressed", function(self)
- config.TooltipTitle = self:GetText()
- self:ClearFocus()
-end)
-TooltipTitleEditBox:SetScript("OnMouseDown", function(self)
- self:SetText(config.TooltipTitle)
-end)
-
--- Info
-local TooltipTitleColorInfo = TooltipFrame:CreateFontString(
- "SettingsTooltipTitleColorInfo", "OVERLAY",
- "GameFontWhite")
-TooltipTitleColorInfo:SetPoint("TOPLEFT", TooltipFrame,
- TooltipTitleEditBox:GetWidth() + 85, -30)
-TooltipTitleColorInfo:SetTextColor(getConfigColors("White"))
-TooltipTitleColorInfo:SetText("Title color") -- Add localization
-
--- Title color
-local TooltipTitleColorDropDown = CreateFrame("Button",
- "SettingsTooltipTitleColorDropDown",
- TooltipFrame,
- "UIDropDownMenuTemplate")
-TooltipTitleColorDropDown:SetPoint("TOPLEFT", TooltipFrame,
- TooltipTitleEditBox:GetWidth() + 70, -50)
-
-local function ShitlistOnClick(self)
- UIDropDownMenu_SetSelectedID(TooltipTitleColorDropDown, self:GetID())
- config.TooltipTitleColor = self:GetText()
- config.TooltipTitleColorID = self:GetID()
-end
-
-function initializeColors(self)
- local info = UIDropDownMenu_CreateInfo()
- for k, v in pairs(config.Colors) do
- info = UIDropDownMenu_CreateInfo()
- info.text = k
- info.value = getConfigColors(v)
- info.func = ShitlistOnClick
- UIDropDownMenu_AddButton(info)
- end
-end
-
-UIDropDownMenu_Initialize(TooltipTitleColorDropDown, initializeColors)
-UIDropDownMenu_SetWidth(TooltipTitleColorDropDown, 100)
-UIDropDownMenu_SetButtonWidth(TooltipTitleColorDropDown, 115)
-UIDropDownMenu_SetSelectedID(TooltipTitleColorDropDown, 1)
-UIDropDownMenu_JustifyText(TooltipTitleColorDropDown, "LEFT")
-
------------------
-
--- Audio settings
-local AudioFrame = CreateFrame("Frame", "SettingsAudioFrame",
- ShitlistSettings.panel)
-AudioFrame:SetPoint("TOPLEFT", ShitlistSettings.panel, 10,
- -TooltipFrame:GetHeight())
-AudioFrame:SetSize(450, 140)
-
--- Title
-local SoundTitle = AudioFrame:CreateFontString("SettingsSoundTitle", "OVERLAY",
- "GameFontNormal")
-SoundTitle:SetPoint("TOPLEFT", AudioFrame, 10, -10)
-SoundTitle:SetFont(config.Font, 14)
-SoundTitle:SetText("Sound") -- Add localization
-
--- Info
-local SoundInfo = AudioFrame:CreateFontString("SettingsSoundInfo", "OVERLAY",
- "GameFontWhite")
-SoundInfo:SetPoint("TOPLEFT", AudioFrame, 15, -30)
-SoundInfo:SetTextColor(getConfigColors("White"))
-SoundInfo:SetText(
- "Is not played if the player is the same since last warning was played and wait time is passed.") -- Add localization
-
--- Sound
-local SoundCheckBox = CreateFrame("CheckButton", "SettingsSoundCheckBox",
- AudioFrame, "ChatConfigCheckButtonTemplate")
-SoundCheckBox:SetPoint("TOPLEFT", 25, -60)
-getglobal(SoundCheckBox:GetName() .. "Text"):SetText("Enable Audio"); -- Add localization
-SoundCheckBox.tooltip = "Plays sound efect when a listed player is found" -- Add localization
-SoundCheckBox:SetScript("OnClick", function(self)
- if config.AlertEnable == false then
- config.AlertEnable = true
- self:SetChecked(config.AlertEnable)
- else
- config.AlertEnable = false
- self:SetChecked(config.AlertEnable)
- end
-end)
-
--- Info
-local SoundEditBoxInfo = AudioFrame:CreateFontString("SettingsSoundEditBoxInfo",
- "OVERLAY", "GameFontWhite")
-SoundEditBoxInfo:SetPoint("TOPLEFT", AudioFrame, 280, -65)
-SoundEditBoxInfo:SetTextColor(getConfigColors("White"))
-SoundEditBoxInfo:SetText("Sleep for x seconds") -- Add localization
-
--- Ignore time
-local SoundEditBox = CreateFrame("EditBox", "SettingsSoundEditBox", AudioFrame,
- BackdropTemplateMixin and "BackdropTemplate")
-SoundEditBox:SetPoint("TOPLEFT", 280, -90)
-SoundEditBox:SetSize(80, 30)
-SoundEditBox:SetTextInsets(10, 0, 0, 0)
-SoundEditBox:SetBackdrop(config.Backdrop)
-SoundEditBox:SetBackdropColor(getConfigColors("Black"))
-SoundEditBox:SetBackdropBorderColor(getConfigColors("White"))
-SoundEditBox:SetMultiLine(false)
-SoundEditBox:SetMaxLetters(5)
-SoundEditBox:SetAutoFocus(false)
-SoundEditBox:SetFontObject(GameFontWhite)
-SoundEditBox:SetScript("OnEscapePressed", function(self)
- config.IgnoreTime = self:GetText()
- self:ClearFocus()
-end)
-SoundEditBox:SetScript("OnEnterPressed", function(self)
- config.IgnoreTime = self:GetText()
- self:ClearFocus()
-end)
-SoundEditBox:SetScript("OnMouseDown",
- function(self) self:SetText(config.IgnoreTime) end)
-
--- Sounds
-local SoundDropDown = CreateFrame("Button", "SettingsSoundDropDown", AudioFrame,
- "UIDropDownMenuTemplate")
-SoundDropDown:SetPoint("TOPLEFT", AudioFrame, 10, -90)
-
-local function OnClick(self)
- UIDropDownMenu_SetSelectedID(SoundDropDown, self:GetID())
- PlaySoundFile(config.Sounds[self:GetText()], config.Channel)
- config.Sound = config.Sounds[self:GetText()]
- config.SoundID = self:GetID()
-end
-
-function initializeSounds(self)
- local info = UIDropDownMenu_CreateInfo()
- for k, v in pairs(config.Sounds) do
- info = UIDropDownMenu_CreateInfo()
- info.text = k
- info.value = v
- info.func = OnClick
- UIDropDownMenu_AddButton(info)
- end
-end
-
-UIDropDownMenu_Initialize(SoundDropDown, initializeSounds)
-UIDropDownMenu_SetWidth(SoundDropDown, 160)
-UIDropDownMenu_SetButtonWidth(SoundDropDown, 185)
-UIDropDownMenu_SetSelectedID(SoundDropDown, 1)
-UIDropDownMenu_JustifyText(SoundDropDown, "LEFT")
-
---------------------
-
--- Party settings
-local PartyFrame = CreateFrame("Frame", "SettingsPartyFrame",
- ShitlistSettings.panel)
-PartyFrame:SetPoint("TOPLEFT", ShitlistSettings.panel, 10,
- -AudioFrame:GetHeight() + -TooltipFrame:GetHeight())
-PartyFrame:SetSize(450, 100)
-
--- Title
-local PartyTitle = PartyFrame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
-PartyTitle:SetPoint("TOPLEFT", PartyFrame, 10, -10)
-PartyTitle:SetFont(config.Font, 14)
-PartyTitle:SetText("Party") -- Add localization
-
--- Info
-local PartyInfo = PartyFrame:CreateFontString("SettingsPartyInfo", "OVERLAY",
- "GameFontWhite")
-PartyInfo:SetPoint("TOPLEFT", PartyFrame, 15, -30)
-PartyInfo:SetTextColor(getConfigColors("White"))
-PartyInfo:SetText(
- "Message is not sent if the player is the same since last message was sent and wait time is passed.") -- Add localization
-
--- Party
-local PartyCheckBox = CreateFrame("CheckButton", "SettingsPartyCheckBox",
- PartyFrame, "ChatConfigCheckButtonTemplate")
-PartyCheckBox:SetPoint("TOPLEFT", 25, -60)
-getglobal(PartyCheckBox:GetName() .. "Text"):SetText("Enable Party Message"); -- Add localization
-PartyCheckBox.tooltip = "Send party message" -- Add localization
-PartyCheckBox:SetScript("OnClick", function(self)
- if config.PartyAlertEnable == false then
- config.PartyAlertEnable = true
- self:SetChecked(config.PartyAlertEnable)
- else
- config.PartyAlertEnable = false
- self:SetChecked(config.PartyAlertEnable)
- end
-end)
-
--- Info
-local PartyEditBoxInfo = PartyFrame:CreateFontString("SettingsPartyEditBoxInfo",
- "OVERLAY", "GameFontWhite")
-PartyEditBoxInfo:SetPoint("TOPLEFT", PartyFrame, 280, -65)
-PartyEditBoxInfo:SetTextColor(getConfigColors("White"))
-PartyEditBoxInfo:SetText("Sleep for x seconds") -- Add localization
-
--- Ignore time
-local PartyEditBox = CreateFrame("EditBox", "SettingsPartyEditBox", PartyFrame,
- BackdropTemplateMixin and "BackdropTemplate")
-PartyEditBox:SetPoint("TOPLEFT", 280, -90)
-PartyEditBox:SetSize(80, 30)
-PartyEditBox:SetTextInsets(10, 0, 0, 0)
-PartyEditBox:SetBackdrop(config.Backdrop)
-PartyEditBox:SetBackdropColor(getConfigColors("Black"))
-PartyEditBox:SetBackdropBorderColor(getConfigColors("White"))
-PartyEditBox:SetMultiLine(false)
-PartyEditBox:SetMaxLetters(5)
-PartyEditBox:SetAutoFocus(false)
-PartyEditBox:SetFontObject(GameFontWhite)
-PartyEditBox:SetScript("OnEscapePressed", function(self)
- config.PartyIgnoreTime = self:GetText()
- self:ClearFocus()
-end)
-PartyEditBox:SetScript("OnEnterPressed", function(self)
- config.PartyIgnoreTime = self:GetText()
- self:ClearFocus()
-end)
-PartyEditBox:SetScript("OnMouseDown",
- function(self) self:SetText(config.PartyIgnoreTime) end)
-
------
-
-local PopupMenusFrame = CreateFrame("Frame", "SettingsPopupMenusFrame",
- ShitlistSettings.panel)
-PopupMenusFrame:SetPoint("TOPLEFT", ShitlistSettings.panel, 10,
- -AudioFrame:GetHeight() + -TooltipFrame:GetHeight() +
- -PartyFrame:GetHeight())
-PopupMenusFrame:SetSize(450, 100)
-
--- Title
-local PopupMenusTitle = PopupMenusFrame:CreateFontString(nil, "OVERLAY",
- "GameFontNormal")
-PopupMenusTitle:SetPoint("TOPLEFT", PopupMenusFrame, 10, -10)
-PopupMenusTitle:SetFont(config.Font, 14)
-PopupMenusTitle:SetText("Menus") -- Add localization
-
--- Info
-local PopupMenusInfo = PopupMenusFrame:CreateFontString(
- "SettingsPopupMenusInfo", "OVERLAY", "GameFontWhite")
-PopupMenusInfo:SetPoint("TOPLEFT", PopupMenusFrame, 15, -30)
-PopupMenusInfo:SetTextColor(getConfigColors("White"))
-PopupMenusInfo:SetText("Add to popup menus") -- Add localization
-
-local TargetCheckBox = CreateFrame("CheckButton", "SettingsTargetCheckBox",
- PopupMenusFrame,
- "ChatConfigCheckButtonTemplate")
-TargetCheckBox:SetPoint("TOPLEFT", 30, -45)
-getglobal(TargetCheckBox:GetName() .. "Text"):SetText("Target"); -- Add localization
-TargetCheckBox.tooltip = "Add to player Target frame" -- Add localization
-TargetCheckBox:SetScript("OnClick", function(self)
- if config.PopupMenus.target == false then
- config.PopupMenus.target = true
- self:SetChecked(config.PopupMenus.target)
- else
- config.PopupMenus.target = false
- self:SetChecked(config.PopupMenus.target)
- end
-end)
-
-local ChatCheckBox = CreateFrame("CheckButton", "SettingsChatCheckBox",
- PopupMenusFrame,
- "ChatConfigCheckButtonTemplate")
-ChatCheckBox:SetPoint("TOPLEFT", 30, -65)
-getglobal(ChatCheckBox:GetName() .. "Text"):SetText("Chat"); -- Add localization
-ChatCheckBox.tooltip = "Add to player Chat frame" -- Add localization
-ChatCheckBox:SetScript("OnClick", function(self)
- if config.PopupMenus.chat == false then
- config.PopupMenus.chat = true
- self:SetChecked(config.PopupMenus.chat)
- else
- config.PopupMenus.chat = false
- self:SetChecked(config.PopupMenus.chat)
- end
-end)
-
--- Info
-local IconMenusInfo = PopupMenusFrame:CreateFontString("SettingsIconMenusInfo",
- "OVERLAY",
- "GameFontWhite")
-IconMenusInfo:SetPoint("TOPLEFT", PopupMenusFrame, 280, -30)
-IconMenusInfo:SetTextColor(getConfigColors("White"))
-IconMenusInfo:SetText("Menu options") -- Add localization
-
-local IconCheckBox = CreateFrame("CheckButton", "SettingsIconCheckBox",
- PopupMenusFrame,
- "ChatConfigCheckButtonTemplate")
-IconCheckBox:SetPoint("TOPLEFT", 280, -45)
-getglobal(IconCheckBox:GetName() .. "Text"):SetText("Icon"); -- Add localization
-IconCheckBox.tooltip = "Show icon in menu" -- Add localization
-IconCheckBox:SetScript("OnClick", function(self)
- if config.MenuOptions.icon == false then
- config.MenuOptions.icon = true
- self:SetChecked(config.MenuOptions.icon)
- else
- config.MenuOptions.icon = false
- self:SetChecked(config.MenuOptions.icon)
- end
-end)
diff --git a/Shitlist/Shitlist.lua b/Shitlist/Shitlist.lua
deleted file mode 100644
index f214dc3..0000000
--- a/Shitlist/Shitlist.lua
+++ /dev/null
@@ -1,352 +0,0 @@
-local _, config = ...
-
-Shitlist = CreateFrame('GameTooltip', 'Shitlist', UIParent, 'DialogBoxFrame')
-
-Shitlist:RegisterEvent("ADDON_LOADED") -- Fired when saved variables are loaded
-Shitlist:RegisterEvent("PLAYER_LOGOUT") -- Fired when about to log out
-
-Shitlist:SetScript("OnEvent", function(self, event)
- if event == "ADDON_LOADED" then
- if _G.ShitlistDB["Reasons"] ~= nil then
- config.Reasons = _G.ShitlistDB["Reasons"]
- end
- if _G.ShitlistDB["ListedPlayers"] ~= nil then
- config.ListedPlayers = _G.ShitlistDB["ListedPlayers"]
- end
- if _G.ShitlistDB["TooltipTitle"] ~= nil then
- config.TooltipTitle = _G.ShitlistDB["TooltipTitle"]
- end
- if _G.ShitlistDB["AlertEnable"] ~= nil then
- config.AlertEnable = _G.ShitlistDB["AlertEnable"]
- end
- if _G.ShitlistDB["Sound"] ~= nil then
- config.Sound = _G.ShitlistDB["Sound"]
- end
- if _G.ShitlistDB["SoundID"] ~= nil then
- config.SoundID = _G.ShitlistDB["SoundID"]
- end
- if _G.ShitlistDB["PartyAlertEnable"] ~= nil then
- config.PartyAlertEnable = _G.ShitlistDB["PartyAlertEnable"]
- end
- if _G.ShitlistDB["IgnoreTime"] ~= nil then
- config.IgnoreTime = _G.ShitlistDB["IgnoreTime"]
- end
- if _G.ShitlistDB["PartyAlertEnable"] ~= nil then
- config.PartyAlertEnable = _G.ShitlistDB["PartyAlertEnable"]
- end
- if _G.ShitlistDB["TooltipTitleColor"] ~= nil then
- config.TooltipTitleColor = _G.ShitlistDB["TooltipTitleColor"]
- end
- if _G.ShitlistDB["TooltipTitleColorID"] ~= nil then
- config.TooltipTitleColorID = _G.ShitlistDB["TooltipTitleColorID"]
- end
- if _G.ShitlistDB["ReasonColor"] ~= nil then
- config.ReasonColor = _G.ShitlistDB["ReasonColor"]
- end
- if _G.ShitlistDB["ReasonColorID"] ~= nil then
- config.ReasonColorID = _G.ShitlistDB["ReasonColorID"]
- end
- if _G.ShitlistDB["PopupMenus"] ~= nil then
- config.PopupMenus = _G.ShitlistDB["PopupMenus"]
- end
- if _G.ShitlistDB["MenuOptions"] ~= nil then
- config.MenuOptions = _G.ShitlistDB["MenuOptions"]
- end
-
- -- Set global settings values
- SettingsTooltipTitleEditBox:SetText(config.TooltipTitle)
- SettingsTooltipTitleEditBox:SetCursorPosition(0)
-
- UIDropDownMenu_Initialize(SettingsTooltipTitleColorDropDown,
- initializeColors)
- UIDropDownMenu_SetSelectedID(SettingsTooltipTitleColorDropDown,
- config.TooltipTitleColorID)
-
- SettingsSoundCheckBox:SetChecked(config.AlertEnable)
- SettingsSoundEditBox:SetText(config.IgnoreTime)
- SettingsSoundEditBox:SetCursorPosition(0)
-
- UIDropDownMenu_Initialize(SettingsSoundDropDown, initializeSounds)
- UIDropDownMenu_SetSelectedID(SettingsSoundDropDown, config.SoundID)
-
- SettingsPartyCheckBox:SetChecked(config.PartyAlertEnable)
- SettingsPartyEditBox:SetText(config.PartyIgnoreTime)
- SettingsPartyEditBox:SetCursorPosition(0)
-
- SettingsTargetCheckBox:SetChecked(config.PopupMenus.target)
- SettingsChatCheckBox:SetChecked(config.PopupMenus.chat)
-
- SettingsIconCheckBox:SetChecked(config.MenuOptions.icon)
-
- -- Reason values
- UIDropDownMenu_Initialize(SettingsReasonDropDown, initializeReasons)
- UIDropDownMenu_SetSelectedID(SettingsReasonDropDown, 1)
- UIDropDownMenu_Initialize(SettingsReasonColorDropDown,
- initializeReasonColor)
- UIDropDownMenu_SetSelectedID(SettingsReasonColorDropDown,
- config.ReasonColorID)
-
- -- Listed Player values
- UIDropDownMenu_Initialize(SettingsListedPlayerDropDown, initializePlayer)
- UIDropDownMenu_SetSelectedID(SettingsListedPlayerDropDown, 1)
- SettingsListedPlayerDescriptionEditBox:SetCursorPosition(0)
-
- elseif event == "PLAYER_LOGOUT" then
- -- _G.ShitlistDB = config -- Save whole config to SavedVariables
- _G.ShitlistDB["TooltipTitle"] = config.TooltipTitle
- _G.ShitlistDB["Reasons"] = config.Reasons
- _G.ShitlistDB["ListedPlayers"] = config.ListedPlayers
- _G.ShitlistDB["AlertEnable"] = config.AlertEnable
- _G.ShitlistDB["Sound"] = config.Sound
- _G.ShitlistDB["SoundID"] = config.SoundID
- _G.ShitlistDB["PartyAlertEnable"] = config.PartyAlertEnable
- _G.ShitlistDB["IgnoreTime"] = config.IgnoreTime
- _G.ShitlistDB["PartyAlertEnable"] = config.PartyAlertEnable
- _G.ShitlistDB["TooltipTitleColor"] = config.TooltipTitleColor
- _G.ShitlistDB["TooltipTitleColorID"] = config.TooltipTitleColorID
- _G.ShitlistDB["ReasonColor"] = config.ReasonColor
- _G.ShitlistDB["ReasonColorID"] = config.ReasonColorID
- _G.ShitlistDB["PopupMenus"] = config.PopupMenus
- _G.ShitlistDB["MenuOptions"] = config.MenuOptions
- end
-end)
-
--- Add info to tooltip
-function ShowPlayerTooltip(self)
- local name, unit = self:GetUnit()
- if UnitIsPlayer(unit) and not UnitIsUnit(unit, "player") then
- local name, realm = UnitName(unit)
- name = name .. "-" .. (realm or GetRealmName())
- if config.ListedPlayers[name] and type(next(config.ListedPlayers)) ~=
- "nil" then
- self:AddLine(config.TooltipTitle,
- config.Colors[config.TooltipTitleColor].red,
- config.Colors[config.TooltipTitleColor].green,
- config.Colors[config.TooltipTitleColor].blue, true)
- for i, value in ipairs(config.ListedPlayers[name]) do
- if i == 1 then
- self:AddLine(value, config.Colors[config.ReasonColor].red,
- config.Colors[config.ReasonColor].green,
- config.Colors[config.ReasonColor].blue, true)
- else
- self:AddLine(value, config.Colors[config.DefaultColor].red,
- config.Colors[config.DefaultColor].green,
- config.Colors[config.DefaultColor].blue, true)
- end
- end
-
- -- Play sound efect
- if config.AlertEnable and time() >= config.Start and
- config.AlertLastSentName ~= name then
- -- PlaySound(8959, "Master", forceNoDuplicates, runFinishCallback)
- PlaySoundFile(config.Sound, config.SoundChannel)
- config.Start = time() + config.IgnoreTime
- config.AlertLastSentName = name
- end
-
- -- Send party message
- if IsInGroup() and config.PartyAlertEnable and time() >=
- config.PartyStart and config.PartyAlertLastSentName ~= name then
- SendChatMessage(config.TooltipTitle .. " " .. name, "PARTY",
- GetDefaultLanguage(unit))
- for k, v in ipairs(config.ListedPlayers[name]) do
- SendChatMessage(v, "PARTY", GetDefaultLanguage(unit))
- end
- config.PartyStart = time() + config.PartyIgnoreTime
- config.PartyAlertLastSentName = name
- end
-
- end
- end
-end
-
-if TooltipDataProcessor then
- -- Retail 10.0.2
- -- https://wowpedia.fandom.com/wiki/Patch_10.0.2/API_changes#Tooltip_Changes
- TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Unit, ShowPlayerTooltip)
-else
- -- Backwards compatibility WOTLK, Classic
- GameTooltip:HookScript("OnTooltipSetUnit", ShowPlayerTooltip)
-end
-
--- Add to player context menu
-function ShitlistDropdownMenuButtonKlick(self)
- name = self.value
- if not config.ListedPlayers[name] then
- Shitlist:Toggle()
- else
- StaticPopupDialogs["CONFIRM_REMOVE_PLAYER"] = {
- text = "Do you want to remove " .. name .. "?",
- button1 = "Yes",
- button2 = "No",
- OnAccept = function() Remove_Player_Confirmation(name) end,
- timeout = 0,
- whileDead = true,
- hideOnEscape = true,
- preferredIndex = 3
- }
- if name ~= nil and config.ListedPlayers[name] then
- StaticPopup_Show("CONFIRM_REMOVE_PLAYER")
- end
- end
-end
-
-function Remove_Player_Confirmation(name)
- print("Removed " .. name)
- config.ListedPlayers[name] = nil
-end
-
-function ShitlistDropdownMenuButton(name)
- local info = UIDropDownMenu_CreateInfo()
- info.owner = which
- info.notCheckable = 1
- info.func = ShitlistDropdownMenuButtonKlick
- if config.ListedPlayers[name] then
- info.text = "Remove from Shitlist"
- info.colorCode = config.MenuOptions.remove_color
- info.value = name
- else
- info.text = "Add to Shitlist"
- info.colorCode = config.MenuOptions.add_color
- info.value = name
- if config.MenuOptions.icon then info.icon = config.Icon end
- end
- UIDropDownMenu_AddButton(info)
-end
-
-hooksecurefunc("UnitPopup_ShowMenu", function(self, event)
- if (UIDROPDOWNMENU_MENU_LEVEL > 1) then return end
- if (config.PopupMenus.target and event ~= "FRIEND" and
- UnitIsPlayer("target") and not UnitIsUnit("target", "player")) then
- local name, realm = UnitName("target")
- name = name .. "-" .. (realm or GetRealmName())
- ShitlistDropdownMenuButton(name)
- end
- if (config.PopupMenus.chat and event == "FRIEND" and
- not UnitIsUnit("target", "player")) then
- local name = self.name .. "-" .. (self.realm or GetRealmName())
- ShitlistDropdownMenuButton(name)
- end
-end)
-
--- Shitlist UI
-function Shitlist:CreateUI()
- shitlistUI =
- CreateFrame("Frame", "ShitlistUI", UIParent, "BackdropTemplate")
- shitlistUI:ClearAllPoints()
- shitlistUI:SetHeight(180)
- shitlistUI:SetWidth(320)
- shitlistUI:SetPoint("CENTER")
- shitlistUI:SetBackdrop(config.Backdrop)
- shitlistUI:SetBackdropColor(getConfigColors("Black"))
- shitlistUI:SetBackdropBorderColor(getConfigColors("White"))
- shitlistUI:SetMovable(true)
- shitlistUI:EnableMouse(true)
- shitlistUI:RegisterForDrag("LeftButton")
- shitlistUI:SetScript("OnDragStart", shitlistUI.StartMoving)
- shitlistUI:SetScript("OnDragStop", shitlistUI.StopMovingOrSizing)
-
- local title = shitlistUI:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- -- title:SetFontObject("GameFontHighlight")
- title:SetPoint("CENTER", shitlistUI, "TOP", 0, -20)
- title:SetFont("Interface\\AddOns\\Shitlist\\Fonts\\Inconsolata-Bold.ttf", 12)
- title:SetTextColor(getConfigColors("White"))
- title:SetText("Add new player notice")
-
- -- Title
- playerText =
- shitlistUI:CreateFontString(nil, "BACKGROUND", "GameFontNormal")
- playerText:SetPoint("TOP", shitlistUI, 0, -35)
- playerText:SetFont(
- "Interface\\AddOns\\Shitlist\\Fonts\\Inconsolata-Bold.ttf", 16)
- playerText:SetTextColor(getConfigColors("Gold"))
- playerText:SetText(name)
-
- -- Reasons drop-down menu
- reasons = CreateFrame("Button", nil, shitlistUI, "UIDropDownMenuTemplate")
- reasons:SetPoint("TOP", 0, -60)
-
- local function OnClick(self)
- UIDropDownMenu_SetSelectedID(reasons, self:GetID())
- end
-
- local function initialize(self)
- local info = UIDropDownMenu_CreateInfo()
- for k, v in pairs(config.Reasons) do
- info = UIDropDownMenu_CreateInfo()
- info.text = v
- info.value = v
- info.func = OnClick
- UIDropDownMenu_AddButton(info)
- end
- end
-
- UIDropDownMenu_Initialize(reasons, initialize)
- UIDropDownMenu_SetWidth(reasons, 160)
- UIDropDownMenu_SetButtonWidth(reasons, 184)
- UIDropDownMenu_SetSelectedID(reasons, 1)
- UIDropDownMenu_JustifyText(reasons, "LEFT")
-
- -- EditBox
- noticeEditBox = CreateFrame("EditBox", "TooltipTitleEditBox", shitlistUI,
- "BackdropTemplate")
- noticeEditBox:SetPoint("CENTER", 0, -15)
- noticeEditBox:SetSize(250, 30)
- noticeEditBox:SetTextInsets(4, 0, 0, 0)
- noticeEditBox:SetBackdrop(config.Backdrop)
- noticeEditBox:SetBackdropColor(getConfigColors("Grey"))
- noticeEditBox:SetBackdropBorderColor(getConfigColors("Gold"))
- noticeEditBox:SetMultiLine(false)
- noticeEditBox:SetMaxLetters(255)
- noticeEditBox:SetAutoFocus(false) -- dont automatically focus
- noticeEditBox:SetFontObject(GameFontWhite)
- noticeEditBox:SetScript("OnEscapePressed",
- function(self) Shitlist:Toggle() end)
- noticeEditBox:SetScript("OnEnterPressed",
- function(self) self:ClearFocus() end)
-
- local saveBtn = CreateFrame("Button", nil, shitlistUI,
- "UIPanelButtonTemplate")
- saveBtn:SetPoint("CENTER", shitlistUI, "BOTTOM", -55, 35)
- saveBtn:SetSize(100, 30)
- saveBtn:SetText("Save")
- saveBtn:SetNormalFontObject("GameFontNormal")
- saveBtn:SetHighlightFontObject("GameFontHighlight")
- saveBtn:SetScript("OnMouseDown", function(self, button)
- if button == "LeftButton" then
- local reason = reasons.Text:GetText()
- local desc = noticeEditBox:GetText()
- print("Added " .. name .. "\n" .. reason .. "\n" .. desc)
- config.ListedPlayers[name] = {reason, desc}
- HideParentPanel(self)
- Shitlist:Reset()
- end
- end)
-
- local cancelBtn = CreateFrame("Button", nil, shitlistUI,
- "UIPanelButtonTemplate")
- cancelBtn:SetPoint("CENTER", shitlistUI, "BOTTOM", 55, 35)
- cancelBtn:SetSize(100, 30)
- cancelBtn:SetText("Cancel")
- cancelBtn:SetNormalFontObject("GameFontNormal")
- cancelBtn:SetHighlightFontObject("GameFontHighlight")
- cancelBtn:SetScript("OnMouseDown", function(self, button)
- if button == "LeftButton" then
- HideParentPanel(self)
- Shitlist:Reset()
- end
- end)
- shitlistUI:Hide()
- return shitlistUI
-end
-
-function Shitlist:Reset()
- UIDropDownMenu_SetSelectedID(reasons, 1)
- noticeEditBox:SetText("")
-end
-
-function Shitlist:Toggle()
- local shitlist = shitlistUI or Shitlist:CreateUI()
- shitlist:SetShown(not shitlist:IsShown())
- playerText:SetText(name)
-end
diff --git a/Shitlist/Shitlist.toc b/Shitlist/Shitlist.toc
deleted file mode 100644
index 5502b3c..0000000
--- a/Shitlist/Shitlist.toc
+++ /dev/null
@@ -1,18 +0,0 @@
-## Interface: 100002
-## Interface-Wrath: 30400
-## Interface-Classic: 11403
-## Title: Shitlist
-## Notes: Set a personal comment on players and adding it to player information tooltip window.
-## Author: Limmek
-## Version: @project-version@
-## SavedVariables: ShitlistDB
-## DefaultState: enabled
-## X-Category: Miscellaneous
-## X-Curse-Project-ID: 344967
-
-Config.lua
-Shitlist.lua
-
-Settings\Shitlist.lua
-Settings\Reasons.lua
-Settings\ListedPlayers.lua
diff --git a/ShitlistConfig.lua b/ShitlistConfig.lua
new file mode 100644
index 0000000..7b4ca54
--- /dev/null
+++ b/ShitlistConfig.lua
@@ -0,0 +1,738 @@
+local shitlist = ...
+local L = LibStub("AceLocale-3.0"):GetLocale(shitlist, true)
+
+Shitlist.defaults = {
+ profile = {
+ icon = "Interface\\AddOns\\" .. shitlist .. "\\Images\\shitlist.png",
+ debug = false,
+ minimap = { hide = false, minimapPos = 240 },
+ announcement = { delay = 10, guild = true, party = true, raid = true, instance = true },
+ alert = {
+ delay = 10,
+ enabled = true,
+ sound = 1,
+ sounds = { "alarmbeep", "alarmbuzz", "alarmbuzzer", "alarmdouble" },
+ last = {},
+ 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, },
+ },
+ reason = { id = 1, reason = "None", color = { r = 1, g = 1, b = 1 } },
+ listedPlayer = {
+ id = 1,
+ name = "Example",
+ realm = "Silvermoon",
+ reason = 1,
+ description = "Example Description",
+ color = { r = 1, g = 1, b = 1 },
+ alert = true,
+ },
+ listedPlayers = {
+ {
+ id = 1,
+ name = "Example",
+ realm = "Silvermoon",
+ reason = 1,
+ description = "Example Description",
+ color = { r = 0, g = 0, b = 0 },
+ alert = true,
+ },
+ }
+ }
+}
+
+-- https://www.wowace.com/projects/ace3/pages/ace-config-3-0-options-tables
+Shitlist.options = {
+ Info = {
+ type = "group",
+ order = 0,
+ name = L["SHITLIST_MENU_TITLE"],
+ inline = true,
+ cmdHidden = true,
+ args = {
+ Notes = {
+ order = 1,
+ type = "description",
+ fontSize = "medium",
+ name = Shitlist:GetNotes() .. "\n\n\n",
+ },
+ Commands = {
+ name = L["SHITLIST_INFO_COMMANDS_TITLE"],
+ desc = L["SHITLIST_INFO_COMMANDS_DESC"],
+ order = 2,
+ type = "group",
+ inline = true,
+ args = {
+ options = {
+ order = 1,
+ type = "description",
+ fontSize = "medium",
+ name = L["SHITLIST_INFO_COMMANDS_2"],
+ },
+ reasons = {
+ order = 2,
+ type = "description",
+ fontSize = "medium",
+ name = L["SHITLIST_INFO_COMMANDS_3"],
+ },
+ players = {
+ order = 3,
+ type = "description",
+ fontSize = "medium",
+ name = L["SHITLIST_INFO_COMMANDS_4"],
+ },
+ minimap = {
+ order = 4,
+ type = "description",
+ fontSize = "medium",
+ name = L["SHITLIST_INFO_COMMANDS_5"],
+ },
+ },
+ },
+ About = {
+ name = L["SHITLIST_INFO_ABOUT_TITLE"],
+ order = 3,
+ type = "group",
+ inline = true,
+ args = {
+ version = {
+ type = "description",
+ order = 0,
+ width = "full",
+ fontSize = "medium",
+ name = "|cffffd700" .. L["SHITLIST_INFO_ABOUT_VERSION"] ..
+ ": |cffff8c00" .. Shitlist:GetVersion()
+ },
+ author = {
+ type = "description",
+ order = 1,
+ width = "full",
+ fontSize = "medium",
+ name = "|cffffd700" .. L["SHITLIST_INFO_ABOUT_AUTHOR"] ..
+ ": |cffffffff" .. Shitlist:GetAuthor()
+ },
+ category = {
+ type = "description",
+ order = 2,
+ width = "full",
+ fontSize = "medium",
+ name = "|cffffd700" .. L["SHITLIST_INFO_ABOUT_CATEGORY"] ..
+ ": |cffffffff" .. Shitlist:GetCategory()
+ },
+ localizations = {
+ type = "description",
+ order = 3,
+ width = "full",
+ fontSize = "medium",
+ name = "|cffffd700" .. L["SHITLIST_INFO_ABOUT_LOCALIZATION"] ..
+ ": |cffffffff" .. Shitlist:GetLocalizations()
+ },
+ license = {
+ type = "description",
+ order = 4,
+ width = "full",
+ fontSize = "medium",
+ name = "|cffffd700" .. L["SHITLIST_INFO_ABOUT_LICENSE"] ..
+ ": |cffffffff" .. Shitlist:GetLicense()
+ },
+ website = {
+ type = "description",
+ order = 5,
+ width = "full",
+ fontSize = "medium",
+ name = "|cffffd700" .. L["SHITLIST_INFO_ABOUT_WEB"] ..
+ ": |cffffffff" .. Shitlist:GetWebsite()
+ },
+ }
+ }
+ }
+ },
+ Settings = {
+ type = "group",
+ order = 1,
+ name = L["SHITLIST_SETTINGS_TITLE"],
+ inline = true,
+ childGroups = "tab",
+ handler = Shitlist,
+ args = {
+ minimap = {
+ name = L["SHITLIST_SETTINGS_MINIMAP"],
+ order = 1,
+ type = "group",
+ inline = true,
+ args = {
+ minimapToggle = {
+ type = "toggle",
+ order = 0,
+ name = L["SHITLIST_SETTINGS_MINIMAP_ICON"],
+ desc = L["SHITLIST_SETTINGS_MINIMAP_ICON_DESC"],
+ get = function(info)
+ return Shitlist.db.profile.minimap.hide;
+ end,
+ set = function(info, value)
+ Shitlist.db.profile.minimap.hide = value;
+ Shitlist:RefreshConfig();
+ end
+ },
+ minimapPos = {
+ type = "range",
+ order = 1,
+ name = L["SHITLIST_SETTINGS_MINIMAP_POS"],
+ desc = L["SHITLIST_SETTINGS_MINIMAP_POS_DESC"],
+ width = 1.5,
+ get = function(info)
+ return Shitlist.db.profile.minimap.minimapPos;
+ end,
+ set = function(info, value)
+ Shitlist.db.profile.minimap.minimapPos = value;
+ Shitlist:RefreshConfig();
+ end,
+ min = 0,
+ max = 360,
+ step = 1,
+ },
+ },
+ },
+ announcement = {
+ name = L["SHITLIST_SETTINGS_ANNOUNCEMENT"],
+ order = 2,
+ type = "group",
+ inline = true,
+ width = 0.5,
+ get = "GetAnnouncement",
+ set = "SetAnnouncement",
+ args = {
+ description = {
+ type = "description",
+ order = 0,
+ name = L["SHITLIST_SETTINGS_ANNOUNCEMENT_DESC"],
+ },
+ guild = {
+ type = "toggle",
+ order = 1,
+ name = L["SHITLIST_SETTINGS_ANNOUNCEMENT_GUILD"],
+ desc = L["SHITLIST_SETTINGS_ANNOUNCEMENT_GUILD_DESC"],
+ width = 0.5
+ },
+ party = {
+ type = "toggle",
+ order = 2,
+ name = L["SHITLIST_SETTINGS_ANNOUNCEMENT_PARY"],
+ desc = L["SHITLIST_SETTINGS_ANNOUNCEMENT_PARY_DESC"],
+ width = 0.5
+ },
+ raid = {
+ type = "toggle",
+ order = 3,
+ name = L["SHITLIST_SETTINGS_ANNOUNCEMENT_RAID"],
+ desc = L["SHITLIST_SETTINGS_ANNOUNCEMENT_RAID_DESC"],
+ width = 0.5
+ },
+ instance = {
+ type = "toggle",
+ order = 4,
+ name = L["SHITLIST_SETTINGS_ANNOUNCEMENT_INSTANCE"],
+ desc = L["SHITLIST_SETTINGS_ANNOUNCEMENT_INSTANCE_DESC"],
+ width = 0.65
+ }
+ }
+ },
+ alert = {
+ name = L["SHITLIST_SETTINGS_ALERT"],
+ order = 3,
+ type = "group",
+ inline = true,
+ width = 0.5,
+ get = "GetAlert",
+ set = "SetAlert",
+ args = {
+ description = {
+ type = "description",
+ order = 0,
+ name = L["SHITLIST_SETTINGS_ALERT_DESC"]
+ },
+ enabled = {
+ type = "toggle",
+ order = 1,
+ name = L["SHITLIST_SETTINGS_ALERT_ENABLED"],
+ desc = L["SHITLIST_SETTINGS_ALERT_ENABLED_DESC"],
+ width = 0.5
+ },
+ sounds = {
+ type = "select",
+ order = 2,
+ name = L["SHITLIST_SETTINGS_ALERT_SOUNDS"],
+ desc = L["SHITLIST_SETTINGS_ALERT_SOUNDS_DESC"],
+ values = function()
+ return Shitlist.db.profile.alert.sounds
+ end,
+ width = 1,
+ set = "SetAlertSoundEffect",
+ get = "GetAlertSoundEffect",
+ },
+ delay = {
+ type = "range",
+ order = 3,
+ min = 1,
+ max = 60,
+ step = 1,
+ name = L["SHITLIST_SETTINGS_ALERT_DELAY"],
+ desc = L["SHITLIST_SETTINGS_ALERT_DELAY_DESC"],
+ width = 1
+ }
+ }
+ }
+ }
+ },
+ Reasons = {
+ type = "group",
+ order = 2,
+ name = L["SHITLIST_REASONS_TITLE"],
+ inline = false,
+ handler = Shitlist,
+ args = {
+ description = {
+ type = "description",
+ order = 0,
+ width = "full",
+ name = L["SHITLIST_REASON_DESCRIPTION"]
+ },
+ id = {
+ type = "select",
+ order = 1,
+ width = 1.6,
+ name = L["SHITLIST_REASONS"],
+ values = function()
+ local _return = {}
+ for key, value in pairs(Shitlist.db.profile.reasons) do
+ _return[key] = value.reason
+ end
+ return _return
+ end,
+ get = "GetReasonSelected",
+ set = "SetReasonSelected",
+ },
+ remove = {
+ type = "execute",
+ order = 2,
+ width = 1,
+ cmdHidden = true,
+ name = L["SHITLIST_REASON_REMOVE"],
+ confirm = function()
+ return L["SHITLIST_REASON_REMOVE_CONFIRMATION"] .. Shitlist.db.profile.reason.reason .. "|cffffffff?";
+ end,
+ func = "RemoveReason",
+ disabled = function()
+ if (Shitlist.db.profile.reason.id <= #Shitlist.defaults.profile.reasons) then
+ return true
+ end
+ return false
+ end
+ },
+ reason = {
+ type = "input",
+ order = 3,
+ name = L["SHITLIST_REASON"],
+ width = 2.6,
+ get = "GetReason",
+ set = "SetReason",
+ },
+ color = {
+ type = "color",
+ order = 4,
+ width = 1.5,
+ name = L["SHITLIST_REASON_COLOR"],
+ hasAlpha = false,
+ get = "GetReasonColor",
+ set = "SetReasonColor",
+ },
+ alert = {
+ type = "toggle",
+ order = 5,
+ width = 1,
+ name = L["SHITLIST_REASON_ALERT_ENABLED"],
+ desc = L["SHITLIST_REASON_ALERT_ENABLED_DESC"],
+ get = "GetReasonAlert",
+ set = "SetReasonAlert",
+ },
+ }
+ },
+ ListedPlayers = {
+ type = "group",
+ order = 3,
+ name = L["SHITLIST_LISTED_PLAYERS_TITLE"],
+ inline = true,
+ handler = Shitlist,
+ args = {
+ id = {
+ type = "select",
+ order = 1,
+ width = 1.6,
+ name = L["SHITLIST_LISTED_PLAYERS"],
+ values = function()
+ local _return = {}
+ for key, value in pairs(Shitlist:GetListedPlayers()) do
+ _return[key] = value.name .. "-" .. value.realm
+ end
+ return _return
+ end,
+ get = "GetListedPlayerSelected",
+ set = "SetListedPlayerSelected",
+ },
+ remove = {
+ type = "execute",
+ order = 2,
+ width = 1,
+ cmdHidden = true,
+ name = L["SHITLIST_LISTED_PLAYER_REMOVE"],
+ confirm = function()
+ return L["SHITLIST_LISTED_PLAYER_REMOVE_CONFIRMATION"] ..
+ Shitlist.db.profile.listedPlayer.name ..
+ "-" .. Shitlist.db.profile.listedPlayer.realm .. "|cffffffff?";
+ end,
+ func = "RemoveListedPlayer",
+ },
+ name = {
+ type = "input",
+ order = 3,
+ name = L["SHITLIST_LISTED_PLAYER_NAME"],
+ width = 1.25,
+ get = "GetListedPlayerName",
+ set = "SetListedPlayerName",
+ },
+ realm = {
+ type = "input",
+ order = 4,
+ name = L["SHITLIST_LISTED_PLAYER_REALM"],
+ width = 1.25,
+ get = "GetListedPlayerRealm",
+ set = "SetListedPlayerRealm",
+ },
+ reason = {
+ type = "select",
+ order = 5,
+ width = 2.6,
+ name = L["SHITLIST_LISTED_PLAYER_REASON"],
+ values = function()
+ local _return = {}
+ for key, value in pairs(Shitlist:GetReasons()) do
+ _return[key] = value.reason
+ end
+ return _return
+ end,
+ get = "GetListedPlayerSelectedReason",
+ set = "SetListedPlayerSelectedReason",
+ },
+ description = {
+ type = "input",
+ order = 6,
+ name = L["SHITLIST_LISTED_PLAYER_DESCRIPTION"],
+ width = 2.6,
+ get = "GetListedPlayerSelectedDescription",
+ set = "SetListedPlayerSelectedDescription",
+ },
+ color = {
+ type = "color",
+ order = 7,
+ width = 1.5,
+ name = L["SHITLIST_LISTED_PLAYER_COLOR"],
+ hasAlpha = false,
+ get = "GetListedPlayerColor",
+ set = "SetListedPlayerColor",
+ },
+ alert = {
+ type = "toggle",
+ order = 8,
+ width = 1,
+ name = L["SHITLIST_LISTED_PLAYER_ALERT_ENABLED"],
+ desc = L["SHITLIST_LISTED_PLAYER_ALERT_ENABLED_DESC"],
+ get = "GetListedPlayerAlert",
+ set = "SetListedPlayerAlert",
+ disabled = function()
+ return not Shitlist.db.profile.reasons[Shitlist.db.profile.listedPlayer.reason].alert
+ end,
+ },
+ }
+ }
+}
+
+
+--#region Announcement
+
+function Shitlist:GetAnnouncement(info)
+ return self.db.profile.announcement[info[#info]]
+end
+
+function Shitlist:SetAnnouncement(info, value)
+ self.db.profile.announcement[info[#info]] = value
+end
+
+--#endregion
+
+
+--#region Sound
+
+function Shitlist:GetAlert(info)
+ return self.db.profile.alert[info[#info]]
+end
+
+function Shitlist:SetAlert(info, value)
+ self.db.profile.alert[info[#info]] = value
+end
+
+--#endregion
+
+
+--#region Reasons
+
+--[[
+ Returns all reasons
+]]
+--
+function Shitlist:GetReasons()
+ return self.db.profile.reasons
+end
+
+function Shitlist:GetReasonSelected(info)
+ return self.db.profile.reason[info[#info]]
+end
+
+function Shitlist:SetReasonSelected(info, value)
+ local r = self.db.profile.reasons[value]
+ if (not r) then
+ return
+ end
+ self.db.profile.reason[info[#info]] = value
+ self.db.profile.reason.reason = r.reason
+ self.db.profile.reason.color = r.color
+ self.db.profile.reason.alert = r.alert
+end
+
+function Shitlist:GetReason(info)
+ return self.db.profile.reason[info[#info]]
+end
+
+function Shitlist:SetReason(info, value)
+ self.db.profile.reason[info[#info]] = value
+ if (self.db.profile.reasons[self.db.profile.reason.id].reason == value) then
+ return
+ else
+ tinsert(self.db.profile.reasons,
+ #self.db.profile.reasons + 1,
+ {
+ id = #self.db.profile.reasons + 1,
+ reason = value,
+ color = { r = 1, g = 1, b = 1 },
+ alert = true
+ })
+ self.db.profile.reason.id = #self.db.profile.reasons
+ -- self.db.profile.reason.color = { r = 1, g = 1, b = 1 }
+ -- self.db.profile.reason.alert = { r = 1, g = 1, b = 1 }
+ self:SetReasonSelected(info, self.db.profile.reason.id)
+ self:GetReasonSelected(info)
+ end
+end
+
+function Shitlist:RemoveReason()
+ tremove(Shitlist.db.profile.reasons, Shitlist.db.profile.reason.id)
+ --Shitlist.db.profile.reasons[Shitlist.db.profile.reason.id] = nil
+ local reasons = Shitlist:GetReasons()
+ Shitlist.db.profile.reason.id = #reasons
+ Shitlist.db.profile.reason.reason = reasons[#reasons].reason
+ Shitlist.db.profile.reason.color = reasons[#reasons].color
+ Shitlist.db.profile.reason.alert = reasons[#reasons].alert
+ return true;
+end
+
+function Shitlist:GetReasonColor(info)
+ local c = self.db.profile.reason[info[#info]]
+ return c.r or 1, c.g or 1, c.b or 1
+end
+
+function Shitlist:SetReasonColor(info, r, g, b)
+ local c = self.db.profile.reason[info[#info]]
+ c.r, c.g, c.b = r or 1, g or 1, b or 1
+end
+
+function Shitlist:GetReasonAlert(info)
+ return self.db.profile.reason[info[#info]]
+end
+
+function Shitlist:SetReasonAlert(info, value)
+ self.db.profile.reason[info[#info]] = value
+ local reason = self:GetReasons()[self.db.profile.reason.id]
+ reason.alert = value
+end
+
+--#endregion
+
+
+--#region Listed Players
+
+--[[
+ Returns all listed players
+]]
+--
+function Shitlist:GetListedPlayers()
+ return self.db.profile.listedPlayers
+end
+
+function Shitlist:GetListedPlayer(name, realm)
+ for index, value in pairs(self.db.profile.listedPlayers) do
+ if (tostring(name) == value.name and tostring(realm) == value.realm) then
+ return self.db.profile.listedPlayers[index]
+ end
+ end
+ return nil
+end
+
+function Shitlist:GetListedPlayerSelected(info)
+ return self.db.profile.listedPlayer[info[#info]]
+end
+
+function Shitlist:SetListedPlayerSelected(info, value)
+ self.db.profile.listedPlayer[info[#info]] = value
+ local player = self.db.profile.listedPlayers[self.db.profile.listedPlayer.id]
+ if (player) then
+ self.db.profile.listedPlayer.id = value
+ self.db.profile.listedPlayer.name = player.name
+ self.db.profile.listedPlayer.realm = player.realm
+ self.db.profile.listedPlayer.reason = player.reason
+ self.db.profile.listedPlayer.description = player.description
+ self.db.profile.listedPlayer.color = player.color
+ self.db.profile.listedPlayer.alert = player.alert
+ end
+end
+
+function Shitlist:GetListedPlayerRealm(info)
+ return self.db.profile.listedPlayer[info[#info]]
+end
+
+function Shitlist:SetListedPlayerRealm(info, value)
+ self.db.profile.listedPlayer[info[#info]] = value
+ local player = Shitlist:GetListedPlayers()[self.db.profile.listedPlayer.id]
+ --local player = Shitlist:GetListedPlayer(self.db.profile.listedPlayer.name, value)
+ if (player) then
+ player.id = self.db.profile.listedPlayer.id
+ player.name = self.db.profile.listedPlayer.name
+ player.realm = value
+ player.reason = self.db.profile.listedPlayer.reason
+ player.description = self.db.profile.listedPlayer.description
+ player.color = self.db.profile.listedPlayer.color
+ player.alert = self.db.profile.listedPlayer.alert
+ end
+end
+
+function Shitlist:GetListedPlayerName(info)
+ return self.db.profile.listedPlayer[info[#info]]
+end
+
+function Shitlist:SetListedPlayerName(info, value)
+ self.db.profile.listedPlayer[info[#info]] = value
+ --local player = Shitlist:GetListedPlayers()[self.db.profile.listedPlayer.id]
+ local player = Shitlist:GetListedPlayer(value, self.db.profile.listedPlayer.realm)
+ if (player) then
+ player.id = self.db.profile.listedPlayer.id
+ player.name = value
+ player.realm = self.db.profile.listedPlayer.realm
+ player.reason = self.db.profile.listedPlayer.reason
+ player.description = self.db.profile.listedPlayer.description
+ player.color = self.db.profile.listedPlayer.color
+ player.alert = self.db.profile.listedPlayer.alert
+ else
+ local new = Shitlist:NewListedPlayer(value, self.db.profile.listedPlayer.realm)
+ Shitlist:SetListedPlayerSelected(info, new.id)
+ Shitlist:GetListedPlayerSelected(info)
+ end
+end
+
+function Shitlist:RemoveListedPlayer()
+ tremove(self.db.profile.listedPlayers, self.db.profile.listedPlayer.id)
+ local listedPlayers = Shitlist:GetListedPlayers()
+ self.db.profile.listedPlayer.id = #listedPlayers
+ self.db.profile.listedPlayer.name = listedPlayers[#listedPlayers].name
+ self.db.profile.listedPlayer.realm = listedPlayers[#listedPlayers].realm
+ self.db.profile.listedPlayer.reason = listedPlayers[#listedPlayers].reason
+ self.db.profile.listedPlayer.description = listedPlayers[#listedPlayers].description
+ self.db.profile.listedPlayer.color = listedPlayers[#listedPlayers].color
+ self.db.profile.listedPlayer.alert = listedPlayers[#listedPlayers].alert
+ return true
+end
+
+function Shitlist:GetListedPlayerSelectedReason(info)
+ return self.db.profile.listedPlayer[info[#info]]
+end
+
+function Shitlist:SetListedPlayerSelectedReason(info, value)
+ self.db.profile.listedPlayer[info[#info]] = value
+ local player = Shitlist:GetListedPlayers()[self.db.profile.listedPlayer.id]
+ player.reason = value
+end
+
+function Shitlist:GetListedPlayerSelectedDescription(info)
+ return self.db.profile.listedPlayer[info[#info]]
+end
+
+function Shitlist:SetListedPlayerSelectedDescription(info, value)
+ self.db.profile.listedPlayer[info[#info]] = value
+ local player = Shitlist:GetListedPlayers()[self.db.profile.listedPlayer.id]
+ player.description = value
+end
+
+function Shitlist:GetListedPlayerColor(info)
+ local c = self.db.profile.listedPlayer[info[#info]]
+ return c.r or 1, c.g or 1, c.b or 1
+end
+
+function Shitlist:SetListedPlayerColor(info, r, g, b)
+ local c = self.db.profile.listedPlayer[info[#info]]
+ c.r, c.g, c.b = r or 1, g or 1, b or 1
+end
+
+function Shitlist:NewListedPlayer(name, realm, reason, description)
+ self.db.profile.listedPlayer.id = #self.db.profile.listedPlayers + 1
+ local newPlayer = {
+ id = self.db.profile.listedPlayer.id,
+ name = name or self.db.profile.listedPlayer.name,
+ realm = realm or self.db.profile.listedPlayer.realm,
+ reason = reason or 1,
+ description = description or "",
+ color = { r = 1, g = 1, b = 1 },
+ alert = true
+ }
+ tinsert(self.db.profile.listedPlayers, self.db.profile.listedPlayer.id, newPlayer)
+ return newPlayer
+end
+
+function Shitlist:GetListedPlayerAlert(info)
+ return self.db.profile.listedPlayer[info[#info]]
+end
+
+function Shitlist:SetListedPlayerAlert(info, value)
+ self.db.profile.listedPlayer[info[#info]] = value
+ local player = Shitlist:GetListedPlayers()[self.db.profile.listedPlayer.id]
+ player.alert = value
+end
+
+--#endregion
+
+function Shitlist:GetAlertSoundEffect(info)
+ return self.db.profile.alert.sound
+end
+
+function Shitlist:SetAlertSoundEffect(info, value)
+ self:PlayAlertEffect(value)
+ self.db.profile.alert.sound = value
+end
+
+function Shitlist:PlayAlertEffect(effect, channel)
+ PlaySoundFile(
+ "Interface\\AddOns\\" ..
+ shitlist .. "\\Sounds\\" .. Shitlist.db.profile.alert.sounds[effect or self:GetAlertSoundEffect()] .. ".ogg",
+ channel or "master"
+ )
+end
diff --git a/ShitlistUtils.lua b/ShitlistUtils.lua
new file mode 100644
index 0000000..e41a53c
--- /dev/null
+++ b/ShitlistUtils.lua
@@ -0,0 +1,61 @@
+local shitlist = ...
+local L = LibStub("AceLocale-3.0"):GetLocale(shitlist, true)
+
+function Shitlist:GetVersion()
+ return tostring(GetAddOnMetadata(shitlist, "Version")) or L["SHITLIST_NA"];
+end
+
+function Shitlist:GetTitle()
+ return GetAddOnMetadata(shitlist, "Title") or L["SHITLIST_NA"];
+end
+
+function Shitlist:GetAuthor()
+ return GetAddOnMetadata(shitlist, "Author") or L["SHITLIST_NA"];
+end
+
+function Shitlist:GetNotes()
+ return GetAddOnMetadata(shitlist, "Notes") or L["SHITLIST_NA"];
+end
+
+function Shitlist:GetLocalizations()
+ return GetAddOnMetadata(shitlist, "X-Localizations") or L["SHITLIST_NA"];
+end
+
+function Shitlist:GetCategory()
+ return GetAddOnMetadata(shitlist, "X-Category") or L["SHITLIST_NA"];
+end
+
+function Shitlist:GetWebsite()
+ return GetAddOnMetadata(shitlist, "X-Website") or L["SHITLIST_NA"];
+end
+
+function Shitlist:GetLicense()
+ return GetAddOnMetadata(shitlist, "X-License") or L["SHITLIST_NA"];
+end
+
+function Shitlist:AceGUIDefaults()
+ local aceGUI = LibStub("AceGUI-3.0"):Create("Frame")
+ aceGUI:SetCallback("OnClose", function(widget) aceGUI:Release() end)
+ aceGUI:SetLayout("Fill")
+ aceGUI:SetStatusText(nil)
+ aceGUI.statustext:Hide()
+ aceGUI.statustext:GetParent():Hide()
+ aceGUI:Hide()
+ return aceGUI
+end
+
+function Shitlist:Print(...)
+ if (self.db and self.db.profile.debug) then
+ return print(L["SHITLIST_DEBUG"], ...)
+ end
+ return print(L["SHITLIST_PRINT"], ...)
+end
+
+--@debug@
+function Shitlist:PrintDebug(...)
+ if (self.db and self.db.profile.debug) then
+ self:Print(...)
+ end
+end
+
+--@end-debug@
diff --git a/Shitlist_Vanilla.toc b/Shitlist_Vanilla.toc
new file mode 100644
index 0000000..9b5428c
--- /dev/null
+++ b/Shitlist_Vanilla.toc
@@ -0,0 +1,22 @@
+## Interface: 11500
+## Title : Shitlist
+## Notes: Set a personal comment on players and adding it to player information tooltip window.
+## Author: Limmek
+## Version: @project-version@
+## Dependencies:
+## OptionalDeps: Ace3, LibStub, LibDataBroker-1.1, LibDBIcon-1.0, LibUIDropDownMenu, CallbackHandler-1.0
+## SavedVariables: ShitlistDB
+## DefaultState: enabled
+## X-Category: Tooltip, Miscellaneous, PvP, Quests & Leveling, Unit Frames
+## X-Curse-Project-ID: 344967
+## X-Localizations: enUS
+## X-Website: https://github.com/Limmek/Shitlist
+## X-License: MIT
+
+embeds.xml
+
+Locales\Locales.xml
+
+Shitlist.lua
+ShitlistUtils.lua
+ShitlistConfig.lua
diff --git a/Shitlist_Wrath.toc b/Shitlist_Wrath.toc
new file mode 100644
index 0000000..87c6319
--- /dev/null
+++ b/Shitlist_Wrath.toc
@@ -0,0 +1,22 @@
+## Interface: 30403
+## Title : Shitlist
+## Notes: Set a personal comment on players and adding it to player information tooltip window.
+## Author: Limmek
+## Version: @project-version@
+## Dependencies:
+## OptionalDeps: Ace3, LibStub, LibDataBroker-1.1, LibDBIcon-1.0, LibUIDropDownMenu, CallbackHandler-1.0
+## SavedVariables: ShitlistDB
+## DefaultState: enabled
+## X-Category: Tooltip, Miscellaneous, PvP, Quests & Leveling, Unit Frames
+## X-Curse-Project-ID: 344967
+## X-Localizations: enUS
+## X-Website: https://github.com/Limmek/Shitlist
+## X-License: MIT
+
+embeds.xml
+
+Locales\Locales.xml
+
+Shitlist.lua
+ShitlistUtils.lua
+ShitlistConfig.lua
diff --git a/Shitlist/Sounds/alarmbeep.ogg b/Sounds/alarmbeep.ogg
similarity index 100%
rename from Shitlist/Sounds/alarmbeep.ogg
rename to Sounds/alarmbeep.ogg
diff --git a/Shitlist/Sounds/alarmbuzz.ogg b/Sounds/alarmbuzz.ogg
similarity index 100%
rename from Shitlist/Sounds/alarmbuzz.ogg
rename to Sounds/alarmbuzz.ogg
diff --git a/Shitlist/Sounds/alarmbuzzer.ogg b/Sounds/alarmbuzzer.ogg
similarity index 100%
rename from Shitlist/Sounds/alarmbuzzer.ogg
rename to Sounds/alarmbuzzer.ogg
diff --git a/Shitlist/Sounds/alarmdouble.ogg b/Sounds/alarmdouble.ogg
similarity index 100%
rename from Shitlist/Sounds/alarmdouble.ogg
rename to Sounds/alarmdouble.ogg
diff --git a/changelog.txt b/changelog.txt
new file mode 100644
index 0000000..0ef6801
--- /dev/null
+++ b/changelog.txt
@@ -0,0 +1,2 @@
+v2.0.0
+ Complete rewrite of the addon.
diff --git a/embeds.xml b/embeds.xml
new file mode 100644
index 0000000..3f82457
--- /dev/null
+++ b/embeds.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/luaformat.cfg b/luaformat.cfg
deleted file mode 100644
index 57f83a6..0000000
--- a/luaformat.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-max_line_length: false
-indent_width: 2
-continuation_indent_width: 2
-keep_simple_block_one_line: false
\ No newline at end of file