From e187f07307e29104b03a2c2f80e39300a3e18e4b Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sun, 1 Dec 2024 18:49:07 -0600 Subject: [PATCH] Revert "make beep use a game sound" This reverts commit 44881905cf0d6deeeeb303459fb315a4d5988efc. --- src/pcedit/pc.editors.cpp | 12 ++++++------ src/tools/winutil.cpp | 6 ------ src/tools/winutil.linux.cpp | 3 +++ src/tools/winutil.mac.mm | 4 ++++ src/tools/winutil.win.cpp | 4 ++++ 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/pcedit/pc.editors.cpp b/src/pcedit/pc.editors.cpp index 974f75d7..24418582 100644 --- a/src/pcedit/pc.editors.cpp +++ b/src/pcedit/pc.editors.cpp @@ -380,7 +380,7 @@ static bool spend_xp_navigate_filter(cDialog& me, std::string item_hit,xp_dlog_s } while(univ.party[save.who].main_status != eMainStatus::ALIVE); do_xp_draw(me,save); } else - beep(); + beep(); // TODO: This is a game event, so it should have a game sound, not a system alert. } else if(item_hit == "right") { // TODO: If they don't work in mode 0, why are they visible? if(save.mode != 0) { @@ -390,7 +390,7 @@ static bool spend_xp_navigate_filter(cDialog& me, std::string item_hit,xp_dlog_s } while(univ.party[save.who].main_status != eMainStatus::ALIVE); do_xp_draw(me,save); } else - beep(); + beep(); // TODO: This is a game event, so it should have a game sound, not a system alert. } return true; } @@ -409,7 +409,7 @@ static bool spend_xp_event_filter(cDialog& me, std::string item_hit, eKeyMod mod if(save.mode == 1) save.g += 10; } - } else beep(); + } else beep(); // TODO: This is a game event, so it should have a game sound, not a system alert. } else if(item_hit[3] == 'p') { if(can_change_skill(eSkill::MAX_SP, save, true)) { save.hp += 2; @@ -444,7 +444,7 @@ static bool spend_xp_event_filter(cDialog& me, std::string item_hit, eKeyMod mod if(save.mode == 1) save.g += 15; } - } else beep(); + } else beep(); // TODO: This is a game event, so it should have a game sound, not a system alert. } else if(item_hit[3] == 'p') { if(can_change_skill(eSkill::MAX_SP, save, true)) { save.sp += 1; @@ -492,7 +492,7 @@ static bool spend_xp_event_filter(cDialog& me, std::string item_hit, eKeyMod mod if(save.mode == 1) save.g += skill_g_cost[which_skill]; } - } else beep(); + } else beep(); // TODO: This is a game event, so it should have a game sound, not a system alert. } else if(dir == 'p') { if(can_change_skill(which_skill, save, true)) { save.skills[which_skill] += 1; @@ -506,7 +506,7 @@ static bool spend_xp_event_filter(cDialog& me, std::string item_hit, eKeyMod mod give_help(25,0,me); else if(save.mode == 1 && save.g < skill_g_cost[which_skill]) give_help(24,0,me); - else beep(); + else beep(); // TODO: This is a game event, so it should have a game sound, not a system alert. } } diff --git a/src/tools/winutil.cpp b/src/tools/winutil.cpp index 62fd51a0..ffc29132 100644 --- a/src/tools/winutil.cpp +++ b/src/tools/winutil.cpp @@ -2,8 +2,6 @@ #include "keymods.hpp" -void play_sound(snd_num_t which, sf::Time delay = sf::Time()); - // The default scale should be the largest that the user's screen can fit all three // BoE application windows (because they should probably default to match each other). double fallback_scale() { @@ -50,8 +48,4 @@ bool pollEvent(sf::Window& win, sf::Event& event){ bool pollEvent(sf::Window* win, sf::Event& event){ return pollEvent(*win, event); -} - -void beep() { - play_sound(1); } \ No newline at end of file diff --git a/src/tools/winutil.linux.cpp b/src/tools/winutil.linux.cpp index 3780d9b0..20eb8b11 100644 --- a/src/tools/winutil.linux.cpp +++ b/src/tools/winutil.linux.cpp @@ -224,6 +224,9 @@ std::unique_ptr get_clipboard_img() { return nullptr; } +void beep() { +} + void launchURL(std::string url) { system((std::string { "xdg-open " } + url).c_str()); } diff --git a/src/tools/winutil.mac.mm b/src/tools/winutil.mac.mm index 7663bbfd..a8469e7a 100644 --- a/src/tools/winutil.mac.mm +++ b/src/tools/winutil.mac.mm @@ -169,6 +169,10 @@ std::unique_ptr get_clipboard_img() { return ret; } +void beep() { + NSBeep(); +} + void launchURL(std::string url) { [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]]]; } diff --git a/src/tools/winutil.win.cpp b/src/tools/winutil.win.cpp index e6d445ed..cdebc3b4 100644 --- a/src/tools/winutil.win.cpp +++ b/src/tools/winutil.win.cpp @@ -418,6 +418,10 @@ CLEANUP: return img; } +void beep() { + MessageBeep(-1); +} + void launchURL(std::string url) { ShellExecuteA(NULL, "open", url.c_str(), NULL, NULL, SW_SHOWNORMAL); }