Added optional notification background color arugment

Co-Authored-By: WolfShy1 <wolfshy1@users.noreply.github.com>
This commit is contained in:
ElPumpo
2020-01-15 12:18:39 +01:00
co-authored by WolfShy1
parent c345d40374
commit 60fd7e317b
2 changed files with 10 additions and 8 deletions
+8 -6
View File
@@ -44,16 +44,18 @@ ESX.SetPlayerData = function(key, val)
ESX.PlayerData[key] = val
end
ESX.ShowNotification = function(msg, flash, saveToBrief)
ESX.ShowNotification = function(msg, flash, saveToBrief, hudColorIndex)
if saveToBrief == nil then saveToBrief = true end
AddTextEntry('esxNotification', msg)
BeginTextCommandThefeedPost('esxNotification')
if hudColorIndex then ThefeedNextPostBackgroundColor(hudColorIndex) end
EndTextCommandThefeedPostTicker(flash or false, saveToBrief)
end
ESX.ShowAdvancedNotification = function(sender, subject, msg, textureDict, iconType, flash, saveToBrief)
ESX.ShowAdvancedNotification = function(sender, subject, msg, textureDict, iconType, flash, saveToBrief, hudColorIndex)
AddTextEntry('esxAdvancedNotification', msg)
BeginTextCommandThefeedPost('esxAdvancedNotification')
if hudColorIndex then ThefeedNextPostBackgroundColor(hudColorIndex) end
EndTextCommandThefeedPostMessagetext(textureDict, textureDict, false, iconType, sender, subject)
EndTextCommandThefeedPostTicker(flash, saveToBrief)
end
@@ -1109,13 +1111,13 @@ AddEventHandler('esx:serverCallback', function(requestId, ...)
end)
RegisterNetEvent('esx:showNotification')
AddEventHandler('esx:showNotification', function(msg, flash, saveToBrief)
ESX.ShowNotification(msg, flash, saveToBrief)
AddEventHandler('esx:showNotification', function(msg, flash, saveToBrief, hudColorIndex)
ESX.ShowNotification(msg, flash, saveToBrief, hudColorIndex)
end)
RegisterNetEvent('esx:showAdvancedNotification')
AddEventHandler('esx:showAdvancedNotification', function(sender, subject, msg, textureDict, iconType, flash, saveToBrief)
ESX.ShowAdvancedNotification(sender, subject, msg, textureDict, iconType, flash, saveToBrief)
AddEventHandler('esx:showAdvancedNotification', function(sender, subject, msg, textureDict, iconType, flash, saveToBrief, hudColorIndex)
ESX.ShowAdvancedNotification(sender, subject, msg, textureDict, iconType, flash, saveToBrief, hudColorIndex)
end)
RegisterNetEvent('esx:showHelpNotification')
+2 -2
View File
@@ -531,8 +531,8 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, c
return
end
self.showNotification = function(msg, flash, saveToBrief)
self.triggerEvent('esx:showNotification', msg, flash, saveToBrief)
self.showNotification = function(msg, flash, saveToBrief, hudColorIndex)
self.triggerEvent('esx:showNotification', msg, flash, saveToBrief, hudColorIndex)
end
self.showHelpNotification = function(msg, thisFrame, beep, duration)