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

We’re only supporting overflows for left and right set icons for the time-being due to additional complexities involved with mid-set icons.

A solution for you instead: check the clients screen size with ViewportSize, then if their X size is below a certain value, create an icon and set a dropdown with all your other icons.

local screenSize = ...

local icon1 = Icon.new()
local icon2 = Icon.new()
local icon3 = Icon.new()

if screenSize.X < DESIRED_AMOUNT then
    local dropdownIcon = Icon.new()
    dropdownIcon:setDropdown({icon1, icon2, icon3})
end

Apologies, by ‘impossible’ I should have said ‘impossible to mimic the chat icon perfectly while preserving the default chat menus without forking and creating your own’.

You’re welcome to use the code we originally wrote for the Chat Mimic Icon:

As far as I’m aware though (with the recent removal of key chat events) you won’t be able to mimic it perfectly unless you create your own chat menu or a fork of the core chat.

1 Like

Is there a way to make a button that hides a certain topbar? (screen gui button)

What do you mean by this?

Do you want hide a CoreGui, Fame, Screen Gui, etc?

I want to make a button that hides 2 of the icons (top bar icons).
I guess its kind of a frame but since its a topbar icon I dont know if its possible.

When I say topbar icon, I mean I made an icon out of this module, and I want to make a button that hides 2 of the icons, so players can decide if to view them.

icon:setEnabled(false) should do the trick:

1 Like

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)
2 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