Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu icon seems to be deselecting other widgets when a different one is pressed. #145

Open
the-trumpeter opened this issue Dec 8, 2024 · 2 comments

Comments

@the-trumpeter
Copy link

the-trumpeter commented Dec 8, 2024

Video:
https://drive.google.com/file/d/1hMuJmgBi_NQ1BElwyDXjbdjUU7qHFCrx/view?usp=sharing

As shown above, When I click on one widget in a menu setup, the other widget deselects, like it's set to 'single selection'. I'm not sure if it's intentonal or not, but I do know that I do not want it happening. How do I stop it?

Here's the code I have:

-- Localscript
-- StarterPlayerScripts

local adminIcon = Icon.new()
		:setName("Admin")
		:setImage("rbxassetid://106591503368488")
		:setCaption("Moderator panel")
		:modifyTheme({"Menu","MaxIcons", 2})
		
		:bindToggleKey(Enum.KeyCode.L)
		
		:bindEvent("selected", function() buttonOnSound:Play() end)
		:bindEvent("deselected", function() buttonOffSound:Play() end)
		
		:setMenu({
			Icon.new()
				:setName("OpenAdmin")
				:setImage("rbxassetid://71593208390625")
				:setLabel("Open")
				:setCaption("Open admin panel")
				
				:bindToggleKey(Enum.KeyCode.K)
				
				:bindEvent("deselected", function() toggleGUIFunc() end)
				:oneClick()
			,
			
			
			Icon.new()
				:setName("adminBillboard")
				:setImage("rbxassetid://78085273064918", "deselected")
				:setImage("rbxassetid://77519475910854", "selected")
				:setLabel("Badge")
				:setCaption("Toggle floating admin badge.")
				
				:bindToggleKey(Enum.KeyCode.M)
				
				:bindEvent("toggled", function() toggleBillBoardGUIFunc() end)
				
			,
		})

note: there are sounds/functions/variables in there that are defined but not included in code snippet (or it will be too long) just imagine they're there. Can upload full code if you need.

I will add video later gtg at the moment sorry.

But as always,

Any help appreciated!

Thank you,
Gill

Roblox: @stopthatchickenGP
GitHub: @the-trumpeter

PS - Sorry if Issues is a bad place to put this, I am unable to post on the DevForum yet otherwise I would have stuck it there!

@Hunterk1241
Copy link

This is intentional behaviour. :autoDeselect(false) is how you disable that functionality for each icon

@the-trumpeter
Copy link
Author

This is intentional behaviour. :autoDeselect(false) is how you disable that functionality for each icon

I assume I should call this with the nested icons?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants