Skip to content

Commit

Permalink
Next batch of to_chat changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
PsiOmegaDelta committed Oct 31, 2016
1 parent c3976fd commit 384acdf
Show file tree
Hide file tree
Showing 97 changed files with 1,402 additions and 723 deletions.
12 changes: 7 additions & 5 deletions code/modules/assembly/assembly.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
attach_assembly(var/obj/item/device/assembly/A, var/mob/user)
holder = new/obj/item/device/assembly_holder(get_turf(src))
if(holder.attach(A,src,user))
user << "\blue You attach \the [A] to \the [src]!"
to_chat(user, "<span class='notice'>You attach \the [A] to \the [src]!</span>")
return 1
return 0

Expand All @@ -104,9 +104,9 @@
return
if(isscrewdriver(W))
if(toggle_secure())
user << "\blue \The [src] is ready!"
to_chat(user, "<span class='notice'>\The [src] is ready!</span<")
else
user << "\blue \The [src] can now be attached!"
to_chat(user, "<span class='notice'>\The [src] can now be attached!</span>")
return
..()
return
Expand All @@ -121,9 +121,11 @@
..(user)
if((in_range(src, user) || loc == user))
if(secured)
user << "\The [src] is ready!"
to_chat(user, "\The [src] is ready!")

else
user << "\The [src] can be attached!"
to_chat(user, "\The [src] can be attached!")

return


Expand Down
9 changes: 6 additions & 3 deletions code/modules/assembly/bomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
return
if(istype(W, /obj/item/weapon/wrench) && !status) //This is basically bomb assembly code inverted. apparently it works.

user << "<span class='notice'>You disassemble [src].</span>"
to_chat(user, "<span class='notice'>You disassemble [src].</span>")


bombassembly.loc = user.loc
bombassembly.master = null
Expand All @@ -46,11 +47,13 @@
status = 1
bombers += "[key_name(user)] welded a single tank bomb. Temp: [bombtank.air_contents.temperature-T0C]"
message_admins("[key_name_admin(user)] welded a single tank bomb. Temp: [bombtank.air_contents.temperature-T0C]")
user << "<span class='notice'>A pressure hole has been bored to [bombtank] valve. \The [bombtank] can now be ignited.</span>"
to_chat(user, "<span class='notice'>A pressure hole has been bored to [bombtank] valve. \The [bombtank] can now be ignited.</span>")

else
status = 0
bombers += "[key_name(user)] unwelded a single tank bomb. Temp: [bombtank.air_contents.temperature-T0C]"
user << "<span class='notice'>The hole has been closed.</span>"
to_chat(user, "<span class='notice'>The hole has been closed.</span>")

add_fingerprint(user)
..()

Expand Down
22 changes: 11 additions & 11 deletions code/modules/assembly/holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@
..(user)
if ((in_range(src, user) || src.loc == user))
if (src.secured)
user << "\The [src] is ready!"
to_chat(user, "\The [src] is ready!")
else
user << "\The [src] can be attached!"
to_chat(user, "\The [src] can be attached!")
return


Expand Down Expand Up @@ -146,15 +146,15 @@
attackby(obj/item/weapon/W as obj, mob/user as mob)
if(isscrewdriver(W))
if(!a_left || !a_right)
user << "\red BUG:Assembly part missing, please report this!"
to_chat(user, "<span class='warning'>BUG:Assembly part missing, please report this!</span>")
return
a_left.toggle_secure()
a_right.toggle_secure()
secured = !secured
if(secured)
user << "\blue \The [src] is ready!"
to_chat(user, "<span class='notice'>\The [src] is ready!</span>")
else
user << "\blue \The [src] can now be taken apart!"
to_chat(user, "<span class='notice'>\The [src] can now be taken apart!</span>")
update_icon()
return
else if(W.IsSpecialAssembly())
Expand All @@ -168,7 +168,7 @@
src.add_fingerprint(user)
if(src.secured)
if(!a_left || !a_right)
user << "\red Assembly part missing!"
to_chat(user, "<span class='warning'>Assembly part missing!</span>")
return
if(istype(a_left,a_right.type))//If they are the same type it causes issues due to window code
switch(alert("Which side would you like to use?",,"Left","Right"))
Expand Down Expand Up @@ -269,18 +269,18 @@
if(!istype(tmr,/obj/item/device/assembly/timer))
tmr = holder.a_right
if(!istype(tmr,/obj/item/device/assembly/timer))
usr << "<span class='notice'>This detonator has no timer.</span>"
to_chat(usr, "<span class='notice'>This detonator has no timer.</span>")
return

