Page 1 of 1
How do I change the sound of a dropdown menu?
Posted: Fri Jul 25, 2025 11:27 am
by yaim904
Hello, I am creating an interface and would like to customize the selection sound.

- (10).png (1.36 MiB) Viewed 222 times
I created the custom dropdown style.
Code: Select all
Styles["zzzYAIM0425_0900_drop_down_channels"] = {
type = "dropdown_style",
width = 282 + 32
}

- (11).png (1.23 MiB) Viewed 222 times
When the options are displayed, each option has a sound when selected, and I would like to change it.

- (12).png (1.19 MiB) Viewed 222 times
I have a “sound” to replace the default sound, and I will take care of the sound effect from the code.
Code: Select all
left_click_sound = "__zzzYAIM0425-0900__/sound/empty_audio.ogg",
Could you provide me with the code to do so?
Re: How do I change the sound of a dropdown menu?
Posted: Sat Jul 26, 2025 11:43 am
by Osmo
Re: How do I change the sound of a dropdown menu?
Posted: Sat Jul 26, 2025 8:32 pm
by yaim904
Osmo wrote: Sat Jul 26, 2025 11:43 am
Seeing your response, it's possible that I didn't explain myself correctly.
I want to change the sound when selecting one of the options displayed.
I am already changing the style of the dropdown.
But, I still appreciate your response.
The following is the last code I tried, but it doesn't work.
Code: Select all
Styles[Prefix .. "drop_down_channels"] = {
type = "dropdown_style",
width = 296 + 64,
button_style =
{
type = "button_style",
left_click_sound = This_MOD.sound .. "empty_audio.ogg",
parent = "dropdown_button"
},
list_box_style = {
type = "list_box_style",
left_click_sound = This_MOD.sound .. "empty_audio.ogg",
}
}
Re: How do I change the sound of a dropdown menu?
Posted: Sun Jul 27, 2025 12:56 pm
by Osmo
yaim904 wrote: Sat Jul 26, 2025 8:32 pm
I am already changing the style of the dropdown.
But you are not changing the opened_sound on the style. If you did, it would display in the Ctrl+F6 menu
Re: How do I change the sound of a dropdown menu?
Posted: Sun Jul 27, 2025 1:33 pm
by EvilPLa
Hmm, I think, because the buttons aren't built in the code, the dropdown items are no LuaGuiElements, you aren't able to change the sound.
But wait, the "left_click_sound" IS actually in the style definition...
Re: How do I change the sound of a dropdown menu?
Posted: Sun Jul 27, 2025 2:07 pm
by EvilPLa
The button you are changing is the closed Dropdown, you need to change this one
https://lua-api.factorio.com/latest/typ ... item_style
Just confirmed it with "my" dropdown

- 07-27-2025, 16-21-51.png (29.75 KiB) Viewed 50 times
Re: How do I change the sound of a dropdown menu?
Posted: Sun Jul 27, 2025 3:53 pm
by yaim904
EvilPLa wrote: Sun Jul 27, 2025 2:07 pm
This is what I need.
Thank you very much.