HideErrorMessages - fix, improve

Fixed UIErrorsFrame, checking for non-existend arg1 (id).
Added enGB only support to show all error messages that contain:
"Requires" text, for Herb,Mine,Lockpick etc.
Need to make locales for it.
This commit is contained in:
Sattva
2023-05-28 20:01:14 +03:00
parent 46968be1d0
commit 9ee821388a
2 changed files with 29 additions and 25 deletions
+4
View File
@@ -27,6 +27,10 @@ Accept Ress - Will it ever accept ressurection if ressurecter in combat ?
-- Functions to-do:
--------------------------------------------------------------------------------
HideErrorMessages - Add locales for "Requires", for herbalism,mining,lockpicking skill requirements.
HideErrorMessages - Make option to reduce Error Messages to 1 line. With option to make them fade faster.
RestoreChatHistory - Fix Channel colors.
RecentChatWindow - Need to add mouse scrolling.
+25 -25
View File
@@ -3030,36 +3030,36 @@ function LeaPlusLC:FriendCheck(name)
-- Error message events
local OrigErrHandler = UIErrorsFrame:GetScript('OnEvent')
UIErrorsFrame:SetScript('OnEvent', function (self, event, id, err, ...)
if event == "UI_ERROR_MESSAGE" then
-- Hide error messages
if LeaPlusLC["ShowErrorsFlag"] == 1 then
if err == ERR_INV_FULL or
err == ERR_QUEST_LOG_FULL or
err == ERR_RAID_GROUP_ONLY or
err == ERR_PET_SPELL_DEAD or
err == ERR_PLAYER_DEAD or
err == ERR_FEIGN_DEATH_RESISTED or
err == SPELL_FAILED_TARGET_NO_POCKETS or
err == ERR_ALREADY_PICKPOCKETED then
return OrigErrHandler(self, event, id, err, ...)
UIErrorsFrame:SetScript('OnEvent', function (self, event, err, ...)
if event == "UI_ERROR_MESSAGE" then
-- Hide error messages
if LeaPlusLC["ShowErrorsFlag"] == 1 then
if err == ERR_INV_FULL or
err == ERR_QUEST_LOG_FULL or
err == ERR_RAID_GROUP_ONLY or
err == ERR_PET_SPELL_DEAD or
err == ERR_PLAYER_DEAD or
err == ERR_FEIGN_DEATH_RESISTED or
err == SPELL_FAILED_TARGET_NO_POCKETS or
err == ERR_ALREADY_PICKPOCKETED or
string.match(err, "Requires") then -- add this line
return OrigErrHandler(self, event, err, ...)
end
else
return OrigErrHandler(self, event, err, ...)
end
else
return OrigErrHandler(self, event, id, err, ...)
elseif event == 'UI_INFO_MESSAGE' then
-- Show information messages
return OrigErrHandler(self, event, err, ...)
end
elseif event == 'UI_INFO_MESSAGE' then
-- Show information messages
return OrigErrHandler(self, event, id, err, ...)
end
end)
end)
end
-- Release memory
LeaPlusLC.Isolated = nil
end
-- Release memory
LeaPlusLC.Isolated = nil
end
----------------------------------------------------------------------
-- L40: Player
----------------------------------------------------------------------