diff --git a/CHANGELOG.md b/CHANGELOG.md
index b17da0b..4948570 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,406 +1,5 @@
# CHANGELOG
-## Version 80200.04
-
-- Added an option to show currency losses. Disabled by default;
-- Added fragment toasts to the "Archaeology" group;
-- Updated Simplified Chinese translation. Translated by vk1103ing@Curse;
-- Updated Traditional Chinese translation. Translated by BNS333@Curse.
-
-## Version 80200.03
-
-- Re-added copper threshold to gold toasts;
-- Made gold loss tracking optional. Enabling this feature will make gold toasts ignore set copper
- threshold. Disabled by default;
-- Updated German translation. Translated by Merathilis@Curse;
-- Updated Korean translation. Translated by netaras@Curse;
-- Updated Spanish translations. Translated by Gotxiko@Curse;
-- Updated Traditional Chinese translation. Translated by BNS333@Curse.
-
-## Version 80200.02
-
-- Rewrote gold toasts to display money gains and losses. Removed the copper threshold option
- because it's interfering with the new functionality;
-- Updated embeds.
-
-## Version 80200.01
-
-- Added 8.2.0 support;
-- Added Ctrl-Left-Click support to transmog, toy, mount, and item toasts to show the dressing room
- frame;
-- Updated embeds.
-
-## Version 80100.10
-
-- Added "ToastCreated", "ToastSpawned", and "ToastReleased" callbacks. As always, callbacks use
- CallbackHandler-1.0;
-- Renamed toasts' Recycle method to Release. Recycle is still available, but is deprecated;
-- Renamed "SetSkin" and "ResetSkin" callbacks to "SkinSet" and "SkinReset". "SetSkin" and
- "ResetSkin" are still available, but are deprecated;
-- Fixed toasts' border's tiling;
-- Updated embeds.
-
-## Version 80100.09
-
-- Updated anchors' config code.
-
-## Version 80100.08
-
-- Added a workaround for a Blizz bug which prevents item tooltips from being rendered correctly.
-
-## Version 80100.07
-
-- Added 8.1.5 support.
-
-## Version 80100.06
-
-- Fixed an issue where multiple transmog toasts were shown for different sources of the same
- appearance. It's mainly occurring when turning in the weekly conquest quest.
-
-## Version 80100.05
-
-- Fixed an issue where world quest toasts wouldn't show the rewards;
-- Tweaked achievement toasts. Added tooltips, guild achievements' toasts will now use "Guild
- Achievement Earned" as their title;
-- Updated German translation. Translated by Merathilis@Curse;
-- Updated Traditional Chinese translation. Translated by BNSSNB@Curse;
-- Updated embeds.
-
-## Version 80100.04
-
-- Added "SetSkin" and "ResetSkin" callbacks. Use these if you hooked my ApplySkin method to modify toasts'
- appearance since ApplySkin no longer exists. Callbacks use CallbackHandler-1.0, so something like
- `ls_Toasts[1].RegisterCallback({}, "SetSkin", function(callbackName, toast) end)` should do the trick;
-- Updated Traditional Chinese translation. Translated by BNSSNB@Curse;
-- Misc performance and memory optimisations.
-
-## Version 80100.03
-
-- Added support for multiple toast anchors. Each anchor has its own growth, scale, and other
- settings;
-- Added options to adjust toast growth offsets.
-
-## Version 80100.02
-
-- Improved compatibility with addons that modify chat messages which are used by common loot and
- currency toasts.
-
-## Version 80100.01
-
-- Added 8.1.0 support;
-- Slightly reorganised in-game config;
-- Fixed common loot toasts. Items created via professions and scrapping should be handled
- correctly once again.
-
-## Version 80000.06
-
-- Added "Default (Legacy)" and "ElvUI (Legacy)" skins that use old texture backgrounds;
-- Updated Simplified Chinese translation. Translated by dxlmike@Curse.
-
-## Version 80000.05
-
-- Updated the default background texture. Retired all other backgrounds, but I'll eventually
- redraw some of them in higher resolution;
-- Updated included ElvUI skins;
-- Updated Korean translation. Translated by next96@Curse.
-
-## Version 80000.04
-
-- Reduced anchor frame's offsets to 4px. Now you can move toasts closer to the screen edge;
-- Updated Simplified Chinese translation. Translated by y368413@Curse;
-- Updated Traditional Chinese translation. Translated by gaspy10@Curse;
-- Updated embeds.
-
-## Version 80000.03
-
-- Fixed an issue where the addon would try to show a toast for an item whose data wasn't available.
-
-## Version 80000.02
-
-- Updated Spanish translations. Translated by Gotzon@Curse;
-- Updated Traditional Chinese translation. Translated by gaspy10@Curse;
-- Updated embeds.
-
-## Version 80000.01
-
-- Added 8.0.1 support;
-- Added War Effort (BfA garrison) toasts;
-- Added partial Latin American Spanish translation. Copied from Spanish;
-- Updated German translation. Translated by staratnight@Curse;
-- Updated French translation. Translated by Daniel8513@Curse;
-- Updated embeds.
-
-## Version 70300.10
-
-- Updated Traditional Chinese translation.
-
-## Version 70300.09
-
-- Reworked slots for additional rewards;
-- Updated Korean translation. Translated by next96@Curse;
-- Updated Traditional Chinese translation. Translated by gaspy10@Curse.
-
-## Version 70300.08
-
-- Fixed libs' loading order.
-
-## Version 70300.07
-
-- Reworked skin engine. Added new toast and icon border textures. Added two basic ElvUI-like skins;
-- Reworked sound controls. Now each toast group has its own SFX toggle;
-- Embedded LibSharedMedia. Added font and font size controls;
-- Added buttons for 1px adjustment to toast anchor frame;
-- Added rarity threshold control for border and text colouring;
-- Fixed issue which caused loot toast duplicates to appear;
-- Updated Russian translation.
-
-NOTE: You'll have to restart WoW client to make things work after the update.
-
-## Version 70300.06
-
-- Improved compatibility with other addons that override UI elements' alpha, e.g., Immersion;
-- Increased max fade-out delay to 10 seconds;
-- Fixed "Handle Left Click" option for transmog toasts;
-- Updated Korean translation. Translated by next96@Curse;
-- Updated Traditional Chinese translation. Translated by gaspy10@Curse.
-
-## Version 70300.05
-
-- Fixed DND option. Previously it's disabling toast group entirely;
-- Re-added click handler to collection toasts;
-- Locked collection and transmog toasts' left click handling behind config option. Both may cause UI errors in combat if enabled, but people like being able to click them regardless;
-- Updated German translation. Translated by pas06@Curse.
-
-## Version 70300.04
-
-- Removed click handler from collection toasts. It taints Blizz code too much;
-- Updated Korean translation. Translated by yuk6196@Curse;
-- Updated Simplified Chinese translation. Translated by y368413@Curse;
-- Updated Traditional Chinese translation. Translated by gaspy10@Curse.
-
-## Version 70300.03
-
-- Fixed errors caused by toasts' click handlers. Sadly, as of now you won't be able to open UI panels via clicking related toasts while in combat;
-- Fixed taint issue caused by toy toast;
-- Added French translation. Translated by cyberlinkfr@Curse;
-- Updated German translation. Translated by pas06@Curse;
-
-NOTE: I reorganised folder structure, so you'll have to restart WoW client to make things work after the update.
-
-## Version 70300.02
-
-- Fixed toast fade out animation bug.
-
-## Version 70300.01
-
-- Added options to control border and icon border colouring;
-- Added new toast type: Collection. Includes toasts for mounts, pets and toys;
-- Fixed item count text. If item count it 1, it's hidden;
-- Updated German translation. Translated by pas06@Curse;
-- Updated Korean translation. Translated by yuk6196@Curse;
-- Updated Russian translation;
-- Updated Simplified Chinese translation. Translated by y368413@Curse;
-- Updated Traditional Chinese translation. Translated by gaspy10@Curse;
-- Misc bug fixes and tweaks.
-
-## Version 70200.11
-
-- Exposed `L` table. Will be useful for plugin devs;
-- Added option to show quest item toasts regardless of their quality;
-- Added Simplified Chinese translation. Translated by y368413@Curse;
-- Updated Traditional Chinese translation. Translated by gaspy10@Curse;
-- Updated Korean translation. Translated by yuk6196@Curse;
-- Updated Russian translation;
-- Misc bug fixes and tweaks.
-
-## Version 70200.10
-
-- Project overhaul. New in-game config;
-- Added option to change toasts' strata;
-- Added option to show ilvl;
-- Moved gold toasts to a separate group: Loot (Gold);
-- Numerous bug fixes and tweaks.
-
-NOTE: Now this addon is more of a framework, others can hook up to it to show toasts. All built-in toast groups are written as plugins, so you may use them as ref.
-
-## Version 70200.09
-
-- Added 7.2.5 support.
-
-## Version 70200.08
-
-- Fixed toast tooltips;
-- Updated Korean translation. Translated by yuk6196@Curse;
-- Updated Russian translation.
-
-## Version 70200.07
-
-- Re-release of 70200.05;
-- Fixed in-game config issue that led to client freeze.
-
-## Version 70200.06
-
-- Rollback. 70200.05 never happened.
-
-## Version 70200.05
-
-- Reworked skins. All existing skins should work just for now, but you'll have to enable the skin of your choice via in-game config. Skin devs should make some minor adjustments;
-- Added countermeasures to limit bloat caused by transmog toasts.
-
-## Version 70200.04
-
-- Fixed bonus roll toast issues.
-
-## Version 70200.03
-
-- Added item toasts stacking. Toasts for identical items that were triggered by the same events will now stack. If two items have similar names, but have different item links and/or come from different events, for example, "CHAT_MSG_LOOT" and "SHOW_LOOT_TOAST", they'll be shown as two different toasts;
-- Added Russian translation. Translated by BLizzatron@Cruse and me;
-- Misc tweaks.
-
-## Version 70200.02
-
-- Fixed transmog toast issue;
-- Fixed profession world quest toast issue;
-- Misc tweaks.
-
-## Version 70200.01
-
-- New version format: INTERFACE_VERSION.PATCH;
-- Added 7.2 support;
-- Added special loot item quality threshold drop down;
-- Added Spanish translation. Translated by Gotxiko@GitHub;
-- Updated Traditional Chinese translation. Translated by BNSSNB@Curse.
-
-## Version 1.24
-
-- Added "ls: Toasts" config entry w/ "Enable" button to interface options panel. However, It doesn't change the fact that you still need to reload UI after you're done setting up the addon, hence I also added "Reload UI" button;
-- Disabled common loot and currency string checks. Hopefully new patterns will perform better, but if I start getting reports about party/raid member loot toasts again, I'll re-enable them;
-- Changed addon name's colour so it'll no longer interfere w/ addon list sorting;
-- Updated Korean translation. Translated by yuk6196@Curse;
-- Updated German translation. Translated by pas06@Curse;
-- Numerous bug fixes and tweaks.
-
-## Version 1.23
-
-- First attempt to address issue that made some people receive party/raid members' loot toasts. As of this version if addon detects that necessary variables were modified by another addon, it'll disable common loot and/or currency toasts, you'll be able to see which variables were modified and what addon did it in in-game config. Addon will also start checking if `CHAT_MSG_LOOT`'s 5th param (target) is the same as player's name;
-- Updated German translation. Translated by pas06@Curse.
-
-NOTE: Warning preview. !test is my test addon.
-![image](http://i.imgur.com/SVPzRN8.png)
-
-## Version 1.22
-
-- Fixed in-game config.
-
-## Version 1.21
-
-- Reworked profile manager. Sadly, I had to reset all settings;
-- Added public methods to create, delete, set, and reset profiles. This feature is for addon devs. For more info, read [here](https://github.com/ls-/ls_Toasts#how-to-mod);
-- Removed config from global `ls_Toasts` table;
-- Updated German translation. Translated by Ithilrandir@Curse.
-
-## Version 1.20
-
-- NEW! Added rated PvP reward toast;
-- Added partial German translation. Translated by pas06@Curse;
-- Added Traditional Chinese translation. Translated by BNSSNB@Curse;
-- Updated Korean translation. Translated by yuk6196@Curse;
-- Fixed issues in anchor frame code.
-
-## Version 1.19
-
-- Improved compatibility with other addons that use default alert system to show custom toasts.
-
-## Version 1.18
-
-- Added localisation support. Korean translation by WetU@GitHub;
-- Fixed issue in reward button code;
-- Fixed issue in follower/champion tooltip code.
-
-## Version 1.17
-
-- Fixed compatibility issues with ElvUI.
-
-## Version 1.16
-
-- Fixed issue that caused transmog toasts not to show proper info;
-- Exposed config to other addons. This feature is for addon devs. For more info, read [here](https://github.com/ls-/ls_Toasts#how-to-mod).
-
-## Version 1.15
-
-- Fixed issue in transmog toast code.
-
-## Version 1.14
-
-- Added 7.1 support;
-- Reworked transmog toasts. Now they show additions and removals of green, blue and epic appearances;
-- Added ilvl upgrade indicator to item toasts.
-
-## Version 1.13
-
-- Added hook to prevent default notifications from being shown;
-- Added comparison tooltip to item toasts. Hold "Shift" key to show it. Original code by p3lim@GitHub.
-
-## Version 1.12
-
-- Added currency toast stacking. Instead of creating new toasts for each currency gain, existing one will be updated;
-- Added skinning support. This feature is for addon devs. For more info, read [here](https://github.com/ls-/ls_Toasts#how-to-reskin).
-
-## Version 1.11
-
-- Fixed handling of caged battle pets.
-
-## Version 1.10
-
-- Added workaround for few taints.
-
-NOTE: **IMPORTANT!** Now there's no ls: Toasts entry in Interface > AddOns section, but you can create one by using **/lstoasts** command. After that you'll be able to access config panel the old way. However, I strongly recommend to **/reload** UI after you're done setting up the addon. Even if you opened and closed config panel without changing anything, **/reload UI**. By doing so, you'll remove config entry from the system and prevent possible taints. Blame Blizzard, not me.
-
-## Version 1.09
-
-- Split "Garrison" toast group into two new groups: "Garrison" and "Class Hall";
-- Moved currency toasts to a new category, "Loot (Currency)";
-- Misc bug fixes and tweaks.
-
-## Version 1.08
-
-- Fixed "SetPortraitToTexture" error.
-
-## Version 1.07
-
-- NEW! Added common loot toasts;
-- Reworked in-game config a bit;
-- Misc bug fixes and tweaks.
-
-## Version 1.06
-
-- NEW! Added transmog toast;
-- NEW! Added an option to colour item, follower names by quality, and world quest, mission titles by rarity. Original code by WetU@GitHub;
-- NEW! Added options for horizontal growth directions;
-- NEW! Added /lstoasts slash command;
-- Fixed missing toast sounds;
-- Misc bug fixes and tweaks.
-
-## Version 1.05
-
-- Fixed anchor frame movement, when it's scaled down.
-
-## Version 1.04
-
-- NEW! Added scaling for toasts;
-- Fixed an issue in fade out delay code.
-
-## Version 1.03
-
-- NEW! Added an option to save settings as a default preset that will be used for all characters;
-- NEW! Added fade out delay slider.
-
-NOTE: Saving settings is an experimental feature, if feedback is negative, I may replace it with a typical profile manager.
-
-## Version 1.02
-
-- Fixed issue in garrison toast test.
-
-## Version 1.01
+## Version 11302.01
- Release released.
diff --git a/README.md b/README.md
index fc45513..b90b1d3 100644
--- a/README.md
+++ b/README.md
@@ -2,25 +2,4 @@
Replacement for the default alert system. Better toasts, cheers!
-![image](https://i.imgur.com/PvzX6VF.gif)
-
-## Download
-
-- [Curse](https://www.curseforge.com/wow/addons/ls-toasts)
-- [WoWInterface](http://www.wowinterface.com/downloads/info24123.html)
-
-## Options
-
-Use **`/LSTOASTS`** or **`/LST`** to open in-game config.
-
-## Feedback and Feature Requests
-
-If you found a bug or want to share an idea on how to improve my addon, either use the issue tracker on [GitHub](https://github.com/ls-/ls_Toasts/issues), or post a comment on [WoWInterfrace](http://www.wowinterface.com/downloads/info24123.html#comments) or [Curse](https://www.curseforge.com/wow/addons/ls-toasts#comments).
-
-## Localisation
-
-Feel free to add and/or review translations on [Curse](https://www.curseforge.com/wow/addons/ls-toasts/localization), alternatively, you may create a PR on [project's GitHub page](https://github.com/ls-/ls_Toasts/pulls).
-
-## License
-
-Please see [LICENSE](https://github.com/ls-/ls_Toasts/blob/master/LICENSE.txt) file.
+Classic WIP.
diff --git a/assets/legacy/toast-bg-alliance.TGA b/assets/legacy/toast-bg-alliance.TGA
deleted file mode 100644
index f9b3132..0000000
Binary files a/assets/legacy/toast-bg-alliance.TGA and /dev/null differ
diff --git a/assets/legacy/toast-bg-archaeology.TGA b/assets/legacy/toast-bg-archaeology.TGA
deleted file mode 100644
index f1318d4..0000000
Binary files a/assets/legacy/toast-bg-archaeology.TGA and /dev/null differ
diff --git a/assets/legacy/toast-bg-azerite.TGA b/assets/legacy/toast-bg-azerite.TGA
deleted file mode 100644
index 9828d96..0000000
Binary files a/assets/legacy/toast-bg-azerite.TGA and /dev/null differ
diff --git a/assets/legacy/toast-bg-collection.TGA b/assets/legacy/toast-bg-collection.TGA
deleted file mode 100644
index f40e738..0000000
Binary files a/assets/legacy/toast-bg-collection.TGA and /dev/null differ
diff --git a/assets/legacy/toast-bg-dungeon.TGA b/assets/legacy/toast-bg-dungeon.TGA
deleted file mode 100644
index 09a9178..0000000
Binary files a/assets/legacy/toast-bg-dungeon.TGA and /dev/null differ
diff --git a/assets/legacy/toast-bg-horde.TGA b/assets/legacy/toast-bg-horde.TGA
deleted file mode 100644
index f1651f4..0000000
Binary files a/assets/legacy/toast-bg-horde.TGA and /dev/null differ
diff --git a/assets/legacy/toast-bg-legion.TGA b/assets/legacy/toast-bg-legion.TGA
deleted file mode 100644
index fe0568e..0000000
Binary files a/assets/legacy/toast-bg-legion.TGA and /dev/null differ
diff --git a/assets/legacy/toast-bg-recipe.TGA b/assets/legacy/toast-bg-recipe.TGA
deleted file mode 100644
index 6b452ca..0000000
Binary files a/assets/legacy/toast-bg-recipe.TGA and /dev/null differ
diff --git a/assets/legacy/toast-bg-store.TGA b/assets/legacy/toast-bg-store.TGA
deleted file mode 100644
index e1fc584..0000000
Binary files a/assets/legacy/toast-bg-store.TGA and /dev/null differ
diff --git a/assets/legacy/toast-bg-transmog.TGA b/assets/legacy/toast-bg-transmog.TGA
deleted file mode 100644
index 6994b13..0000000
Binary files a/assets/legacy/toast-bg-transmog.TGA and /dev/null differ
diff --git a/assets/legacy/toast-bg-upgrade.TGA b/assets/legacy/toast-bg-upgrade.TGA
deleted file mode 100644
index 628f8e4..0000000
Binary files a/assets/legacy/toast-bg-upgrade.TGA and /dev/null differ
diff --git a/assets/legacy/toast-bg-worldquest.TGA b/assets/legacy/toast-bg-worldquest.TGA
deleted file mode 100644
index 775e880..0000000
Binary files a/assets/legacy/toast-bg-worldquest.TGA and /dev/null differ
diff --git a/assets/ui-common-loot-toast.OGG b/assets/ui-common-loot-toast.OGG
new file mode 100644
index 0000000..86b5b12
Binary files /dev/null and b/assets/ui-common-loot-toast.OGG differ
diff --git a/assets/ui-legendary-loot-toast.OGG b/assets/ui-legendary-loot-toast.OGG
new file mode 100644
index 0000000..3508e54
Binary files /dev/null and b/assets/ui-legendary-loot-toast.OGG differ
diff --git a/core/toast.lua b/core/toast.lua
index 089e211..1d14ace 100644
--- a/core/toast.lua
+++ b/core/toast.lua
@@ -17,9 +17,8 @@ local C_Timer = _G.C_Timer
local Lerp = _G.Lerp
--[[ luacheck: globals
- BattlePetTooltip CreateFrame GameTooltip GameTooltip_ShowCompareItem GarrisonFollowerTooltip
- GarrisonShipyardFollowerTooltip GetCVarBool IsModifiedClick PlaySound ShoppingTooltip1
- ShoppingTooltip2 UIParent
+ CreateFrame GameTooltip GameTooltip_ShowCompareItem GetCVarBool IsModifiedClick PlaySound PlaySoundFile
+ ShoppingTooltip1 ShoppingTooltip2 UIParent
]]
-- Mine
@@ -244,7 +243,11 @@ end
local function toast_OnShow(self)
if self._data.sound_file then
- PlaySound(self._data.sound_file)
+ if type(self._data.sound_file) == "number" then
+ PlaySound(self._data.sound_file)
+ elseif type(self._data.sound_file) == "string" then
+ PlaySoundFile(self._data.sound_file)
+ end
end
self.AnimIn:Play()
@@ -281,10 +284,7 @@ local function toast_OnEnter(self)
end
local function toast_OnLeave(self)
- BattlePetTooltip:Hide()
GameTooltip:Hide()
- GarrisonFollowerTooltip:Hide()
- GarrisonShipyardFollowerTooltip:Hide()
ShoppingTooltip1:Hide()
ShoppingTooltip2:Hide()
diff --git a/init.lua b/init.lua
index 489892a..2574e5e 100644
--- a/init.lua
+++ b/init.lua
@@ -10,7 +10,7 @@ local tonumber = _G.tonumber
--[[ luacheck: globals
AlertFrame CreateFrame GetAddOnMetadata InCombatLockdown InterfaceOptions_AddCategory
- InterfaceOptionsFrame_Show InterfaceOptionsFramePanelContainer SlashCmdList
+ InterfaceOptionsFrame_Show InterfaceOptionsFramePanelContainer LibStub SlashCmdList
ITEM_QUALITY_COLORS ITEM_QUALITY1_DESC ITEM_QUALITY2_DESC ITEM_QUALITY3_DESC ITEM_QUALITY4_DESC
ITEM_QUALITY5_DESC LS_TOASTS_CFG LS_TOASTS_CFG_GLOBAL SLASH_LSTOASTS1 SLASH_LSTOASTS2
@@ -36,28 +36,9 @@ local STRATA_INDICES ={
}
local BLACKLISTED_EVENTS = {
- ["ACHIEVEMENT_EARNED"] = true,
- ["AZERITE_EMPOWERED_ITEM_LOOTED"] = true,
- ["CRITERIA_EARNED"] = true,
- ["GARRISON_BUILDING_ACTIVATABLE"] = true,
- ["GARRISON_FOLLOWER_ADDED"] = true,
- ["GARRISON_MISSION_FINISHED"] = true,
- ["GARRISON_RANDOM_MISSION_ADDED"] = true,
- ["GARRISON_TALENT_COMPLETE"] = true,
- ["LFG_COMPLETION_REWARD"] = true,
["LOOT_ITEM_ROLL_WON"] = true,
- ["NEW_MOUNT_ADDED"] = true,
- ["NEW_PET_ADDED"] = true,
["NEW_RECIPE_LEARNED"] = true,
- ["NEW_TOY_ADDED"] = true,
- ["QUEST_LOOT_RECEIVED"] = true,
["QUEST_TURNED_IN"] = true,
- ["SCENARIO_COMPLETED"] = true,
- ["SHOW_LOOT_TOAST"] = true,
- ["SHOW_LOOT_TOAST_LEGENDARY_LOOTED"] = true,
- ["SHOW_LOOT_TOAST_UPGRADE"] = true,
- ["SHOW_PVP_FACTION_LOOT_TOAST"] = true,
- ["SHOW_RATED_PVP_REWARD_TOAST"] = true,
["STORE_PRODUCT_DELIVERED"] = true,
}
@@ -85,46 +66,6 @@ E:RegisterEvent("ADDON_LOADED", function(arg1)
C.db:RegisterCallback("OnProfileShutdown", shutdownCallback)
C.db:RegisterCallback("OnDatabaseShutdown", shutdownCallback)
- -- cleanup
- LS_TOASTS_CFG = nil
- LS_TOASTS_CFG_GLOBAL = nil
-
- -- ->80100.03
- if not C.db.profile.version or C.db.profile.version < 8010003 then
- if C.db.profile.fadeout_delay then
- C.db.profile.anchors[1].fadeout_delay = C.db.profile.fadeout_delay
- C.db.profile.fadeout_delay = nil
- end
-
- if C.db.profile.growth_direction then
- C.db.profile.anchors[1].growth_direction = C.db.profile.growth_direction
- C.db.profile.growth_direction = nil
- end
-
- if C.db.profile.max_active_toasts then
- C.db.profile.anchors[1].max_active_toasts = C.db.profile.max_active_toasts
- C.db.profile.max_active_toasts = nil
- end
-
- if C.db.profile.scale then
- C.db.profile.anchors[1].scale = C.db.profile.scale
- C.db.profile.scale = nil
- end
-
- if C.db.profile.point then
- C.db.profile.anchors[1].point.p = C.db.profile.point.p
- C.db.profile.anchors[1].point.rP = C.db.profile.point.rP
- C.db.profile.anchors[1].point.x = C.db.profile.point.x
- C.db.profile.anchors[1].point.y = C.db.profile.point.y
- C.db.profile.point = nil
- end
- end
-
- -- ->80100.05
- if not C.db.profile.version or C.db.profile.version < 8010005 then
- C.db.profile.point = nil
- end
-
C.options = {
type = "group",
name = L["LS_TOASTS"],
@@ -323,24 +264,6 @@ E:RegisterEvent("ADDON_LOADED", function(arg1)
P:UpdateOptions()
P:EnableAllSystems()
- local panel = CreateFrame("Frame", "LSTConfigPanel", InterfaceOptionsFramePanelContainer)
- panel.name = L["LS_TOASTS"]
- panel:Hide()
-
- local button = CreateFrame("Button", nil, panel, "UIPanelButtonTemplate")
- button:SetText(L["OPEN_CONFIG"])
- button:SetWidth(button:GetTextWidth() + 18)
- button:SetPoint("TOPLEFT", 16, -16)
- button:SetScript("OnClick", function()
- if not InCombatLockdown() then
- InterfaceOptionsFrame_Show()
-
- LibStub("AceConfigDialog-3.0"):Open(addonName)
- end
- end)
-
- InterfaceOptions_AddCategory(panel, true)
-
E:RegisterEvent("PLAYER_REGEN_DISABLED", function()
LibStub("AceConfigDialog-3.0"):Close(addonName)
end)
diff --git a/locales/_locales.xml b/locales/_locales.xml
index a77c089..acc3e0d 100644
--- a/locales/_locales.xml
+++ b/locales/_locales.xml
@@ -10,4 +10,5 @@
+
diff --git a/locales/_post.lua b/locales/_post.lua
new file mode 100644
index 0000000..245fe38
--- /dev/null
+++ b/locales/_post.lua
@@ -0,0 +1,11 @@
+-- Contributors: Gotxiko@GitHub
+
+local _, addonTable = ...
+local L = addonTable.L
+
+-- Lua
+local _G = getfenv(0)
+
+-- Mine
+-- These rely on custom strings
+L["YOU_LOST_RED"] = "|cffdc4436" .. L["YOU_LOST"] .. "|r"
diff --git a/locales/deDE.lua b/locales/deDE.lua
index 7b2acfc..7158016 100644
--- a/locales/deDE.lua
+++ b/locales/deDE.lua
@@ -12,7 +12,6 @@ L["ANCHOR_FRAME_#"] = "Ankerrahmen #%d"
L["ANCHOR_FRAMES"] = "Ankerrahmen"
L["ANCHOR_RESET_DESC"] = "|cffffffffShift-Klick|r um die Position zurückzusetzen."
L["BORDER"] = "Rahmen"
-L["COLLECTIONS_TAINT_WARNING"] = "Diese Option kann Probleme verursachen, wenn das Sammlungsfenster während des Kampfes geöffnet wird."
L["COLORS"] = "Farben"
L["COORDS"] = "Koordinaten"
L["COPPER_THRESHOLD"] = "Kupferschwelle"
@@ -28,10 +27,8 @@ L["GROWTH_DIR_DOWN"] = "Nach unten"
L["GROWTH_DIR_LEFT"] = "Nach links"
L["GROWTH_DIR_RIGHT"] = "Nach rechts"
L["GROWTH_DIR_UP"] = "Nach oben"
-L["HANDLE_LEFT_CLICK"] = "Linksklick behandeln"
L["ICON_BORDER"] = "Symbolrahmen"
L["NAME"] = "Name"
-L["OPEN_CONFIG"] = "Konfiguration öffnen"
L["RARITY_THRESHOLD"] = "Schwellenwert der Seltenheit"
L["SCALE"] = "Skalierung"
L["SHOW_ILVL"] = "GS anzeigen"
@@ -48,25 +45,8 @@ L["TOAST_TYPES"] = "Benachrichtigungstypen"
L["TOGGLE_ANCHORS"] = "Ankerpunkte umschalten"
L["TRACK_LOSS"] = "Verlust Verfolgung"
L["TRACK_LOSS_DESC"] = "Diese Option ignoriert die Kupferschwelle."
-L["TRANSMOG_ADDED"] = "Vorlage hinzugefügt"
-L["TRANSMOG_REMOVED"] = "Vorlage entfernt"
-L["TYPE_ACHIEVEMENT"] = "Erfolg"
-L["TYPE_ARCHAEOLOGY"] = "Archäologie"
-L["TYPE_CLASS_HALL"] = "Klassenhalle"
-L["TYPE_COLLECTION"] = "Sammlung"
-L["TYPE_COLLECTION_DESC"] = "Benachrichtigungen für erhaltene Reittiere, Haustiere und Spielzeuge."
-L["TYPE_DUNGEON"] = "Dungeon"
-L["TYPE_GARRISON"] = "Garnison"
L["TYPE_LOOT_COMMON"] = "Beute (Gewöhnlich)"
-L["TYPE_LOOT_COMMON_DESC"] = "Benachrichtigungen, die von Chatereignissen ausgelöst werden wie grüne, blaue Gegenstände, manche epischen Gegenstände, alles was nicht von der Benachrichtigung für besondere Beute abgedeckt wird."
-L["TYPE_LOOT_CURRENCY"] = "Beute (Abzeichen)"
L["TYPE_LOOT_GOLD"] = "Beute (Gold)"
-L["TYPE_LOOT_SPECIAL"] = "Beute (Spezial)"
-L["TYPE_LOOT_SPECIAL_DESC"] = "Benachrichtigungen, die von besonderen Beuteereignissen wie gewonnene Würfe, legendäre Gegenstände, persönliche Beute etc. ausgelöst werden."
-L["TYPE_RECIPE"] = "Rezept"
-L["TYPE_TRANSMOG"] = "Transmogrifikation"
-L["TYPE_WAR_EFFORT"] = "Kriegsanstrengungen"
-L["TYPE_WORLD_QUEST"] = "Weltquest"
L["X_OFFSET"] = "X-Versatz"
L["Y_OFFSET"] = "Y-Versatz"
L["YOU_LOST"] = "Ihr verliert"
diff --git a/locales/enUS.lua b/locales/enUS.lua
index 591c99b..8ad4656 100644
--- a/locales/enUS.lua
+++ b/locales/enUS.lua
@@ -9,49 +9,23 @@ local _G = getfenv(0)
local L = {}
addonTable.L = L
-L["ACHIEVEMENT_PROGRESSED"] = _G.ACHIEVEMENT_PROGRESSED
-L["ACHIEVEMENT_UNLOCKED"] = _G.ACHIEVEMENT_UNLOCKED
L["ADD"] = _G.ADD
-L["BLIZZARD_STORE_PURCHASE_DELIVERED"] = _G.BLIZZARD_STORE_PURCHASE_COMPLETE
-L["CANCEL"] = _G.CANCEL
L["DELETE"] = _G.DELETE
-L["DIGSITE_COMPLETED"] = _G.ARCHAEOLOGY_DIGSITE_COMPLETE_TOAST_FRAME_TITLE
-L["DUNGEON_COMPLETED"] = _G.DUNGEON_COMPLETED
L["ENABLE"] = _G.ENABLE
-L["GARRISON_MISSION_ADDED"] = _G.GARRISON_MISSION_ADDED_TOAST1
-L["GARRISON_MISSION_COMPLETED"] = _G.GARRISON_MISSION_COMPLETE
-L["GARRISON_NEW_BUILDING"] = _G.GARRISON_UPDATE
-L["GARRISON_NEW_TALENT"] = _G.GARRISON_TALENT_ORDER_ADVANCEMENT
L["GENERAL"] = _G.GENERAL_LABEL
-L["GUILD_ACHIEVEMENT_UNLOCKED"] = _G.GUILD_ACHIEVEMENT_UNLOCKED
-L["HONOR_POINTS"] = _G.HONOR_POINTS
-L["ITEM_AZERITE_EMPOWERED"] = _G.AZERITE_EMPOWERED_ITEM_LOOT_LABEL
L["ITEM_LEGENDARY"] = _G.LEGENDARY_ITEM_LOOT_LABEL
-L["ITEM_UPGRADED"] = _G.ITEM_UPGRADED_LABEL
-L["ITEM_UPGRADED_FORMAT"] = _G.LOOTUPGRADEFRAME_TITLE:format("%s%s|r")
L["LOOT_THRESHOLD"] = _G.LOOT_THRESHOLD
L["LS_TOASTS"] = "ls: |cff1a9fc0Toasts|r"
-L["NEW_PROFILE"] = _G.NEW_COMPACT_UNIT_FRAME_PROFILE
L["OKAY"] = _G.OKAY
-L["RECIPE_LEARNED"] = _G.NEW_RECIPE_LEARNED_TITLE
-L["RECIPE_UPGRADED"] = _G.UPGRADED_RECIPE_LEARNED_TITLE
L["RELOADUI"] = _G.RELOADUI
L["RESET"] = _G.RESET
-L["SCENARIO_COMPLETED"] = _G.SCENARIO_COMPLETED
-L["SCENARIO_INVASION_COMPLETED"] = _G.SCENARIO_INVASION_COMPLETE
-L["SETTINGS_GENERAL_LABEL"] = _G.GENERAL_LABEL
L["SFX"] = _G.ENABLE_SOUNDFX
-L["WORLD_QUEST_COMPLETED"] = _G.WORLD_QUEST_COMPLETE
-L["XP_FORMAT"] = _G.BONUS_OBJECTIVE_EXPERIENCE_FORMAT
-L["YOU_EARNED"] = _G.YOU_EARNED_LABEL
-L["YOU_WON"] = _G.YOU_WON_LABEL
-- Require translation
L["ANCHOR_FRAME_#"] = "Anchor Frame #%d"
L["ANCHOR_FRAMES"] = "Anchor Frames"
L["ANCHOR_RESET_DESC"] = "|cffffffffShift-Click|r to reset the position."
L["BORDER"] = "Border"
-L["COLLECTIONS_TAINT_WARNING"] = "Enabling this option may cause errors when opening \"Collections\" panel in combat."
L["COLORS"] = "Colours"
L["COORDS"] = "Coordinates"
L["COPPER_THRESHOLD"] = "Copper Threshold"
@@ -67,10 +41,8 @@ L["GROWTH_DIR_DOWN"] = "Down"
L["GROWTH_DIR_LEFT"] = "Left"
L["GROWTH_DIR_RIGHT"] = "Right"
L["GROWTH_DIR_UP"] = "Up"
-L["HANDLE_LEFT_CLICK"] = "Handle Left Click"
L["ICON_BORDER"] = "Icon Border"
L["NAME"] = "Name"
-L["OPEN_CONFIG"] = "Open Config"
L["RARITY_THRESHOLD"] = "Rarity Threshold"
L["SCALE"] = "Scale"
L["SHOW_ILVL"] = "Show iLvl"
@@ -87,25 +59,8 @@ L["TOAST_TYPES"] = "Toast Types"
L["TOGGLE_ANCHORS"] = "Toggle Anchors"
L["TRACK_LOSS"] = "Track Loss"
L["TRACK_LOSS_DESC"] = "This option ignores set copper threshold."
-L["TRANSMOG_ADDED"] = "Appearance Added"
-L["TRANSMOG_REMOVED"] = "Appearance Removed"
-L["TYPE_ACHIEVEMENT"] = "Achievement"
-L["TYPE_ARCHAEOLOGY"] = "Archaeology"
-L["TYPE_CLASS_HALL"] = "Class Hall"
-L["TYPE_COLLECTION"] = "Collection"
-L["TYPE_COLLECTION_DESC"] = "Toasts for newly collected mounts, pets and toys."
-L["TYPE_DUNGEON"] = "Dungeon"
-L["TYPE_GARRISON"] = "Garrison"
L["TYPE_LOOT_COMMON"] = "Loot (Common)"
-L["TYPE_LOOT_COMMON_DESC"] = "Toasts triggered by chat events, e.g. greens, blues, some epics, everything that isn't handled by special loot toasts."
-L["TYPE_LOOT_CURRENCY"] = "Loot (Currency)"
L["TYPE_LOOT_GOLD"] = "Loot (Gold)"
-L["TYPE_LOOT_SPECIAL"] = "Loot (Special)"
-L["TYPE_LOOT_SPECIAL_DESC"] = "Toasts triggered by special loot events, e.g. won rolls, legendary drops, personal loot, etc."
-L["TYPE_RECIPE"] = "Recipe"
-L["TYPE_TRANSMOG"] = "Transmogrification"
-L["TYPE_WAR_EFFORT"] = "War Effort"
-L["TYPE_WORLD_QUEST"] = "World Quest"
L["X_OFFSET"] = "xOffset"
L["Y_OFFSET"] = "yOffset"
L["YOU_LOST"] = "You Lost"
diff --git a/locales/esES.lua b/locales/esES.lua
index f928bce..0951620 100644
--- a/locales/esES.lua
+++ b/locales/esES.lua
@@ -12,7 +12,6 @@ L["ANCHOR_FRAME_#"] = "Marco de anclaje #%d"
L["ANCHOR_FRAMES"] = "Marcos de anclaje"
L["ANCHOR_RESET_DESC"] = "|cffffffffShift-Click|r para reiniciar la posición."
L["BORDER"] = "Borde"
-L["COLLECTIONS_TAINT_WARNING"] = "Activar esta opción puede causar problemas al abrir la ventana de \"Colecciones\" en combate."
L["COLORS"] = "Colores"
L["COORDS"] = "Coordenadas"
L["COPPER_THRESHOLD"] = "Límite de Cobre"
@@ -28,10 +27,8 @@ L["GROWTH_DIR_DOWN"] = "Abajo"
L["GROWTH_DIR_LEFT"] = "Izquierda"
L["GROWTH_DIR_RIGHT"] = "Derecha"
L["GROWTH_DIR_UP"] = "Arriba"
-L["HANDLE_LEFT_CLICK"] = "Utilizar clic izquierdo"
L["ICON_BORDER"] = "Borde de icono"
L["NAME"] = "Nombre"
-L["OPEN_CONFIG"] = "Abrir Config"
L["RARITY_THRESHOLD"] = "Límite de rareza"
L["SCALE"] = "Escala"
L["SHOW_ILVL"] = "Mostrar nivel de objeto"
@@ -48,25 +45,8 @@ L["TOAST_TYPES"] = "Tipos de Toasts"
L["TOGGLE_ANCHORS"] = "Alternar anclajes"
L["TRACK_LOSS"] = "Mostrar pérdidas"
L["TRACK_LOSS_DESC"] = "Esta opción ignora el margen de cobre establecido."
-L["TRANSMOG_ADDED"] = "Appariencia añadida"
-L["TRANSMOG_REMOVED"] = "Apariencia eliminada"
-L["TYPE_ACHIEVEMENT"] = "Logro"
-L["TYPE_ARCHAEOLOGY"] = "Arquelogía"
-L["TYPE_CLASS_HALL"] = "Sede de clase"
-L["TYPE_COLLECTION"] = "Colección"
-L["TYPE_COLLECTION_DESC"] = "Toasts para nuevas monturas, mascotas y juguetes."
-L["TYPE_DUNGEON"] = "Mazmorra"
-L["TYPE_GARRISON"] = "Ciudadela"
L["TYPE_LOOT_COMMON"] = "Botín (Común)"
-L["TYPE_LOOT_COMMON_DESC"] = "Toasts activados por eventos de chat, ej. verdes, azules, algunos épicos, cualquier cosa que no sea recogida por toasts de botines especiales."
-L["TYPE_LOOT_CURRENCY"] = "Botín (Moneda)"
L["TYPE_LOOT_GOLD"] = "Botín (Oro)"
-L["TYPE_LOOT_SPECIAL"] = "Botín (Especial)"
-L["TYPE_LOOT_SPECIAL_DESC"] = "Toasts activados por eventos de botín especial, ej. tiradas ganadas, caídas de legendarios, botín personal, etc."
-L["TYPE_RECIPE"] = "Receta"
-L["TYPE_TRANSMOG"] = "Transmogrificación"
-L["TYPE_WAR_EFFORT"] = "Esfuerzo de guerra"
-L["TYPE_WORLD_QUEST"] = "Misión de mundo"
L["X_OFFSET"] = "xOffset"
L["Y_OFFSET"] = "yOffset"
L["YOU_LOST"] = "Has perdido"
diff --git a/locales/esMX.lua b/locales/esMX.lua
index 74e56c6..02d1621 100644
--- a/locales/esMX.lua
+++ b/locales/esMX.lua
@@ -12,7 +12,6 @@ L["ANCHOR_FRAME_#"] = "Marco de anclaje #%d"
L["ANCHOR_FRAMES"] = "Marcos de anclaje"
L["ANCHOR_RESET_DESC"] = "|cffffffffShift-Click|r para reiniciar la posición."
L["BORDER"] = "Borde"
-L["COLLECTIONS_TAINT_WARNING"] = "Activar esta opción puede causar problemas al abrir la ventana de \"Colecciones\" en combate."
L["COLORS"] = "Colores"
L["COORDS"] = "Coordenadas"
L["COPPER_THRESHOLD"] = "Límite de Cobre"
@@ -28,10 +27,8 @@ L["GROWTH_DIR_DOWN"] = "Abajo"
L["GROWTH_DIR_LEFT"] = "Izquierda"
L["GROWTH_DIR_RIGHT"] = "Derecha"
L["GROWTH_DIR_UP"] = "Arriba"
-L["HANDLE_LEFT_CLICK"] = "Utilizar clic izquierdo"
L["ICON_BORDER"] = "Borde de icono"
L["NAME"] = "Nombre"
-L["OPEN_CONFIG"] = "Abrir Config"
L["RARITY_THRESHOLD"] = "Límite de rareza"
L["SCALE"] = "Escala"
L["SHOW_ILVL"] = "Mostrar nivel de objeto"
@@ -48,25 +45,8 @@ L["TOAST_TYPES"] = "Tipos de Toasts"
L["TOGGLE_ANCHORS"] = "Alternar anclajes"
L["TRACK_LOSS"] = "Mostrar pérdidas"
L["TRACK_LOSS_DESC"] = "Esta opción ignora el margen de cobre establecido."
-L["TRANSMOG_ADDED"] = "Appariencia añadida"
-L["TRANSMOG_REMOVED"] = "Apariencia eliminada"
-L["TYPE_ACHIEVEMENT"] = "Logro"
-L["TYPE_ARCHAEOLOGY"] = "Arquelogía"
-L["TYPE_CLASS_HALL"] = "Sede de clase"
-L["TYPE_COLLECTION"] = "Colección"
-L["TYPE_COLLECTION_DESC"] = "Toasts para nuevas monturas, mascotas y juguetes."
-L["TYPE_DUNGEON"] = "Mazmorra"
-L["TYPE_GARRISON"] = "Ciudadela"
L["TYPE_LOOT_COMMON"] = "Botín (Común)"
-L["TYPE_LOOT_COMMON_DESC"] = "Toasts activados por eventos de chat, ej. verdes, azules, algunos épicos, cualquier cosa que no sea recogida por toasts de botines especiales."
-L["TYPE_LOOT_CURRENCY"] = "Botín (Moneda)"
L["TYPE_LOOT_GOLD"] = "Botín (Oro)"
-L["TYPE_LOOT_SPECIAL"] = "Botín (Especial)"
-L["TYPE_LOOT_SPECIAL_DESC"] = "Toasts activados por eventos de botín especial, ej. tiradas ganadas, caídas de legendarios, botín personal, etc."
-L["TYPE_RECIPE"] = "Receta"
-L["TYPE_TRANSMOG"] = "Transmogrificación"
-L["TYPE_WAR_EFFORT"] = "Esfuerzo de guerra"
-L["TYPE_WORLD_QUEST"] = "Misión de mundo"
L["X_OFFSET"] = "xOffset"
L["Y_OFFSET"] = "yOffset"
L["YOU_LOST"] = "Has perdido"
diff --git a/locales/frFR.lua b/locales/frFR.lua
index b8f5d90..2ec9a64 100644
--- a/locales/frFR.lua
+++ b/locales/frFR.lua
@@ -12,7 +12,6 @@ if GetLocale() ~= "frFR" then return end
--[[ L["ANCHOR_FRAMES"] = "Anchor Frames" ]]
--[[ L["ANCHOR_RESET_DESC"] = "|cffffffffShift-Click|r to reset the position." ]]
L["BORDER"] = "Bordure"
-L["COLLECTIONS_TAINT_WARNING"] = "Activer cette option peut provoquer des erreurs lors de l'ouverture de l'interface \"Collections\" en combat"
L["COLORS"] = "Couleurs"
L["COORDS"] = "Coordonnées"
L["COPPER_THRESHOLD"] = "Seuil (en pièces de cuivre)"
@@ -28,10 +27,8 @@ L["GROWTH_DIR_DOWN"] = "Bas"
L["GROWTH_DIR_LEFT"] = "Gauche"
L["GROWTH_DIR_RIGHT"] = "Droite"
L["GROWTH_DIR_UP"] = "Haut"
---[[ L["HANDLE_LEFT_CLICK"] = "Handle Left Click" ]]
L["ICON_BORDER"] = "Bordure d'icône"
L["NAME"] = "Nom"
-L["OPEN_CONFIG"] = "Ouvrir Configuration"
--[[ L["RARITY_THRESHOLD"] = "Rarity Threshold" ]]
L["SCALE"] = "Echelle"
L["SHOW_ILVL"] = "Montrer l'iLvl"
@@ -48,25 +45,8 @@ L["TOAST_TYPES"] = "Types de 'Toast'"
--[[ L["TOGGLE_ANCHORS"] = "Toggle Anchors" ]]
--[[ L["TRACK_LOSS"] = "Track Loss" ]]
--[[ L["TRACK_LOSS_DESC"] = "This option ignores set copper threshold." ]]
-L["TRANSMOG_ADDED"] = "Apparence ajoutée"
-L["TRANSMOG_REMOVED"] = "Apparence retirée"
-L["TYPE_ACHIEVEMENT"] = "Haut-Fait"
-L["TYPE_ARCHAEOLOGY"] = "Archéologie"
-L["TYPE_CLASS_HALL"] = "Hall de Classe"
-L["TYPE_COLLECTION"] = "Collection"
-L["TYPE_COLLECTION_DESC"] = "Toasts pour les nouveaux Compagnons, Jouets et Montures collectés."
-L["TYPE_DUNGEON"] = "Donjon"
-L["TYPE_GARRISON"] = "Fief"
L["TYPE_LOOT_COMMON"] = "Butin (Commun)"
-L["TYPE_LOOT_COMMON_DESC"] = "Toasts générés par le tchat, ex: verts, bleus, certains épiques, tout ce que ne gère pas la fonction Toasts 'Butin (Special)'."
-L["TYPE_LOOT_CURRENCY"] = "Butin (Breloques)"
L["TYPE_LOOT_GOLD"] = "Butin (Gold)"
-L["TYPE_LOOT_SPECIAL"] = "Butin (Special)"
-L["TYPE_LOOT_SPECIAL_DESC"] = "Toasts générés par les Butins spéciaux, ex: Jets de Butin, Butin Légendaire ou Personnel, etc."
-L["TYPE_RECIPE"] = "Recettes"
-L["TYPE_TRANSMOG"] = "Transmogrification"
---[[ L["TYPE_WAR_EFFORT"] = "War Effort" ]]
-L["TYPE_WORLD_QUEST"] = "Missions d'expédition"
--[[ L["X_OFFSET"] = "xOffset" ]]
--[[ L["Y_OFFSET"] = "yOffset" ]]
L["YOU_LOST"] = "Vous avez perdu"
diff --git a/locales/koKR.lua b/locales/koKR.lua
index 094a278..ed95344 100644
--- a/locales/koKR.lua
+++ b/locales/koKR.lua
@@ -12,7 +12,6 @@ if GetLocale() ~= "koKR" then return end
--[[ L["ANCHOR_FRAMES"] = "Anchor Frames" ]]
L["ANCHOR_RESET_DESC"] = "|cffffffffShift-클릭|r으로 위치를 초기화 합니다."
L["BORDER"] = "테두리"
-L["COLLECTIONS_TAINT_WARNING"] = "이 설정을 사용하는 경우 전투중 \"수집창\"을 열게 되면 오류가 발생합니다."
L["COLORS"] = "색상"
L["COORDS"] = "좌표"
L["COPPER_THRESHOLD"] = "코퍼 제한"
@@ -28,10 +27,8 @@ L["GROWTH_DIR_DOWN"] = "아래로"
L["GROWTH_DIR_LEFT"] = "왼쪽으로"
L["GROWTH_DIR_RIGHT"] = "오른쪽으로"
L["GROWTH_DIR_UP"] = "위로"
-L["HANDLE_LEFT_CLICK"] = "왼쪽 클릭으로 조정"
L["ICON_BORDER"] = "아이콘 테두리"
L["NAME"] = "이름"
-L["OPEN_CONFIG"] = "설정 열기"
L["RARITY_THRESHOLD"] = "최저 아이템 등급"
L["SCALE"] = "크기 비율"
L["SHOW_ILVL"] = "아이템 레벨 표시"
@@ -48,25 +45,8 @@ L["TOAST_TYPES"] = "알림창 종류"
--[[ L["TOGGLE_ANCHORS"] = "Toggle Anchors" ]]
--[[ L["TRACK_LOSS"] = "Track Loss" ]]
--[[ L["TRACK_LOSS_DESC"] = "This option ignores set copper threshold." ]]
-L["TRANSMOG_ADDED"] = "형상이 추가되었습니다"
-L["TRANSMOG_REMOVED"] = "형상이 제거되었습니다"
-L["TYPE_ACHIEVEMENT"] = "업적"
-L["TYPE_ARCHAEOLOGY"] = "고고학"
-L["TYPE_CLASS_HALL"] = "직업 전당"
-L["TYPE_COLLECTION"] = "수집품"
-L["TYPE_COLLECTION_DESC"] = "새로 수집한 탈것, 애완동물과 장난감의 알림창입니다."
-L["TYPE_DUNGEON"] = "던전"
-L["TYPE_GARRISON"] = "주둔지"
L["TYPE_LOOT_COMMON"] = "전리품 (일반)"
-L["TYPE_LOOT_COMMON_DESC"] = "알림창이 대화 이벤트에 의해 발생됩니다, 즉. 특별 전리품 알림창이 처리하지 않는 모든 고급, 희귀, 몇몇 영웅 전리품입니다."
-L["TYPE_LOOT_CURRENCY"] = "전리품 (화폐)"
L["TYPE_LOOT_GOLD"] = "전리품 (골드)"
-L["TYPE_LOOT_SPECIAL"] = "전리품 (특별)"
-L["TYPE_LOOT_SPECIAL_DESC"] = "알림창이 특별 전리품 이벤트에 의해 발생됩니다, 즉. 주사위 우승, 전설 획득, 개인 획득 등입니다."
-L["TYPE_RECIPE"] = "제조법"
-L["TYPE_TRANSMOG"] = "형상변환"
-L["TYPE_WAR_EFFORT"] = "전쟁 효과"
-L["TYPE_WORLD_QUEST"] = "전역 퀘스트"
L["X_OFFSET"] = "X 좌표"
L["Y_OFFSET"] = "Y 좌표"
--[[ L["YOU_LOST"] = "You Lost" ]]
diff --git a/locales/ruRU.lua b/locales/ruRU.lua
index 7336f6c..8baa9ba 100644
--- a/locales/ruRU.lua
+++ b/locales/ruRU.lua
@@ -12,7 +12,6 @@ L["ANCHOR_FRAME_#"] = "Фрейм крепления #%d"
L["ANCHOR_FRAMES"] = "Фреймы крепления"
L["ANCHOR_RESET_DESC"] = "|cffffffffЗажмите Shift и щелкните|r, чтобы сбросить позицию."
L["BORDER"] = "Рамка"
-L["COLLECTIONS_TAINT_WARNING"] = "Включение данной настройки может вызвать ошибки при открытии панели \"Коллекции\" в бою."
L["COLORS"] = "Цвета"
L["COORDS"] = "Координаты"
L["COPPER_THRESHOLD"] = "Порог меди"
@@ -28,10 +27,8 @@ L["GROWTH_DIR_DOWN"] = "Вниз"
L["GROWTH_DIR_LEFT"] = "Влево"
L["GROWTH_DIR_RIGHT"] = "Вправо"
L["GROWTH_DIR_UP"] = "Вверх"
-L["HANDLE_LEFT_CLICK"] = "Обрабатывать левый щелчок"
L["ICON_BORDER"] = "Рамка иконки"
L["NAME"] = "Название"
-L["OPEN_CONFIG"] = "Открыть настройки"
L["RARITY_THRESHOLD"] = "Порог редкости"
L["SCALE"] = "Масштаб"
L["SHOW_ILVL"] = "Показывать ур. пр."
@@ -48,25 +45,8 @@ L["TOAST_TYPES"] = "Типы уведомлений"
L["TOGGLE_ANCHORS"] = "Показать/скрыть фреймы крепления"
L["TRACK_LOSS"] = "Отслеживать потерю"
L["TRACK_LOSS_DESC"] = "Эта настройка игнорирует установленный порог меди."
-L["TRANSMOG_ADDED"] = "Модель добавлена"
-L["TRANSMOG_REMOVED"] = "Модель удалена"
-L["TYPE_ACHIEVEMENT"] = "Достижение"
-L["TYPE_ARCHAEOLOGY"] = "Археология"
-L["TYPE_CLASS_HALL"] = "Оплот класса"
-L["TYPE_COLLECTION"] = "Коллекция"
-L["TYPE_COLLECTION_DESC"] = "Уведомления для недавно добавленных средств передвижений, питомцев и игрушек."
-L["TYPE_DUNGEON"] = "Подземелье"
-L["TYPE_GARRISON"] = "Гарнизон"
L["TYPE_LOOT_COMMON"] = "Добыча (Обычная)"
-L["TYPE_LOOT_COMMON_DESC"] = "Уведомления, вызванные событиями чата, например: необычные, редкие, некоторые эпические предметы, все то, что не показывается посредством уведомлений об особой добыче."
-L["TYPE_LOOT_CURRENCY"] = "Добыча (Валюта)"
L["TYPE_LOOT_GOLD"] = "Добыча (Золото)"
-L["TYPE_LOOT_SPECIAL"] = "Добыча (Особая)"
-L["TYPE_LOOT_SPECIAL_DESC"] = "Уведомления, вызванные специальными событиями добычи, например: выигранный розыгрыш добычи, легендарная или персональная добыча, и т. д."
-L["TYPE_RECIPE"] = "Рецепт"
-L["TYPE_TRANSMOG"] = "Трансмогрификация"
-L["TYPE_WAR_EFFORT"] = "Военная кампания"
-L["TYPE_WORLD_QUEST"] = "Локальное задание"
L["X_OFFSET"] = "Смещение по X"
L["Y_OFFSET"] = "Смещение по Y"
L["YOU_LOST"] = "Вы потеряли"
diff --git a/locales/zhCN.lua b/locales/zhCN.lua
index 1379c3d..4a2607e 100644
--- a/locales/zhCN.lua
+++ b/locales/zhCN.lua
@@ -12,7 +12,6 @@ L["ANCHOR_FRAME_#"] = "锚点框架#%d"
L["ANCHOR_FRAMES"] = "锚点框架"
L["ANCHOR_RESET_DESC"] = "|cffffffffShift-点击左键|r 重置位置。"
L["BORDER"] = "边框"
-L["COLLECTIONS_TAINT_WARNING"] = "战斗中打开收藏(包括坐骑、宠物和玩具)界面,会引起Blz内置插件报错(污染)。"
L["COLORS"] = "着色"
L["COORDS"] = "方位"
L["COPPER_THRESHOLD"] = "拾取最小值(铜)"
@@ -21,17 +20,15 @@ L["DEFAULT_VALUE"] = "默认参数:|cffffd200%s|r"
L["DND"] = "勿扰"
L["DND_TOOLTIP"] = "提示处于勿扰模式将不会在战斗中显示,但仍在后台队列,一旦你离开战斗,就会开始弹出提示。"
L["FADE_OUT_DELAY"] = "淡出延迟"
-L["FLUSH_QUEUE"] = "显示队列"
+L["FLUSH_QUEUE"] = "刷新分组"
L["FONTS"] = "字体"
L["GROWTH_DIR"] = "延伸方向"
L["GROWTH_DIR_DOWN"] = "下"
L["GROWTH_DIR_LEFT"] = "左"
L["GROWTH_DIR_RIGHT"] = "右"
L["GROWTH_DIR_UP"] = "上"
-L["HANDLE_LEFT_CLICK"] = "支持左键点击"
L["ICON_BORDER"] = "图标边框"
L["NAME"] = "名称"
-L["OPEN_CONFIG"] = "打开设置"
L["RARITY_THRESHOLD"] = "品质限定"
L["SCALE"] = "缩放"
L["SHOW_ILVL"] = "显示装等"
@@ -48,26 +45,9 @@ L["TOAST_TYPES"] = "提示框类型"
L["TOGGLE_ANCHORS"] = "移动位置"
L["TRACK_LOSS"] = "追踪损失"
L["TRACK_LOSS_DESC"] = "开启该选项后将忽略 拾取最小值 设置。"
-L["TRANSMOG_ADDED"] = "幻化外观已添加"
-L["TRANSMOG_REMOVED"] = "幻化外观已移除"
-L["TYPE_ACHIEVEMENT"] = "成就"
-L["TYPE_ARCHAEOLOGY"] = "考古"
-L["TYPE_CLASS_HALL"] = "职业大厅"
-L["TYPE_COLLECTION"] = "藏品"
-L["TYPE_COLLECTION_DESC"] = "对获取到的坐骑、宠物和玩具进行提示。"
-L["TYPE_DUNGEON"] = "地下城"
-L["TYPE_GARRISON"] = "要塞"
L["TYPE_LOOT_COMMON"] = "拾取(一般)"
-L["TYPE_LOOT_COMMON_DESC"] = "由聊天事件触发的通知,例如:绿色、蓝色或某些紫色装备,一切其他不属于特殊战利品的拾取。"
-L["TYPE_LOOT_CURRENCY"] = "拾取(货币)"
L["TYPE_LOOT_GOLD"] = "拾取(金币)"
-L["TYPE_LOOT_SPECIAL"] = "拾取(特殊)"
-L["TYPE_LOOT_SPECIAL_DESC"] = "由特殊战利品触发的通知,例如:贏得Roll、橙装、个人拾取..等等。"
-L["TYPE_RECIPE"] = "专业图纸"
-L["TYPE_TRANSMOG"] = "幻化收藏"
-L["TYPE_WAR_EFFORT"] = "前线战役"
-L["TYPE_WORLD_QUEST"] = "世界任务"
L["X_OFFSET"] = "水平偏移量"
L["Y_OFFSET"] = "垂直偏移量"
-L["YOU_LOST"] = "你損失了"
-L["YOU_RECEIVED"] = "你獲得了"
+L["YOU_LOST"] = "你损失了"
+L["YOU_RECEIVED"] = "你获得了"
diff --git a/locales/zhTW.lua b/locales/zhTW.lua
index 4ba5d29..cec50a5 100644
--- a/locales/zhTW.lua
+++ b/locales/zhTW.lua
@@ -12,7 +12,6 @@ L["ANCHOR_FRAME_#"] = "定位框架 #%d"
L["ANCHOR_FRAMES"] = "定位框架"
L["ANCHOR_RESET_DESC"] = "|cffffffffShift-左鍵點擊|r 重置位置。"
L["BORDER"] = "邊框"
-L["COLLECTIONS_TAINT_WARNING"] = "啟用這個選項時,若在戰鬥中點擊開啟了 \"收藏\" 視窗,會發生錯誤。"
L["COLORS"] = "顏色"
L["COORDS"] = "座標"
L["COPPER_THRESHOLD"] = "銅最小值"
@@ -28,10 +27,8 @@ L["GROWTH_DIR_DOWN"] = "下"
L["GROWTH_DIR_LEFT"] = "左"
L["GROWTH_DIR_RIGHT"] = "右"
L["GROWTH_DIR_UP"] = "上"
-L["HANDLE_LEFT_CLICK"] = "允許左鍵點擊"
L["ICON_BORDER"] = "圖示邊框"
L["NAME"] = "名稱"
-L["OPEN_CONFIG"] = "開啟設定"
L["RARITY_THRESHOLD"] = "最低物品品質"
L["SCALE"] = "縮放"
L["SHOW_ILVL"] = "顯示物品等級"
@@ -48,25 +45,8 @@ L["TOAST_TYPES"] = "通知類型"
L["TOGGLE_ANCHORS"] = "切換定位點"
L["TRACK_LOSS"] = "追蹤失去"
L["TRACK_LOSS_DESC"] = "此選項忽略設置的銅幣閥值。"
-L["TRANSMOG_ADDED"] = "外觀已加入"
-L["TRANSMOG_REMOVED"] = "外觀已移除"
-L["TYPE_ACHIEVEMENT"] = "成就"
-L["TYPE_ARCHAEOLOGY"] = "考古"
-L["TYPE_CLASS_HALL"] = "職業大廳"
-L["TYPE_COLLECTION"] = "收藏"
-L["TYPE_COLLECTION_DESC"] = "最新收集到的坐騎、寵物和玩具通知。"
-L["TYPE_DUNGEON"] = "地城"
-L["TYPE_GARRISON"] = "要塞"
L["TYPE_LOOT_COMMON"] = "拾取(一般)"
-L["TYPE_LOOT_COMMON_DESC"] = "由聊天事件觸發的通知,例如:綠色藍色或某些史詩,一切其他不屬於特殊戰利品的處理。"
-L["TYPE_LOOT_CURRENCY"] = "拾取(貨幣)"
L["TYPE_LOOT_GOLD"] = "拾取(金錢)"
-L["TYPE_LOOT_SPECIAL"] = "拾取(特殊)"
-L["TYPE_LOOT_SPECIAL_DESC"] = "由特殊戰利品觸發的通知,例如:贏得擲骰、傳說掉落、個人拾取..等等。"
-L["TYPE_RECIPE"] = "專業圖紙"
-L["TYPE_TRANSMOG"] = "塑形提醒"
-L["TYPE_WAR_EFFORT"] = "陣營戰役"
-L["TYPE_WORLD_QUEST"] = "世界任務"
L["X_OFFSET"] = "水平位置"
L["Y_OFFSET"] = "垂直位置"
L["YOU_LOST"] = "你失去"
diff --git a/ls_Toasts.toc b/ls_Toasts.toc
index f4eb6ed..5c1a0c8 100644
--- a/ls_Toasts.toc
+++ b/ls_Toasts.toc
@@ -1,6 +1,6 @@
-## Interface: 80200
+## Interface: 11302
## Author: lightspark
-## Version: 80200.04
+## Version: 11302.01
## Title: ls: |cff1a9fc0Toasts|r
## Notes: Better toasts, cheers!
## SavedVariables: LS_TOASTS_GLOBAL_CONFIG
diff --git a/skins/default.lua b/skins/default.lua
index a0c4d21..be91ff0 100644
--- a/skins/default.lua
+++ b/skins/default.lua
@@ -106,89 +106,17 @@ E:RegisterSkin("default-legacy", {
name = "Default (Legacy)",
template = "default",
bg = {
- alliance = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-alliance",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- archaeology = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-archaeology",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- azerite = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-azerite",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- collection = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-collection",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
default = {
color = {1, 1, 1},
texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-default",
tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
tile = false,
},
- dungeon = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-dungeon",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- horde = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-horde",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
legendary = {
color = {1, 1, 1},
texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-legendary",
tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
tile = false,
},
- legion = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-legion",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- recipe = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-recipe",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- store = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-store",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- transmog = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-transmog",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- upgrade = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-upgrade",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- worldquest = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-worldquest",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
},
})
diff --git a/skins/elv.lua b/skins/elv.lua
index d1bd825..27a2e9a 100644
--- a/skins/elv.lua
+++ b/skins/elv.lua
@@ -48,90 +48,18 @@ E:RegisterSkin("elv-legacy", {
name = "ElvUI (Legacy)",
template = "elv",
bg = {
- alliance = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-alliance",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- archaeology = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-archaeology",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- azerite = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-azerite",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- collection = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-collection",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
default = {
color = {1, 1, 1},
texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-default",
tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
tile = false,
},
- dungeon = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-dungeon",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- horde = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-horde",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
legendary = {
color = {1, 1, 1},
texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-legendary",
tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
tile = false,
},
- legion = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-legion",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- recipe = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-recipe",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- store = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-store",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- transmog = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-transmog",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- upgrade = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-upgrade",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
- worldquest = {
- color = {1, 1, 1},
- texture = "Interface\\AddOns\\ls_Toasts\\assets\\legacy\\toast-bg-worldquest",
- tex_coords = {1 / 256, 225 / 256, 1 / 64, 49 / 64},
- tile = false,
- },
},
})
diff --git a/systems/_systems.xml b/systems/_systems.xml
index 9db1451..16b2e22 100644
--- a/systems/_systems.xml
+++ b/systems/_systems.xml
@@ -1,14 +1,4 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/systems/achievement.lua b/systems/achievement.lua
deleted file mode 100644
index ede4941..0000000
--- a/systems/achievement.lua
+++ /dev/null
@@ -1,158 +0,0 @@
-local _, addonTable = ...
-local E, L, C = addonTable.E, addonTable.L, addonTable.C
-
--- Lua
-local _G = getfenv(0)
-
---[[ luacheck: globals
- AchievementFrame AchievementFrame_LoadUI AchievementFrame_SelectAchievement FormatShortDate GameTooltip
- GetAchievementInfo InCombatLockdown ShowUIPanel
-]]
-
--- Mine
-local function Toast_OnClick(self)
- if self._data.ach_id and not InCombatLockdown() then
- if not AchievementFrame then
- AchievementFrame_LoadUI()
- end
-
- if AchievementFrame then
- ShowUIPanel(AchievementFrame)
- AchievementFrame_SelectAchievement(self._data.ach_id)
- end
- end
-end
-
-local function Toast_OnEnter(self)
- if self._data.ach_id then
- local _, name, _, _, month, day, year, description = GetAchievementInfo(self._data.ach_id)
- if name then
- if day and day > 0 then
- GameTooltip:AddDoubleLine(name, FormatShortDate(day, month, year), nil, nil, nil, 0.5, 0.5, 0.5)
- else
- GameTooltip:AddLine(name)
- end
-
- if description then
- GameTooltip:AddLine(description, 1, 1, 1, true)
- end
- end
-
- GameTooltip:Show()
- end
-end
-
-local function Toast_SetUp(event, achievementID, flag, isCriteria)
- local toast = E:GetToast()
- local _, name, points, _, _, _, _, _, _, icon, _, isGuildAchievement = GetAchievementInfo(achievementID)
-
- if isCriteria then
- toast.Title:SetText(L["ACHIEVEMENT_PROGRESSED"])
- toast.Text:SetText(flag)
-
- toast.IconText1:SetText("")
- else
- toast.Title:SetText(isGuildAchievement and L["GUILD_ACHIEVEMENT_UNLOCKED"] or L["ACHIEVEMENT_UNLOCKED"])
- toast.Text:SetText(name)
-
- if flag then
- toast.IconText1:SetText("")
- else
- if C.db.profile.colors.border then
- toast.Border:SetVertexColor(0.9, 0.75, 0.26)
- end
-
- if C.db.profile.colors.icon_border then
- toast.IconBorder:SetVertexColor(0.9, 0.75, 0.26)
- end
-
- toast.IconText1:SetText(points == 0 and "" or points)
- end
- end
-
- toast.Icon:SetTexture(icon)
- toast.IconBorder:Show()
-
- toast._data.event = event
- toast._data.ach_id = achievementID
-
- toast:HookScript("OnClick", Toast_OnClick)
- toast:HookScript("OnEnter", Toast_OnEnter)
- toast:Spawn(C.db.profile.types.achievement.anchor, C.db.profile.types.achievement.dnd)
-end
-
-local function ACHIEVEMENT_EARNED(achievementID, alreadyEarned)
- Toast_SetUp("ACHIEVEMENT_EARNED", achievementID, alreadyEarned)
-end
-
-local function CRITERIA_EARNED(achievementID, criteriaString)
- Toast_SetUp("CRITERIA_EARNED", achievementID, criteriaString, true)
-end
-
-local function Enable()
- if C.db.profile.types.achievement.enabled then
- E:RegisterEvent("ACHIEVEMENT_EARNED", ACHIEVEMENT_EARNED)
- E:RegisterEvent("CRITERIA_EARNED", CRITERIA_EARNED)
- end
-end
-
-local function Disable()
- E:UnregisterEvent("ACHIEVEMENT_EARNED", ACHIEVEMENT_EARNED)
- E:UnregisterEvent("CRITERIA_EARNED", CRITERIA_EARNED)
-end
-
-local function Test()
- -- new, Shave and a Haircut
- Toast_SetUp("ACHIEVEMENT_TEST", 545, false)
-
- -- earned, Ten Hit Tunes
- Toast_SetUp("ACHIEVEMENT_TEST", 9828, true)
-
- -- guild, It All Adds Up
- Toast_SetUp("ACHIEVEMENT_TEST", 4913, false)
-end
-
-E:RegisterOptions("achievement", {
- enabled = true,
- anchor = 1,
- dnd = false,
-}, {
- name = L["TYPE_ACHIEVEMENT"],
- get = function(info)
- return C.db.profile.types.achievement[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.achievement[info[#info]] = value
- end,
- args = {
- enabled = {
- order = 1,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.achievement.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 2,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = Test,
- },
- },
-})
-
-E:RegisterSystem("achievement", Enable, Disable, Test)
diff --git a/systems/archaeology.lua b/systems/archaeology.lua
deleted file mode 100644
index e474f39..0000000
--- a/systems/archaeology.lua
+++ /dev/null
@@ -1,227 +0,0 @@
-local _, addonTable = ...
-local E, L, C = addonTable.E, addonTable.L, addonTable.C
-
--- Lua
-local _G = getfenv(0)
-local hooksecurefunc = _G.hooksecurefunc
-local m_abs = _G.math.abs
-local m_random = _G.math.random
-
---[[ luacheck: globals
- ArchaeologyFrame ArcheologyDigsiteProgressBar FormatLargeNumber GameTooltip GetArchaeologyRaceInfoByID
- GetCurrencyInfo
-]]
-
--- Mine
-local function DigsiteToast_SetUp(event, researchFieldID)
- local toast = E:GetToast()
- local raceName, raceTexture = GetArchaeologyRaceInfoByID(researchFieldID)
-
- if C.db.profile.colors.border then
- toast.Border:SetVertexColor(0.9, 0.4, 0.1)
- end
-
- toast:SetBackground("archaeology")
- toast.Title:SetText(L["DIGSITE_COMPLETED"])
- toast.Text:SetText(raceName)
- toast.Icon:SetPoint("TOPLEFT", 1, 3)
- toast.Icon:SetSize(40, 48)
- toast.Icon:SetTexture(raceTexture)
- toast.Icon:SetTexCoord(0 / 128, 74 / 128, 0 / 128, 88 / 128)
-
- toast._data.event = event
- toast._data.sound_file = C.db.profile.types.archaeology.sfx and 38326 -- SOUNDKIT.UI_DIG_SITE_COMPLETION_TOAST
-
- toast:Spawn(C.db.profile.types.archaeology.anchor, C.db.profile.types.archaeology.dnd)
-end
-
-local function ARTIFACT_DIGSITE_COMPLETE(researchFieldID)
- DigsiteToast_SetUp("ARTIFACT_DIGSITE_COMPLETE", researchFieldID)
-end
-
-------
-local NO_GAIN_SOURCE = 38
-
--- https://wow.tools/dbc/?dbc=currencytypes&build=whatever
-local WHITELIST = {
- -- 82 (Archaeology)
- [ 384] = true, -- Dwarf Archaeology Fragment
- [ 385] = true, -- Troll Archaeology Fragment
- [ 393] = true, -- Fossil Archaeology Fragment
- [ 394] = true, -- Night Elf Archaeology Fragment
- [ 397] = true, -- Orc Archaeology Fragment
- [ 398] = true, -- Draenei Archaeology Fragment
- [ 399] = true, -- Vrykul Archaeology Fragment
- [ 400] = true, -- Nerubian Archaeology Fragment
- [ 401] = true, -- Tol'vir Archaeology Fragment
- [ 676] = true, -- Pandaren Archaeology Fragment
- [ 677] = true, -- Mogu Archaeology Fragment
- [ 754] = true, -- Mantid Archaeology Fragment
- [ 821] = true, -- Draenor Clans Archaeology Fragment
- [ 828] = true, -- Ogre Archaeology Fragment
- [ 829] = true, -- Arakkoa Archaeology Fragment
- [ 830] = true, -- n/a
- [1172] = true, -- Highborne Archaeology Fragment
- [1173] = true, -- Highmountain Tauren Archaeology Fragment
- [1174] = true, -- Demonic Archaeology Fragment
- [1534] = true, -- Zandalari Archaeology Fragment
- [1535] = true, -- Drust Archaeology Fragment
-}
-
-local function Toast_OnEnter(self)
- if self._data.tooltip_link then
- GameTooltip:SetHyperlink(self._data.tooltip_link)
- GameTooltip:Show()
- end
-end
-
-local function PostSetAnimatedValue(self, value)
- self:SetText(value == 1 and "" or FormatLargeNumber(m_abs(value)))
-end
-
-local function FragmentToast_SetUp(event, link, quantity)
- local toast, isNew, isQueued = E:GetToast(event, "link", link)
- if isNew then
- local name, _, icon = GetCurrencyInfo(link)
- if name then
- toast.IconText1.PostSetAnimatedValue = PostSetAnimatedValue
-
- if C.db.profile.colors.border then
- toast.Border:SetVertexColor(0.9, 0.4, 0.1)
- end
-
- if C.db.profile.colors.icon_border then
- toast.IconBorder:SetVertexColor(0.9, 0.4, 0.1)
- end
-
- toast.Title:SetText(L["YOU_RECEIVED"])
- toast.Text:SetText(name)
- toast.Icon:SetTexture(icon)
- toast.IconBorder:Show()
- toast.IconText1:SetAnimatedValue(quantity, true)
-
- toast._data.count = quantity
- toast._data.event = event
- toast._data.link = link
- toast._data.sound_file = C.db.profile.types.loot_currency.sfx and 31578 -- SOUNDKIT.UI_EPICLOOT_TOAST
- toast._data.tooltip_link = link
-
- toast:HookScript("OnEnter", Toast_OnEnter)
- toast:Spawn(C.db.profile.types.loot_currency.anchor, C.db.profile.types.loot_currency.dnd)
- else
- toast:Recycle()
- end
- else
- toast._data.count = toast._data.count + quantity
-
- if isQueued then
- toast.IconText1:SetAnimatedValue(toast._data.count, true)
- else
- toast.IconText1:SetAnimatedValue(toast._data.count)
-
- toast.IconText2:SetText("+" .. quantity)
- toast.IconText2.Blink:Stop()
- toast.IconText2.Blink:Play()
-
- toast.AnimOut:Stop()
- toast.AnimOut:Play()
- end
- end
-end
-
-local function CURRENCY_DISPLAY_UPDATE(id, _, quantity, gainSource)
- if not (id and WHITELIST[id]) or gainSource == NO_GAIN_SOURCE then
- return
- end
-
- FragmentToast_SetUp("CURRENCY_DISPLAY_UPDATE", "currency:" .. id, quantity)
-end
-
-local function Enable()
- if not ArchaeologyFrame then
- local hooked = false
-
- hooksecurefunc("ArchaeologyFrame_LoadUI", function()
- if not hooked then
- ArcheologyDigsiteProgressBar.AnimOutAndTriggerToast:SetScript("OnFinished", function(self)
- self:GetParent():Hide()
- end)
-
- hooked = true
- end
- end)
- else
- ArcheologyDigsiteProgressBar.AnimOutAndTriggerToast:SetScript("OnFinished", function(self)
- self:GetParent():Hide()
- end)
- end
-
- if C.db.profile.types.archaeology.enabled then
- E:RegisterEvent("ARTIFACT_DIGSITE_COMPLETE", ARTIFACT_DIGSITE_COMPLETE)
- E:RegisterEvent("CURRENCY_DISPLAY_UPDATE", CURRENCY_DISPLAY_UPDATE)
- end
-end
-
-local function Disable()
- E:UnregisterEvent("ARTIFACT_DIGSITE_COMPLETE", ARTIFACT_DIGSITE_COMPLETE)
- E:UnregisterEvent("CURRENCY_DISPLAY_UPDATE", CURRENCY_DISPLAY_UPDATE)
-end
-
-local function Test()
- -- Night Elf Archaeology Fragment
- FragmentToast_SetUp("ARCHAEOLOGY_TEST", "currency:" .. 394, m_random(4, 8))
-
- -- Night Elf
- DigsiteToast_SetUp("ARCHAEOLOGY_TEST", 4)
-end
-
-E:RegisterOptions("archaeology", {
- enabled = true,
- anchor = 1,
- dnd = false,
- sfx = true,
-}, {
- name = L["TYPE_ARCHAEOLOGY"],
- get = function(info)
- return C.db.profile.types.archaeology[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.archaeology[info[#info]] = value
- end,
- args = {
- enabled = {
- order = 1,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.archaeology.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 2,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- sfx = {
- order = 3,
- type = "toggle",
- name = L["SFX"],
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = Test,
- },
- },
-})
-
-E:RegisterSystem("archaeology", Enable, Disable, Test)
diff --git a/systems/collection.lua b/systems/collection.lua
deleted file mode 100644
index 08f253f..0000000
--- a/systems/collection.lua
+++ /dev/null
@@ -1,235 +0,0 @@
-local _, addonTable = ...
-local E, L, C = addonTable.E, addonTable.L, addonTable.C
-
--- Lua
-local _G = getfenv(0)
-
--- Blizz
-local C_MountJournal = _G.C_MountJournal
-local C_PetJournal = _G.C_PetJournal
-local C_ToyBox = _G.C_ToyBox
-
---[[ luacheck: globals
- CollectionsJournal CollectionsJournal_LoadUI DressUpBattlePet DressUpMount InCombatLockdown IsModifiedClick
- MountJournal_SelectByMountID PetJournal PetJournal_SelectPet SetCollectionsJournalShown ToyBox
- ToyBox_FindPageForToyID
-
- COLLECTIONS_JOURNAL_TAB_INDEX_MOUNTS COLLECTIONS_JOURNAL_TAB_INDEX_PETS COLLECTIONS_JOURNAL_TAB_INDEX_TOYS
- ITEM_QUALITY_COLORS
-]]
-
--- Mine
-local function Toast_OnClick(self)
- if self._data.collection_id then
- if IsModifiedClick("DRESSUP") then
- if self._data.is_mount then
- DressUpMount(C_MountJournal.GetMountInfoExtraByID(self._data.collection_id))
- elseif self._data.is_pet then
- local _, _, _, _, _, displayID, _, _, _, _, creatureID = C_PetJournal.GetPetInfoByPetID(self._data.collection_id)
- DressUpBattlePet(creatureID, displayID)
- end
- elseif C.db.profile.types.collection.left_click and not InCombatLockdown() then
- if not CollectionsJournal then
- CollectionsJournal_LoadUI()
- end
-
- if CollectionsJournal then
- if self._data.is_mount then
- SetCollectionsJournalShown(true, COLLECTIONS_JOURNAL_TAB_INDEX_MOUNTS)
- MountJournal_SelectByMountID(self._data.collection_id)
- elseif self._data.is_pet then
- SetCollectionsJournalShown(true, COLLECTIONS_JOURNAL_TAB_INDEX_PETS)
- PetJournal_SelectPet(PetJournal, self._data.collection_id)
- elseif self._data.is_toy then
- SetCollectionsJournalShown(true, COLLECTIONS_JOURNAL_TAB_INDEX_TOYS)
-
- local page = ToyBox_FindPageForToyID(self._data.collection_id)
- if page then
- ToyBox.PagingFrame:SetCurrentPage(page)
- end
- end
- end
- end
- end
-end
-
-local function PostSetAnimatedValue(self, value)
- self:SetText(value == 1 and "" or value)
-end
-
-local function Toast_SetUp(event, ID, isMount, isPet, isToy)
- local toast, isNew, isQueued = E:GetToast(event, "collection_id", ID)
- if isNew then
- local color, name, icon, rarity, _
-
- if isMount then
- name, _, icon = C_MountJournal.GetMountInfoByID(ID)
- elseif isPet then
- local customName
- _, _, _, _, rarity = C_PetJournal.GetPetStats(ID)
- _, customName, _, _, _, _, _, name, icon = C_PetJournal.GetPetInfoByPetID(ID)
- rarity = (rarity or 2) - 1
- color = ITEM_QUALITY_COLORS[rarity]
- name = customName or name
- elseif isToy then
- _, name, icon = C_ToyBox.GetToyInfo(ID)
- end
-
- if not name then
- return toast:Release()
- end
-
- toast.IconText1.PostSetAnimatedValue = PostSetAnimatedValue
-
- if rarity and rarity >= C.db.profile.colors.threshold then
- if color and C.db.profile.colors.name then
- toast.Text:SetTextColor(color.r, color.g, color.b)
- end
-
- if color and C.db.profile.colors.border then
- toast.Border:SetVertexColor(color.r, color.g, color.b)
- end
-
- if color and C.db.profile.colors.icon_border then
- toast.IconBorder:SetVertexColor(color.r, color.g, color.b)
- end
- end
-
- toast:SetBackground("collection")
- toast.Title:SetText(L["YOU_EARNED"])
- toast.Text:SetText(name)
- toast.Icon:SetTexture(icon)
- toast.IconBorder:Show()
- toast.IconText1:SetAnimatedValue(1, true)
-
- toast._data.collection_id = ID
- toast._data.count = 1
- toast._data.event = event
- toast._data.is_mount = isMount
- toast._data.is_pet = isPet
- toast._data.is_toy = isToy
- toast._data.sound_file = C.db.profile.types.collection.sfx and 31578 -- SOUNDKIT.UI_EPICLOOT_TOAST
-
- toast:HookScript("OnClick", Toast_OnClick)
- toast:Spawn(C.db.profile.types.collection.anchor, C.db.profile.types.collection.dnd)
- else
- if isQueued then
- toast._data.count = toast._data.count + 1
- toast.IconText1:SetAnimatedValue(toast._data.count, true)
- else
- toast._data.count = toast._data.count + 1
- toast.IconText1:SetAnimatedValue(toast._data.count)
-
- toast.IconText2:SetText("+1")
- toast.IconText2.Blink:Stop()
- toast.IconText2.Blink:Play()
-
- toast.AnimOut:Stop()
- toast.AnimOut:Play()
- end
- end
-end
-
-local function NEW_MOUNT_ADDED(mountID)
- Toast_SetUp("NEW_MOUNT_ADDED", mountID, true)
-end
-
-local function NEW_PET_ADDED(petID)
- Toast_SetUp("NEW_PET_ADDED", petID, nil, true)
-end
-
-local function NEW_TOY_ADDED(toyID)
- Toast_SetUp("NEW_TOY_ADDED", toyID, nil, nil, true)
-end
-
-local function Enable()
- if C.db.profile.types.collection.enabled then
- E:RegisterEvent("NEW_MOUNT_ADDED", NEW_MOUNT_ADDED)
- E:RegisterEvent("NEW_PET_ADDED", NEW_PET_ADDED)
- E:RegisterEvent("NEW_TOY_ADDED", NEW_TOY_ADDED)
- end
-end
-
-local function Disable()
- E:UnregisterEvent("NEW_MOUNT_ADDED", NEW_MOUNT_ADDED)
- E:UnregisterEvent("NEW_PET_ADDED", NEW_PET_ADDED)
- E:UnregisterEvent("NEW_TOY_ADDED", NEW_TOY_ADDED)
-end
-
-local function Test()
- -- Golden Gryphon
- Toast_SetUp("MOUNT_TEST", 129, true)
-
- -- Pet
- local petID = C_PetJournal.GetPetInfoByIndex(1)
- if petID then
- Toast_SetUp("PET_TEST", petID, nil, true)
- end
-
- -- A Tiny Set of Warglaves
- Toast_SetUp("TOY_TEST", 147537, nil, nil, true)
-end
-
-E:RegisterOptions("collection", {
- enabled = true,
- anchor = 1,
- dnd = false,
- sfx = true,
- left_click = false,
-}, {
- name = L["TYPE_COLLECTION"],
- get = function(info)
- return C.db.profile.types.collection[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.collection[info[#info]] = value
- end,
- args = {
- desc = {
- order = 1,
- type = "description",
- name = L["TYPE_COLLECTION_DESC"],
- },
- enabled = {
- order = 2,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.collection.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 3,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- sfx = {
- order = 4,
- type = "toggle",
- name = L["SFX"],
- },
- left_click = {
- order = 5,
- type = "toggle",
- name = L["HANDLE_LEFT_CLICK"],
- desc = L["COLLECTIONS_TAINT_WARNING"],
- image = "Interface\\DialogFrame\\UI-Dialog-Icon-AlertNew",
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = Test,
- },
- },
-})
-
-E:RegisterSystem("collection", Enable, Disable, Test)
diff --git a/systems/garrison.lua b/systems/garrison.lua
deleted file mode 100644
index e8ac16f..0000000
--- a/systems/garrison.lua
+++ /dev/null
@@ -1,563 +0,0 @@
-local _, addonTable = ...
-local E, L, C = addonTable.E, addonTable.L, addonTable.C
-
--- Lua
-local _G = getfenv(0)
-local pcall = _G.pcall
-local s_split = _G.string.split
-local select = _G.select
-local tonumber = _G.tonumber
-
--- Blizz
-local C_Garrison = _G.C_Garrison
-
---[[ luacheck: globals
- GameTooltip GarrisonFollowerOptions GarrisonFollowerTooltip GarrisonFollowerTooltipTemplate_SetGarrisonFollower
- GarrisonFollowerTooltipTemplate_SetShipyardFollower GarrisonShipyardFollowerTooltip GetInstanceInfo UnitClass
-
- ITEM_QUALITY_COLORS LE_FOLLOWER_TYPE_GARRISON_6_0 LE_FOLLOWER_TYPE_GARRISON_7_0 LE_FOLLOWER_TYPE_GARRISON_8_0
- LE_FOLLOWER_TYPE_SHIPYARD_6_2 LE_GARRISON_TYPE_6_0 LE_GARRISON_TYPE_7_0 LE_GARRISON_TYPE_8_0
- LOOTUPGRADEFRAME_QUALITY_TEXTURES
-]]
-
--- Mine
-local PLAYER_CLASS = select(3, UnitClass("player"))
-
-local function getGarrisonTypeByFollowerType(followerTypeID)
- if followerTypeID == LE_FOLLOWER_TYPE_GARRISON_8_0 then
- return LE_GARRISON_TYPE_8_0
- elseif followerTypeID == LE_FOLLOWER_TYPE_GARRISON_7_0 then
- return LE_GARRISON_TYPE_7_0
- elseif followerTypeID == LE_FOLLOWER_TYPE_GARRISON_6_0 or followerTypeID == LE_FOLLOWER_TYPE_SHIPYARD_6_2 then
- return LE_GARRISON_TYPE_6_0
- end
-end
-
-local function MissionToast_SetUp(event, garrisonType, missionID, isAdded)
- local missionInfo = C_Garrison.GetBasicMissionInfo(missionID)
- local rarity = missionInfo.isRare and 3 or 1
- local color = ITEM_QUALITY_COLORS[rarity]
- local level = missionInfo.iLevel == 0 and missionInfo.level or missionInfo.iLevel
- local toast = E:GetToast()
-
- if isAdded then
- toast.Title:SetText(L["GARRISON_MISSION_ADDED"])
- else
- toast.Title:SetText(L["GARRISON_MISSION_COMPLETED"])
- end
-
- if rarity >= C.db.profile.colors.threshold then
- if C.db.profile.colors.name then
- toast.Text:SetTextColor(color.r, color.g, color.b)
- end
-
- if C.db.profile.colors.border then
- toast.Border:SetVertexColor(color.r, color.g, color.b)
- end
- end
-
- toast.Text:SetText(missionInfo.name)
- toast.Icon:SetPoint("TOPLEFT", -1, 1)
- toast.Icon:SetSize(44, 44)
- toast.Icon:SetTexCoord(0, 1, 0, 1)
- toast.Icon:SetAtlas(missionInfo.typeAtlas, false)
- toast.IconText1:SetText(level)
-
- toast._data.event = event
- toast._data.mission_id = missionID
-
- if garrisonType == LE_GARRISON_TYPE_8_0 then
- toast._data.sound_file = C.db.profile.types.garrison_8_0.sfx and 44294 -- SOUNDKIT.UI_GARRISON_TOAST_MISSION_COMPLETE
-
- toast:Spawn(C.db.profile.types.garrison_8_0.anchor, C.db.profile.types.garrison_8_0.dnd)
- elseif garrisonType == LE_GARRISON_TYPE_7_0 then
- toast._data.sound_file = C.db.profile.types.garrison_7_0.sfx and 44294 -- SOUNDKIT.UI_GARRISON_TOAST_MISSION_COMPLETE
-
- toast:Spawn(C.db.profile.types.garrison_7_0.anchor, C.db.profile.types.garrison_7_0.dnd)
- elseif garrisonType == LE_GARRISON_TYPE_6_0 then
- toast._data.sound_file = C.db.profile.types.garrison_6_0.sfx and 44294 -- SOUNDKIT.UI_GARRISON_TOAST_MISSION_COMPLETE
-
- toast:Spawn(C.db.profile.types.garrison_6_0.anchor, C.db.profile.types.garrison_6_0.dnd)
- end
-end
-
-local function GARRISON_MISSION_FINISHED(followerTypeID, missionID)
- local garrisonType = getGarrisonTypeByFollowerType(followerTypeID)
- if (garrisonType == LE_GARRISON_TYPE_8_0 and not C.db.profile.types.garrison_8_0.enabled)
- or (garrisonType == LE_GARRISON_TYPE_7_0 and not C.db.profile.types.garrison_7_0.enabled)
- or (garrisonType == LE_GARRISON_TYPE_6_0 and not C.db.profile.types.garrison_6_0.enabled) then
- return
- end
-
- local _, instanceType = GetInstanceInfo()
- local validInstance = false
-
- if instanceType == "none" or C_Garrison.IsOnGarrisonMap() then
- validInstance = true
- end
-
- if validInstance then
- MissionToast_SetUp("GARRISON_MISSION_FINISHED", garrisonType, missionID)
- end
-end
-
-local function GARRISON_RANDOM_MISSION_ADDED(followerTypeID, missionID)
- local garrisonType = getGarrisonTypeByFollowerType(followerTypeID)
- if (garrisonType == LE_GARRISON_TYPE_8_0 and not C.db.profile.types.garrison_8_0.enabled)
- or (garrisonType == LE_GARRISON_TYPE_7_0 and not C.db.profile.types.garrison_7_0.enabled)
- or (garrisonType == LE_GARRISON_TYPE_6_0 and not C.db.profile.types.garrison_6_0.enabled) then
- return
- end
-
- MissionToast_SetUp("GARRISON_RANDOM_MISSION_ADDED", garrisonType, missionID, true)
-end
-
-------
-
-local function FollowerToast_OnEnter(self)
- if self._data.follower_id then
- local isOK, link = pcall(C_Garrison.GetFollowerLink, self._data.follower_id)
- if not isOK then
- isOK, link = pcall(C_Garrison.GetFollowerLinkByID, self._data.follower_id)
- end
-
- if isOK and link then
- local _, garrisonFollowerID, quality, level, itemLevel, ability1, ability2, ability3, ability4, trait1, trait2, trait3, trait4, spec1 = s_split(":", link)
- garrisonFollowerID = tonumber(garrisonFollowerID)
- local data = {
- garrisonFollowerID = garrisonFollowerID,
- followerTypeID = C_Garrison.GetFollowerTypeByID(garrisonFollowerID),
- collected = false,
- hyperlink = false,
- name = C_Garrison.GetFollowerNameByID(garrisonFollowerID),
- spec = C_Garrison.GetFollowerClassSpecByID(garrisonFollowerID),
- portraitIconID = C_Garrison.GetFollowerPortraitIconIDByID(garrisonFollowerID),
- quality = tonumber(quality),
- level = tonumber(level),
- xp = 0,
- levelxp = 0,
- iLevel = tonumber(itemLevel),
- spec1 = tonumber(spec1),
- ability1 = tonumber(ability1),
- ability2 = tonumber(ability2),
- ability3 = tonumber(ability3),
- ability4 = tonumber(ability4),
- trait1 = tonumber(trait1),
- trait2 = tonumber(trait2),
- trait3 = tonumber(trait3),
- trait4 = tonumber(trait4),
- isTroop = C_Garrison.GetFollowerIsTroop(garrisonFollowerID),
- }
-
- local tooltip
- if data.followerTypeID == LE_FOLLOWER_TYPE_SHIPYARD_6_2 then
- tooltip = GarrisonShipyardFollowerTooltip
- GarrisonFollowerTooltipTemplate_SetShipyardFollower(tooltip, data)
- else
- tooltip = GarrisonFollowerTooltip
- GarrisonFollowerTooltipTemplate_SetGarrisonFollower(tooltip, data)
- end
-
- tooltip:Show()
- tooltip:ClearAllPoints()
- tooltip:SetPoint(GameTooltip:GetPoint())
- end
- end
-end
-
-local function FollowerToast_SetUp(event, garrisonType, followerTypeID, followerID, name, texPrefix, level, quality, isUpgraded)
- local followerInfo = C_Garrison.GetFollowerInfo(followerID)
- local followerStrings = GarrisonFollowerOptions[followerTypeID].strings
- local upgradeTexture = LOOTUPGRADEFRAME_QUALITY_TEXTURES[quality] or LOOTUPGRADEFRAME_QUALITY_TEXTURES[2]
- local color = ITEM_QUALITY_COLORS[quality]
- local toast = E:GetToast()
-
- if followerTypeID == LE_FOLLOWER_TYPE_SHIPYARD_6_2 then
- toast.Icon:SetPoint("TOPLEFT", -2, -1)
- toast.Icon:SetSize(46, 40)
- toast.Icon:SetTexCoord(0, 1, 0, 1)
- toast.Icon:SetAtlas(texPrefix .. "-Portrait", false)
- else
- local portrait
- if followerInfo.portraitIconID and followerInfo.portraitIconID ~= 0 then
- portrait = followerInfo.portraitIconID
- else
- portrait = "Interface\\Garrison\\Portraits\\FollowerPortrait_NoPortrait"
- end
-
- toast.Icon:SetTexture(portrait)
- toast.Icon:SetTexCoord(0, 1, 0, 1)
- toast.IconText1:SetText(level)
- end
-
- if isUpgraded then
- toast:SetBackground("upgrade")
- toast.Title:SetText(followerStrings.FOLLOWER_ADDED_UPGRADED_TOAST)
-
- for i = 1, 5 do
- toast["Arrow" .. i]:SetAtlas(upgradeTexture.arrow, true)
- end
- else
- toast.Title:SetText(followerStrings.FOLLOWER_ADDED_TOAST)
- end
-
- if quality >= C.db.profile.colors.threshold then
- if C.db.profile.colors.name then
- toast.Text:SetTextColor(color.r, color.g, color.b)
- end
-
- if C.db.profile.colors.border then
- toast.Border:SetVertexColor(color.r, color.g, color.b)
- end
- end
-
- toast.Text:SetText(name)
-
- toast._data.event = event
- toast._data.follower_id = followerID
- toast._data.show_arrows = isUpgraded
-
- toast:HookScript("OnEnter", FollowerToast_OnEnter)
-
- if garrisonType == LE_GARRISON_TYPE_8_0 then
- toast._data.sound_file = C.db.profile.types.garrison_8_0.sfx and 44296 -- SOUNDKIT.UI_GARRISON_TOAST_FOLLOWER_GAINED
-
- toast:Spawn(C.db.profile.types.garrison_8_0.anchor, C.db.profile.types.garrison_8_0.dnd)
- elseif garrisonType == LE_GARRISON_TYPE_7_0 then
- toast._data.sound_file = C.db.profile.types.garrison_7_0.sfx and 44296 -- SOUNDKIT.UI_GARRISON_TOAST_FOLLOWER_GAINED
-
- toast:Spawn(C.db.profile.types.garrison_7_0.anchor, C.db.profile.types.garrison_7_0.dnd)
- elseif garrisonType == LE_GARRISON_TYPE_6_0 then
- toast._data.sound_file = C.db.profile.types.garrison_6_0.sfx and 44296 -- SOUNDKIT.UI_GARRISON_TOAST_FOLLOWER_GAINED
-
- toast:Spawn(C.db.profile.types.garrison_6_0.anchor, C.db.profile.types.garrison_6_0.dnd)
- end
-end
-
-local function GARRISON_FOLLOWER_ADDED(followerID, name, _, level, quality, isUpgraded, texPrefix, followerTypeID)
- local garrisonType = getGarrisonTypeByFollowerType(followerTypeID)
- if (garrisonType == LE_GARRISON_TYPE_8_0 and not C.db.profile.types.garrison_8_0.enabled)
- or (garrisonType == LE_GARRISON_TYPE_7_0 and not C.db.profile.types.garrison_7_0.enabled)
- or (garrisonType == LE_GARRISON_TYPE_6_0 and not C.db.profile.types.garrison_6_0.enabled) then
- return
- end
-
- FollowerToast_SetUp("GARRISON_FOLLOWER_ADDED", garrisonType, followerTypeID, followerID, name, texPrefix, level, quality, isUpgraded)
-end
-
-------
-
-local function BuildingToast_SetUp(event, buildingName)
- local toast = E:GetToast()
-
- toast.Title:SetText(L["GARRISON_NEW_BUILDING"])
- toast.Text:SetText(buildingName)
- toast.Icon:SetTexture("Interface\\Icons\\Garrison_Build")
- toast.IconBorder:Show()
-
- toast._data.event = event
- toast._data.sound_file = C.db.profile.types.garrison_6_0.sfx and 44295 -- SOUNDKIT.UI_GARRISON_TOAST_BUILDING_COMPLETE
-
- toast:Spawn(C.db.profile.types.garrison_6_0.anchor, C.db.profile.types.garrison_6_0.dnd)
-end
-
-local function GARRISON_BUILDING_ACTIVATABLE(buildingName)
- BuildingToast_SetUp("GARRISON_BUILDING_ACTIVATABLE", buildingName)
-end
-
-------
-
-local function TalentToast_SetUp(event, garrisonType, talentID)
- local talent = C_Garrison.GetTalent(talentID)
- local toast = E:GetToast()
-
- toast.Title:SetText(L["GARRISON_NEW_TALENT"])
- toast.Text:SetText(talent.name)
- toast.Icon:SetTexture(talent.icon)
- toast.IconBorder:Show()
-
- toast._data.event = event
- toast._data.talend_id = talentID
-
- if garrisonType == LE_GARRISON_TYPE_8_0 then
- toast._data.sound_file = C.db.profile.types.garrison_8_0.sfx and 73280 -- SOUNDKIT.UI_ORDERHALL_TALENT_READY_TOAST
-
- toast:Spawn(C.db.profile.types.garrison_8_0.anchor, C.db.profile.types.garrison_8_0.dnd)
- elseif garrisonType == LE_GARRISON_TYPE_7_0 then
- toast._data.sound_file = C.db.profile.types.garrison_7_0.sfx and 73280 -- SOUNDKIT.UI_ORDERHALL_TALENT_READY_TOAST
-
- toast:Spawn(C.db.profile.types.garrison_7_0.anchor, C.db.profile.types.garrison_7_0.dnd)
- end
-end
-
-local function GARRISON_TALENT_COMPLETE(garrisonType, doAlert)
- if doAlert then
- TalentToast_SetUp("GARRISON_TALENT_COMPLETE", garrisonType, C_Garrison.GetCompleteTalent(garrisonType))
- end
-end
-
-local function Enable()
- if C.db.profile.types.garrison_8_0.enabled or C.db.profile.types.garrison_7_0.enabled or C.db.profile.types.garrison_6_0.enabled then
- E:RegisterEvent("GARRISON_FOLLOWER_ADDED", GARRISON_FOLLOWER_ADDED)
- E:RegisterEvent("GARRISON_MISSION_FINISHED", GARRISON_MISSION_FINISHED)
- E:RegisterEvent("GARRISON_RANDOM_MISSION_ADDED", GARRISON_RANDOM_MISSION_ADDED)
-
- if C.db.profile.types.garrison_6_0.enabled then
- E:RegisterEvent("GARRISON_BUILDING_ACTIVATABLE", GARRISON_BUILDING_ACTIVATABLE)
- end
-
- if C.db.profile.types.garrison_8_0.enabled or C.db.profile.types.garrison_7_0.enabled then
- E:RegisterEvent("GARRISON_TALENT_COMPLETE", GARRISON_TALENT_COMPLETE)
- end
- end
-end
-
-local function Disable()
- if not (C.db.profile.types.garrison_8_0.enabled and C.db.profile.types.garrison_7_0.enabled and C.db.profile.types.garrison_6_0.enabled) then
- E:UnregisterEvent("GARRISON_FOLLOWER_ADDED", GARRISON_FOLLOWER_ADDED)
- E:UnregisterEvent("GARRISON_MISSION_FINISHED", GARRISON_MISSION_FINISHED)
- E:UnregisterEvent("GARRISON_RANDOM_MISSION_ADDED", GARRISON_RANDOM_MISSION_ADDED)
- end
-
- if not C.db.profile.types.garrison_6_0.enabled then
- E:UnregisterEvent("GARRISON_BUILDING_ACTIVATABLE", GARRISON_BUILDING_ACTIVATABLE)
- end
-
- if not (C.db.profile.types.garrison_8_0.enabled and C.db.profile.types.garrison_7_0.enabled) then
- E:UnregisterEvent("GARRISON_TALENT_COMPLETE", GARRISON_TALENT_COMPLETE)
- end
-end
-
-local function TestGarrison()
- -- follower
- local followers = C_Garrison.GetFollowers(LE_FOLLOWER_TYPE_GARRISON_6_0)
- local follower = followers and followers[1] or nil
- if follower then
- FollowerToast_SetUp("GARRISON_FOLLOWER_TEST", LE_GARRISON_TYPE_6_0, follower.followerTypeID, follower.followerID, follower.name, nil, follower.level, follower.quality, false)
- end
-
- -- ship
- followers = C_Garrison.GetFollowers(LE_FOLLOWER_TYPE_SHIPYARD_6_2)
- follower = followers and followers[1] or nil
- if follower then
- FollowerToast_SetUp("GARRISON_FOLLOWER_TEST", LE_GARRISON_TYPE_6_0, follower.followerTypeID, follower.followerID, follower.name, follower.texPrefix, follower.level, follower.quality, false)
- end
-
- -- garrison mission
- local missions = C_Garrison.GetAvailableMissions(LE_FOLLOWER_TYPE_GARRISON_6_0)
- local missionID = missions and missions[1] and missions[1].missionID or nil
- if missionID then
- MissionToast_SetUp("GARRISON_MISSION_TEST", LE_GARRISON_TYPE_6_0, missionID)
- end
-
- -- shipyard mission
- missions = C_Garrison.GetAvailableMissions(LE_FOLLOWER_TYPE_SHIPYARD_6_2)
- missionID = missions and missions[1] and missions[1].missionID or nil
- if missionID then
- MissionToast_SetUp("GARRISON_MISSION_TEST", LE_GARRISON_TYPE_6_0, missionID)
- end
-
- -- building
- local buildings = C_Garrison.GetBuildings(LE_GARRISON_TYPE_6_0)
- local buildingID = buildings and buildings[1] and buildings[1].buildingID or nil
- if buildingID then
- BuildingToast_SetUp("GARRISON_BUILDING_TEST", select(2, C_Garrison.GetBuildingInfo(buildingID)))
- end
-end
-
-local function TestClassHall()
- -- champion
- local followers = C_Garrison.GetFollowers(LE_FOLLOWER_TYPE_GARRISON_7_0)
- local follower = followers and followers[1] or nil
- if follower then
- FollowerToast_SetUp("GARRISON_FOLLOWER_TEST", LE_GARRISON_TYPE_7_0, follower.followerTypeID, follower.followerID, follower.name, nil, follower.level, follower.quality, false)
- end
-
- -- mission
- local missions = C_Garrison.GetAvailableMissions(LE_FOLLOWER_TYPE_GARRISON_7_0)
- local missionID = missions and missions[1] and missions[1].missionID or nil
- if missionID then
- MissionToast_SetUp("GARRISON_MISSION_TEST", LE_GARRISON_TYPE_7_0, missionID)
- end
-
- -- talent
- local talentTreeIDs = C_Garrison.GetTalentTreeIDsByClassID(LE_GARRISON_TYPE_7_0, PLAYER_CLASS)
- local talentTreeID = talentTreeIDs and talentTreeIDs[1] or nil
- local tree, _
-
- if talentTreeID then
- _, _, tree = C_Garrison.GetTalentTreeInfoForID(talentTreeID)
- end
-
- local talentID = tree and tree[1] and tree[1].id or nil
- if talentID then
- TalentToast_SetUp("GARRISON_TALENT_TEST", LE_GARRISON_TYPE_7_0, talentID)
- end
-end
-
-local function TestWarEffort()
- -- champion
- local followers = C_Garrison.GetFollowers(LE_FOLLOWER_TYPE_GARRISON_8_0)
- local follower = followers and followers[1] or nil
- if follower then
- FollowerToast_SetUp("GARRISON_FOLLOWER_TEST", LE_GARRISON_TYPE_8_0, follower.followerTypeID, follower.followerID, follower.name, nil, follower.level, follower.quality, false)
- end
-
- -- mission
- local missions = C_Garrison.GetAvailableMissions(LE_FOLLOWER_TYPE_GARRISON_8_0)
- local missionID = missions and missions[1] and missions[1].missionID or nil
- if missionID then
- MissionToast_SetUp("GARRISON_MISSION_TEST", LE_GARRISON_TYPE_8_0, missionID)
- end
-end
-
-E:RegisterOptions("garrison_6_0", {
- enabled = false,
- anchor = 1,
- dnd = true,
- sfx = true,
-}, {
- name = L["TYPE_GARRISON"],
- get = function(info)
- return C.db.profile.types.garrison_6_0[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.garrison_6_0[info[#info]] = value
- end,
- args = {
- enabled = {
- order = 1,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.garrison_6_0.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 2,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- sfx = {
- order = 3,
- type = "toggle",
- name = L["SFX"],
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = TestGarrison,
- },
- },
-})
-
-E:RegisterOptions("garrison_7_0", {
- enabled = true,
- anchor = 1,
- dnd = true,
- sfx = true,
-}, {
- name = L["TYPE_CLASS_HALL"],
- get = function(info)
- return C.db.profile.types.garrison_7_0[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.garrison_7_0[info[#info]] = value
- end,
- args = {
- enabled = {
- order = 1,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.garrison_7_0.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 2,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- sfx = {
- order = 3,
- type = "toggle",
- name = L["SFX"],
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = TestClassHall,
- },
- },
-})
-
-E:RegisterOptions("garrison_8_0", {
- enabled = true,
- anchor = 1,
- dnd = true,
- sfx = true,
-}, {
- name = L["TYPE_WAR_EFFORT"],
- get = function(info)
- return C.db.profile.types.garrison_8_0[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.garrison_8_0[info[#info]] = value
- end,
- args = {
- enabled = {
- order = 1,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.garrison_8_0.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 2,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- sfx = {
- order = 3,
- type = "toggle",
- name = L["SFX"],
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = TestWarEffort,
- },
- },
-})
-
-E:RegisterSystem("garrison_6_0", Enable, Disable, TestGarrison)
-E:RegisterSystem("garrison_7_0", Enable, Disable, TestClassHall)
-E:RegisterSystem("garrison_8_0", Enable, Disable, TestWarEffort)
diff --git a/systems/instance.lua b/systems/instance.lua
deleted file mode 100644
index 51b58e0..0000000
--- a/systems/instance.lua
+++ /dev/null
@@ -1,209 +0,0 @@
-local _, addonTable = ...
-local E, L, C = addonTable.E, addonTable.L, addonTable.C
-
--- Lua
-local _G = getfenv(0)
-
--- Blizz
-local C_Scenario = _G.C_Scenario
-
---[[ luacheck: globals
- GameTooltip GetLFGCompletionReward GetLFGCompletionRewardItem GetLFGCompletionRewardItemLink GetLFGDungeonInfo
- GetMoneyString UnitLevel
-
- LE_SCENARIO_TYPE_LEGION_INVASION LFG_SUBTYPEID_HEROIC MAX_PLAYER_LEVEL
-]]
-
--- Mine
-local function Slot_OnEnter(self)
- if self._data.type then
- if self._data.type == "item" then
- GameTooltip:SetHyperlink(self._data.link)
- elseif self._data.type == "xp" then
- GameTooltip:AddLine(L["YOU_RECEIVED"])
- GameTooltip:AddLine(L["XP_FORMAT"]:format(self._data.count), 1, 1, 1)
- elseif self._data.type == "money" then
- GameTooltip:AddLine(L["YOU_RECEIVED"])
- GameTooltip:AddLine(GetMoneyString(self._data.count, true), 1, 1, 1)
- end
-
- GameTooltip:Show()
- end
-end
-
-local function Toast_SetUp(event, name, subTypeID, textureFile, moneyReward, xpReward, numItemRewards, isScenario, isScenarioBonusComplete)
- local toast = E:GetToast()
- local usedSlots = 0
- local soundFile
-
- if moneyReward and moneyReward > 0 then
- usedSlots = usedSlots + 1
-
- local slot = toast["Slot" .. usedSlots]
- if slot then
- slot.Icon:SetTexture("Interface\\Icons\\inv_misc_coin_02")
-
- slot._data.type = "money"
- slot._data.count = moneyReward
-
- slot:HookScript("OnEnter", Slot_OnEnter)
- slot:Show()
- end
- end
-
- if xpReward and xpReward > 0 and UnitLevel("player") < MAX_PLAYER_LEVEL then
- usedSlots = usedSlots + 1
-
- local slot = toast["Slot" .. usedSlots]
- if slot then
- slot.Icon:SetTexture("Interface\\Icons\\xp_icon")
-
- slot._data.type = "xp"
- slot._data.count = xpReward
-
- slot:HookScript("OnEnter", Slot_OnEnter)
- slot:Show()
- end
- end
-
- for i = 1, numItemRewards or 0 do
- local link = GetLFGCompletionRewardItemLink(i)
- if link then
- usedSlots = usedSlots + 1
-
- local slot = toast["Slot" .. usedSlots]
- if slot then
- local texture = GetLFGCompletionRewardItem(i)
- texture = texture or "Interface\\Icons\\INV_Box_02"
-
- slot.Icon:SetTexture(texture)
-
- slot._data.type = "item"
- slot._data.link = link
-
- slot:HookScript("OnEnter", Slot_OnEnter)
- slot:Show()
- end
- end
- end
-
- if isScenario then
- if isScenarioBonusComplete and not toast.Bonus.isHidden then
- toast.Bonus:Show()
- end
-
- toast.Title:SetText(L["SCENARIO_COMPLETED"])
-
- soundFile = 31754 -- SOUNDKIT.UI_SCENARIO_ENDING
- else
- if subTypeID == LFG_SUBTYPEID_HEROIC and not toast.Skull.isHidden then
- toast.Skull:Show()
- end
-
- toast.Title:SetText(L["DUNGEON_COMPLETED"])
-
- soundFile = 17316 -- SOUNDKIT.LFG_REWARDS
- end
-
- toast:SetBackground("dungeon")
- toast.Text:SetText(name)
- toast.Icon:SetTexture(textureFile or "Interface\\LFGFrame\\LFGIcon-Dungeon")
- toast.IconBorder:Show()
-
- toast._data.event = event
- toast._data.sound_file = C.db.profile.types.instance.sfx and soundFile
- toast._data.used_slots = usedSlots
-
- toast:Spawn(C.db.profile.types.instance.anchor, C.db.profile.types.instance.dnd)
-end
-
-local function LFG_COMPLETION_REWARD()
- if C_Scenario.IsInScenario() and not C_Scenario.TreatScenarioAsDungeon() then
- local _, _, _, _, hasBonusStep, isBonusStepComplete, _, _, _, scenarioType = C_Scenario.GetInfo()
-
- if scenarioType ~= LE_SCENARIO_TYPE_LEGION_INVASION then
- local name, _, subTypeID, textureFile, moneyBase, moneyVar, experienceBase, experienceVar, numStrangers, numItemRewards = GetLFGCompletionReward()
-
- Toast_SetUp("LFG_COMPLETION_REWARD", name, subTypeID, textureFile, moneyBase + moneyVar * numStrangers, experienceBase + experienceVar * numStrangers, numItemRewards, true, hasBonusStep and isBonusStepComplete)
- end
- else
- local name, _, subTypeID, textureFile, moneyBase, moneyVar, experienceBase, experienceVar, numStrangers, numItemRewards = GetLFGCompletionReward()
-
- Toast_SetUp("LFG_COMPLETION_REWARD", name, subTypeID, textureFile, moneyBase + moneyVar * numStrangers, experienceBase + experienceVar * numStrangers, numItemRewards)
- end
-end
-
-local function Enable()
- if C.db.profile.types.instance.enabled then
- E:RegisterEvent("LFG_COMPLETION_REWARD", LFG_COMPLETION_REWARD)
- end
-end
-
-local function Disable()
- E:UnregisterEvent("LFG_COMPLETION_REWARD", LFG_COMPLETION_REWARD)
-end
-
-local function Test()
- -- dungeon, Wailing Caverns
- local name, _, subTypeID = GetLFGDungeonInfo(1)
- if name then
- Toast_SetUp("INSTANCE_TEST", name, subTypeID, nil, 123456, 123456, 0)
- end
-
- -- scenario, Crypt of Forgotten Kings
- name, _, subTypeID = GetLFGDungeonInfo(504)
- if name then
- Toast_SetUp("INSTANCE_TEST", name, subTypeID, nil, 123456, 123456, 0, true, true)
- end
-end
-
-E:RegisterOptions("instance", {
- enabled = true,
- anchor = 1,
- dnd = false,
- sfx = true,
-}, {
- name = L["TYPE_DUNGEON"],
- get = function(info)
- return C.db.profile.types.instance[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.instance[info[#info]] = value
- end,
- args = {
- enabled = {
- order = 1,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.instance.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 2,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- sfx = {
- order = 3,
- type = "toggle",
- name = L["SFX"],
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = Test,
- },
- },
-})
-
-E:RegisterSystem("instance", Enable, Disable, Test)
diff --git a/systems/loot_common.lua b/systems/loot_common.lua
index 42c5f5d..708d9ce 100644
--- a/systems/loot_common.lua
+++ b/systems/loot_common.lua
@@ -3,18 +3,13 @@ local E, L, C = addonTable.E, addonTable.L, addonTable.C
-- Lua
local _G = getfenv(0)
-local m_random = _G.math.random
-local s_split = _G.string.split
local tonumber = _G.tonumber
-- Blizz
-local C_MountJournal = _G.C_MountJournal
-local C_PetJournal = _G.C_PetJournal
local C_Timer = _G.C_Timer
--[[ luacheck: globals
- BattlePetToolTip_Show DressUpBattlePet DressUpMount DressUpVisual GameTooltip GetItemInfo IsDressableItem
- IsModifiedClick OpenBag UnitGUID
+ DressUpVisual GameTooltip GetItemInfo IsDressableItem IsModifiedClick OpenBag UnitGUID UnitName
ITEM_QUALITY_COLORS ITEM_QUALITY1_DESC ITEM_QUALITY2_DESC ITEM_QUALITY3_DESC ITEM_QUALITY4_DESC
LOOT_ITEM_CREATED_SELF LOOT_ITEM_CREATED_SELF_MULTIPLE LOOT_ITEM_PUSHED_SELF LOOT_ITEM_PUSHED_SELF_MULTIPLE
@@ -23,6 +18,7 @@ local C_Timer = _G.C_Timer
-- Mine
local PLAYER_GUID = UnitGUID("player")
+local PLAYER_NAME = UnitName("player")
local CACHED_LOOT_ITEM_CREATED
local CACHED_LOOT_ITEM_CREATED_MULTIPLE
@@ -86,36 +82,6 @@ local function dressUp(link)
return
end
end
-
- -- battle pet
- local creatureID, displayID
-
- local linkType, linkID, _ = s_split(":", link)
- if linkType == "item" then
- _, _, _, creatureID, _, _, _, _, _, _, _, displayID = C_PetJournal.GetPetInfoByItemID(tonumber(linkID))
- elseif linkType == "battlepet" then
- _, _, _, creatureID, _, _, _, _, _, _, _, displayID = C_PetJournal.GetPetInfoBySpeciesID(tonumber(linkID))
- end
-
- if creatureID and displayID then
- if DressUpBattlePet(creatureID, displayID) then
- return
- end
- end
-
- -- mount
- local mountID
-
- linkType, linkID = s_split(":", link)
- if linkType == "item" then
- mountID = C_MountJournal.GetMountFromItem(tonumber(linkID))
- elseif linkType == "spell" then
- mountID = C_MountJournal.GetMountFromSpell(tonumber(linkID))
- end
-
- if mountID then
- DressUpMount(C_MountJournal.GetMountInfoExtraByID(mountID))
- end
end
local function Toast_OnClick(self)
@@ -131,13 +97,8 @@ end
local function Toast_OnEnter(self)
if self._data.tooltip_link then
- if self._data.tooltip_link:find("item") then
- GameTooltip:SetHyperlink(self._data.tooltip_link)
- GameTooltip:Show()
- elseif self._data.tooltip_link:find("battlepet") then
- local _, speciesID, level, breedQuality, maxHealth, power, speed = s_split(":", self._data.tooltip_link)
- BattlePetToolTip_Show(tonumber(speciesID), tonumber(level), tonumber(breedQuality), tonumber(maxHealth), tonumber(power), tonumber(speed))
- end
+ GameTooltip:SetHyperlink(self._data.tooltip_link)
+ GameTooltip:Show()
end
end
@@ -146,36 +107,17 @@ local function PostSetAnimatedValue(self, value)
end
local function Toast_SetUp(event, link, quantity)
- local sanitizedLink, originalLink, linkType, itemID = E:SanitizeLink(link)
- local toast, isNew, isQueued
-
- -- Check if there's a toast for this item from another event
- toast, isQueued = E:FindToast(nil, "item_id", itemID)
- if toast then
- if toast._data.event ~= event then
- return
- end
- else
- toast, isNew, isQueued = E:GetToast(event, "link", sanitizedLink)
- end
-
+ local sanitizedLink, originalLink, _, itemID = E:SanitizeLink(link)
+ local toast, isNew, isQueued = E:GetToast(event, "link", sanitizedLink)
if isNew then
- local name, quality, icon, _, classID, subClassID, bindType, isQuestItem
-
- if linkType == "battlepet" then
- local _, speciesID, _, breedQuality, _ = s_split(":", originalLink)
- name, icon = C_PetJournal.GetPetInfoBySpeciesID(speciesID)
- quality = tonumber(breedQuality)
- else
- name, _, quality, _, _, _, _, _, _, icon, _, classID, subClassID, bindType = GetItemInfo(originalLink)
- isQuestItem = bindType == 4 or (classID == 12 and subClassID == 0)
- end
+ local name, _, quality, _, _, _, _, _, _, icon, _, classID, subClassID, bindType = GetItemInfo(originalLink)
+ local isQuestItem = bindType == 4 or (classID == 12 and subClassID == 0)
if name and ((quality and quality >= C.db.profile.types.loot_common.threshold and quality <= 5)
or (C.db.profile.types.loot_common.quest and isQuestItem)) then
local color = ITEM_QUALITY_COLORS[quality] or ITEM_QUALITY_COLORS[1]
local title = L["YOU_RECEIVED"]
- local soundFile = 31578 -- SOUNDKIT.UI_EPICLOOT_TOAST
+ local soundFile = "Interface\\AddOns\\ls_Toasts\\assets\\ui-common-loot-toast.OGG"
toast.IconText1.PostSetAnimatedValue = PostSetAnimatedValue
@@ -203,7 +145,7 @@ local function Toast_SetUp(event, link, quantity)
if quality == 5 then
title = L["ITEM_LEGENDARY"]
- soundFile = 63971 -- SOUNDKIT.UI_LEGENDARY_LOOT_TOAST
+ soundFile = "Interface\\AddOns\\ls_Toasts\\assets\\ui-legendary-loot-toast.OGG"
toast:SetBackground("legendary")
@@ -253,8 +195,8 @@ local function Toast_SetUp(event, link, quantity)
end
end
-local function CHAT_MSG_LOOT(message, _, _, _, _, _, _, _, _, _, _, guid)
- if guid ~= PLAYER_GUID then
+local function CHAT_MSG_LOOT(message, _, _, _, name, _, _, _, _, _, _, guid)
+ if guid and guid ~= PLAYER_GUID or name ~= PLAYER_NAME then
return
end
@@ -297,14 +239,35 @@ local function Disable()
end
local function Test()
- -- item, Chaos Crystal
- local _, link = GetItemInfo(124442)
+ -- common, Hearthstone
+ local _, link = GetItemInfo(6948)
+ if link then
+ Toast_SetUp("COMMON_LOOT_TEST", link, 1)
+ end
+
+ -- uncommon, Chromatic Sword
+ _, link = GetItemInfo(1604)
+ if link then
+ Toast_SetUp("COMMON_LOOT_TEST", link, 1)
+ end
+
+ -- rare, Arcanite Reaper
+ _, link = GetItemInfo(12784)
+ if link then
+ Toast_SetUp("COMMON_LOOT_TEST", link, 1)
+ end
+
+ -- epic, Corrupted Ashbringer
+ _, link = GetItemInfo(22691)
if link then
- Toast_SetUp("COMMON_LOOT_TEST", link, m_random(9, 99))
+ Toast_SetUp("COMMON_LOOT_TEST", link, 1)
end
- -- battlepet, Anubisath Idol
- Toast_SetUp("COMMON_LOOT_TEST", "battlepet:1155:25:3:1725:276:244:0000000000000000", 1)
+ -- legendary, Atiesh, Greatstaff of the Guardian
+ _, link = GetItemInfo(22589)
+ if link then
+ Toast_SetUp("COMMON_LOOT_TEST", link, 1)
+ end
end
E:RegisterOptions("loot_common", {
@@ -324,13 +287,8 @@ E:RegisterOptions("loot_common", {
C.db.profile.types.loot_common[info[#info]] = value
end,
args = {
- desc = {
- order = 1,
- type = "description",
- name = L["TYPE_LOOT_COMMON_DESC"],
- },
enabled = {
- order = 2,
+ order = 1,
type = "toggle",
name = L["ENABLE"],
set = function(_, value)
@@ -344,24 +302,24 @@ E:RegisterOptions("loot_common", {
end
},
dnd = {
- order = 3,
+ order = 2,
type = "toggle",
name = L["DND"],
desc = L["DND_TOOLTIP"],
},
sfx = {
- order = 4,
+ order = 3,
type = "toggle",
name = L["SFX"],
},
ilvl = {
- order = 5,
+ order = 4,
type = "toggle",
name = L["SHOW_ILVL"],
desc = L["SHOW_ILVL_DESC"],
},
threshold = {
- order = 6,
+ order = 5,
type = "select",
name = L["LOOT_THRESHOLD"],
values = {
@@ -372,7 +330,7 @@ E:RegisterOptions("loot_common", {
},
},
quest = {
- order = 7,
+ order = 6,
type = "toggle",
name = L["SHOW_QUEST_ITEMS"],
desc = L["SHOW_QUEST_ITEMS_DESC"],
diff --git a/systems/loot_currency.lua b/systems/loot_currency.lua
deleted file mode 100644
index 345419e..0000000
--- a/systems/loot_currency.lua
+++ /dev/null
@@ -1,253 +0,0 @@
-local _, addonTable = ...
-local E, L, C = addonTable.E, addonTable.L, addonTable.C
-
--- Lua
-local _G = getfenv(0)
-local m_abs = _G.math.abs
-local m_random = _G.math.random
-
---[[ luacheck: globals
- FormatLargeNumber GameTooltip GetCurrencyInfo
-
- ITEM_QUALITY_COLORS
-]]
-
--- Mine
-local NO_GAIN_SOURCE = 38
-
--- https://wow.tools/dbc/?dbc=currencytypes&build=whatever
-local BLACKLIST = {
- -- 41 (Test)
- [ 22] = true, -- Birmingham Test Item 3
- -- 82 (Archaeology)
- [ 384] = true, -- Dwarf Archaeology Fragment
- [ 385] = true, -- Troll Archaeology Fragment
- [ 393] = true, -- Fossil Archaeology Fragment
- [ 394] = true, -- Night Elf Archaeology Fragment
- [ 397] = true, -- Orc Archaeology Fragment
- [ 398] = true, -- Draenei Archaeology Fragment
- [ 399] = true, -- Vrykul Archaeology Fragment
- [ 400] = true, -- Nerubian Archaeology Fragment
- [ 401] = true, -- Tol'vir Archaeology Fragment
- [ 676] = true, -- Pandaren Archaeology Fragment
- [ 677] = true, -- Mogu Archaeology Fragment
- [ 754] = true, -- Mantid Archaeology Fragment
- [ 821] = true, -- Draenor Clans Archaeology Fragment
- [ 828] = true, -- Ogre Archaeology Fragment
- [ 829] = true, -- Arakkoa Archaeology Fragment
- [ 830] = true, -- n/a
- [1172] = true, -- Highborne Archaeology Fragment
- [1173] = true, -- Highmountain Tauren Archaeology Fragment
- [1174] = true, -- Demonic Archaeology Fragment
- [1534] = true, -- Zandalari Archaeology Fragment
- [1535] = true, -- Drust Archaeology Fragment
- -- 89 (Meta)
- [ 483] = true, -- Conquest Arena Meta
- [ 484] = true, -- Conquest Rated BG Meta
- [ 692] = true, -- Conquest Random BG Meta
- -- 142 (Hidden)
- [ 395] = true, -- Justice Points
- [ 396] = true, -- Valor Points
- [1171] = true, -- Artifact Knowledge
- [1191] = true, -- Valor
- [1324] = true, -- Horde Qiraji Commendation
- [1325] = true, -- Alliance Qiraji Commendation
- [1347] = true, -- Legionfall Building - Personal Tracker - Mage Tower (Hidden)
- [1349] = true, -- Legionfall Building - Personal Tracker - Command Tower (Hidden)
- [1350] = true, -- Legionfall Building - Personal Tracker - Nether Tower (Hidden)
- [1501] = true, -- Writhing Essence
- [1506] = true, -- Argus Waystone
- -- [1540] = true, -- Wood
- -- [1541] = true, -- Iron
- -- [1559] = true, -- Essence of Storms
- [1579] = true, -- Champions of Azeroth
- [1592] = true, -- Order of Embers
- [1593] = true, -- Proudmoore Admiralty
- [1594] = true, -- Storm's Wake
- [1595] = true, -- Talanji's Expedition
- [1596] = true, -- Voldunai
- [1597] = true, -- Zandalari Empire
- [1598] = true, -- Tortollan Seekers
- [1599] = true, -- 7th Legion
- [1600] = true, -- Honorbound
- -- [1602] = true, -- Conquest
- [1703] = true, -- BFA Season Rated Participation Currency
- [1705] = true, -- Warfronts - Personal Tracker - Iron in Chest (Hidden)
- [1714] = true, -- Warfronts - Personal Tracker - Wood in Chest (Hidden)
- [1722] = true, -- Azerite Ore
- [1723] = true, -- Lumber
- [1738] = true, -- Unshackled
- [1739] = true, -- Ankoan
- [1740] = true, -- Rustbolt Resistance (Hidden)
- [1742] = true, -- Rustbolt Resistance
- [1745] = true, -- Nazjatar Ally - Neri Sharpfin
- [1746] = true, -- Nazjatar Ally - Vim Brineheart
- [1747] = true, -- Nazjatar Ally - Poen Gillbrack
- [1748] = true, -- Nazjatar Ally - Bladesman Inowari
- [1749] = true, -- Nazjatar Ally - Hunter Akana
- [1750] = true, -- Nazjatar Ally - Farseer Ori
- [1752] = true, -- Honeyback Hive
- -- 144 (Virtual)
- [1553] = true, -- Azerite
- [1585] = true, -- Honor
- [1586] = true, -- Honor Level
-}
-
-local MULT = {
- [1602] = 0.01, -- Conquest
-}
-
-local function Toast_OnEnter(self)
- if self._data.tooltip_link then
- GameTooltip:SetHyperlink(self._data.tooltip_link)
- GameTooltip:Show()
- end
-end
-
-local function PostSetAnimatedValue(self, value)
- self:SetText(value == 1 and "" or FormatLargeNumber(m_abs(value)))
-end
-
-local function Toast_SetUp(event, link, quantity, isGain)
- local toast, isNew, isQueued = E:GetToast(event, "link", link)
- if isNew then
- local name, _, icon, _, _, _, _, quality = GetCurrencyInfo(link)
- if name then
- local color = ITEM_QUALITY_COLORS[quality] or ITEM_QUALITY_COLORS[1]
-
- toast.IconText1.PostSetAnimatedValue = PostSetAnimatedValue
-
- if quality >= C.db.profile.colors.threshold then
- if C.db.profile.colors.name then
- toast.Text:SetTextColor(color.r, color.g, color.b)
- end
-
- if C.db.profile.colors.border then
- toast.Border:SetVertexColor(color.r, color.g, color.b)
- end
-
- if C.db.profile.colors.icon_border then
- toast.IconBorder:SetVertexColor(color.r, color.g, color.b)
- end
- end
-
- toast.Title:SetText(isGain and L["YOU_RECEIVED"] or L["YOU_LOST"])
- toast.Text:SetText(name)
- toast.Icon:SetTexture(icon)
- toast.IconBorder:Show()
- toast.IconText1:SetAnimatedValue(quantity, true)
-
- toast._data.count = quantity * (isGain and 1 or -1)
- toast._data.event = event
- toast._data.link = link
- toast._data.sound_file = C.db.profile.types.loot_currency.sfx and 31578 -- SOUNDKIT.UI_EPICLOOT_TOAST
- toast._data.tooltip_link = link
-
- toast:HookScript("OnEnter", Toast_OnEnter)
- toast:Spawn(C.db.profile.types.loot_currency.anchor, C.db.profile.types.loot_currency.dnd)
- else
- toast:Recycle()
- end
- else
- toast._data.count = toast._data.count + quantity * (isGain and 1 or -1)
- toast.Title:SetText(toast._data.count > 0 and L["YOU_RECEIVED"] or L["YOU_LOST"])
-
- if isQueued then
- toast.IconText1:SetAnimatedValue(toast._data.count, true)
- else
- toast.IconText1:SetAnimatedValue(toast._data.count)
-
- toast.IconText2:SetText((isGain and "+" or "-") .. quantity)
- toast.IconText2.Blink:Stop()
- toast.IconText2.Blink:Play()
-
- toast.AnimOut:Stop()
- toast.AnimOut:Play()
- end
- end
-end
-
-local function CURRENCY_DISPLAY_UPDATE(id, _, quantity, gainSource)
- if not id or BLACKLIST[id] then
- return
- end
-
- if not C.db.profile.types.loot_currency.track_loss and gainSource == NO_GAIN_SOURCE then
- return
- end
-
- Toast_SetUp("CURRENCY_DISPLAY_UPDATE", "currency:" .. id, quantity * (MULT[id] or 1), gainSource ~= NO_GAIN_SOURCE)
-end
-
-local function Enable()
- if C.db.profile.types.loot_currency.enabled then
- E:RegisterEvent("CURRENCY_DISPLAY_UPDATE", CURRENCY_DISPLAY_UPDATE)
- end
-end
-
-local function Disable()
- E:UnregisterEvent("CURRENCY_DISPLAY_UPDATE", CURRENCY_DISPLAY_UPDATE)
-end
-
-local function Test()
- -- Order Resources
- Toast_SetUp("LOOT_CURRENCY_TEST", "currency:" .. 1220, m_random(300, 600), m_random(38, 39) == NO_GAIN_SOURCE)
-end
-
-E:RegisterOptions("loot_currency", {
- enabled = true,
- anchor = 1,
- dnd = false,
- sfx = true,
- track_loss = false,
-}, {
- name = L["TYPE_LOOT_CURRENCY"],
- get = function(info)
- return C.db.profile.types.loot_currency[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.loot_currency[info[#info]] = value
- end,
- args = {
- enabled = {
- order = 1,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.loot_currency.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 2,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- sfx = {
- order = 3,
- type = "toggle",
- name = L["SFX"],
- },
- track_loss = {
- order = 4,
- type = "toggle",
- name = L["TRACK_LOSS"],
- desc = L["TRACK_LOSS_DESC"],
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = Test,
- },
- },
-})
-
-E:RegisterSystem("loot_currency", Enable, Disable, Test)
diff --git a/systems/loot_gold.lua b/systems/loot_gold.lua
index e5eaeeb..1228ce0 100644
--- a/systems/loot_gold.lua
+++ b/systems/loot_gold.lua
@@ -32,7 +32,7 @@ local function Toast_SetUp(event, quantity)
toast.IconBorder:SetVertexColor(0.9, 0.75, 0.26)
end
- toast.Title:SetText(quantity > 0 and L["YOU_RECEIVED"] or L["YOU_LOST"])
+ toast.Title:SetText(quantity > 0 and L["YOU_RECEIVED"] or L["YOU_LOST_RED"])
toast.Text:SetAnimatedValue(quantity, true)
toast.Icon:SetTexture("Interface\\Icons\\INV_Misc_Coin_02")
toast.IconBorder:Show()
@@ -44,7 +44,7 @@ local function Toast_SetUp(event, quantity)
toast:Spawn(C.db.profile.types.loot_gold.anchor, C.db.profile.types.loot_gold.dnd)
else
toast._data.count = toast._data.count + quantity
- toast.Title:SetText(toast._data.count > 0 and L["YOU_RECEIVED"] or L["YOU_LOST"])
+ toast.Title:SetText(toast._data.count > 0 and L["YOU_RECEIVED"] or L["YOU_LOST_RED"])
if isQueued then
toast.Text:SetAnimatedValue(toast._data.count, true)
diff --git a/systems/loot_special.lua b/systems/loot_special.lua
deleted file mode 100644
index 549dbf5..0000000
--- a/systems/loot_special.lua
+++ /dev/null
@@ -1,491 +0,0 @@
-local _, addonTable = ...
-local E, L, C = addonTable.E, addonTable.L, addonTable.C
-
--- Lua
-local _G = getfenv(0)
-local m_random = _G.math.random
-local s_lower = _G.string.lower
-local s_split = _G.string.split
-local tonumber = _G.tonumber
-
--- Blizz
-local C_MountJournal = _G.C_MountJournal
-local C_PetJournal = _G.C_PetJournal
-local C_Timer = _G.C_Timer
-
---[[ luacheck: globals
- BattlePetToolTip_Show BonusRollFrame DressUpBattlePet DressUpMount DressUpVisual GameTooltip GetItemInfo
- GroupLootContainer GroupLootContainer_RemoveFrame IsDressableItem IsModifiedClick OpenBag UnitFactionGroup
-
- ITEM_QUALITY_COLORS ITEM_QUALITY1_DESC ITEM_QUALITY2_DESC ITEM_QUALITY3_DESC ITEM_QUALITY4_DESC ITEM_QUALITY5_DESC
- LOOT_ROLL_TYPE_DISENCHANT LOOT_ROLL_TYPE_GREED LOOT_ROLL_TYPE_NEED LOOTUPGRADEFRAME_QUALITY_TEXTURES
-]]
-
--- Mine
-local TITLE_DE_TEMPLATE = "%s|cff00ff00%s|r|TInterface\\Buttons\\UI-GroupLoot-DE-Up:0:0:0:0:32:32:0:32:0:31|t"
-local TITLE_GREED_TEMPLATE = "%s|cff00ff00%s|r|TInterface\\Buttons\\UI-GroupLoot-Coin-Up:0:0:0:0:32:32:0:32:0:31|t"
-local TITLE_NEED_TEMPLATE = "%s|cff00ff00%s|r|TInterface\\Buttons\\UI-GroupLoot-Dice-Up:0:0:0:0:32:32:0:32:0:31|t"
-
-local function dressUp(link)
- if not link then
- return
- end
-
- -- item
- if IsDressableItem(link) then
- if DressUpVisual(link) then
- return
- end
- end
-
- -- battle pet
- local creatureID, displayID
-
- local linkType, linkID, _ = s_split(":", link)
- if linkType == "item" then
- _, _, _, creatureID, _, _, _, _, _, _, _, displayID = C_PetJournal.GetPetInfoByItemID(tonumber(linkID))
- elseif linkType == "battlepet" then
- _, _, _, creatureID, _, _, _, _, _, _, _, displayID = C_PetJournal.GetPetInfoBySpeciesID(tonumber(linkID))
- end
-
- if creatureID and displayID then
- if DressUpBattlePet(creatureID, displayID) then
- return
- end
- end
-
- -- mount
- local mountID
-
- linkType, linkID = s_split(":", link)
- if linkType == "item" then
- mountID = C_MountJournal.GetMountFromItem(tonumber(linkID))
- elseif linkType == "spell" then
- mountID = C_MountJournal.GetMountFromSpell(tonumber(linkID))
- end
-
- if mountID then
- DressUpMount(C_MountJournal.GetMountInfoExtraByID(mountID))
- end
-end
-
-local function Toast_OnClick(self)
- if self._data.link and IsModifiedClick("DRESSUP") then
- dressUp(self._data.link)
- elseif self._data.item_id then
- local slot = E:SearchBagsForItemID(self._data.item_id)
- if slot >= 0 then
- OpenBag(slot)
- end
- end
-end
-
-local function Toast_OnEnter(self)
- if self._data.tooltip_link then
- if self._data.tooltip_link:find("item") then
- GameTooltip:SetHyperlink(self._data.tooltip_link)
- GameTooltip:Show()
- elseif self._data.tooltip_link:find("battlepet") then
- local _, speciesID, level, breedQuality, maxHealth, power, speed = s_split(":", self._data.tooltip_link)
- BattlePetToolTip_Show(tonumber(speciesID), tonumber(level), tonumber(breedQuality), tonumber(maxHealth), tonumber(power), tonumber(speed))
- end
- end
-end
-
-local function PostSetAnimatedValue(self, value)
- self:SetText(value == 1 and "" or value)
-end
-
-local function Toast_SetUp(event, link, quantity, rollType, roll, factionGroup, isItem, isHonor, isPersonal, lessAwesome, isUpgraded, baseQuality, isLegendary, isStorePurchase, isAzerite)
- if isItem then
- if link then
- local sanitizedLink, originalLink, _, itemID = E:SanitizeLink(link)
- local toast, isNew, isQueued = E:GetToast(event, "link", sanitizedLink)
- if isNew then
- local name, _, quality, _, _, _, _, _, _, icon = GetItemInfo(originalLink)
- if name and (quality and quality >= C.db.profile.types.loot_special.threshold and quality <= 5) then
- local color = ITEM_QUALITY_COLORS[quality] or ITEM_QUALITY_COLORS[1]
- local title = L["YOU_RECEIVED"]
- local soundFile = 31578 -- SOUNDKIT.UI_EPICLOOT_TOAST
- local bgTexture
-
- toast.IconText1.PostSetAnimatedValue = PostSetAnimatedValue
-
- if isPersonal or lessAwesome then
- if lessAwesome then
- soundFile = 51402 -- SOUNDKIT.UI_RAID_LOOT_TOAST_LESSER_ITEM_WON
- end
- end
-
- if isUpgraded then
- if baseQuality and baseQuality < quality then
- title = L["ITEM_UPGRADED_FORMAT"]:format(color.hex, _G["ITEM_QUALITY" .. quality .. "_DESC"])
- else
- title = L["ITEM_UPGRADED"]
- end
-
- soundFile = 51561 -- SOUNDKIT.UI_WARFORGED_ITEM_LOOT_TOAST
- bgTexture = "upgrade"
-
- local upgradeTexture = LOOTUPGRADEFRAME_QUALITY_TEXTURES[quality] or LOOTUPGRADEFRAME_QUALITY_TEXTURES[2]
-
- for i = 1, 5 do
- toast["Arrow" .. i]:SetAtlas(upgradeTexture.arrow, true)
- end
- end
-
- if factionGroup then
- bgTexture = s_lower(factionGroup)
- end
-
- if isLegendary then
- title = L["ITEM_LEGENDARY"]
- soundFile = 63971 -- SOUNDKIT.UI_LEGENDARY_LOOT_TOAST
- bgTexture = "legendary"
-
- if not toast.Dragon.isHidden then
- toast.Dragon:Show()
- end
- end
-
- if isStorePurchase then
- title = L["BLIZZARD_STORE_PURCHASE_DELIVERED"]
- soundFile = 39517 -- SOUNDKIT.UI_IG_STORE_PURCHASE_DELIVERED_TOAST_01
- bgTexture = "store"
- end
-
- if isAzerite then
- title = L["ITEM_AZERITE_EMPOWERED"]
- soundFile = 118238 -- SOUNDKIT.UI_AZERITE_EMPOWERED_ITEM_LOOT_TOAST
- bgTexture = "azerite"
- end
-
- if rollType == LOOT_ROLL_TYPE_NEED then
- title = TITLE_NEED_TEMPLATE:format(title, roll)
- elseif rollType == LOOT_ROLL_TYPE_GREED then
- title = TITLE_GREED_TEMPLATE:format(title, roll)
- elseif rollType == LOOT_ROLL_TYPE_DISENCHANT then
- title = TITLE_DE_TEMPLATE:format(title, roll)
- end
-
- if quality >= C.db.profile.colors.threshold then
- if C.db.profile.colors.name then
- name = color.hex .. name .. "|r"
- end
-
- if C.db.profile.colors.border then
- toast.Border:SetVertexColor(color.r, color.g, color.b)
- end
-
- if C.db.profile.colors.icon_border then
- toast.IconBorder:SetVertexColor(color.r, color.g, color.b)
- end
- end
-
- if C.db.profile.types.loot_special.ilvl then
- local iLevel = E:GetItemLevel(originalLink)
-
- if iLevel > 0 then
- name = "[" .. color.hex .. iLevel .. "|r] " .. name
- end
- end
-
- if bgTexture then
- toast:SetBackground(bgTexture)
- end
-
- toast.Title:SetText(title)
- toast.Text:SetText(name)
- toast.Icon:SetTexture(icon)
- toast.IconBorder:Show()
- toast.IconText1:SetAnimatedValue(quantity, true)
-
- toast._data.count = quantity
- toast._data.event = event
- toast._data.item_id = itemID
- toast._data.link = sanitizedLink
- toast._data.show_arrows = isUpgraded
- toast._data.sound_file = C.db.profile.types.loot_special.sfx and soundFile
- toast._data.tooltip_link = originalLink
-
- toast:HookScript("OnClick", Toast_OnClick)
- toast:HookScript("OnEnter", Toast_OnEnter)
- toast:Spawn(C.db.profile.types.loot_special.anchor, C.db.profile.types.loot_special.dnd)
- else
- toast:Release()
- end
- else
- if rollType then
- if rollType == LOOT_ROLL_TYPE_NEED then
- toast.Title:SetFormattedText(TITLE_NEED_TEMPLATE, L["YOU_WON"], roll)
- elseif rollType == LOOT_ROLL_TYPE_GREED then
- toast.Title:SetFormattedText(TITLE_GREED_TEMPLATE, L["YOU_WON"], roll)
- elseif rollType == LOOT_ROLL_TYPE_DISENCHANT then
- toast.Title:SetFormattedText(TITLE_DE_TEMPLATE, L["YOU_WON"], roll)
- end
- end
-
- if isQueued then
- toast._data.count = toast._data.count + quantity
- toast.IconText1:SetAnimatedValue(toast._data.count, true)
- else
- toast._data.count = toast._data.count + quantity
- toast.IconText1:SetAnimatedValue(toast._data.count)
-
- toast.IconText2:SetText("+" .. quantity)
- toast.IconText2.Blink:Stop()
- toast.IconText2.Blink:Play()
-
- toast.AnimOut:Stop()
- toast.AnimOut:Play()
- end
- end
- end
- elseif isHonor then
- local toast, isNew, isQueued = E:GetToast(event, "is_honor", true)
- if isNew then
- if factionGroup then
- toast:SetBackground(s_lower(factionGroup))
- end
-
- toast.Title:SetText(L["YOU_RECEIVED"])
- toast.Text:SetText(L["HONOR_POINTS"])
- toast.Icon:SetTexture("Interface\\Icons\\Achievement_LegionPVPTier4")
- toast.IconBorder:Show()
- toast.IconText1:SetAnimatedValue(quantity, true)
-
- toast._data.count = quantity
- toast._data.event = event
- toast._data.is_honor = true
- toast._data.sound_file = C.db.profile.types.loot_special.sfx and 31578 -- SOUNDKIT.UI_EPICLOOT_TOAST
-
- toast:Spawn(C.db.profile.types.loot_special.anchor, C.db.profile.types.loot_special.dnd)
- else
- if isQueued then
- toast._data.count = toast._data.count + quantity
- toast.IconText1:SetAnimatedValue(toast._data.count, true)
- else
- toast._data.count = toast._data.count + quantity
- toast.IconText1:SetAnimatedValue(toast._data.count)
-
- toast.IconText2:SetText("+" .. quantity)
- toast.IconText2.Blink:Stop()
- toast.IconText2.Blink:Play()
-
- toast.AnimOut:Stop()
- toast.AnimOut:Play()
- end
- end
- end
-end
-
-local function AZERITE_EMPOWERED_ITEM_LOOTED(link)
- Toast_SetUp("AZERITE_EMPOWERED_ITEM_LOOTED", link, 1, nil, nil, nil, true, nil, nil, nil, nil, nil, nil, nil, true)
-end
-
-local function LOOT_ITEM_ROLL_WON(link, quantity, rollType, roll, isUpgraded)
- Toast_SetUp("LOOT_ITEM_ROLL_WON", link, quantity, rollType, roll, nil, true, nil, nil, nil, isUpgraded)
-end
-
-local function SHOW_LOOT_TOAST(typeID, link, quantity, _, _, isPersonal, _, lessAwesome, isUpgraded)
- local factionGroup = UnitFactionGroup("player")
- factionGroup = (typeID == "honor" and factionGroup ~= "Neutral") and factionGroup or nil
-
- Toast_SetUp("SHOW_LOOT_TOAST", link, quantity, nil, nil, factionGroup, typeID == "item", typeID == "honor", isPersonal, lessAwesome, isUpgraded)
-end
-
-local function SHOW_LOOT_TOAST_UPGRADE(link, quantity, _, _, baseQuality)
- Toast_SetUp("SHOW_LOOT_TOAST_UPGRADE", link, quantity, nil, nil, nil, true, nil, nil, nil, true, baseQuality)
-end
-
-local function SHOW_PVP_FACTION_LOOT_TOAST(typeID, link, quantity, _, _, isPersonal, lessAwesome)
- local factionGroup = UnitFactionGroup("player")
- factionGroup = factionGroup ~= "Neutral" and factionGroup or nil
-
- Toast_SetUp("SHOW_PVP_FACTION_LOOT_TOAST", link, quantity, nil, nil, factionGroup, typeID == "item", typeID == "honor", isPersonal, lessAwesome)
-end
-
-local function SHOW_RATED_PVP_REWARD_TOAST(typeID, link, quantity, _, _, isPersonal, lessAwesome)
- local factionGroup = UnitFactionGroup("player")
- factionGroup = factionGroup ~= "Neutral" and factionGroup or nil
-
- Toast_SetUp("SHOW_RATED_PVP_REWARD_TOAST", link, quantity, nil, nil, factionGroup, typeID == "item", typeID == "honor", isPersonal, lessAwesome)
-end
-
-local function SHOW_LOOT_TOAST_LEGENDARY_LOOTED(link)
- Toast_SetUp("SHOW_LOOT_TOAST_LEGENDARY_LOOTED", link, 1, nil, nil, nil, true, nil, nil, nil, nil, nil, true)
-end
-
-local function STORE_PRODUCT_DELIVERED(_, _, _, payloadID)
- local _, link = GetItemInfo(payloadID)
-
- if link then
- Toast_SetUp("STORE_PRODUCT_DELIVERED", link, 1, nil, nil, nil, true, nil, nil, nil, nil, nil, nil, true)
- else
- return C_Timer.After(0.25, function() STORE_PRODUCT_DELIVERED(nil, nil, nil, payloadID) end)
- end
-end
-
-local function BonusRollFrame_FinishedFading_Disabled(self)
- GroupLootContainer_RemoveFrame(GroupLootContainer, self:GetParent())
-end
-
-local function BonusRollFrame_FinishedFading_Enabled(self)
- local frame = self:GetParent()
-
- if frame.rewardType == "item" or frame.rewardType == "artifact_power" then
- Toast_SetUp("LOOT_ITEM_BONUS_ROLL_WON", frame.rewardLink, frame.rewardQuantity, nil, nil, nil, true)
- end
-
- GroupLootContainer_RemoveFrame(GroupLootContainer, frame)
-end
-
-local function Enable()
- if C.db.profile.types.loot_special.enabled then
- E:RegisterEvent("AZERITE_EMPOWERED_ITEM_LOOTED", AZERITE_EMPOWERED_ITEM_LOOTED)
- E:RegisterEvent("LOOT_ITEM_ROLL_WON", LOOT_ITEM_ROLL_WON)
- E:RegisterEvent("SHOW_LOOT_TOAST_LEGENDARY_LOOTED", SHOW_LOOT_TOAST_LEGENDARY_LOOTED)
- E:RegisterEvent("SHOW_LOOT_TOAST_UPGRADE", SHOW_LOOT_TOAST_UPGRADE)
- E:RegisterEvent("SHOW_LOOT_TOAST", SHOW_LOOT_TOAST)
- E:RegisterEvent("SHOW_PVP_FACTION_LOOT_TOAST", SHOW_PVP_FACTION_LOOT_TOAST)
- E:RegisterEvent("SHOW_RATED_PVP_REWARD_TOAST", SHOW_RATED_PVP_REWARD_TOAST)
- E:RegisterEvent("STORE_PRODUCT_DELIVERED", STORE_PRODUCT_DELIVERED)
-
- BonusRollFrame.FinishRollAnim:SetScript("OnFinished", BonusRollFrame_FinishedFading_Enabled)
- else
- BonusRollFrame.FinishRollAnim:SetScript("OnFinished", BonusRollFrame_FinishedFading_Disabled)
- end
-end
-
-local function Disable()
- E:UnregisterEvent("AZERITE_EMPOWERED_ITEM_LOOTED", AZERITE_EMPOWERED_ITEM_LOOTED)
- E:UnregisterEvent("LOOT_ITEM_ROLL_WON", LOOT_ITEM_ROLL_WON)
- E:UnregisterEvent("SHOW_LOOT_TOAST_LEGENDARY_LOOTED", SHOW_LOOT_TOAST_LEGENDARY_LOOTED)
- E:UnregisterEvent("SHOW_LOOT_TOAST_UPGRADE", SHOW_LOOT_TOAST_UPGRADE)
- E:UnregisterEvent("SHOW_LOOT_TOAST", SHOW_LOOT_TOAST)
- E:UnregisterEvent("SHOW_PVP_FACTION_LOOT_TOAST", SHOW_PVP_FACTION_LOOT_TOAST)
- E:UnregisterEvent("SHOW_RATED_PVP_REWARD_TOAST", SHOW_RATED_PVP_REWARD_TOAST)
- E:UnregisterEvent("STORE_PRODUCT_DELIVERED", STORE_PRODUCT_DELIVERED)
-
- BonusRollFrame.FinishRollAnim:SetScript("OnFinished", BonusRollFrame_FinishedFading_Disabled)
-end
-
-local function Test()
- -- honour
- local factionGroup = UnitFactionGroup("player")
- factionGroup = factionGroup ~= "Neutral" and factionGroup or "Horde"
-
- Toast_SetUp("SPECIAL_LOOT_TEST", nil, m_random(100, 400), nil, nil, factionGroup, nil, true)
-
- -- pvp, Fearless Gladiator's Dreadplate Girdle
- local _, link = GetItemInfo(142679)
- if link then
- Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, factionGroup, true)
- end
-
- -- titanforged, Bonespeaker Bracers
- _, link = GetItemInfo("item:134222::::::::110:63::36:4:3432:41:1527:3337:::")
- if link then
- Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, nil, true, nil, nil, nil, true)
- end
-
- -- upgraded from uncommon to epic, Nightsfall Brestplate
- _, link = GetItemInfo("item:139055::::::::110:70::36:3:3432:1507:3336:::")
- if link then
- Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, nil, true, nil, nil, nil, true, 2)
- end
-
- -- legendary, Aman'Thul's Vision
- _, link = GetItemInfo("item:154172::::::::110:64:::1:3571:::")
- if link then
- Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, nil, true, nil, nil, nil, nil, nil, true)
- end
-
- -- store, Pouch of Enduring Wisdom
- _, link = GetItemInfo(105911)
- if link then
- Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, nil, true, nil, nil, nil, nil, nil, nil, true)
- end
-
- -- azerite, Vest of the Champion
- _, link = GetItemInfo("item:159906::::::::110:581::11::::")
- if link then
- Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, nil, true, nil, nil, nil, nil, nil, nil, nil, true)
- end
-end
-
-E:RegisterOptions("loot_special", {
- enabled = true,
- anchor = 1,
- dnd = false,
- sfx = true,
- ilvl = true,
- threshold = 1,
-}, {
- name = L["TYPE_LOOT_SPECIAL"],
- get = function(info)
- return C.db.profile.types.loot_special[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.loot_special[info[#info]] = value
- end,
- args = {
- desc = {
- order = 1,
- type = "description",
- name = L["TYPE_LOOT_SPECIAL_DESC"],
- },
- enabled = {
- order = 2,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.loot_special.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 3,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- sfx = {
- order = 3,
- type = "toggle",
- name = L["SFX"],
- },
- ilvl = {
- order = 5,
- type = "toggle",
- name = L["SHOW_ILVL"],
- desc = L["SHOW_ILVL_DESC"],
- },
- threshold = {
- order = 6,
- type = "select",
- name = L["LOOT_THRESHOLD"],
- values = {
- [1] = ITEM_QUALITY_COLORS[1].hex .. ITEM_QUALITY1_DESC .. "|r",
- [2] = ITEM_QUALITY_COLORS[2].hex .. ITEM_QUALITY2_DESC .. "|r",
- [3] = ITEM_QUALITY_COLORS[3].hex .. ITEM_QUALITY3_DESC .. "|r",
- [4] = ITEM_QUALITY_COLORS[4].hex .. ITEM_QUALITY4_DESC .. "|r",
- [5] = ITEM_QUALITY_COLORS[5].hex .. ITEM_QUALITY5_DESC .. "|r",
- },
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = Test,
- },
- },
-})
-
-E:RegisterSystem("loot_special", Enable, Disable, Test)
diff --git a/systems/recipe.lua b/systems/recipe.lua
deleted file mode 100644
index 5410a64..0000000
--- a/systems/recipe.lua
+++ /dev/null
@@ -1,144 +0,0 @@
-local _, addonTable = ...
-local E, L, C = addonTable.E, addonTable.L, addonTable.C
-
--- Lua
-local _G = getfenv(0)
-
--- Blizz
-local C_TradeSkillUI = _G.C_TradeSkillUI
-
---[[ luacheck: globals
- GameTooltip GetSpellInfo GetSpellRank InCombatLockdown TradeSkillFrame TradeSkillFrame_LoadUI
-]]
-
--- Mine
-local function Toast_OnClick(self)
- if self._data.tradeskill_id and not InCombatLockdown() then
- if not TradeSkillFrame then
- TradeSkillFrame_LoadUI()
- end
-
- if TradeSkillFrame then
- if C_TradeSkillUI.OpenTradeSkill(self._data.tradeskill_id) then
- TradeSkillFrame:SelectRecipe(self._data.recipe_id)
- end
- end
- end
-end
-
-local function Toast_OnEnter(self)
- if self._data.recipe_id then
- GameTooltip:SetSpellByID(self._data.recipe_id)
- GameTooltip:Show()
- end
-end
-
-local function Toast_SetUp(event, recipeID)
- local tradeSkillID = C_TradeSkillUI.GetTradeSkillLineForRecipe(recipeID)
- if tradeSkillID then
- local recipeName = GetSpellInfo(recipeID)
- if recipeName then
- local toast = E:GetToast()
- local rank = GetSpellRank(recipeID)
- local rankTexture = ""
-
- if rank == 1 then
- rankTexture = "|TInterface\\LootFrame\\toast-star:12:12:0:0:32:32:0:21:0:21|t"
- elseif rank == 2 then
- rankTexture = "|TInterface\\LootFrame\\toast-star-2:12:24:0:0:64:32:0:42:0:21|t"
- elseif rank == 3 then
- rankTexture = "|TInterface\\LootFrame\\toast-star-3:12:36:0:0:64:32:0:64:0:21|t"
- end
-
- toast:SetBackground("recipe")
- toast.Title:SetText(rank and rank > 1 and L["RECIPE_UPGRADED"] or L["RECIPE_LEARNED"])
- toast.Text:SetText(recipeName)
- toast.Icon:SetTexture(C_TradeSkillUI.GetTradeSkillTexture(tradeSkillID))
- toast.IconBorder:Show()
- toast.IconText1:SetText(rankTexture)
- toast.IconText1BG:SetShown(not not rank)
-
- toast._data.event = event
- toast._data.recipe_id = recipeID
- toast._data.sound_file = C.db.profile.types.recipe.sfx and 73919 -- SOUNDKIT.UI_PROFESSIONS_NEW_RECIPE_LEARNED_TOAST
- toast._data.tradeskill_id = tradeSkillID
-
- toast:HookScript("OnClick", Toast_OnClick)
- toast:HookScript("OnEnter", Toast_OnEnter)
- toast:Spawn(C.db.profile.types.recipe.anchor, C.db.profile.types.recipe.dnd)
- end
- end
-end
-
-local function NEW_RECIPE_LEARNED(recipeID)
- Toast_SetUp("NEW_RECIPE_LEARNED", recipeID)
-end
-
-local function Enable()
- if C.db.profile.types.recipe.enabled then
- E:RegisterEvent("NEW_RECIPE_LEARNED", NEW_RECIPE_LEARNED)
- end
-end
-
-local function Disable()
- E:UnregisterEvent("NEW_RECIPE_LEARNED", NEW_RECIPE_LEARNED)
-end
-
-local function Test()
- -- no rank, Elixir of Minor Defence
- Toast_SetUp("RECIPE_TEST", 7183)
-
- -- rank 2, Word of Critical Strike
- Toast_SetUp("RECIPE_TEST", 190992)
-end
-
-E:RegisterOptions("recipe", {
- enabled = true,
- anchor = 1,
- dnd = false,
- sfx = true,
-}, {
- name = L["TYPE_RECIPE"],
- get = function(info)
- return C.db.profile.types.recipe[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.recipe[info[#info]] = value
- end,
- args = {
- enabled = {
- order = 1,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.recipe.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 2,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- sfx = {
- order = 3,
- type = "toggle",
- name = L["SFX"],
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = Test,
- },
- },
-})
-
-E:RegisterSystem("recipe", Enable, Disable, Test)
diff --git a/systems/transmog.lua b/systems/transmog.lua
deleted file mode 100644
index a7c1823..0000000
--- a/systems/transmog.lua
+++ /dev/null
@@ -1,169 +0,0 @@
-local _, addonTable = ...
-local E, L, C = addonTable.E, addonTable.L, addonTable.C
-
--- Lua
-local _G = getfenv(0)
-
--- Blizz
-local C_Timer = _G.C_Timer
-local C_TransmogCollection = _G.C_TransmogCollection
-
---[[ luacheck: globals
- CollectionsJournal CollectionsJournal_LoadUI DressUpVisual InCombatLockdown IsModifiedClick
- WardrobeCollectionFrame_OpenTransmogLink
-]]
-
--- Mine
-local function Toast_OnClick(self)
- if self._data.source_id and IsModifiedClick("DRESSUP") then
- DressUpVisual(self._data.source_id)
- elseif C.db.profile.types.transmog.left_click and self._data.link and not InCombatLockdown() then
- if not CollectionsJournal then
- CollectionsJournal_LoadUI()
- end
-
- if CollectionsJournal then
- WardrobeCollectionFrame_OpenTransmogLink(self._data.link)
- end
- end
-end
-
-local function Toast_SetUp(event, sourceID, isAdded, attempt)
- local _, visualID, _, icon, _, _, link = C_TransmogCollection.GetAppearanceSourceInfo(sourceID)
- local name
- link, _, _, _, name = E:SanitizeLink(link)
- if not link then
- return attempt < 4 and C_Timer.After(0.25, function() Toast_SetUp(event, sourceID, isAdded, attempt + 1) end)
- end
-
- if E:FindToast(event, "visual_id", visualID) then
- return
- end
-
- local toast, isNew, isQueued = E:GetToast(nil, "source_id", sourceID)
- if isNew then
- if C.db.profile.colors.border then
- toast.Border:SetVertexColor(1, 0.5, 1)
- end
-
- if C.db.profile.colors.icon_border then
- toast.IconBorder:SetVertexColor(1, 0.5, 1)
- end
-
- toast:SetBackground("transmog")
- toast.Title:SetText(isAdded and L["TRANSMOG_ADDED"] or L["TRANSMOG_REMOVED"])
- toast.Text:SetText(name)
- toast.Icon:SetTexture(icon)
- toast.IconBorder:Show()
-
- toast._data.event = event
- toast._data.link = link
- toast._data.sound_file = C.db.profile.types.transmog.sfx and 38326 -- SOUNDKIT.UI_DIG_SITE_COMPLETION_TOAST
- toast._data.source_id = sourceID
- toast._data.visual_id = visualID
-
- toast:HookScript("OnClick", Toast_OnClick)
- toast:Spawn(C.db.profile.types.transmog.anchor, C.db.profile.types.transmog.dnd)
- else
- toast.Title:SetText(isAdded and L["TRANSMOG_ADDED"] or L["TRANSMOG_REMOVED"])
-
- if not isQueued then
- toast.AnimOut:Stop()
- toast.AnimOut:Play()
- end
- end
-end
-
-local function TRANSMOG_COLLECTION_SOURCE_ADDED(sourceID)
- -- don't show toasts for sources that aren't in player's wardrobe
- if C_TransmogCollection.PlayerKnowsSource(sourceID) then
- Toast_SetUp("TRANSMOG_COLLECTION_SOURCE_ADDED", sourceID, true, 1)
- end
-end
-
-local function TRANSMOG_COLLECTION_SOURCE_REMOVED(sourceID)
- -- don't show toasts for sources that aren't in player's wardrobe
- if C_TransmogCollection.PlayerKnowsSource(sourceID) then
- Toast_SetUp("TRANSMOG_COLLECTION_SOURCE_REMOVED", sourceID, nil, 1)
- end
-end
-
-local function Enable()
- if C.db.profile.types.transmog.enabled then
- E:RegisterEvent("TRANSMOG_COLLECTION_SOURCE_ADDED", TRANSMOG_COLLECTION_SOURCE_ADDED)
- E:RegisterEvent("TRANSMOG_COLLECTION_SOURCE_REMOVED", TRANSMOG_COLLECTION_SOURCE_REMOVED)
- end
-end
-
-local function Disable()
- E:UnregisterEvent("TRANSMOG_COLLECTION_SOURCE_ADDED", TRANSMOG_COLLECTION_SOURCE_ADDED)
- E:UnregisterEvent("TRANSMOG_COLLECTION_SOURCE_REMOVED", TRANSMOG_COLLECTION_SOURCE_REMOVED)
-end
-
-local function Test()
- local appearance = C_TransmogCollection.GetCategoryAppearances(1) and C_TransmogCollection.GetCategoryAppearances(1)[1]
- local source = C_TransmogCollection.GetAppearanceSources(appearance.visualID) and C_TransmogCollection.GetAppearanceSources(appearance.visualID)[1]
-
- if source then
- Toast_SetUp("TRANSMOG_TEST", source.sourceID, true, 1)
- end
-end
-
-E:RegisterOptions("transmog", {
- enabled = true,
- anchor = 1,
- dnd = false,
- sfx = true,
- left_click = false,
-}, {
- name = L["TYPE_TRANSMOG"],
- get = function(info)
- return C.db.profile.types.transmog[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.transmog[info[#info]] = value
- end,
- args = {
- enabled = {
- order = 1,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.transmog.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 2,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- sfx = {
- order = 3,
- type = "toggle",
- name = L["SFX"],
- },
- left_click = {
- order = 4,
- type = "toggle",
- name = L["HANDLE_LEFT_CLICK"],
- desc = L["COLLECTIONS_TAINT_WARNING"],
- image = "Interface\\DialogFrame\\UI-Dialog-Icon-AlertNew",
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = Test,
- },
- },
-})
-
-E:RegisterSystem("transmog", Enable, Disable, Test)
diff --git a/systems/world.lua b/systems/world.lua
deleted file mode 100644
index 1e48b6c..0000000
--- a/systems/world.lua
+++ /dev/null
@@ -1,300 +0,0 @@
-local _, addonTable = ...
-local E, L, C = addonTable.E, addonTable.L, addonTable.C
-
--- Lua
-local _G = getfenv(0)
-local next = _G.next
-local select = _G.select
-
--- Blizz
-local C_Scenario = _G.C_Scenario
-local C_TaskQuest = _G.C_TaskQuest
-local C_Timer = _G.C_Timer
-
---[[ luacheck: globals
- GameTooltip GetItemInfo GetItemInfoInstant GetMoneyString GetNumQuestLogRewardCurrencies GetProfessionInfo
- GetQuestLogRewardCurrencyInfo GetQuestLogRewardMoney GetQuestLogRewardXP GetQuestTagInfo HaveQuestData
- HaveQuestRewardData QuestUtils_IsQuestWorldQuest UnitLevel
-
- LE_QUEST_TAG_TYPE_DUNGEON LE_QUEST_TAG_TYPE_PET_BATTLE LE_QUEST_TAG_TYPE_PROFESSION LE_QUEST_TAG_TYPE_PVP
- LE_QUEST_TAG_TYPE_RAID LE_SCENARIO_TYPE_LEGION_INVASION MAX_PLAYER_LEVEL WORLD_QUEST_QUALITY_COLORS
-]]
-
--- Mine
-local CURRENCY_TEMPLATE = "%s|T%s:0|t"
-
-local function Slot_OnEnter(self)
- if self._data.type then
- if self._data.type == "item" then
- GameTooltip:SetHyperlink(self._data.link)
- elseif self._data.type == "xp" then
- GameTooltip:AddLine(L["YOU_RECEIVED"])
- GameTooltip:AddLine(L["XP_FORMAT"]:format(self._data.count), 1, 1, 1)
- elseif self._data.type == "money" then
- GameTooltip:AddLine(L["YOU_RECEIVED"])
- GameTooltip:AddLine(GetMoneyString(self._data.count, true), 1, 1, 1)
- elseif self._data.type == "currency" then
- GameTooltip:AddLine(L["YOU_RECEIVED"])
- GameTooltip:AddLine(CURRENCY_TEMPLATE:format(self._data.count, self._data.texture), 1, 1, 1)
- end
-
- GameTooltip:Show()
- end
-end
-
-local function Toast_SetUp(event, isUpdate, questID, name, moneyReward, xpReward, numCurrencyRewards, itemReward)
- local toast, isNew, isQueued = E:GetToast(nil, "quest_id", questID)
- if isUpdate and isNew then
- toast:Release()
-
- return
- end
-
- if isNew then
- local usedSlots = 0
-
- if moneyReward and moneyReward > 0 then
- usedSlots = usedSlots + 1
-
- local slot = toast["Slot" .. usedSlots]
- if slot then
- slot.Icon:SetTexture("Interface\\Icons\\inv_misc_coin_02")
-
- slot._data.type = "money"
- slot._data.count = moneyReward
-
- slot:HookScript("OnEnter", Slot_OnEnter)
- slot:Show()
- end
- end
-
- if xpReward and xpReward > 0 and UnitLevel("player") < MAX_PLAYER_LEVEL then
- usedSlots = usedSlots + 1
-
- local slot = toast["Slot" .. usedSlots]
- if slot then
- slot.Icon:SetTexture("Interface\\Icons\\xp_icon")
-
- slot._data.type = "xp"
- slot._data.count = xpReward
-
- slot:HookScript("OnEnter", Slot_OnEnter)
- slot:Show()
- end
- end
-
- for i = 1, numCurrencyRewards or 0 do
- usedSlots = usedSlots + 1
-
- local slot = toast["Slot" .. usedSlots]
- if slot then
- local _, texture, count = GetQuestLogRewardCurrencyInfo(i, questID)
- texture = texture or "Interface\\Icons\\INV_Box_02"
-
- slot.Icon:SetTexture(texture)
-
- slot._data.type = "currency"
- slot._data.count = count
- slot._data.texture = texture
-
- slot:HookScript("OnEnter", Slot_OnEnter)
- slot:Show()
- end
- end
-
- local _, _, worldQuestType, rarity, _, tradeskillLineIndex = GetQuestTagInfo(questID)
- if worldQuestType == LE_QUEST_TAG_TYPE_PVP then
- toast.Icon:SetTexture("Interface\\Icons\\achievement_arena_2v2_1")
- elseif worldQuestType == LE_QUEST_TAG_TYPE_PET_BATTLE then
- toast.Icon:SetTexture("Interface\\Icons\\INV_Pet_BattlePetTraining")
- elseif worldQuestType == LE_QUEST_TAG_TYPE_PROFESSION and tradeskillLineIndex then
- toast.Icon:SetTexture(select(2, GetProfessionInfo(tradeskillLineIndex)))
- elseif worldQuestType == LE_QUEST_TAG_TYPE_DUNGEON or worldQuestType == LE_QUEST_TAG_TYPE_RAID then
- toast.Icon:SetTexture("Interface\\Icons\\INV_Misc_Bone_Skull_02")
- else
- toast.Icon:SetTexture("Interface\\Icons\\Achievement_Quests_Completed_TwilightHighlands")
- end
-
- if rarity >= C.db.profile.colors.threshold then
- local color = WORLD_QUEST_QUALITY_COLORS[rarity] or WORLD_QUEST_QUALITY_COLORS[1]
-
- if C.db.profile.colors.border then
- toast.Border:SetVertexColor(color.r, color.g, color.b)
- end
-
- if C.db.profile.colors.icon_border then
- toast.IconBorder:SetVertexColor(color.r, color.g, color.b)
- end
- end
-
- toast:SetBackground("worldquest")
- toast.Title:SetText(L["WORLD_QUEST_COMPLETED"])
- toast.Text:SetText(name)
- toast.IconBorder:Show()
-
- toast._data.event = event
- toast._data.quest_id = questID
- toast._data.sound_file = C.db.profile.types.world.sfx and 73277 -- SOUNDKIT.UI_WORLDQUEST_COMPLETE
- toast._data.used_slots = usedSlots
-
- toast:Spawn(C.db.profile.types.world.anchor, C.db.profile.types.world.dnd)
- else
- if itemReward then
- toast._data.used_slots = toast._data.used_slots + 1
- local slot = toast["Slot" .. toast._data.used_slots]
-
- if slot then
- local _, _, _, _, texture = GetItemInfoInstant(itemReward)
- texture = texture or "Interface\\Icons\\INV_Box_02"
-
- slot.Icon:SetTexture(texture)
-
- slot._data.type = "item"
- slot._data.link = itemReward
-
- slot:HookScript("OnEnter", Slot_OnEnter)
- slot:Show()
- end
- end
-
- if not isQueued then
- toast.AnimOut:Stop()
- toast.AnimOut:Play()
- end
- end
-end
-
-local function QUEST_TURNED_IN(questID)
- if QuestUtils_IsQuestWorldQuest(questID) then
- if not HaveQuestRewardData(questID) then
- C_TaskQuest.RequestPreloadRewardData(questID)
- C_Timer.After(0.5, function() QUEST_TURNED_IN(questID) end)
-
- return
- end
-
- Toast_SetUp("QUEST_TURNED_IN", false, questID, C_TaskQuest.GetQuestInfoByQuestID(questID), GetQuestLogRewardMoney(questID), GetQuestLogRewardXP(questID), GetNumQuestLogRewardCurrencies(questID))
- end
-end
-
-local function QUEST_LOOT_RECEIVED(questID, itemLink)
- --- QUEST_LOOT_RECEIVED may fire before QUEST_TURNED_IN
- if not E:FindToast(nil, "quest_id", questID) then
- if not HaveQuestRewardData(questID) then
- C_TaskQuest.RequestPreloadRewardData(questID)
- C_Timer.After(0.5, function() QUEST_LOOT_RECEIVED(questID, itemLink) end)
-
- return
- end
-
- QUEST_TURNED_IN(questID)
- end
-
- Toast_SetUp("QUEST_LOOT_RECIEVED", true, questID, nil, nil, nil, nil, itemLink)
-end
-
-local function Enable()
- if C.db.profile.types.world.enabled then
- E:RegisterEvent("QUEST_TURNED_IN", QUEST_TURNED_IN)
- E:RegisterEvent("QUEST_LOOT_RECEIVED", QUEST_LOOT_RECEIVED)
- end
-end
-
-local function Disable()
- E:UnregisterEvent("QUEST_TURNED_IN")
- E:UnregisterEvent("QUEST_LOOT_RECEIVED")
-end
-
-local function Test()
- -- reward, Blood of Sargeras
- local _, link = GetItemInfo(124124)
- if link then
- -- world quest, may not work
- local quests = C_TaskQuest.GetQuestsForPlayerByMapID(1014)
- if not quests or #quests == 0 then
- quests = C_TaskQuest.GetQuestsForPlayerByMapID(1015)
- if not quests or #quests == 0 then
- quests = C_TaskQuest.GetQuestsForPlayerByMapID(1017)
- if not quests or #quests == 0 then
- quests = C_TaskQuest.GetQuestsForPlayerByMapID(1018)
- if not quests or #quests == 0 then
- quests = C_TaskQuest.GetQuestsForPlayerByMapID(1021)
- if not quests or #quests == 0 then
- quests = C_TaskQuest.GetQuestsForPlayerByMapID(1024)
- if not quests or #quests == 0 then
- quests = C_TaskQuest.GetQuestsForPlayerByMapID(1033)
- if not quests or #quests == 0 then
- quests = C_TaskQuest.GetQuestsForPlayerByMapID(1096)
- end
- end
- end
- end
- end
- end
- end
-
- if quests then
- for _, quest in next, quests do
- if HaveQuestData(quest.questId) then
- if QuestUtils_IsQuestWorldQuest(quest.questId) then
- Toast_SetUp("WORLD_TEST", false, quest.questId, C_TaskQuest.GetQuestInfoByQuestID(quest.questId), 123456, 123456)
- Toast_SetUp("WORLD_TEST", true, quest.questId, "scenario", nil, nil, nil, link)
-
- return
- end
- end
- end
- end
- end
-end
-
-E:RegisterOptions("world", {
- enabled = true,
- anchor = 1,
- dnd = false,
- sfx = true,
-}, {
- name = L["TYPE_WORLD_QUEST"],
- get = function(info)
- return C.db.profile.types.world[info[#info]]
- end,
- set = function(info, value)
- C.db.profile.types.world[info[#info]] = value
- end,
- args = {
- enabled = {
- order = 1,
- type = "toggle",
- name = L["ENABLE"],
- set = function(_, value)
- C.db.profile.types.world.enabled = value
-
- if value then
- Enable()
- else
- Disable()
- end
- end
- },
- dnd = {
- order = 2,
- type = "toggle",
- name = L["DND"],
- desc = L["DND_TOOLTIP"],
- },
- sfx = {
- order = 3,
- type = "toggle",
- name = L["SFX"],
- },
- test = {
- type = "execute",
- order = 99,
- width = "full",
- name = L["TEST"],
- func = Test,
- },
- },
-})
-
-E:RegisterSystem("world", Enable, Disable, Test)