mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge pull request #11058 from VOREStation/Arokha/entertain
Make tvcamera and entertainment monitor FANCY
This commit is contained in:
committed by
Chompstation Bot
parent
b246cfd374
commit
5c5aaa1887
@@ -8,6 +8,8 @@
|
||||
var/channel = "NCS Northern Star News Feed"
|
||||
var/obj/machinery/camera/network/thunder/camera
|
||||
var/obj/item/device/radio/radio
|
||||
var/weakref/showing
|
||||
var/showing_name
|
||||
|
||||
/obj/item/device/tvcamera/New()
|
||||
..()
|
||||
@@ -45,9 +47,14 @@
|
||||
/obj/item/device/tvcamera/attack_self(mob/user)
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
show_ui(user)
|
||||
|
||||
/obj/item/device/tvcamera/proc/show_ui(mob/user)
|
||||
var/dat = list()
|
||||
dat += "Channel name is: <a href='?src=\ref[src];channel=1'>[channel ? channel : "unidentified broadcast"]</a><br>"
|
||||
dat += "Video streaming is <a href='?src=\ref[src];video=1'>[camera.status ? "on" : "off"]</a><br>"
|
||||
if(camera.status && showing_name)
|
||||
dat += "- You're showing [showing_name] to your viewers.<br>"
|
||||
dat += "Mic is <a href='?src=\ref[src];sound=1'>[radio.broadcasting ? "on" : "off"]</a><br>"
|
||||
dat += "Sound is being broadcasted on frequency [format_frequency(radio.frequency)] ([get_frequency_name(radio.frequency)])<br>"
|
||||
var/datum/browser/popup = new(user, "Hovercamera", "Eye Buddy", 300, 390, src)
|
||||
@@ -67,8 +74,12 @@
|
||||
camera.set_status(!camera.status)
|
||||
if(camera.status)
|
||||
to_chat(usr,"<span class='notice'>Video streaming activated. Broadcasting on channel '[channel]'</span>")
|
||||
show_tvs(loc)
|
||||
else
|
||||
to_chat(usr,"<span class='notice'>Video streaming deactivated.</span>")
|
||||
hide_tvs()
|
||||
for(var/obj/machinery/computer/security/telescreen/entertainment/ES as anything in GLOB.entertainment_screens)
|
||||
ES.stop_showing()
|
||||
update_icon()
|
||||
if(href_list["sound"])
|
||||
radio.ToggleBroadcast()
|
||||
@@ -79,6 +90,50 @@
|
||||
if(!href_list["close"])
|
||||
attack_self(usr)
|
||||
|
||||
/obj/item/device/tvcamera/proc/show_tvs(atom/thing)
|
||||
if(showing)
|
||||
hide_tvs(showing)
|
||||
|
||||
showing = weakref(thing)
|
||||
showing_name = "[thing]"
|
||||
for(var/obj/machinery/computer/security/telescreen/entertainment/ES as anything in GLOB.entertainment_screens)
|
||||
ES.show_thing(thing)
|
||||
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/device/tvcamera/proc/hide_tvs()
|
||||
if(!showing)
|
||||
return
|
||||
for(var/obj/machinery/computer/security/telescreen/entertainment/ES as anything in GLOB.entertainment_screens)
|
||||
ES.maybe_stop_showing(showing)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
showing = null
|
||||
showing_name = null
|
||||
|
||||
/obj/item/device/tvcamera/Moved(atom/old_loc, direction, forced = FALSE, movetime)
|
||||
. = ..()
|
||||
if(camera.status && loc != old_loc)
|
||||
show_tvs(loc)
|
||||
|
||||
/obj/item/device/tvcamera/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||
. = ..()
|
||||
if(camera.status && !isturf(target))
|
||||
show_tvs(target)
|
||||
user.visible_message("<b>[user]</b> aims [src] at [target].", "You aim [src] at [target].")
|
||||
if(user.machine == src)
|
||||
show_ui(user) // refresh the UI
|
||||
|
||||
/obj/item/device/tvcamera/process()
|
||||
if(!showing)
|
||||
return PROCESS_KILL
|
||||
|
||||
var/atom/A = showing.resolve()
|
||||
if(!A || QDELETED(A))
|
||||
show_tvs(loc)
|
||||
|
||||
if(get_dist(get_turf(src), get_turf(A)) > 5)
|
||||
show_tvs(loc)
|
||||
|
||||
/obj/item/device/tvcamera/update_icon()
|
||||
..()
|
||||
if(camera.status)
|
||||
|
||||
Reference in New Issue
Block a user