From e3be7e765a86699d338d5fa3840da8c13b8d75fb Mon Sep 17 00:00:00 2001 From: Hopekz Date: Sat, 27 Jun 2020 23:27:56 -0500 Subject: [PATCH] Tape recorder revamp (TG edition) (#51653) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Yogstation closed this for some dumb reason so TG gets it instead. Re-publishes my original under yogstation13/Yogstation#8446 Old way Context-sensitive buttons! And you can also alt-click a tape recorder to play it like in yogstation13/Yogstation#8445 UEl2rkUv3y Changelog 🆑 Hopek add: Tape recorder has been reworked. /🆑 --- .../objects/items/devices/taperecorder.dm | 55 ++++++++++++++++-- icons/effects/icons.dmi | Bin 0 -> 498 bytes 2 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 icons/effects/icons.dmi diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index f40f2e46c61..c824beaf792 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -19,6 +19,8 @@ var/starting_tape_type = /obj/item/tape/random var/open_panel = 0 var/canprint = 1 + var/list/icons_available = list() + var/icon_directory = 'icons/effects/icons.dmi' /obj/item/taperecorder/Initialize(mapload) @@ -32,6 +34,29 @@ . = ..() . += "The wire panel is [open_panel ? "opened" : "closed"]." +/obj/item/taperecorder/AltClick(mob/user) + . = ..() + play() + +/obj/item/taperecorder/proc/update_available_icons() + icons_available = list() + + if(recording) + icons_available += list("Stop Recording" = image(icon = icon_directory, icon_state = "record_stop")) + else + if(!playing) + icons_available += list("Record" = image(icon = icon_directory, icon_state = "record")) + + if(playing) + icons_available += list("Pause" = image(icon = icon_directory, icon_state = "pause")) + else + if(!recording) + icons_available += list("Play" = image(icon = icon_directory, icon_state = "play")) + + if(canprint && !recording && !playing) + icons_available += list("Print Transcript" = image(icon = icon_directory, icon_state = "print")) + if(mytape) + icons_available += list("Eject" = image(icon = icon_directory, icon_state = "eject")) /obj/item/taperecorder/attackby(obj/item/I, mob/user, params) if(!mytape && istype(I, /obj/item/tape)) @@ -190,13 +215,31 @@ /obj/item/taperecorder/attack_self(mob/user) - if(!mytape || mytape.ruined) + if(!mytape) + to_chat(user, "The [src] does not have a tape inside.") return - if(recording) - stop() - else - record() - + if(mytape.ruined) + to_chat(user, "The tape inside the [src] appears to be broken.") + return + + update_available_icons() + if(icons_available) + var/selection = show_radial_menu(user, src, icons_available, radius = 38, require_near = TRUE, tooltips = TRUE) + if(!selection) + return + switch(selection) + if("Pause") + stop() + if("Stop Recording") // yes we actually need 2 seperate stops for the same proc- Hopek + stop() + if("Record") + record() + if("Play") + play() + if("Print Transcript") + print_transcript() + if("Eject") + eject(user) /obj/item/taperecorder/verb/print_transcript() set name = "Print Transcript" diff --git a/icons/effects/icons.dmi b/icons/effects/icons.dmi new file mode 100644 index 0000000000000000000000000000000000000000..0d62217efbf29d914a0faf54b164327d32b5af75 GIT binary patch literal 498 zcmVRCUN_J@SDC`AG%{d==RjZ6FE`v zdark@HK>`axIDHED2H@)vWz4~FlSYPvcxIp2GoVk1DF1S$mFG{$j7Oy@P=bq#k+Zx zk(m+}72_D#{>jcsLi}ZG-3{&M;WvYhWxQ{@Uef>o0P{&iK~zYI#goAjgCGnGN-cyylS)O4F)-bSjQ|3Nl0If}=5gAcBBh9IBNu&_>H51tNf!U1MVv0g|(gcG(32wB)>(Fc+nw^&JrZ otBKCz?oLdwu0TrSNerj`2~HkuoKqSpkpKVy07*qoM6N<$g3CSKV*mgE literal 0 HcmV?d00001