diff --git a/code/modules/pda/PDA.dm b/code/modules/pda/PDA.dm index a25bd67af91..c0f05650d64 100755 --- a/code/modules/pda/PDA.dm +++ b/code/modules/pda/PDA.dm @@ -31,6 +31,7 @@ GLOBAL_LIST_EMPTY(PDAs) var/datum/data/pda/utility/scanmode/scanmode = null var/lock_code = "" // Lockcode to unlock uplink + var/silent = FALSE //To beep or not to beep, that is the question var/honkamt = 0 //How many honks left when infected with honk.exe var/mimeamt = 0 //How many silence left when infected with mime.exe var/detonate = 1 // Can the PDA be blown up? @@ -67,6 +68,7 @@ GLOBAL_LIST_EMPTY(PDAs) */ /obj/item/pda/Initialize(mapload) . = ..() + silent = TRUE // We don't want to hear the first program start up GLOB.PDAs += src GLOB.PDAs = sortAtom(GLOB.PDAs) update_programs() @@ -75,6 +77,7 @@ GLOBAL_LIST_EMPTY(PDAs) cartridge.update_programs(src) new /obj/item/pen(src) start_program(find_program(/datum/data/pda/app/main_menu)) + silent = initial(silent) /obj/item/pda/proc/can_use() if(!ismob(loc)) @@ -182,6 +185,7 @@ GLOBAL_LIST_EMPTY(PDAs) id.forceMove(get_turf(src)) overlays -= image('icons/goonstation/objects/pda_overlay.dmi', id.icon_state) id = null + playsound(src, 'sound/machines/terminal_eject.ogg', 50, TRUE) /obj/item/pda/verb/verb_remove_id() set category = "Object" @@ -214,6 +218,7 @@ GLOBAL_LIST_EMPTY(PDAs) var/obj/item/pen/O = locate() in src if(O) to_chat(user, "You remove the [O] from [src].") + playsound(src, 'sound/machines/pda_button2.ogg', 50, TRUE) if(istype(loc, /mob)) var/mob/M = loc if(M.get_active_hand() == null) @@ -243,6 +248,7 @@ GLOBAL_LIST_EMPTY(PDAs) I.forceMove(src) id = I user.put_in_hands(old_id) + playsound(src, 'sound/machines/pda_button1.ogg', 50, TRUE) return /obj/item/pda/attackby(obj/item/C as obj, mob/user as mob, params) @@ -257,11 +263,14 @@ GLOBAL_LIST_EMPTY(PDAs) SStgui.update_uis(src) if(cartridge.radio) cartridge.radio.hostpda = src + playsound(src, 'sound/machines/pda_button1.ogg', 50, TRUE) else if(istype(C, /obj/item/card/id)) var/obj/item/card/id/idcard = C if(!idcard.registered_name) to_chat(user, "\The [src] rejects the ID.") + if(!silent) + playsound(src, 'sound/machines/terminal_error.ogg', 50, TRUE) return if(!owner) owner = idcard.registered_name @@ -270,6 +279,8 @@ GLOBAL_LIST_EMPTY(PDAs) name = "PDA-[owner] ([ownjob])" to_chat(user, "Card scanned.") SStgui.update_uis(src) + if(!silent) + playsound(src, 'sound/machines/terminal_success.ogg', 50, TRUE) else //Basic safety check. If either both objects are held by user or PDA is on ground and card is in hand. if(((src in user.contents) && (C in user.contents)) || (istype(loc, /turf) && in_range(src, user) && (C in user.contents)) ) @@ -285,6 +296,7 @@ GLOBAL_LIST_EMPTY(PDAs) pai = C to_chat(user, "You slot \the [C] into [src].") SStgui.update_uis(src) + playsound(src, 'sound/machines/pda_button1.ogg', 50, TRUE) else if(istype(C, /obj/item/pen)) var/obj/item/pen/O = locate() in src if(O) @@ -293,6 +305,7 @@ GLOBAL_LIST_EMPTY(PDAs) user.drop_item() C.forceMove(src) to_chat(user, "You slide \the [C] into \the [src].") + playsound(src, 'sound/machines/pda_button1.ogg', 50, TRUE) else if(istype(C, /obj/item/nanomob_card)) if(cartridge && istype(cartridge, /obj/item/cartridge/mob_hunt_game)) cartridge.attackby(C, user, params) @@ -345,7 +358,7 @@ GLOBAL_LIST_EMPTY(PDAs) if(ttone in ttone_sound) S = ttone_sound[ttone] else - S = 'sound/machines/twobeep.ogg' + S = 'sound/machines/twobeep_high.ogg' playsound(loc, S, 50, 1) for(var/mob/O in hearers(3, loc)) O.show_message(text("[bicon(src)] *[ttone]*")) diff --git a/code/modules/pda/ai.dm b/code/modules/pda/ai.dm index aece49b6b83..bfbecad1b5b 100644 --- a/code/modules/pda/ai.dm +++ b/code/modules/pda/ai.dm @@ -69,9 +69,9 @@ if(!can_use()) return - var/datum/data/pda/app/messenger/M = find_program(/datum/data/pda/app/messenger) - M.notify_silent = !M.notify_silent - to_chat(usr, "PDA ringer toggled [(M.notify_silent ? "Off" : "On")]!") + + silent = !silent + to_chat(usr, "PDA ringer toggled [(silent ? "Off" : "On")]!") /obj/item/pda/silicon/attack_self(mob/user as mob) if((honkamt > 0) && (prob(60)))//For clown virus. diff --git a/code/modules/pda/app.dm b/code/modules/pda/app.dm index e3d6b365f13..18c71e764ae 100644 --- a/code/modules/pda/app.dm +++ b/code/modules/pda/app.dm @@ -2,7 +2,6 @@ /datum/data/pda var/icon = "tasks" //options comes from http://fontawesome.io/icons/ var/notify_icon = "exclamation-circle" - var/notify_silent = 0 var/hidden = 0 // program not displayed in main menu var/category = "General" // the category to list it in on the main menu var/obj/item/pda/pda // if this is null, and the app is running code, something's gone wrong @@ -37,7 +36,7 @@ to_chat(L, "[bicon(pda)] [message]") SStgui.update_user_uis(L, pda) // Update the receiving user's PDA UI so that they can see the new message - if(!notify_silent) + if(!pda.silent) pda.play_ringtone() if(blink && !(src in pda.notifying_programs)) @@ -67,7 +66,9 @@ if(pda.current_app) pda.current_app.stop() pda.current_app = src - return 1 + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) + return TRUE /datum/data/pda/app/proc/update_ui(mob/user, list/data) return @@ -80,7 +81,6 @@ size = 1 category = "Utilities" - /datum/data/pda/utility/scanmode var/base_name category = "Scanners" @@ -100,6 +100,8 @@ name = "Disable [base_name]" pda.update_shortcuts() + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) return TRUE /datum/data/pda/utility/scanmode/proc/scan_mob(mob/living/C, mob/living/user) diff --git a/code/modules/pda/cart_apps.dm b/code/modules/pda/cart_apps.dm index fae5140429e..355cc456a82 100644 --- a/code/modules/pda/cart_apps.dm +++ b/code/modules/pda/cart_apps.dm @@ -16,6 +16,9 @@ if(..()) return + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) + . = TRUE switch(action) if("Status") @@ -78,6 +81,9 @@ . = TRUE + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) + if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/signal)) var/obj/item/integrated_radio/signal/R = pda.cartridge.radio @@ -110,6 +116,9 @@ if(..()) return + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) + . = TRUE // Observe pm.ui_act(action, params, ui, state) @@ -139,6 +148,9 @@ . = TRUE + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) + switch(action) if("Records") var/datum/data/record/R = locateUID(params["target"]) @@ -252,6 +264,9 @@ if(..()) return + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) + . = TRUE // Aight listen up. Its time for a comment rant again. @@ -333,6 +348,9 @@ if(..()) return + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) + . = TRUE // Heres the exact same shit as before, but worse diff --git a/code/modules/pda/core_apps.dm b/code/modules/pda/core_apps.dm index c9d91281601..b5ecb0b2d74 100644 --- a/code/modules/pda/core_apps.dm +++ b/code/modules/pda/core_apps.dm @@ -28,6 +28,9 @@ pda.ownjob = pda.id.assignment pda.ownrank = pda.id.rank pda.name = "PDA-[pda.owner] ([pda.ownjob])" + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_processing.ogg', 15, TRUE) + addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, pda, 'sound/machines/terminal_success.ogg', 15, TRUE), 1.3 SECONDS) if("pai") if(pda.pai) if(pda.pai.loc != pda) @@ -39,8 +42,9 @@ if(2) // Eject pAI device var/turf/T = get_turf_or_move(pda.loc) if(T) - pda.pai.loc = T + pda.pai.forceMove(T) pda.pai = null + playsound(pda, 'sound/machines/terminal_eject.ogg', 50, TRUE) /datum/data/pda/app/notekeeper name = "Notekeeper" @@ -61,6 +65,9 @@ if(..()) return + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) + . = TRUE switch(action) diff --git a/code/modules/pda/messenger.dm b/code/modules/pda/messenger.dm index e10b0f84c43..7bcf3dd1a61 100644 --- a/code/modules/pda/messenger.dm +++ b/code/modules/pda/messenger.dm @@ -18,7 +18,7 @@ unnotify() /datum/data/pda/app/messenger/update_ui(mob/user as mob, list/data) - data["silent"] = notify_silent // does the pda make noise when it receives a message? + data["silent"] = pda.silent // does the pda make noise when it receives a message? data["toff"] = toff // is the messenger function turned off? // Yes I know convo is awful, but it lets me stay inside the 80 char TGUI line limit data["active_convo"] = active_conversation // Which conversation are we following right now? @@ -64,12 +64,16 @@ unnotify() + var/play_beep = TRUE + . = TRUE + + switch(action) if("Toggle Messenger") toff = !toff if("Toggle Ringer")//If viewing texts then erase them, if not then toggle silent status - notify_silent = !notify_silent + pda.silent = !pda.silent if("Clear")//Clears messages if(params["option"] == "All") tnote.Cut() @@ -84,6 +88,7 @@ active_conversation = null if("Message") + play_beep = FALSE var/obj/item/pda/P = locateUID(params["target"]) create_message(usr, P) if(params["target"] in conversations) // Need to make sure the message went through, if not welp. @@ -108,6 +113,10 @@ if("Back") active_conversation = null + if(play_beep && !pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) + + /datum/data/pda/app/messenger/proc/create_message(var/mob/living/U, var/obj/item/pda/P) var/t = input(U, "Please enter message", name, null) as text|null if(!t) @@ -160,10 +169,14 @@ if(!sendable) // Are we in the range of a reciever? to_chat(U, "ERROR: No connection to server.") + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_error.ogg', 15, TRUE) return if(!receivable) // Is our recipient in the range of a reciever? to_chat(U, "ERROR: No connection to recipient.") + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_error.ogg', 15, TRUE) return if(useMS && sendable && receivable) // only send the message if its going to work @@ -197,8 +210,12 @@ receiver = P log_message = "[log_message] (no holder)" U.create_log(MISC_LOG, log_message, receiver) + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_success.ogg', 15, TRUE) else to_chat(U, "ERROR: Messaging server is not responding.") + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_error.ogg', 15, TRUE) /datum/data/pda/app/messenger/proc/available_pdas() var/list/names = list() diff --git a/code/modules/pda/messenger_plugins.dm b/code/modules/pda/messenger_plugins.dm index c69d8890164..a23ec988772 100644 --- a/code/modules/pda/messenger_plugins.dm +++ b/code/modules/pda/messenger_plugins.dm @@ -34,9 +34,7 @@ . = ..(user, P) if(.) user.show_message("Virus sent!", 1) - var/datum/data/pda/app/M = P.find_program(/datum/data/pda/app/messenger) - if(M) - M.notify_silent = 1 + P.silent = TRUE P.ttone = "silence" diff --git a/code/modules/pda/mob_hunt_game_app.dm b/code/modules/pda/mob_hunt_game_app.dm index 12818a92be1..5db744c37ef 100644 --- a/code/modules/pda/mob_hunt_game_app.dm +++ b/code/modules/pda/mob_hunt_game_app.dm @@ -156,6 +156,9 @@ if(..()) return + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) + . = TRUE switch(action) if("Rename") diff --git a/code/modules/pda/pda_tgui.dm b/code/modules/pda/pda_tgui.dm index 18f172d95a7..c79af319a88 100644 --- a/code/modules/pda/pda_tgui.dm +++ b/code/modules/pda/pda_tgui.dm @@ -93,14 +93,17 @@ P.unnotify() cartridge = null update_shortcuts() - if("Authenticate")//Checks for ID + playsound(src, 'sound/machines/terminal_eject.ogg', 50, TRUE) + if("Authenticate") //Checks for ID id_check(usr, 1) if("Ringtone") + if(!silent) + playsound(src, 'sound/machines/terminal_select.ogg', 15, TRUE) return set_ringtone() else if(current_app) . = current_app.ui_act(action, params, ui, state) // It needs proxying through down here so apps actually have their interacts called - if((honkamt > 0) && (prob(60)))//For clown virus. + if((honkamt > 0) && (prob(60))) //For clown virus. honkamt-- - playsound(loc, 'sound/items/bikehorn.ogg', 30, 1) + playsound(src, 'sound/items/bikehorn.ogg', 30, TRUE) diff --git a/code/modules/pda/pdas.dm b/code/modules/pda/pdas.dm index f6f02e3457f..971f2eb8003 100644 --- a/code/modules/pda/pdas.dm +++ b/code/modules/pda/pdas.dm @@ -45,12 +45,7 @@ default_cartridge = /obj/item/cartridge/mime icon_state = "pda-mime" ttone = "silence" - -/obj/item/pda/mime/New() - ..() - var/datum/data/pda/app/M = find_program(/datum/data/pda/app/messenger) - if(M) - M.notify_silent = 1 + silent = TRUE /obj/item/pda/heads default_cartridge = /obj/item/cartridge/head @@ -149,12 +144,7 @@ icon_state = "pda-library" desc = "A portable microcomputer by Thinktronic Systems, LTD. This is model is a WGW-11 series e-reader." model_name = "Thinktronic 5290 WGW-11 Series E-reader and Personal Data Assistant" - -/obj/item/pda/librarian/New() - ..() - var/datum/data/pda/app/M = find_program(/datum/data/pda/app/messenger) - if(M) - M.notify_silent = 1 //Quiet in the library! + silent = TRUE /obj/item/pda/clear icon_state = "pda-transp" diff --git a/code/modules/pda/utilities.dm b/code/modules/pda/utilities.dm index 3f3f8303469..14371791da7 100644 --- a/code/modules/pda/utilities.dm +++ b/code/modules/pda/utilities.dm @@ -14,6 +14,8 @@ pda.overlays += image('icons/obj/pda.dmi', "pda-light") else pda.overlays -= image('icons/obj/pda.dmi', "pda-light") + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) /datum/data/pda/utility/honk name = "Honk Synthesizer" @@ -39,6 +41,8 @@ M.open() else M.close() + if(!pda.silent) + playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE) /datum/data/pda/utility/scanmode/medical base_name = "Med Scanner" diff --git a/sound/machines/pda_button1.ogg b/sound/machines/pda_button1.ogg new file mode 100644 index 00000000000..79b458317ac Binary files /dev/null and b/sound/machines/pda_button1.ogg differ diff --git a/sound/machines/pda_button2.ogg b/sound/machines/pda_button2.ogg new file mode 100644 index 00000000000..9fceed1611f Binary files /dev/null and b/sound/machines/pda_button2.ogg differ diff --git a/sound/machines/terminal_eject.ogg b/sound/machines/terminal_eject.ogg new file mode 100644 index 00000000000..357e667f943 Binary files /dev/null and b/sound/machines/terminal_eject.ogg differ diff --git a/sound/machines/terminal_error.ogg b/sound/machines/terminal_error.ogg new file mode 100644 index 00000000000..22556e5ea4b Binary files /dev/null and b/sound/machines/terminal_error.ogg differ diff --git a/sound/machines/terminal_processing.ogg b/sound/machines/terminal_processing.ogg new file mode 100644 index 00000000000..b65c2e81d48 Binary files /dev/null and b/sound/machines/terminal_processing.ogg differ diff --git a/sound/machines/terminal_select.ogg b/sound/machines/terminal_select.ogg new file mode 100644 index 00000000000..42d7c628855 Binary files /dev/null and b/sound/machines/terminal_select.ogg differ diff --git a/sound/machines/terminal_success.ogg b/sound/machines/terminal_success.ogg new file mode 100644 index 00000000000..b2712c8202c Binary files /dev/null and b/sound/machines/terminal_success.ogg differ diff --git a/sound/machines/twobeep_high.ogg b/sound/machines/twobeep_high.ogg new file mode 100644 index 00000000000..b97b39a4f01 Binary files /dev/null and b/sound/machines/twobeep_high.ogg differ