Skip to content

Commit

Permalink
feat(gui): credit where credit is due
Browse files Browse the repository at this point in the history
marks common contributors & developers as such in the GUI.

@coleminer0112 i couldn't find any infos about you, let me know one of your FiveM Identifiers and i'll add you to the list! 😄
  • Loading branch information
Blumlaut committed Aug 30, 2022
1 parent 10e9552 commit bb9efe9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
8 changes: 8 additions & 0 deletions client/gui_c.lua
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ function generateTextures()
dui = nil
end
txd = CreateRuntimeTxd("easyadmin")
CreateRuntimeTextureFromImage(txd, 'badge_dev', 'dependencies/images/pl_badge_dev.png')
CreateRuntimeTextureFromImage(txd, 'badge_contrib', 'dependencies/images/pl_badge_contr.png')

if ((overrideEgg == nil) and easterChance == 100) or (overrideEgg or overrideEgg == false) then
local chance = overrideEgg
if ((overrideEgg == nil) and easterChance == 100) then
Expand Down Expand Up @@ -462,6 +465,11 @@ function GenerateMenu() -- this is a big ass function
}
end
local thisPlayerMenu = _menuPool:AddSubMenu(playermanagement,"["..thePlayer.id.."] "..thePlayer.name,"",true)
if not RedM and thePlayer.developer then
thisPlayerMenu.ParentItem:SetRightBadge(23)
elseif not RedM and thePlayer.contributor then
thisPlayerMenu.ParentItem:SetRightBadge(24)
end
playerMenus[tostring(thePlayer.id)] = {menu = thisPlayerMenu, name = thePlayer.name, id = thePlayer.id }

thisPlayerMenu:SetMenuWidthOffset(menuWidth)
Expand Down
10 changes: 10 additions & 0 deletions dependencies/NativeUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ BadgeTexture = {
[20] = function(Selected) if Selected then return "shop_trevor_icon_b" else return "shop_trevor_icon_a" end end,
[21] = function() return "shop_lock" end,
[22] = function() return "shop_tick_icon" end,
[23] = function() return "badge_dev" end,
[24] = function() return "badge_contrib" end,
}

BadgeDictionary = {
Expand All @@ -104,12 +106,20 @@ BadgeDictionary = {
return "commonmenu"
end
end,
[23] = function(Selected)
return "easyadmin"
end,
[24] = function(Selected)
return "easyadmin"
end,
}

BadgeColour = {
[5] = function(Selected) if Selected then return 0, 0, 0, 255 else return 255, 255, 255, 255 end end,
[21] = function(Selected) if Selected then return 0, 0, 0, 255 else return 255, 255, 255, 255 end end,
[22] = function(Selected) if Selected then return 0, 0, 0, 255 else return 255, 255, 255, 255 end end,
[23] = function(Selected) if Selected then return 0,0,0, 255 else return 255,255,255,255 end end,
[24] = function(Selected) if Selected then return 0,0,0, 255 else return 255,255,255,255 end end
}

Colours = {
Expand Down
Binary file added dependencies/images/pl_badge_contr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dependencies/images/pl_badge_dev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion server/admin_server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,15 @@ RegisterServerEvent("EasyAdmin:GetInfinityPlayerList", function()
cachePlayer(player)
for i, cached in pairs(CachedPlayers) do
if (cached.id == player) then
table.insert(l, {id = cached.id, name = cached.name, immune = cached.immune})
local pData = {id = cached.id, name = cached.name, immune = cached.immune}
for i, v in pairs(cached.identifiers) do
if v == "discord:178889658128793600" then
pData.developer = true
elseif v == "discord:736521574383091722" --[[ Jaccosf ]] or v == "discord:1001065851790839828" --[[ robbybaseplate ]] then
pData.contributor = true
elseif
end
table.insert(l, pData)
end
end
end
Expand Down

0 comments on commit bb9efe9

Please sign in to comment.