if(tmr.timing)
usr << "<span class='notice'>Clock is ticking already.</span>"
to_chat(usr, "<span class='notice'>Clock is ticking already.</span>")
else
var/ntime = input("Enter desired time in seconds", "Time", "5") as num
if (ntime>0 && ntime<1000)
tmr.time = ntime
name = initial(name) + "([tmr.time] secs)"
usr << "<span class='notice'>Timer set to [tmr.time] seconds.</span>"
to_chat(usr, "<span class='notice'>Timer set to [tmr.time] seconds.</span>")
else
usr << "<span class='notice'>Timer can't be [ntime<=0?"negative":"more than 1000 seconds"].</span>"
to_chat(usr, "<span class='notice'>Timer can't be [ntime<=0?"negative":"more than 1000 seconds"].</span>")
else
usr << "<span class='notice'>You cannot do this while [usr.stat?"unconscious/dead":"restrained"].</span>"
to_chat(usr, "<span class='notice'>You cannot do this while [usr.stat?"unconscious/dead":"restrained"].</span>")
9 changes: 6 additions & 3 deletions code/modules/assembly/mousetrap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
examine(mob/user)
..(user)
if(armed)
user << "It looks like it's armed."
to_chat(user, "It looks like it's armed.")


update_icon()
if(armed)
Expand Down Expand Up @@ -52,7 +53,8 @@

attack_self(mob/living/user as mob)
if(!armed)
user << "<span class='notice'>You arm [src].</span>"
to_chat(user, "<span class='notice'>You arm [src].</span>")

else
if((CLUMSY in user.mutations) && prob(50))
var/which_hand = BP_L_HAND
Expand All @@ -62,7 +64,8 @@
user.visible_message("<span class='warning'>[user] accidentally sets off [src], breaking their fingers.</span>", \
"<span class='warning'>You accidentally trigger [src]!</span>")
return
user << "<span class='notice'>You disarm [src].</span>"
to_chat(user, "<span class='notice'>You disarm [src].</span>")

