closing the modified gui of a combinator plays no sound

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 117
Joined: Tue Feb 06, 2024 5:18 am
Contact:

closing the modified gui of a combinator plays no sound

Post by hgschmie »

I have an entity that is derived from constant combinator. It shows up as having a "close gui sound" in the prototype gui:
Screenshot 2024-12-05 at 19.17.59.png
Screenshot 2024-12-05 at 19.17.59.png (129.02 KiB) Viewed 438 times
in my code, I am overwriting "entity.opened" with my own GUI.

When opening the GUI, the game plays the "open gui sound". However, when closing it (calling player.opened.destroy()), the gui closes but no sound is played.
Honktown
Smart Inserter
Smart Inserter
Posts: 1057
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: closing the modified gui of a combinator plays no sound

Post by Honktown »

Is it possible you're not noticing because the gui is closed during your explicit overwrite? I would expect writing player.opened = something else would play the close sound then, as that would be when the entity gui is closed. And that destroying a LuaGuiElement or a LuaEntity would not play a sound (the former because destroying a gui plays no sound, and that a destroying an entity wouldn't be "closing" the entity).

From how you wrote it, was it:
1) opened entity (opened sound played)
2) player.opened is written with created LuaGuiElement (I might expect a close sound to play here, overlapping entity open)
3) Player triggers close (no sound)
4) LuaGuiElement is .destroyed()? (no sound)
I have mods! I guess!
Link
User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 117
Joined: Tue Feb 06, 2024 5:18 am
Contact:

Re: closing the modified gui of a combinator plays no sound

Post by hgschmie »

Hi,

Thanks for the quick response.

Basically, when the gui opens (fires on_gui_opened), I overwrite player.opened with my own GUI (in this case to replace a constant combinator gui with my own). It does play the "open sound", it does not play the "close sound here" (or maybe it does and it is not audible). The sound is not different from opening the "vanilla" GUI.

The player now interacts with the custom GUI and at some point, they press the "close" icon to close the GUI:
- assign 'nil' to player.opened
- call destroy on the custom GUI root element.

The GUI closes silently (no close sound).

Of course I can play the sound myself there but it seems wrong.
Post Reply

Return to “Pending”