[v3!] TopbarPlus v3.0.0 | Construct intuitive topbar icons; customise them with themes, dropdowns, captions, labels and much more

Hi, i found an bug recently. When i disable and enable the local script which makes icon it duplicates
Here’s the footage

That doesn’t work however, since I want to have that enabled for other icons…

To explain my use-case better:
I want to make an icon that displays what song is currently playing, and have a button to mute the music:
image
When clicked, the “Mute music” icon must remain enabled. It should only disable when clicked again. I don’t want this icon to be influenced by other icons, while still having only one “open” at a time.

Also one bug I noticed with resizeInfo's tween (on label add/remove) is that the tween jumps back and forth when using it on an icon that has :setRight().

1 Like

This doesn’t seem to be a bug. Whenever you disable and re-enabled the script, it will run like it hasn’t started and will recreate the icons. If disabling and re-enabling the script is necessary, you can use IconController.getIcon(IconName) and see if the icon exists before creating a new one.

Expanding upon what Haydz6 said, this isn’t a bug, icons are only designed to be constructed once per client. We do however provide support for icons which reset on spawn, you can find the solution here:

This is amazing, but is it compatible/usable with mobile games or do I have to create my own UI for mobile players?

TopbarPlus fully supports PC, Mobile, Tablet and Console, and comes with internal features such as ‘overflows’ to ensure icons remain within suitable bounds. More info here:

1 Like

image
Hi how can I do this ?? to the admin

The reason this is happening is because your ‘resizeInfo’ is out of sync with your ‘repositionInfo’. You have to ensure those tween time values are the same if you want the icon to remain in its relative space, especially if using a hovering effect.

0.2 (repositionInfo) vs 0.15 (resizeInfo) for your case.

Also as a tip, you don’t have to call :set("resizeInfo", openTween) for every single icon, you can modify it within the BlueGradient themes module (or whatever theme you require) instead.

1 Like

You can customise that here:

Please note this isn’t the official help thread for that, we’ll have one setup once Nanoblox is released (feel free to DM or https://twitter.com/hdteamroblox for the time being)

1 Like

Some things for example if I can’t get out, can I ask you again?

image
Did I do something?

1 Like

Hi again!

When using a Dropdown menu, the icon within the menu doesn’t seem to adjust it’s size:
image
This is calling :setLabel() after the icon has been setup in the dropdown. My expected behavior would be that the width of the icon should update like with the uppermost icons when updating their label.

Another small thing I noticed is that the healthbar displays over the icons on the right-hand side:
image
I think hiding the healthbar would be the best option, just like the Leaderstats. (if that is possible)

Cheers for the report, I’ll aim to have these fixed for the next update:

2 Likes

Currently I’m making an admin panel and I was wondering if there was a way to make it so only a certain rank and above will be able to see the icon or menu.

local player = game:GetService("Players").LocalPlayer
local playerGui = player.PlayerGui
local replicatedStorage = game:GetService("ReplicatedStorage")
local iconModule = replicatedStorage.Icon
local Icon = require(iconModule)
local IconController = require(iconModule.IconController)
local Themes = require(iconModule.Themes)
local adminMenu = game.StarterGui["Admin Gui"]

Icon.new()
:setName("AdminPanel")
:setImage(7072721855)
:setLabel("Admin Panel")
:bindEvent("selected", function()
	adminMenu.Visible = true
end)
:bindEvent("deselected", function()
	adminMenu.Visible = false
end)
:setName("AdminIcon")
:give(function(icon)
	return adminMenu.CloseButton.MouseButton1Click:Connect(function()
		icon:deselect()
	end)
end)

icon:setEnabled(bool) will help achieve this:

local canViewIcon = false
if isAnAdmin then
    canViewIcon = true
end

Icon.new()
    :setEnabled(canViewIcon)
2 Likes

I’ve tried this but it still doesn’t seem to work in game, have I done something wrong. No error shows up in the output?

game.Players.PlayerAdded:Connect(function(Player)

local player = game:GetService("Players").LocalPlayer
local playerGui = player.PlayerGui
local replicatedStorage = game:GetService("ReplicatedStorage")
local iconModule = replicatedStorage.Icon
local Icon = require(iconModule)
local IconController = require(iconModule.IconController)
local Themes = require(iconModule.Themes)
local adminMenu = game.StarterGui["Admin Gui"]
local canViewIcon = false
if Player:GetRankInGroup(10565031) >= 1  then
	canViewIcon = true
end


Icon.new()
:setEnabled(false)
:setName("AdminPanel")
:setImage(7072721855)
:setLabel("Admin Panel")
:bindEvent("selected", function()
	adminMenu.Visible = true
end)
:bindEvent("deselected", function()
	adminMenu.Visible = false
end)
:setName("AdminIcon")
:give(function(icon)
	return adminMenu.CloseButton.MouseButton1Click:Connect(function()
		icon:deselect()	
		end)
	end)
end)

That should be canViewIcon not false.

2 Likes

This still didn’t seem to change anything, and nothing is showing in the output either…?

game.Players.PlayerAdded:Connect(function(player)

local player = game:GetService("Players").LocalPlayer
local playerGui = player.PlayerGui
local replicatedStorage = game:GetService("ReplicatedStorage")
local iconModule = replicatedStorage.Icon
local Icon = require(iconModule)
local IconController = require(iconModule.IconController)
local Themes = require(iconModule.Themes)
local adminMenu = game.StarterGui["Admin Gui"]
local canViewIcon = false
if player:GetRankInGroup(10565031) > 6 then
	canViewIcon = true
end


Icon.new()
:setEnabled(canViewIcon)
:setName("AdminPanel")
:setImage(7072721855)
:setLabel("Admin Panel")
:bindEvent("selected", function()
	adminMenu.Visible = true
end)
:bindEvent("deselected", function()
	adminMenu.Visible = false
end)
:setName("AdminIcon")
:give(function(icon)
	return adminMenu.CloseButton.MouseButton1Click:Connect(function()
		icon:deselect()	
		end)
	end)
end)

This is because you have put your code in a PlayerAdded function but since this is a localscript, the player has already joined the game. Removing game.Players.PlayerAdded:Connect(function(player) and the accompanying end) will fix it.

1 Like

Now it works, thanks for the help. Didn’t realize that could happen so thank you.