HideErrors - no reload now

This commit is contained in:
Sattva
2025-01-22 02:14:26 +03:00
parent b79f55eb04
commit f9b359727f
2 changed files with 24 additions and 19 deletions
-2
View File
@@ -24,8 +24,6 @@ Manage Debuffs - Test IT in fight.
-- What i plan to do in near future list from easy to hard -- What i plan to do in near future list from easy to hard
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Minimap - show time by user option.
MinimapButton - Add functions to alt-click and other clicks on button (prio - error text togggle) MinimapButton - Add functions to alt-click and other clicks on button (prio - error text togggle)
Minimap - MailIcon - Move - Create Dropdown with anchor. Minimap - MailIcon - Move - Create Dropdown with anchor.
+24 -17
View File
@@ -683,7 +683,6 @@ function LeaPlusLC:ReloadCheck()
or (LeaPlusLC["RestoreChatMessages"] ~= LeaPlusDB["RestoreChatMessages"]) -- Restore chat messages or (LeaPlusLC["RestoreChatMessages"] ~= LeaPlusDB["RestoreChatMessages"]) -- Restore chat messages
-- Text -- Text
or (LeaPlusLC["HideErrorMessages"] ~= LeaPlusDB["HideErrorMessages"]) -- Hide error messages
or (LeaPlusLC["NoHitIndicators"] ~= LeaPlusDB["NoHitIndicators"]) -- Hide portrait text or (LeaPlusLC["NoHitIndicators"] ~= LeaPlusDB["NoHitIndicators"]) -- Hide portrait text
or (LeaPlusLC["HideZoneText"] ~= LeaPlusDB["HideZoneText"]) -- Hide zone text or (LeaPlusLC["HideZoneText"] ~= LeaPlusDB["HideZoneText"]) -- Hide zone text
or (LeaPlusLC["HideKeybindText"] ~= LeaPlusDB["HideKeybindText"]) -- Hide keybind text or (LeaPlusLC["HideKeybindText"] ~= LeaPlusDB["HideKeybindText"]) -- Hide keybind text
@@ -3865,14 +3864,14 @@ function LeaPlusLC:Isolated()
-- Hide error messages -- Hide error messages
---------------------------------------------------------------------- ----------------------------------------------------------------------
if LeaPlusLC["HideErrorMessages"] == "On" then
-- Error message events -- Error message events
local OrigErrHandler = UIErrorsFrame:GetScript('OnEvent') local OrigErrHandler = UIErrorsFrame:GetScript('OnEvent')
UIErrorsFrame:SetScript('OnEvent', function(self, event, err, ...) local function UpdateErrorMessageVisibility()
if event == "UI_ERROR_MESSAGE" then if LeaPlusLC["HideErrorMessages"] == "On" and LeaPlusLC["ShowErrorsFlag"] == 1 then
-- Hide error messages UIErrorsFrame:SetScript('OnEvent', function(self, event, err, ...)
if LeaPlusLC["ShowErrorsFlag"] == 1 then if event == "UI_ERROR_MESSAGE" then
-- Hide error messages for specific conditions
if err == ERR_INV_FULL or if err == ERR_INV_FULL or
err == ERR_QUEST_LOG_FULL or err == ERR_QUEST_LOG_FULL or
err == ERR_RAID_GROUP_ONLY or err == ERR_RAID_GROUP_ONLY or
@@ -3888,21 +3887,29 @@ function LeaPlusLC:Isolated()
string.match(err, "afford") or string.match(err, "afford") or
string.match(err, "shapeshift") or string.match(err, "shapeshift") or
string.match(err, "disarm") string.match(err, "disarm")
then then
return OrigErrHandler(self, event, err, ...) return OrigErrHandler(self, event, err, ...)
end end
else elseif event == 'UI_INFO_MESSAGE' then
-- Show information messages
return OrigErrHandler(self, event, err, ...) return OrigErrHandler(self, event, err, ...)
end end
elseif event == 'UI_INFO_MESSAGE' then end)
-- Show information messages else
return OrigErrHandler(self, event, err, ...) UIErrorsFrame:SetScript('OnEvent', OrigErrHandler)
end end
end)
end end
-- Hook the checkbox click to toggle visibility
LeaPlusCB["HideErrorMessages"]:HookScript("OnClick", function(self)
LeaPlusLC["ShowErrorsFlag"] = self:GetChecked() and 1 or 0
UpdateErrorMessageVisibility() -- Update the error message visibility state
end)
-- Initial check to set the correct visibility on load
UpdateErrorMessageVisibility()
-- Release memory -- Release memory
LeaPlusLC.Isolated = nil LeaPlusLC.Isolated = nil
end end
@@ -19547,7 +19554,7 @@ LeaPlusLC:CfgBtn("FilterChatMessagesBtn", LeaPlusCB["FilterChatMessages"])
pg = "Page4"; pg = "Page4";
LeaPlusLC:MakeTx(LeaPlusLC[pg], "Visibility", 146, -72); LeaPlusLC:MakeTx(LeaPlusLC[pg], "Visibility", 146, -72);
LeaPlusLC:MakeCB(LeaPlusLC[pg], "HideErrorMessages", "Hide error messages", 146, -92, true, "If checked, most error messages (such as 'Not enough rage') will not be shown. Some important errors are excluded.|n|nIf you have the minimap button enabled, you can hold down the alt key and click it to toggle error messages without affecting this setting.") LeaPlusLC:MakeCB(LeaPlusLC[pg], "HideErrorMessages", "Hide error messages", 146, -92, false, "If checked, most error messages (such as 'Not enough rage') will not be shown. Some important errors are excluded.|n|nIf you have the minimap button enabled, you can hold down the alt key and click it to toggle error messages without affecting this setting.")
LeaPlusLC:MakeCB(LeaPlusLC[pg], "NoHitIndicators", "Hide portrait numbers", 146, -112, true, "If checked, damage and healing numbers in the player and pet portrait frames will be hidden.") LeaPlusLC:MakeCB(LeaPlusLC[pg], "NoHitIndicators", "Hide portrait numbers", 146, -112, true, "If checked, damage and healing numbers in the player and pet portrait frames will be hidden.")
LeaPlusLC:MakeCB(LeaPlusLC[pg], "HideZoneText", "Hide zone text", 146, -132, true, "If checked, zone text will not be shown (eg. 'Ironforge').") LeaPlusLC:MakeCB(LeaPlusLC[pg], "HideZoneText", "Hide zone text", 146, -132, true, "If checked, zone text will not be shown (eg. 'Ironforge').")
LeaPlusLC:MakeCB(LeaPlusLC[pg], "HideKeybindText", "Hide keybind text", 146, -152, true, "If checked, keybind text will not be shown on action buttons.") LeaPlusLC:MakeCB(LeaPlusLC[pg], "HideKeybindText", "Hide keybind text", 146, -152, true, "If checked, keybind text will not be shown on action buttons.")