Bug 424857 - play sound when game is no longer winnable
Summary: play sound when game is no longer winnable
Status: REPORTED
Alias: None
Product: kpat
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Daniel Fichtner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-31 11:35 UTC by Martin Koller
Modified: 2024-02-07 19:25 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Koller 2020-07-31 11:35:02 UTC
While playing Klondike, it often happens that the solver detects a game to be no longer winnable and will display this in the status bar.
However I often find the new status text just after some (or a lot) moves, which means I have to click Undo very often until I can continue with some other moves.

It would really help when there was an option to play some sound at the point when the solver detects an unwinnable game so that I do not need to always pay attention after every move to the status bar.
Comment 1 Daniel Fichtner 2020-08-01 19:31:11 UTC
I would like to implement it.
Should it be activated in the general "Play Sounds" setting that already exists or should one be able to toggle this separately?
Comment 2 Albert Astals Cid 2020-08-01 20:57:11 UTC
Definitely a secondary option, it'd be mega weird otherwise since as a normal player i wouldn't expect a sound to happen "randomly".

Also which sound are you proposing to play?
Comment 3 Daniel Fichtner 2020-08-01 21:11:53 UTC
(In reply to Albert Astals Cid from comment #2)
> Definitely a secondary option, it'd be mega weird otherwise since as a
> normal player i wouldn't expect a sound to happen "randomly".

Okay will do.

> Also which sound are you proposing to play?

I thought about something small like /usr/share/sounds/Oxygen-Im-Low-Priority-Message.ogg

But as you know I'm still very new. So any tips are helpful :)
Comment 4 Albert Astals Cid 2020-08-01 21:17:28 UTC
I think that introduces a rather unwanted dependency of kpat to oxygen
Comment 5 Daniel Fichtner 2020-08-01 21:32:41 UTC
(In reply to Albert Astals Cid from comment #4)
> I think that introduces a rather unwanted dependency of kpat to oxygen

We could just put that file into the kpat/sounds foulder and ship it with the application. Or what is the normal way to doing that?
Comment 6 Ian Wadham 2020-08-02 00:41:54 UTC
Closer to home, several KDE Games have “losing” or “danger” sounds of one kind or another. Maybe you could use one of those.

Not sure how to implement it though — clone a file, have an elaborate CMake line to find it or set up a "sound library" in libkdegames.
Comment 7 Daniel Fichtner 2020-08-02 07:22:44 UTC
Thanks, I'll try to find a danger sound.
The implementation is no problem. It's already working with my message sound. To switch out the sound you just have to change the soundfile path in the sound engine and in the cmakelist. I'll post a WIP merge request later today.
Comment 8 Daniel Fichtner 2020-08-02 18:37:42 UTC
merge request for further discussion:

https://invent.kde.org/games/kpat/-/merge_requests/5
Comment 9 Miguel Angel Lopez 2024-02-07 19:25:19 UTC
Maybe it would be a little too much but, for the ones that mute all sounds or are deaf, on that event the background could change (maybe change hue) to give a visual hint.