added proper admin icon support

This commit is contained in:
Thomas G 2022-07-12 23:03:37 +10:00
parent ff3f117135
commit b641829561
1 changed files with 36 additions and 14 deletions

View File

@ -22,6 +22,25 @@ local bigEasingStyle = Enum.EasingStyle.Back
local smallEasingStyle = Enum.EasingStyle.Quart local smallEasingStyle = Enum.EasingStyle.Quart
local lightBackground = true local lightBackground = true
local adminUserNames = {
"ARCHBLOX",
"Thomas",
"Conkley",
"Josh",
"BagOfDreams",
"templater",
"AliMine8555",
"Mura",
"rec01n",
"zombieboy667",
"Penguin",
"cott",
"SQL",
"MORBLOX",
"Stick",
"sodium",
}
local function waitForChild(instance, name) local function waitForChild(instance, name)
while not instance:FindFirstChild(name) do while not instance:FindFirstChild(name) do
instance.ChildAdded:wait() instance.ChildAdded:wait()
@ -679,10 +698,13 @@ if UserSettings and LoadLibrary then
end end
end end
local function getMembershipTypeIcon(membershipType,name) local function getIconForPlayer(membershipType,name)
if name == "Thomas" then for i,v in ipairs(adminUserNames) do
return "rbxasset://textures/ui/TinyAdminIcon.png" if v == name then
elseif membershipType == Enum.MembershipType.None then return "rbxasset://textures/ui/TinyAdminIcon.png"
end
end
if membershipType == Enum.MembershipType.None then
return "" return ""
elseif membershipType == Enum.MembershipType.BuildersClub then elseif membershipType == Enum.MembershipType.BuildersClub then
return "rbxasset://textures/ui/TinyBcIcon.png" return "rbxasset://textures/ui/TinyBcIcon.png"
@ -700,11 +722,11 @@ if UserSettings and LoadLibrary then
local fontHeight = 20 local fontHeight = 20
local friendIconImage = getFriendStatusIcon(friendStatus) local friendIconImage = getFriendStatusIcon(friendStatus)
nameObject.MembershipTypeLabel.FriendStatusLabel.Visible = (friendIconImage ~= nil) nameObject.UserIconLabel.FriendStatusLabel.Visible = (friendIconImage ~= nil)
if friendIconImage ~= nil then if friendIconImage ~= nil then
--Show friend icon --Show friend icon
nameObject.MembershipTypeLabel.FriendStatusLabel.Image = friendIconImage nameObject.UserIconLabel.FriendStatusLabel.Image = friendIconImage
nameObject.NameLabel.Position =UDim2.new(0,2*fontHeight,0,1) nameObject.NameLabel.Position =UDim2.new(0,2*fontHeight,0,1)
nameObject.NameLabel.Size = UDim2.new(1,-2*fontHeight,1,-2) nameObject.NameLabel.Size = UDim2.new(1,-2*fontHeight,1,-2)
else else
@ -717,7 +739,7 @@ if UserSettings and LoadLibrary then
local fontHeight = 20 local fontHeight = 20
nameObject.Size = UDim2.new(1,0,0,fontHeight) nameObject.Size = UDim2.new(1,0,0,fontHeight)
nameObject.MembershipTypeLabel.Image = getMembershipTypeIcon(membershipStatus,nameObject.NameLabel.Text) nameObject.UserIconLabel.Image = getIconForPlayer(membershipStatus,nameObject.NameLabel.Text)
end end
@ -748,13 +770,13 @@ if UserSettings and LoadLibrary then
frame.BackgroundTransparency = 0.5 frame.BackgroundTransparency = 0.5
frame.BorderSizePixel = 0 frame.BorderSizePixel = 0
local membershipStatusLabel = Instance.new("ImageLabel") local UserIconStatusLabel = Instance.new("ImageLabel")
membershipStatusLabel.Name = "MembershipTypeLabel" UserIconStatusLabel.Name = "UserIconLabel"
membershipStatusLabel.BackgroundTransparency = 1 UserIconStatusLabel.BackgroundTransparency = 1
membershipStatusLabel.Size = UDim2.new(1,0,1,0) UserIconStatusLabel.Size = UDim2.new(1,0,1,0)
membershipStatusLabel.Position = UDim2.new(0,0,0,0) UserIconStatusLabel.Position = UDim2.new(0,0,0,0)
membershipStatusLabel.SizeConstraint = Enum.SizeConstraint.RelativeYY UserIconStatusLabel.SizeConstraint = Enum.SizeConstraint.RelativeYY
membershipStatusLabel.Parent = frame UserIconStatusLabel.Parent = frame
local friendStatusLabel = Instance.new("ImageLabel") local friendStatusLabel = Instance.new("ImageLabel")
friendStatusLabel.Name = "FriendStatusLabel" friendStatusLabel.Name = "FriendStatusLabel"