Add option to disable sound on GUI-buttons

Things that already exist in the current mod API
Post Reply
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Add option to disable sound on GUI-buttons

Post by Therenas »

Currently, there seems to be no way to disable the 'click'-sound that a (sprite-)button makes for modders. The base game however does this in many places, as it would become quite annoying otherwise, hearing click-sounds all the time. Now I find myself in a situation where I am implementing views similar to some of the base ones, like a recipe selector for example. So I would like to be able to disable the sounds on some of the buttons, for consistency and a nicer user experience.

SyncViews
Filter Inserter
Filter Inserter
Posts: 295
Joined: Thu Apr 21, 2016 3:17 pm
Contact:

Re: Add option to disable sound on GUI-buttons

Post by SyncViews »

Can you not define a button style that either has a "silence" sound or zero volume (never tried personally)?

User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: Add option to disable sound on GUI-buttons

Post by Therenas »

Well not that I am aware of? There is no such property in LuaStyle I think.

User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: Add option to disable sound on GUI-buttons

Post by Therenas »

I just found out that, at least in 0.17, you can set style.left_click_sound = {}, which removes the sound, so I guess this can be moved to already exists.

Post Reply

Return to “Already exists”