Skip to content

Commit

Permalink
caller history and spans
Browse files Browse the repository at this point in the history
  • Loading branch information
Gristlebee committed May 19, 2024
1 parent 9e629b3 commit 177597e
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions code/game/machinery/hologram.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Possible to do for anyone motivated enough:
var/secure = FALSE
/// If we are currently calling another holopad
var/calling = FALSE
/// The last holopad that called this one.
var/caller_history

/obj/machinery/holopad/Initialize()
. = ..()
Expand Down Expand Up @@ -178,7 +180,9 @@ Possible to do for anyone motivated enough:
/obj/machinery/holopad/examine(mob/user)
. = ..()
if(in_range(user, src) || isobserver(user))
. += "<span class='notice'>The status display reads: Current projection range: <b>[holo_range]</b> units.</span>"
. += span_notice("The status display reads: Current projection range: <b>[holo_range]</b> units.")
if(caller_history)
. += span_notice("The caller history displays the last recieved call to be from: [caller_history].")

/obj/machinery/holopad/attackby(obj/item/P, mob/user, params)
if(default_deconstruction_screwdriver(user, "holopad_open", "holopad0", P))
Expand All @@ -195,11 +199,11 @@ Possible to do for anyone motivated enough:

if(istype(P,/obj/item/disk/holodisk))
if(disk)
to_chat(user,"<span class='warning'>There's already a disk inside [src]!</span>")
to_chat(user,span_warning("There's already a disk inside [src]!"))
return
if (!user.transferItemToLoc(P,src))
return
to_chat(user,"<span class='notice'>You insert [P] into [src].</span>")
to_chat(user,span_notice("You insert [P] into [src]."))
disk = P
return

Expand Down Expand Up @@ -249,15 +253,15 @@ Possible to do for anyone motivated enough:
if("AIrequest")
if(last_request + 200 < world.time)
last_request = world.time
to_chat(usr, "<span class='info'>You requested an AI's presence.</span>")
to_chat(usr, span_info("You requested an AI's presence."))
var/area/area = get_area(src)
for(var/mob/living/silicon/ai/AI in GLOB.silicon_mobs)
if(!AI.client)
continue
to_chat(AI, "<span class='info'>Your presence is requested at <a href='?src=[REF(AI)];jumptoholopad=[REF(src)]'>\the [area]</a>.</span>")
to_chat(AI, span_info("Your presence is requested at <a href='?src=[REF(AI)];jumptoholopad=[REF(src)]'>\the [area]</a>."))
return TRUE
else
to_chat(usr, "<span class='info'>A request for AI presence was already sent recently.</span>")
to_chat(usr, span_info("A request for AI presence was already sent recently."))
return
if("holocall")
if(outgoing_call)
Expand All @@ -280,7 +284,7 @@ Possible to do for anyone motivated enough:
calling = TRUE
return TRUE
else
to_chat(usr, "<span class='warning'>You must stand on the holopad to make a call!</span>")
to_chat(usr, span_warning("You must stand on the holopad to make a call!"))
if("connectcall")
var/datum/holocall/call_to_connect = locate(params["holopad"]) in holo_calls
if(!QDELETED(call_to_connect))
Expand Down Expand Up @@ -374,6 +378,7 @@ Possible to do for anyone motivated enough:
for(var/I in holo_calls)
var/datum/holocall/HC = I
if(HC.connected_holopad != src)
caller_history = get_area(HC.calling_holopad)
if(force_answer_call && world.time > (HC.call_start_time + (HOLOPAD_MAX_DIAL_TIME / 2)))
HC.Answer(src)
break
Expand All @@ -392,7 +397,7 @@ Possible to do for anyone motivated enough:

if(is_operational && (!AI || AI.eyeobj.loc == loc))//If the projector has power and client eye is on it
if (AI && istype(AI.current, /obj/machinery/holopad))
to_chat(user, "<span class='danger'>ERROR:</span> \black Image feed in progress.")
to_chat(user, span_danger("ERROR:</span> \black Image feed in progress."))
return

var/obj/effect/overlay/holo_pad_hologram/Hologram = new(loc)//Spawn a blank effect at the location.
Expand All @@ -415,11 +420,11 @@ Possible to do for anyone motivated enough:
move_hologram(user, loc)

set_holo(user, Hologram)
visible_message("<span class='notice'>A holographic image of [user] flickers to life before your eyes!</span>")
visible_message(span_notice("A holographic image of [user] flickers to life before your eyes!"))

return Hologram
else
to_chat(user, "<span class='danger'>ERROR:</span> Unable to project hologram.")
to_chat(user, span_danger("ERROR:</span> Unable to project hologram."))

/*This is the proc for special two-way communication between AI and holopad/people talking near holopad.
For the other part of the code, check silicon say.dm. Particularly robot talk.*/
Expand Down Expand Up @@ -580,7 +585,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
Hologram.set_anchored(TRUE)//So space wind cannot drag it.
Hologram.name = "[record.caller_name] (Hologram)"//If someone decides to right click.
Hologram.set_light(2) //hologram lighting
visible_message("<span class='notice'>A holographic image of [record.caller_name] flickers to life before your eyes!</span>")
visible_message(span_notice("A holographic image of [record.caller_name] flickers to life before your eyes!"))
return Hologram

/obj/machinery/holopad/proc/replay_start()
Expand Down

0 comments on commit 177597e

Please sign in to comment.