diff --git a/ElvUI/Core/core.lua b/ElvUI/Core/core.lua index cd068c3..6fab1ca 100644 --- a/ElvUI/Core/core.lua +++ b/ElvUI/Core/core.lua @@ -15,7 +15,6 @@ local GetActiveTalentGroup = GetActiveTalentGroup local GetCVar = GetCVar local GetFunctionCPUUsage = GetFunctionCPUUsage local GetTalentTabInfo = GetTalentTabInfo -local InCombatLockdown = InCombatLockdown local IsAddOnLoaded = IsAddOnLoaded local IsInInstance, GetNumPartyMembers, GetNumRaidMembers = IsInInstance, GetNumPartyMembers, GetNumRaidMembers local RequestBattlefieldScoreData = RequestBattlefieldScoreData @@ -28,6 +27,8 @@ local RAID_CLASS_COLORS = RAID_CLASS_COLORS _, E.myclass = UnitClass("player") -- Constants _, E.myrace = UnitRace("player") _, E.myfaction = UnitFactionGroup("player") +-- The E.myfaction may error when in GM mode +E.myfaction = E.myfaction or "Others" E.myname = UnitName("player") E.version = GetAddOnMetadata("ElvUI", "Version") E.myrealm = GetRealmName() diff --git a/ElvUI/Modules/Misc/AFK.lua b/ElvUI/Modules/Misc/AFK.lua index fa395e6..4500015 100644 --- a/ElvUI/Modules/Misc/AFK.lua +++ b/ElvUI/Modules/Misc/AFK.lua @@ -5,7 +5,6 @@ local AFK = E:NewModule("AFK", "AceEvent-3.0", "AceTimer-3.0"); --Cache global variables --Lua functions local _G = _G -local GetTime = GetTime local floor = math.floor --WoW API / Variables local CinematicFrame = CinematicFrame @@ -14,12 +13,12 @@ local GetBattlefieldStatus = GetBattlefieldStatus local GetGuildInfo = GetGuildInfo local GetScreenHeight = GetScreenHeight local GetScreenWidth = GetScreenWidth +local GetTime = GetTime local UnitAffectingCombat = UnitAffectingCombat local IsInGuild = IsInGuild local IsShiftKeyDown = IsShiftKeyDown local Screenshot = Screenshot local SetCVar = SetCVar -local UnitFactionGroup = UnitFactionGroup local CUSTOM_CLASS_COLORS = CUSTOM_CLASS_COLORS local MAX_BATTLEFIELD_QUEUES = MAX_BATTLEFIELD_QUEUES @@ -284,11 +283,9 @@ function AFK:Initialize() E:Size(self.AFKMode.bottom.logo, 320, 150) E:Point(self.AFKMode.bottom.logo, "CENTER", self.AFKMode.bottom, "CENTER", 0, 50) self.AFKMode.bottom.logo:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\logo") - - local factionGroup = UnitFactionGroup("player") self.AFKMode.bottom.faction = self.AFKMode.bottom:CreateTexture(nil, "OVERLAY") E:Point(self.AFKMode.bottom.faction, "BOTTOMLEFT", self.AFKMode.bottom, "BOTTOMLEFT", -20, -16) - self.AFKMode.bottom.faction:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\"..factionGroup.."-Logo") + self.AFKMode.bottom.faction:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\"..E.myfaction.."-Logo") E:Size(self.AFKMode.bottom.faction, 140) self.AFKMode.bottom.name = self.AFKMode.bottom:CreateFontString(nil, "OVERLAY")