1ForeverHD / TopbarPlus

Construct dynamic and intuitive topbar icons. Enhance the appearance and behaviour of these icons with features such as themes, dropdowns and menus.
https://devforum.roblox.com/t/topbarplus/1017485
Mozilla Public License 2.0
91 stars 119 forks source link

Gui's do not open #85

Closed ICrashWindows12 closed 5 months ago

ICrashWindows12 commented 7 months ago

when I use the bindToggleItem it somehow does not work even if I follow the guides and tutorials it does not work. I cannot open a gui for some reason because I was going to update a game with a cool UI feature than my old one. Look at the code to see if something is wrong: -- This retrieves the theme module under Icon local iconModule = game:GetService("ReplicatedStorage").Icon local Icon = require(iconModule) local Themes = require(iconModule.Themes)

-- Retrieve the GUI from StarterGui local gui = game:GetService("StarterGui"):WaitForChild("lol")

-- Create the icon local topbarIcon = Icon.new() :setImage(6326373239) :setLabel("My Settings") -- Set your own label for the topbar icon :setCaption("Custom Settings Caption") :setTip("Open Settings (M)") -- Set your own tooltip text :bindToggleKey(Enum.KeyCode.M) :bindToggleItem(gui) -- Bind the GUI to the icon :setProperty("deselectWhenOtherIconSelected", false) :set("iconFont", Enum.Font.Arial) -- Set the font to Arial :setRight() :notify() :setTheme(Themes.BlueGradient) :bindEvent("selected", function(icon) gui.Enabled = true -- Enable the GUI when the icon is selected end) :bindEvent("deselected", function(icon) gui.Enabled = false -- Disable the GUI when the icon is deselected end)

ICrashWindows12 commented 7 months ago

test the code out yourself to see if it works and maybe there was an update that changed something? i do not know