mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
update AFK (fix guild chat not showing)
This commit is contained in:
+16
-16
@@ -5,20 +5,21 @@ local CH = E:GetModule("Chat")
|
|||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = _G
|
local _G = _G
|
||||||
|
local format = string.format
|
||||||
local floor = math.floor
|
local floor = math.floor
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local CinematicFrame = CinematicFrame
|
local CinematicFrame = CinematicFrame
|
||||||
local CreateFrame = CreateFrame
|
local CreateFrame = CreateFrame
|
||||||
local GetBattlefieldStatus = GetBattlefieldStatus
|
local GetBattlefieldStatus = GetBattlefieldStatus
|
||||||
|
local GetCVar, SetCVar = GetCVar, SetCVar
|
||||||
local GetGuildInfo = GetGuildInfo
|
local GetGuildInfo = GetGuildInfo
|
||||||
local GetScreenHeight = GetScreenHeight
|
local GetScreenHeight = GetScreenHeight
|
||||||
local GetScreenWidth = GetScreenWidth
|
local GetScreenWidth = GetScreenWidth
|
||||||
local GetTime = GetTime
|
local GetTime = GetTime
|
||||||
local UnitAffectingCombat = UnitAffectingCombat
|
|
||||||
local IsInGuild = IsInGuild
|
local IsInGuild = IsInGuild
|
||||||
local IsShiftKeyDown = IsShiftKeyDown
|
local IsShiftKeyDown = IsShiftKeyDown
|
||||||
local Screenshot = Screenshot
|
local Screenshot = Screenshot
|
||||||
local SetCVar = SetCVar
|
local UnitAffectingCombat = UnitAffectingCombat
|
||||||
|
|
||||||
local CUSTOM_CLASS_COLORS = CUSTOM_CLASS_COLORS
|
local CUSTOM_CLASS_COLORS = CUSTOM_CLASS_COLORS
|
||||||
local MAX_BATTLEFIELD_QUEUES = MAX_BATTLEFIELD_QUEUES
|
local MAX_BATTLEFIELD_QUEUES = MAX_BATTLEFIELD_QUEUES
|
||||||
@@ -51,7 +52,7 @@ local function StopAnimation(self)
|
|||||||
self:SetScript("OnAnimFinished", nil)
|
self:SetScript("OnAnimFinished", nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateAnimation(...)
|
local function UpdateAnimation()
|
||||||
this.animTime = this.animTime + (arg1 * 1000)
|
this.animTime = this.animTime + (arg1 * 1000)
|
||||||
this:SetSequenceTime(67, this.animTime)
|
this:SetSequenceTime(67, this.animTime)
|
||||||
|
|
||||||
@@ -153,7 +154,7 @@ function AFK:SetAFK(status)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function AFK:OnEvent(event)
|
function AFK:OnEvent()
|
||||||
if event == "PLAYER_REGEN_DISABLED" or event == "UPDATE_BATTLEFIELD_STATUS" then
|
if event == "PLAYER_REGEN_DISABLED" or event == "UPDATE_BATTLEFIELD_STATUS" then
|
||||||
if event == "UPDATE_BATTLEFIELD_STATUS" then
|
if event == "UPDATE_BATTLEFIELD_STATUS" then
|
||||||
local status, _, instanceID
|
local status, _, instanceID
|
||||||
@@ -214,9 +215,9 @@ function AFK:Toggle()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function OnKeyDown(_, key)
|
local function OnKeyDown()
|
||||||
if ignoreKeys[key] then return end
|
if ignoreKeys[arg1] then return end
|
||||||
if printKeys[key] then
|
if printKeys[arg1] then
|
||||||
Screenshot()
|
Screenshot()
|
||||||
else
|
else
|
||||||
AFK:SetAFK(false)
|
AFK:SetAFK(false)
|
||||||
@@ -224,15 +225,15 @@ local function OnKeyDown(_, key)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function Chat_OnMouseWheel(self, delta)
|
local function Chat_OnMouseWheel()
|
||||||
if delta == 1 and IsShiftKeyDown() then
|
if arg1 == 1 and IsShiftKeyDown() then
|
||||||
self:ScrollToTop()
|
this:ScrollToTop()
|
||||||
elseif delta == -1 and IsShiftKeyDown() then
|
elseif arg1 == -1 and IsShiftKeyDown() then
|
||||||
self:ScrollToBottom()
|
this:ScrollToBottom()
|
||||||
elseif delta == -1 then
|
elseif arg1 == -1 then
|
||||||
self:ScrollDown()
|
this:ScrollDown()
|
||||||
else
|
else
|
||||||
self:ScrollUp()
|
this:ScrollUp()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -265,7 +266,6 @@ function AFK:Initialize()
|
|||||||
self.AFKMode.chat:SetMovable(true)
|
self.AFKMode.chat:SetMovable(true)
|
||||||
self.AFKMode.chat:EnableMouse(true)
|
self.AFKMode.chat:EnableMouse(true)
|
||||||
self.AFKMode.chat:SetClampedToScreen(true)
|
self.AFKMode.chat:SetClampedToScreen(true)
|
||||||
-- self.AFKMode.chat:SetClampRectInsets(-4, 3, 3, -4)
|
|
||||||
self.AFKMode.chat:RegisterForDrag("LeftButton")
|
self.AFKMode.chat:RegisterForDrag("LeftButton")
|
||||||
self.AFKMode.chat:SetScript("OnDragStart", self.AFKMode.chat.StartMoving)
|
self.AFKMode.chat:SetScript("OnDragStart", self.AFKMode.chat.StartMoving)
|
||||||
self.AFKMode.chat:SetScript("OnDragStop", self.AFKMode.chat.StopMovingOrSizing)
|
self.AFKMode.chat:SetScript("OnDragStop", self.AFKMode.chat.StopMovingOrSizing)
|
||||||
|
|||||||
Reference in New Issue
Block a user