Skip to content

Commit

Permalink
tweak(plugins): remove "enableNotificationReplace" variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Blumlaut committed Dec 10, 2021
1 parent 56be74f commit 93ec0cb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
5 changes: 2 additions & 3 deletions plugins/notifications/mythic-notify_client.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
enableNotificationReplace = false -- change to true to enable replacement of the default V Notification for EasyAdmin

-- this bit of code tells EasyAdmin to not draw the V Notification.
AddEventHandler("EasyAdmin:receivedNotification", function()
if GetResourceState("mythic-notify") == "started" or enableNotificationReplace then
if GetResourceState("mythic-notify") == "started" then
CancelEvent()
end
end)

AddEventHandler("EasyAdmin:showNotification", function(text, important)
if GetResourceState("mythic-notify") == "started" or enableNotificationReplace then
if GetResourceState("mythic-notify") == "started" then
exports['mythic_notify']:DoHudText('inform', text)
end
end)
6 changes: 2 additions & 4 deletions plugins/notifications/pNotify_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@
-- Feel free to make Pull Requests to add aditional features for this, this is merely an example of whats possible.
--

enableNotificationReplace = false -- change to true to enable replacement of the default V Notification for EasyAdmin

-- this bit of code tells EasyAdmin to not draw the V Notification.
AddEventHandler("EasyAdmin:receivedNotification", function()
if GetResourceState("pNotify") == "started" or enableNotificationReplace then
if GetResourceState("pNotify") == "started" then
CancelEvent()
end
end)

AddEventHandler("EasyAdmin:showNotification", function(text, important)
if GetResourceState("pNotify") == "started" or enableNotificationReplace then
if GetResourceState("pNotify") == "started" then
exports['pNotify']:SendNotification({layout = "centerLeft", type = "alert", text = text})
end
end)
5 changes: 2 additions & 3 deletions plugins/notifications/t-notify_client.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
enableNotificationReplace = false -- change to true to enable replacement of the default V Notification for EasyAdmin

-- this bit of code tells EasyAdmin to not draw the V Notification.
AddEventHandler("EasyAdmin:receivedNotification", function()
if GetResourceState("t-notify") == "started" or enableNotificationReplace then
if GetResourceState("t-notify") == "started" then
CancelEvent()
end
end)

AddEventHandler("EasyAdmin:showNotification", function(text, important)
if GetResourceState("t-notify") == "started" or enableNotificationReplace then
if GetResourceState("t-notify") == "started" then
exports['t-notify']:Alert({style = "error", message = text})
end
end)

0 comments on commit 93ec0cb

Please sign in to comment.