armed = !armed
update_icon()
playsound(user.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/assembly/shock_kit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
return
if(istype(W, /obj/item/weapon/screwdriver))
status = !status
user << "<span class='notice'>[src] is now [status ? "secured" : "unsecured"]!</span>"
to_chat(user, "<span class='notice'>[src] is now [status ? "secured" : "unsecured"]!</span>")

add_fingerprint(user)
return

Expand Down
18 changes: 11 additions & 7 deletions code/modules/awaymissions/gateway.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ obj/machinery/gateway/centerstation/process()
if(linked.len != 8) return
if(!powered()) return
if(!awaygate)
user << "<span class='notice'>Error: No destination found.</span>"
to_chat(user, "<span class='notice'>Error: No destination found.</span>")

return
if(world.time < wait)
user << "<span class='notice'>Error: Warpspace triangulation in progress. Estimated time to completion: [round(((wait - world.time) / 10) / 60)] minutes.</span>"
to_chat(user, "<span class='notice'>Error: Warpspace triangulation in progress. Estimated time to completion: [round(((wait - world.time) / 10) / 60)] minutes.</span>")

return

for(var/obj/machinery/gateway/G in linked)
Expand Down Expand Up @@ -133,7 +135,8 @@ obj/machinery/gateway/centerstation/process()

/obj/machinery/gateway/centerstation/attackby(obj/item/device/W as obj, mob/user as mob)
if(istype(W,/obj/item/device/multitool))
user << "\black The gate is already calibrated, there is no work for you to do here."
to_chat(user, "The gate is already calibrated, there is no work for you to do here.")

return

/////////////////////////////////////Away////////////////////////
Expand Down Expand Up @@ -185,7 +188,8 @@ obj/machinery/gateway/centerstation/process()
if(!ready) return
if(linked.len != 8) return
if(!stationgate)
user << "<span class='notice'>Error: No destination found.</span>"
to_chat(user, "<span class='notice'>Error: No destination found.</span>")

return

for(var/obj/machinery/gateway/G in linked)
Expand Down Expand Up @@ -219,7 +223,7 @@ obj/machinery/gateway/centerstation/process()
if(istype(M, /mob/living/carbon))
for(var/obj/item/weapon/implant/exile/E in M)//Checking that there is an exile implant in the contents
if(E.imp_in == M)//Checking that it's actually implanted vs just in their pocket
M << "\black The station gate has detected your exile implant and is blocking your entry."
to_chat(M, "The station gate has detected your exile implant and is blocking your entry.")
return
M.loc = get_step(stationgate.loc, SOUTH)
M.set_dir(SOUTH)
Expand All @@ -228,9 +232,9 @@ obj/machinery/gateway/centerstation/process()
/obj/machinery/gateway/centeraway/attackby(obj/item/device/W as obj, mob/user as mob)
if(istype(W,/obj/item/device/multitool))
if(calibrated)
user << "\black The gate is already calibrated, there is no work for you to do here."
to_chat(user, "The gate is already calibrated, there is no work for you to do here.")
return
else
user << "\blue <b>Recalibration successful!</b>: \black This gate's systems have been fine tuned. Travel to this gate will now be on target."
to_chat(user, "<span class='notice'><b>Recalibration successful!</b></span>: This gate's systems have been fine tuned. Travel to this gate will now be on target.")
calibrated = 1
return
3 changes: 2 additions & 1 deletion code/modules/awaymissions/trigger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

/obj/effect/step_trigger/message/Trigger(mob/M as mob)
if(M.client)
M << "<span class='info'>[message]</span>"
to_chat(M, "<span class='info'>[message]</span>")

if(once)
qdel(src)

Expand Down
3 changes: 2 additions & 1 deletion code/modules/client/asset_cache.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ You can set verify to TRUE if you want send() to sleep until the client has the
if(!unreceived || !unreceived.len)
return 0
if (unreceived.len >= ASSET_CACHE_TELL_CLIENT_AMOUNT)
client << "Sending Resources..."
to_chat(client, "Sending Resources...")

for(var/asset in unreceived)
if (asset in asset_cache.cache)
client << browse_rsc(asset_cache.cache[asset], asset)
Expand Down
41 changes: 27 additions & 14 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@
return

#if defined(TOPIC_DEBUGGING)
world << "[src]'s Topic: [href] destined for [hsrc]."
log_debug("[src]'s Topic: [href] destined for [hsrc].")

if(href_list["nano_err"]) //nano throwing errors
world << "## NanoUI, Subject [src]: " + html_decode(href_list["nano_err"]) //NANO DEBUG HOOK
log_debug("## NanoUI, Subject [src]: " + html_decode(href_list["nano_err"]))//NANO DEBUG HOOK


#endif

// asset_cache
if(href_list["asset_cache_confirm_arrival"])
//src << "ASSET JOB [href_list["asset_cache_confirm_arrival"]] ARRIVED."
// to_chat(src, "ASSET JOB [href_list["asset_cache_confirm_arrival"]] ARRIVED.")

var/job = text2num(href_list["asset_cache_confirm_arrival"])
completed_asset_jobs += job
return
Expand All @@ -59,10 +61,12 @@

if(href_list["irc_msg"])
if(!holder && received_irc_pm < world.time - 6000) //Worse they can do is spam IRC for 10 minutes
usr << "<span class='warning'>You are no longer able to use this, it's been more then 10 minutes since an admin on IRC has responded to you</span>"
to_chat(usr, "<span class='warning'>You are no longer able to use this, it's been more then 10 minutes since an admin on IRC has responded to you</span>")

return
if(mute_irc)
usr << "<span class='warning'You cannot use this as your client has been muted from sending messages to the admins on IRC</span>"
to_chat(usr, "<span class='warning'You cannot use this as your client has been muted from sending messages to the admins on IRC</span>")

return
cmd_admin_irc_pm(href_list["irc_msg"])
return
Expand All @@ -71,7 +75,8 @@

//Logs all hrefs
if(config && config.log_hrefs && href_logfile)
href_logfile << "<small>[time2text(world.timeofday,"hh:mm")] [src] (usr:[usr])</small> || [hsrc ? "[hsrc] " : ""][href]<br>"
to_chat(href_logfile, "<small>[time2text(world.timeofday,"hh:mm")] [src] (usr:[usr])</small> || [hsrc ? "[hsrc] " : ""][href]<br>")


switch(href_list["_src_"])
if("holder") hsrc = holder
Expand All @@ -84,13 +89,15 @@
//This stops files larger than UPLOAD_LIMIT being sent from client to server via input(), client.Import() etc.
/client/AllowUpload(filename, filelength)
if(filelength > UPLOAD_LIMIT)
src << "<font color='red'>Error: AllowUpload(): File Upload too large. Upload Limit: [UPLOAD_LIMIT/1024]KiB.</font>"
to_chat(src, "<font color='red'>Error: AllowUpload(): File Upload too large. Upload Limit: [UPLOAD_LIMIT/1024]KiB.</font>")

return 0
/* //Don't need this at the moment. But it's here if it's needed later.
//Helps prevent multiple files being uploaded at once. Or right after eachother.
var/time_to_wait = fileaccess_timer - world.time
if(time_to_wait > 0)
src << "<font color='red'>Error: AllowUpload(): Spam prevention. Please wait [round(time_to_wait/10)] seconds.</font>"
to_chat(src, "<font color='red'>Error: AllowUpload(): Spam prevention. Please wait [round(time_to_wait/10)] seconds.</font>")
return 0
fileaccess_timer = world.time + FTPDELAY */
return 1
Expand Down Expand Up @@ -143,10 +150,14 @@
prefs.sanitize_preferences()

if(custom_event_msg && custom_event_msg != "")
src << "<h1 class='alert'>Custom Event</h1>"
src << "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>"
src << "<span class='alert'>[custom_event_msg]</span>"
src << "<br>"
to_chat(src, "<h1 class='alert'>Custom Event</h1>")

to_chat(src, "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>")

to_chat(src, "<span class='alert'>[custom_event_msg]</span>")

to_chat(src, "<br>")



if(holder)
Expand All @@ -166,14 +177,16 @@
send_resources()

if(prefs.lastchangelog != changelog_hash) //bolds the changelog button on the interface so we know there are updates.
src << "<span class='info'>You have unread updates in the changelog.</span>"
to_chat(src, "<span class='info'>You have unread updates in the changelog.</span>")

winset(src, "rpane.changelog", "background-color=#eaeaea;font-style=bold")
if(config.aggressive_changelog)
src.changes()


if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them.
src << "<span class='warning'>Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you.</span>"
to_chat(src, "<span class='warning'>Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you.</span>")


//////////////
//DISCONNECT//
Expand Down
9 changes: 6 additions & 3 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ datum/preferences
if(!user || !user.client) return

if(!get_mob_by_key(client_ckey))
user << "<span class='danger'>No mob exists for the given client!</span>"
to_chat(user, "<span class='danger'>No mob exists for the given client!</span>")

close_load_dialog(user)
return

Expand Down Expand Up @@ -217,9 +218,11 @@ datum/preferences

if(href_list["preference"] == "open_whitelist_forum")
if(config.forumurl)
user << link(config.forumurl)
to_chat(user, link(config.forumurl))

else
user << "<span class='danger'>The forum URL is not set in the server configuration.</span>"
to_chat(user, "<span class='danger'>The forum URL is not set in the server configuration.</span>")

return
ShowChoices(usr)
return 1
Expand Down
6 changes: 4 additions & 2 deletions code/modules/client/ui_style.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
set desc = "Configure your user interface"

if(!ishuman(usr))
usr << "<span class='warning'>You must be human to use this verb.</span>"
to_chat(usr, "<span class='warning'>You must be human to use this verb.</span>")

return

var/UI_style_new = input(usr, "Select a style. White is recommended for customization") as null|anything in all_ui_styles
Expand Down Expand Up @@ -55,4 +56,5 @@
prefs.UI_style_alpha = UI_style_alpha_new
prefs.UI_style_color = UI_style_color_new
prefs.save_preferences()
usr << "UI was saved"
to_chat(usr, "UI was saved")

Loading

0 comments on commit 384acdf

Please sign in to comment.