Skip to content

Commit

Permalink
Replaces the default output with the to_chat wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
lzimann committed Mar 10, 2017
1 parent ffbb492 commit 5a61829
Show file tree
Hide file tree
Showing 1,034 changed files with 7,618 additions and 7,681 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/admin.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//A set of constants used to determine which type of mute an admin wishes to apply:
//Please read and understand the muting/automuting stuff before changing these. MUTE_IC_AUTO etc = (MUTE_IC << 1)
//Please read and understand the muting/automuting stuff before changing these. MUTE_IC_AUTO etc = (to_chat(MUTE_IC, 1))
//Therefore there needs to be a gap between the flags for the automute flags
#define MUTE_IC 1
#define MUTE_OOC 2
Expand Down
4 changes: 2 additions & 2 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
#define SHELTER_DEPLOY_ANCHORED_OBJECTS "anchored objects"

//debug printing macros
#define debug_world(msg) if (Debug2) world << "DEBUG: [msg]"
#define debug_admins(msg) if (Debug2) admins << "DEBUG: [msg]"
#define debug_world(msg) if (Debug2) to_chat(world, "DEBUG: [msg]")
#define debug_admins(msg) if (Debug2) to_chat(admins, "DEBUG: [msg]")
#define debug_world_log(msg) if (Debug2) log_world("DEBUG: [msg]")

#define COORD(A) "([A.x],[A.y],[A.z])"
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

//print a testing-mode debug message to world.log and world
#ifdef TESTING
#define testing(msg) log_world("## TESTING: [msg]"); world << "## TESTING: [msg]"
#define testing(msg) log_world("## TESTING: [msg]"); to_chat(world, "## TESTING: [msg]")
#else
#define testing(msg)
#endif
Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/files.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

var/extension = copytext(path,-4,0)
if( !fexists(path) || !(extension in valid_extensions) )
src << "<font color='red'>Error: browse_files(): File not found/Invalid file([path]).</font>"
to_chat(src, "<font color='red'>Error: browse_files(): File not found/Invalid file([path]).</font>")
return

return path
Expand All @@ -53,7 +53,7 @@
/client/proc/file_spam_check()
var/time_to_wait = fileaccess_timer - world.time
if(time_to_wait > 0)
src << "<font color='red'>Error: file_spam_check(): Spam. Please wait [round(time_to_wait/10)] seconds.</font>"
to_chat(src, "<font color='red'>Error: file_spam_check(): Spam. Please wait [round(time_to_wait/10)] seconds.</font>")
return 1
fileaccess_timer = world.time + FTPDELAY
return 0
Expand Down
12 changes: 6 additions & 6 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -422,20 +422,20 @@
window_flash(G.client)
switch(ignore_category ? askuser(G,Question,"Please answer in [poll_time/10] seconds!","Yes","No","Never for this round", StealFocus=0, Timeout=poll_time) : askuser(G,Question,"Please answer in [poll_time/10] seconds!","Yes","No", StealFocus=0, Timeout=poll_time))
if(1)
G << "<span class='notice'>Choice registered: Yes.</span>"
to_chat(G, "<span class='notice'>Choice registered: Yes.</span>")
if((world.time-time_passed)>poll_time)
G << "<span class='danger'>Sorry, you were too late for the consideration!</span>"
to_chat(G, "<span class='danger'>Sorry, you were too late for the consideration!</span>")
G << 'sound/machines/buzz-sigh.ogg'
else
candidates += G
if(2)
G << "<span class='danger'>Choice registered: No.</span>"
to_chat(G, "<span class='danger'>Choice registered: No.</span>")
if(3)
var/list/L = poll_ignore[ignore_category]
if(!L)
poll_ignore[ignore_category] = list()
poll_ignore[ignore_category] += G.ckey
G << "<span class='danger'>Choice registered: Never for this round.</span>"
to_chat(G, "<span class='danger'>Choice registered: Never for this round.</span>")

/proc/pollCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck, var/be_special_flag = 0, var/poll_time = 300, var/ignore_category = null, flashwindow = TRUE)
var/list/mob/dead/observer/candidates = list()
Expand Down Expand Up @@ -498,10 +498,10 @@

return new_character

/proc/send_to_playing_players(thing) //sends a whatever to all playing players; use instead of world << where needed
/proc/send_to_playing_players(thing) //sends a whatever to all playing players; use instead of to_chat(world, where needed)
for(var/M in player_list)
if(M && !isnewplayer(M))
M << thing
to_chat(M, thing)

/proc/window_flash(client/C, ignorepref = FALSE)
if(ismob(C))
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
var/list/L = chemical_reactions_list[reaction]
for(var/t in L)
. += " has: [t]\n"
world << .
to_chat(world, .)
*/

//creates every subtype of prototype (excluding prototype) and adds it to list L.
Expand Down
6 changes: 3 additions & 3 deletions code/__HELPERS/icon_smoothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
AM = find_type_in_direction(A, direction)
if(AM == NULLTURF_BORDER)
if((A.smooth & SMOOTH_BORDER))
adjacencies |= 1 << direction
adjacencies |= to_chat(1, direction)
else if( (AM && !istype(AM)) || (istype(AM) && AM.anchored) )
adjacencies |= 1 << direction
adjacencies |= to_chat(1, direction)

if(adjacencies & N_NORTH)
if(adjacencies & N_WEST)
Expand Down Expand Up @@ -259,7 +259,7 @@
A.cut_overlay(A.bottom_left_corner)
A.bottom_left_corner = se
LAZYADD(New, se)

if(New)
A.add_overlay(New)

Expand Down
24 changes: 12 additions & 12 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -333,26 +333,26 @@ world
--digits
switch(which)
if(0)
r = (r << 4) | ch
r = (to_chat(r, 4) | ch)
if(single)
r |= r << 4
r |= to_chat(r, 4)
++which
else if(!(digits & 1)) ++which
if(1)
g = (g << 4) | ch
g = (to_chat(g, 4) | ch)
if(single)
g |= g << 4
g |= to_chat(g, 4)
++which
else if(!(digits & 1)) ++which
if(2)
b = (b << 4) | ch
b = (to_chat(b, 4) | ch)
if(single)
b |= b << 4
b |= to_chat(b, 4)
++which
else if(!(digits & 1)) ++which
if(3)
alpha = (alpha << 4) | ch
if(single) alpha |= alpha << 4
alpha = (to_chat(alpha, 4) | ch)
if(single) alpha |= to_chat(alpha, 4)

. = list(r, g, b)
if(usealpha) . += alpha
Expand Down Expand Up @@ -382,16 +382,16 @@ world
--digits
switch(which)
if(0)
hue = (hue << 4) | ch
hue = (to_chat(hue, 4) | ch)
if(digits == (usealpha ? 6 : 4)) ++which
if(1)
sat = (sat << 4) | ch
sat = (to_chat(sat, 4) | ch)
if(digits == (usealpha ? 4 : 2)) ++which
if(2)
val = (val << 4) | ch
val = (to_chat(val, 4) | ch)
if(digits == (usealpha ? 2 : 0)) ++which
if(3)
alpha = (alpha << 4) | ch
alpha = (to_chat(alpha, 4) | ch)

. = list(hue, sat, val)
if(usealpha) . += alpha
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,4 @@ Proc for attack log creation, because really why not
else if(turf_target)
var/turf_link = TURF_LINK(M, turf_target)
message = "[turf_link] [message]"
M << "[message]"
to_chat(M, "[message]")
8 changes: 4 additions & 4 deletions code/__HELPERS/sorts/__main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ var/datum/sortInstance/sortInstance = new()
var/maxOffset = len - hint
while(offset < maxOffset && call(cmp)(key, fetchElement(L,base+hint+offset)) > 0)
lastOffset = offset
offset = (offset << 1) + 1
offset = (to_chat(offset, 1) + 1)

if(offset > maxOffset)
offset = maxOffset
Expand All @@ -278,7 +278,7 @@ var/datum/sortInstance/sortInstance = new()
var/maxOffset = hint + 1
while(offset < maxOffset && call(cmp)(key, fetchElement(L,base+hint-offset)) <= 0)
lastOffset = offset
offset = (offset << 1) + 1
offset = (to_chat(offset, 1) + 1)

if(offset > maxOffset)
offset = maxOffset
Expand Down Expand Up @@ -325,7 +325,7 @@ var/datum/sortInstance/sortInstance = new()
var/maxOffset = hint + 1 //therefore we want to insert somewhere in the range [base,base+hint] = [base+,base+(hint+1))
while(offset < maxOffset && call(cmp)(key, fetchElement(L,base+hint-offset)) < 0) //we are iterating backwards
lastOffset = offset
offset = (offset << 1) + 1 //1 3 7 15
offset = (to_chat(offset, 1) + 1 )
//if(offset <= 0) //int overflow, not an issue here since we are using floats
// offset = maxOffset

Expand All @@ -340,7 +340,7 @@ var/datum/sortInstance/sortInstance = new()
var/maxOffset = len - hint //therefore we want to insert somewhere in the range (base+hint,base+len) = [base+hint+1, base+hint+(len-hint))
while(offset < maxOffset && call(cmp)(key, fetchElement(L,base+hint+offset)) >= 0)
lastOffset = offset
offset = (offset << 1) + 1
offset = (to_chat(offset, 1) + 1)
//if(offset <= 0) //int overflow, not an issue here since we are using floats
// offset = maxOffset

Expand Down
13 changes: 8 additions & 5 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -834,20 +834,20 @@ var/list/WALLITEMS_INVERSE = typecacheof(list(
var/pressure = air_contents.return_pressure()
var/total_moles = air_contents.total_moles()

user << "<span class='notice'>Results of analysis of \icon[icon] [target].</span>"
to_chat(user, "<span class='notice'>Results of analysis of \icon[icon] [target].</span>")
if(total_moles>0)
user << "<span class='notice'>Pressure: [round(pressure,0.1)] kPa</span>"
to_chat(user, "<span class='notice'>Pressure: [round(pressure,0.1)] kPa</span>")

var/list/cached_gases = air_contents.gases

for(var/id in cached_gases)
var/gas_concentration = cached_gases[id][MOLES]/total_moles
if(id in hardcoded_gases || gas_concentration > 0.001) //ensures the four primary gases are always shown.
user << "<span class='notice'>[cached_gases[id][GAS_META][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] %</span>"
to_chat(user, "<span class='notice'>[cached_gases[id][GAS_META][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] %</span>")

user << "<span class='notice'>Temperature: [round(air_contents.temperature-T0C)] &deg;C</span>"
to_chat(user, "<span class='notice'>Temperature: [round(air_contents.temperature-T0C)] &deg;C</span>")
else
user << "<span class='notice'>[target] is empty!</span>"
to_chat(user, "<span class='notice'>[target] is empty!</span>")
return

/proc/check_target_facings(mob/living/initator, mob/living/target)
Expand Down Expand Up @@ -1420,3 +1420,6 @@ var/valid_HTTPSGet = FALSE
fdel(temp_file)

#define UNTIL(X) while(!(X)) stoplag()

/proc/to_chat(target, message)
target << message
2 changes: 1 addition & 1 deletion code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ so as to remain in compliance with the most up-to-date laws."
return
var/paramslist = params2list(params)
if(paramslist["shift"]) // screen objects don't do the normal Click() stuff so we'll cheat
usr << "<span class='boldnotice'>[name]</span> - <span class='info'>[desc]</span>"
to_chat(usr, "<span class='boldnotice'>[name]</span> - <span class='info'>[desc]</span>")
return
if(master)
return usr.client.Click(master, location, control, params)
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@

if(hud_used && client)
hud_used.show_hud() //Shows the next hud preset
usr << "<span class ='info'>Switched HUD mode. Press F12 to toggle.</span>"
to_chat(usr, "<span class ='info'>Switched HUD mode. Press F12 to toggle.</span>")
else
usr << "<span class ='warning'>This mob type does not use a HUD.</span>"
to_chat(usr, "<span class ='warning'>This mob type does not use a HUD.</span>")


//(re)builds the hand ui slots, throwing away old ones
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
screenmob.client.screen += module_store_icon //"store" icon

if(!R.module.modules)
usr << "<span class='danger'>Selected module has no modules to select</span>"
to_chat(usr, "<span class='danger'>Selected module has no modules to select</span>")
return

if(!R.robot_modules_background)
Expand Down
22 changes: 11 additions & 11 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
return 1
var/area/A = get_area(usr)
if(!A.outdoors)
usr << "<span class='warning'>There is already a defined structure here.</span>"
to_chat(usr, "<span class='warning'>There is already a defined structure here.</span>")
return 1
create_area(usr)

Expand Down Expand Up @@ -241,49 +241,49 @@

if(C.internal)
C.internal = null
C << "<span class='notice'>You are no longer running on internals.</span>"
to_chat(C, "<span class='notice'>You are no longer running on internals.</span>")
icon_state = "internal0"
else
if(!C.getorganslot("breathing_tube"))
if(!istype(C.wear_mask, /obj/item/clothing/mask))
C << "<span class='warning'>You are not wearing an internals mask!</span>"
to_chat(C, "<span class='warning'>You are not wearing an internals mask!</span>")
return 1
else
var/obj/item/clothing/mask/M = C.wear_mask
if(M.mask_adjusted) // if mask on face but pushed down
M.adjustmask(C) // adjust it back
if( !(M.flags & MASKINTERNALS) )
C << "<span class='warning'>You are not wearing an internals mask!</span>"
to_chat(C, "<span class='warning'>You are not wearing an internals mask!</span>")
return

var/obj/item/I = C.is_holding_item_of_type(/obj/item/weapon/tank)
if(I)
C << "<span class='notice'>You are now running on internals from the [I] on your [C.get_held_index_name(C.get_held_index_of_item(I))].</span>"
to_chat(C, "<span class='notice'>You are now running on internals from the [I] on your [C.get_held_index_name(C.get_held_index_of_item(I))].</span>")
C.internal = I
else if(ishuman(C))
var/mob/living/carbon/human/H = C
if(istype(H.s_store, /obj/item/weapon/tank))
H << "<span class='notice'>You are now running on internals from the [H.s_store] on your [H.wear_suit].</span>"
to_chat(H, "<span class='notice'>You are now running on internals from the [H.s_store] on your [H.wear_suit].</span>")
H.internal = H.s_store
else if(istype(H.belt, /obj/item/weapon/tank))
H << "<span class='notice'>You are now running on internals from the [H.belt] on your belt.</span>"
to_chat(H, "<span class='notice'>You are now running on internals from the [H.belt] on your belt.</span>")
H.internal = H.belt
else if(istype(H.l_store, /obj/item/weapon/tank))
H << "<span class='notice'>You are now running on internals from the [H.l_store] in your left pocket.</span>"
to_chat(H, "<span class='notice'>You are now running on internals from the [H.l_store] in your left pocket.</span>")
H.internal = H.l_store
else if(istype(H.r_store, /obj/item/weapon/tank))
H << "<span class='notice'>You are now running on internals from the [H.r_store] in your right pocket.</span>"
to_chat(H, "<span class='notice'>You are now running on internals from the [H.r_store] in your right pocket.</span>")
H.internal = H.r_store

//Seperate so CO2 jetpacks are a little less cumbersome.
if(!C.internal && istype(C.back, /obj/item/weapon/tank))
C << "<span class='notice'>You are now running on internals from the [C.back] on your back.</span>"
to_chat(C, "<span class='notice'>You are now running on internals from the [C.back] on your back.</span>")
C.internal = C.back

if(C.internal)
icon_state = "internal1"
else
C << "<span class='warning'>You don't have an oxygen tank!</span>"
to_chat(C, "<span class='warning'>You don't have an oxygen tank!</span>")
return
C.update_action_buttons_icon()

Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
if(user.a_intent == INTENT_HARM && stat == DEAD && butcher_results) //can we butcher it?
var/sharpness = I.is_sharp()
if(sharpness)
user << "<span class='notice'>You begin to butcher [src]...</span>"
to_chat(user, "<span class='notice'>You begin to butcher [src]...</span>")
playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
if(do_mob(user, src, 80/sharpness))
harvest(user)
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
if(awaygate)
user.forceMove(awaygate.loc)
else
user << "[src] has no destination."
to_chat(user, "[src] has no destination.")

/obj/machinery/gateway/centeraway/attack_ghost(mob/user)
if(stationgate)
user.forceMove(stationgate.loc)
else
user << "[src] has no destination."
to_chat(user, "[src] has no destination.")

/obj/item/weapon/storage/attack_ghost(mob/user)
orient2hud(user)
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/mob/living/carbon/human/UnarmedAttack(atom/A, proximity)

if(!has_active_hand()) //can't attack without a hand.
src << "<span class='notice'>You look at your arm and sigh.</span>"
to_chat(src, "<span class='notice'>You look at your arm and sigh.</span>")
return

// Special glove functions:
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/telekinesis.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ var/const/tk_maxrange = 15
if(focus)
d = max(d,get_dist(user,focus)) // whichever is further
if(d > tk_maxrange)
user << "<span class ='warning'>Your mind won't reach that far.</span>"
to_chat(user, "<span class ='warning'>Your mind won't reach that far.</span>")
return 0
return 1

Expand Down
Loading

0 comments on commit 5a61829

Please sign in to comment.