From 42e51a3b36b7d328e00d675792617d38b8ba5235 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sun, 1 Dec 2024 18:50:13 -0600 Subject: [PATCH] make beep() use a game sound on Linux --- src/tools/winutil.linux.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/winutil.linux.cpp b/src/tools/winutil.linux.cpp index 20eb8b11..433334a7 100644 --- a/src/tools/winutil.linux.cpp +++ b/src/tools/winutil.linux.cpp @@ -16,6 +16,8 @@ extern sf::RenderWindow mainPtr; extern void showError(std::string str1, std::string str2, cDialog* parent = nullptr); +extern void play_sound(snd_num_t which, sf::Time delay = sf::Time()); + // TODO: I'm sure there's a better way to do this (maybe one that's keyboard layout agnostic) // The proper way would involve use of the TextEntered event char keyToChar(sf::Keyboard::Key key, bool isShift) { @@ -225,6 +227,7 @@ std::unique_ptr get_clipboard_img() { } void beep() { + play_sound(1); } void launchURL(std::string url) {