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

It wont work for me… I’m trying to connect it into a text button and it wont work

edit: nvm, I figured it out.

Hey so I keep getting this error after I reset in game. I have the button tween a UI, if you reset it will throw these errors. Before you reset tho it works fine, which is weird. Here’s the error

And here is the code for the icon:

Anyone know why?

3 Likes

Your GUIs likely have ResetOnSpawn set to true (while the icon constructor localscripts located in StarterPlayerScripts don’t reset).

You can solve this two ways:

  1. Set all the GUIs ResetOnSpawn property to false

  2. Or move the icon constructor code within a GUI that resets on spawn then put the following code at the very bottom of your icon creation localscript:

local icons = IconController.getIcons()
for _, icon in pairs(icons) do
	IconController.clearIconOnSpawn(icon)
end
3 Likes

Yep that’s what I was thinking too, I can just set it to off. Thanks for the help bro.

Hello, I had a question. How can I deselect a button when I select it?

For example: I made a DropDown button and I add some stuff in it. If I click on one of the buttons the DropDown will be disabled and the one which I selected will be deselected.

1 Like

Is there a way I can stop my dropdown from clipping through the chat GUI, would I have to disable default topbar and create my own chat button?

2 Likes

Is it overwriting the chat button? If it is well I guess you gotta wait until devs fix it or you gotta make new chat button

It’s not the button it’s that my dropdown clips through the chat GUI

Icon:deselect should do the trick when combined with the selected event:

local dropdownIcon = ... -- Create dropdown icon

-- Then for all your icons within the dropdown do
icon:bindEvent("selected", function()
    icon:deselect()
    dropdownIcon:deselect()
end)

1 Like

The dropdown should appear in front of the chat:

Do you want to completely hide the chat menu when your dropdown is toggled?

If so you can do this:

local originalChatState = true
Icon.new()
	:bindEvent("selected", function(icon)
		originalChatState = game:GetService("StarterGui"):GetCore("ChatActive")
		game:GetService("StarterGui"):SetCore("ChatActive", false)
	end)
	:bindEvent("deselected", function(icon)
		game:GetService("StarterGui"):SetCore("ChatActive", originalChatState)
	end)

We appear to have a dropdownHidePlayerlistOnOverlap setting although not one for the chat menu so I’ll add this to the to-do list. This means when released you could do the following as an alternative:

icon:set("dropdownHideChatOnOverlap", true)
3 Likes

Ok thanks! I can’t wait for this update!

I am totally bookmarking this! Looks amazing!

1 Like

Hello, my game has HD admin, the HD admin button has a blue gradient, but the other buttons of the topBar have the default theme, how do I make the HD admin button black and white?

image

I want the HD admin button to look something like TTD 3:

image

Thanks.

1 Like

Hi there, HD Admin should be merging with whatever theme the game uses so it sounds like a small bug with that.

What version of TopbarPlus are you using for TTD 3? (there should be a module within the Icon folder called VERSION, if not its v2.3 or below).

2 Likes

oh, it was my mistake, there is no bug I could already fix it. Thank you!
PS: I don’t work for TTD, it was just an example lol

2 Likes

Heyo, it looks like disableStateOverlay doesn’t function as intended, the shade effect is still enabled even after being disabled using icon:disableStateOverlay(true)

Hi, doing playIcon:disableStatOverlay(true) appears to work fine:

Is that the desired result? If so, can you provide more details on how you reproduce it (your icon constructor code, uncopylocked place, etc) / what you want it to look like, and I’ll look at fixing it asap.

(I may not be able to get back until the end of the month as I’m going away shortly)

1 Like

Ah, my bad, I completely misunderstood the documentation. I thought :disableStateOverlay() was supposed to disable this effect when clicking the button.

Is there any way to disable this effect?

Sure there’s a few ways to achieve this (such as by making the selected theme the same as deselected, using events, etc). The easiest is to use the selected event combined with the deselect method:

:bindEvent("selected", function(icon)
	icon:deselect()
end)

… which is equivalent to doing:

icon.selected:Connect(function()
	icon:deselect()
end)

You could also consider doing icon:lock() which additionally disables the overlay hover/press effects.

4 Likes

Sweet! Thanks for the help! : )