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

Hey! make sure to set this on your mute icon:
music:autoDeselect(false) edit: I just saw @DarthKarimYT ’ s reply after posting this.

1 Like

You need a script for that with a function, you can see some examples with the TopbarPlus Playground.

1 Like

Just found a bug when it comes to Rendering Icons on the right side.

I was updating my TopbarPlus version as it has been getting a little old over the time, i was specifically interested in the new userSelected and userDeselected events (idk if they are really new or not, haven’t touched my topbar for a while honestly)

For me the Module appears to be overlapping the Core-GUI “three dot menu” (The dropdown where the emotes button is located)

function buildTeams()
	local list = {}
	
	for _,team in pairs(game.Teams:GetTeams()) do
		table.insert(list,
			TopbarDrawer.new()
			:setName("KSKTeam"..team.Name)
			:setLabel(team.Name)
			:setTip("Join Team")
			:bindEvent("selected",function(self)
               ...
			end)
		)
	end
	
	return list
end

local AdminButton = TopbarDrawer.new()
AdminButton:setName("KSK_Admin")
AdminButton:setLabel("KSK - Admin")
AdminButton:setRight()
AdminButton:set("menuMaxIconsBeforeScroll", 2)
AdminButton:setMenu({
	
	TopbarDrawer.new()
	:setName("KSKAdmin_Team")
	:setLabel("Team")
	:set("dropdownSquareCorners", true)
	:setDropdown(buildTeams())
	,
	
	
	TopbarDrawer.new()
	:setName("KSKAdmin_Team")
	:setLabel("Management")
	,
	
})

local PlayerListButton = TopbarDrawer.new()
PlayerListButton:setName("KSK_PlayerList")
PlayerListButton:setLabel("Player List")
PlayerListButton:setRight()
PlayerListButton:autoDeselect(false)
PlayerListButton:bindEvent("userSelected", function(self)
...
end)
PlayerListButton:bindEvent("userDeselected", function(self)
...
end)

In the script aboe TopbarDrawer is references as the Module “Icon”

Specifically i have two components, both alligned to the right. One of them is serving as a simple button.
The other one is a menu that pops up two more buttons, one (currently) without any functionality, the other with a dropdown menu

Problem with this setup here is it overlaps the Core-GUI Button to the right of the Screen (the one with the three dots). The old version worked fine for me (possibly a version from about 1 year ago)

Can anyone reproduce this issue?

UPDATE: This issue does not always appear from the start on. Sometimes any update of the topbar is needed (opening the Menu)

1 Like

This changes nothing and is actually in a way worse.

2 Likes

This is amazing, However i think roblox is going to chage their topbar icon system in general. Start up studios and you’ll see the new ui when testing a place. Therefore this isnt a good use for the up-coming design. Dont get me wrong it looks good and is good i mean u know your stuff but if roblox does release the new design and dosnt make it developers choice it would be pretty bad.

1 Like

Scroll up a little there’s a TBP theme and modified TBP version to match the new theme and fix the hover bug. There should be both a theme by me and someone else.

How to automatically deselect icon?

	 Pulsar = TopBarPlus.new()
			:setLabel("Physic Pulsar")
			:setImage(14859461416)
			:setCornerRadius(0.1, 0)
			:bindEvent("selected", function()
				Pulsar:deselect()
			end),
	})

It gives me an error

1 Like

Why are you deselecting on it being selected?

Why would you want to do that?

How would I go about making something un-selectable?

By not giving it a select function or showing it.

1 Like

Err but It automatically make’s the button selectable.

3 Likes

Because i need it to click and deselect
like button not toggle

It doesn’t make it selectable at all if you don’t give it anything to be selectedable for.

1 Like

Err, you’re wrong actually I only made it display a text if they are hovering, I didn’t add anything for selection.

Then you’re good…? Your questioning is weird, re-word it better.

1 Like

Hello, I am having a critical issue with multiple buttons. Whenever I toggle one, the others also get toggled. Here is what I’m talking about:

As you can see in the video, when I click Settings, it acts as if I’m clicking Camera, even though there are literally no events for the Settings button. Same goes for my Spectate button.

Here is my entire script if necessary:

if not game:IsLoaded() then
	game.Loaded:Wait()
end

local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterPlayer = game:GetService("StarterPlayer")

local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Camera = workspace.CurrentCamera
local SCP096Head = workspace:WaitForChild("SCP-096"):WaitForChild("Body"):WaitForChild("HeadPart")

local Icon = require(ReplicatedStorage:WaitForChild("Icon"))
local IconController = require(ReplicatedStorage:WaitForChild("Icon"):WaitForChild("IconController"))
IconController.voiceChatEnabled = true
--->

local SettingsIcon = Icon.new()
SettingsIcon:setLeft()
SettingsIcon:setImage(14881489544)
SettingsIcon:setOrder(1)
--SettingsIcon:bindEvent("selected", function()
	
--end)
--SettingsIcon:bindEvent("deselected", function()
	
--end)
--->

local SpectateIcon = Icon.new()
SpectateIcon:setLeft()
SpectateIcon:setImage(14881468104)
SpectateIcon:setOrder(2)
SpectateIcon:bindEvent("selected", function()
	Camera.CameraSubject = SCP096Head
end)
SpectateIcon:bindEvent("deselected", function()
	Camera.CameraSubject = Humanoid
end)
--->

local CameraIcon = Icon.new()
local CameraToggled = false
Player.CameraMode = Enum.CameraMode.LockFirstPerson

CameraIcon:setLeft()
CameraIcon:setImage(14765357002)
CameraIcon:bindToggleKey(Enum.KeyCode.V)
CameraIcon:setOrder(3)
CameraIcon:bindEvent("toggled", function()
	if not CameraToggled then
		CameraToggled = true
		Player.CameraMode = Enum.CameraMode.Classic
		Player.CameraMaxZoomDistance = 128
		
		Player.CameraMinZoomDistance = 10
		Player.CameraMinZoomDistance = 5
	else
		CameraToggled = false
	
		Player.CameraMode = Enum.CameraMode.LockFirstPerson
	end
end)
--->

local exitGame = Icon.new()
exitGame:setRight()
exitGame:setImage(14875415042)
exitGame:setLabel("Back to Menu")
exitGame:bindEvent("selected", function()
	TeleportService:Teleport(12624976319, nil, Character)
	exitGame:deselect()
end)

Any and all help is appreciated! Thank you for your time.
-nebulimity

1 Like

It’s because of this part of your code;
(beneath local CameraToggled = false)

Player.CameraMode = Enum.CameraMode.LockFirstPerson
local CameraIcon = Icon.new()
local CameraToggled = false
Player.CameraMode = Enum.CameraMode.LockFirstPerson

CameraIcon:setLeft()
CameraIcon:setImage(14765357002)
CameraIcon:bindToggleKey(Enum.KeyCode.V)
CameraIcon:setOrder(3)
CameraIcon:bindEvent("toggled", function()
	if not CameraToggled then
		CameraToggled = true
		Player.CameraMode = Enum.CameraMode.Classic
		Player.CameraMaxZoomDistance = 128
		
		Player.CameraMinZoomDistance = 10
		Player.CameraMinZoomDistance = 5
	else
		CameraToggled = false
	
		Player.CameraMode = Enum.CameraMode.LockFirstPerson
	end
end)
--->
1 Like

I’ve removed that bit of code and even added a print statement in my Toggled function, but other buttons still run that event. However, something I’ve noticed, is that the Settings icon will only toggle the Camera icon off, not on.

Edit: After some experimenting, I found that if one button is toggled and you try to toggle another one, it untoggles ALL of the others.

1 Like