Commit 1c4737ee authored by Merathilis's avatar Merathilis

Added an Azerite Animation Skip. Credits to: Permok - Skip Azerite Animations:...

Added an Azerite Animation Skip. Credits to: Permok - Skip Azerite Animations: https://wago.io/HkUtqi7QQ
Ported from ElvUI_LivvenUI, because he took my skins. >.>
parent fb7548f2
......@@ -143,6 +143,7 @@ L["MISC_PARAGON_REPUTATION"] = "Paragon Ruf"
L["MISC_PARAGON_NOTIFY"] = "Maximaler Ruf - Belohnung abholen."
L["Progress Bar"] = "Fortschrittsleiste"
L["Shows Azerite/Honor/XP/Rep."] = "Zeigt Azerite/Ehre/EP/Ruf"
L["Skip Azerite Animation"] = "Überspringe Azerite Animation"
-- Tooltip
L["Your Status:"] = "Dein Status:"
......
......@@ -146,6 +146,7 @@ L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
L["Your Status:"] = true
......
......@@ -145,6 +145,7 @@ L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
L["Your Status:"] = true
......
......@@ -145,6 +145,7 @@ L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
L["Your Status:"] = true
......
......@@ -141,6 +141,7 @@ L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
L["Your Status:"] = true
......
......@@ -143,6 +143,7 @@ L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
L["Your Status:"] = true
......
......@@ -143,6 +143,7 @@ L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
L["Your Status:"] = "你的状态: "
......
......@@ -143,6 +143,7 @@ L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
L["Your Status:"] = true
......
local MER, E, L, V, P, G = unpack(select(2, ...))
local module = MER:NewModule("AzeriteSkip", "AceHook-3.0", "AceEvent-3.0")
-- Cache global variables
-- Lua functions
local _G = _G
-- WoW API / Variables
local C_AzeriteEmpoweredItem_HasBeenViewed = C_AzeriteEmpoweredItem.HasBeenViewed
local C_AzeriteEmpoweredItem_SetHasBeenViewed = C_AzeriteEmpoweredItem.SetHasBeenViewed
local C_Timer_After = C_Timer.After
local GetItemInfoFromHyperlink = GetItemInfoFromHyperlink
local GetContainerNumSlots = GetContainerNumSlots
local GetContainerItemID = GetContainerItemID
local IsAddOnLoaded = IsAddOnLoaded
local UIParentLoadAddOn = UIParentLoadAddOn
-- Credits: Permok - Skip Azerite Animations: https://wago.io/HkUtqi7QQ
function module.OnItemSet(self)
local itemLocation = self.azeriteItemDataSource:GetItemLocation()
if self:IsAnyTierRevealing() then
C_Timer_After(0.7, function()
OpenAzeriteEmpoweredItemUIFromItemLocation(itemLocation)
end)
end
end
function module:ADDON_LOADED(event, name)
if name == "Blizzard_AzeriteUI" then
self:SecureHook(AzeriteEmpoweredItemUI, "OnItemSet", module.OnItemSet)
self:UnregisterEvent("ADDON_LOADED")
end
end
function module:AZERITE_EMPOWERED_ITEM_LOOTED(event, item)
local itemId = GetItemInfoFromHyperlink(item)
local bag, slot
C_Timer_After(0.4, function()
for i = 0, _G.NUM_BAG_SLOTS do
for j = 1, GetContainerNumSlots(i) do
local id = GetContainerItemID(i, j)
if id and id == itemId then
slot = j
bag = i
end
end
end
if slot then
local location = ItemLocation:CreateFromBagAndSlot(bag, slot)
C_AzeriteEmpoweredItem_SetHasBeenViewed(location)
C_AzeriteEmpoweredItem_HasBeenViewed(location)
end
end)
end
function module:AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED(event, itemLocation)
OpenAzeriteEmpoweredItemUIFromItemLocation(itemLocation)
end
function module:Initialize()
if E.db.mui.misc.skipAzerite ~= true then return end
if not IsAddOnLoaded("Blizzard_AzeriteUI") then
self:RegisterEvent("ADDON_LOADED")
UIParentLoadAddOn("Blizzard_AzeriteUI")
else
self:SecureHook(AzeriteEmpoweredItemUI, "OnItemSet", module.OnItemSet)
end
self:RegisterEvent("AZERITE_EMPOWERED_ITEM_LOOTED")
self:RegisterEvent("AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED")
end
MER:RegisterModule(module:GetName())
......@@ -15,7 +15,6 @@ local GetScreenWidth, GetScreenHeight = GetScreenWidth, GetScreenHeight
local UIFrameFadeIn = UIFrameFadeIn
local IsAddOnLoaded = IsAddOnLoaded
-- Global variables that we don"t cache, list them here for the mikk"s Find Globals script
-- GLOBALS: button, modelHolder, playerModel, npcHolder, npcModel, LibStub
-- Credit for the Class logos: ADDOriN @DevianArt
......
......@@ -2,6 +2,7 @@
<Script file="misc.lua"/>
<Script file="afk.lua"/>
<Script file="alerts.lua"/>
<Script file="azeriteAnimationSkip.lua"/>
<Script file="combatText.lua"/>
<Script file="cursor.lua"/>
<Script file="flightMode.lua"/>
......
......@@ -73,6 +73,11 @@ local function Misc()
type = "toggle",
name = L["LFG Member Info"],
},
skipAzerite = {
order = 11,
type = "toggle",
name = E.NewSign..L["Skip Azerite Animation"],
},
alerts = {
order = 20,
type = "group",
......
......@@ -71,6 +71,7 @@ MP.misc = {
textStyle = "PARAGON",
paragonColor = {r = 0.9, g = 0.8, b = 0.6},
},
skipAzerite = true,
}
MP.nameHover = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment