Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to_chat replacer #11

Merged
merged 11 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions code/__DEFINES/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ GLOBAL_LIST_INIT(surgery_tool_behaviors, list(
//Welder messages and other stuff
#define HEALPERWELD 15
#define WELDER_ATTEMPT_WELD_MESSAGE user.visible_message("<span class='notice'>[user] begins welding [src]...</span>", "<span class='notice'>You begin welding [src]...</span>", "<span class='warning'>You hear welding.</span>")
#define WELDER_WELD_SUCCESS_MESSAGE to_chat(user, "<span class='notice'>You finish welding [src]!</span>")
#define WELDER_WELD_SUCCESS_MESSAGE user.balloon_alert(user, "<span class='notice'>You finish welding [src]!</span>")
#define WELDER_ATTEMPT_REPAIR_MESSAGE user.visible_message("<span class='notice'>[user] begins repairing the damage on [src]...</span>", "<span class='notice'>You begin repairing [src]...</span>", "<span class='warning'>You hear welding.</span>")
#define WELDER_REPAIR_SUCCESS_MESSAGE to_chat(user, "<span class='notice'>You repair the damage on [src]!</span>")
#define WELDER_REPAIR_SUCCESS_MESSAGE user.balloon_alert(user, "<span class='notice'>You repair the damage on [src]!</span>")
#define WELDER_ATTEMPT_SLICING_MESSAGE user.visible_message("<span class='notice'>[user] begins slicing through [src]...</span>", "<span class='notice'>You begin slicing through [src]...</span>", "<span class='warning'>You hear welding.</span>")
#define WELDER_SLICING_SUCCESS_MESSAGE to_chat(user, "<span class='notice'>You slice clean through [src]!</span>")
#define WELDER_SLICING_SUCCESS_MESSAGE user.balloon_alert(user, "<span class='notice'>You slice clean through [src]!</span>")
#define WELDER_ATTEMPT_FLOOR_SLICE_MESSAGE user.visible_message("<span class='notice'>[user] begins slicing [src] free from [get_turf(src)]...</span>", "<span class='notice'>You begin slicing [src] free from [get_turf(src)]...</span>", "<span class='warning'>You hear welding.</span>")
#define WELDER_FLOOR_SLICE_SUCCESS_MESSAGE to_chat(user, "<span class='notice'>You slice [src] clear of [get_turf(src)]!</span>")
#define WELDER_FLOOR_SLICE_SUCCESS_MESSAGE user.balloon_alert(user, "<span class='notice'>You slice [src] clear of [get_turf(src)]!</span>")
#define WELDER_ATTEMPT_FLOOR_WELD_MESSAGE user.visible_message("<span class='notice'>[user] begins welding [src] to [get_turf(src)]...</span>", "<span class='notice'>You begin welding [src] to [get_turf(src)]...</span>", "<span class='warning'>You hear welding.</span>")
#define WELDER_FLOOR_WELD_SUCCESS_MESSAGE to_chat(user, "<span class='notice'>You weld [src] to [get_turf(src)]!</span>")
#define WELDER_FLOOR_WELD_SUCCESS_MESSAGE user.balloon_alert(user, "<span class='notice'>You weld [src] to [get_turf(src)]!</span>")

//Wrench messages
#define WRENCH_ANCHOR_MESSAGE user.visible_message("<span class='notice'>[user] tightens the bolts on [src]!</span>", "<span class='notice'>You tighten the bolts on [src]!</span>", "<span class='warning'>You hear ratcheting.</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/pai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@

/mob/living/silicon/pai/proc/reset_cooldown()
capa_is_cooldown = FALSE
to_chat(src, "<span class = 'notice'>Your ability to interact with airlocks has been restored.</span>")
src.balloon_alert(src, "Your ability to interact with airlocks has been restored.")
8 changes: 4 additions & 4 deletions code/datums/components/defibrillator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
return
safety = !safety
if(user && !robotic)
to_chat(user, span_warning("You silently [safety ? "disable" : "enable"] [unit]'s safety protocols with the card."))
user.balloon_alert(user, span_warning("You silently [safety ? "disable" : "enable"] [unit]'s safety protocols with the card."))

/datum/component/defib/proc/set_cooldown(how_short)
on_cooldown = TRUE
Expand Down Expand Up @@ -138,17 +138,17 @@
return

if(on_cooldown)
to_chat(user, span_notice("[defib_ref] is recharging."))
user.balloon_alert(user, span_notice("[defib_ref] is recharging."))
return

if(application_result & COMPONENT_BLOCK_DEFIB_MISC)
return // the unit should handle this

if(!istype(target))
if(robotic)
to_chat(user, span_notice("This unit is only designed to work on humanoid lifeforms."))
user.balloon_alert(user, span_notice("This unit is only designed to work on humanoid lifeforms."))
else
to_chat(user, span_notice("The instructions on [defib_ref] don't mention how to defibrillate that..."))
user.balloon_alert(user, span_notice("The instructions don't mention how to defibrillate that..."))
return

if(should_cause_harm && combat && heart_attack_chance == 100)
Expand Down
6 changes: 3 additions & 3 deletions code/datums/components/ducttape.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


/datum/component/ducttape/proc/remove_tape(obj/item/I, mob/user)
to_chat(user, span_notice("You tear the tape off [I]!"))
user.balloon_alert(user, span_notice("You tear the tape off [I]!"))
playsound(I, 'sound/items/poster_ripped.ogg', 50, 1)
new /obj/item/trash/tapetrash(user.loc)
I.update_icon()
Expand All @@ -62,7 +62,7 @@
var/target_direction = get_dir(source_turf, target_turf)//The direction we clicked
// Snowflake diagonal handling
if(target_direction in GLOB.diagonals)
to_chat(user, span_warning("You can't reach [target_turf]."))
user.balloon_alert(user, span_warning("You can't reach [target_turf]."))
return
if(target_direction & EAST)
x_offset = 16
Expand All @@ -78,7 +78,7 @@
y_offset = -16
if(!user.drop_item_ground(I))
return
to_chat(user, span_notice("You stick [I] to [target_turf]."))
user.balloon_alert(user, span_notice("You stick [I] to [target_turf]."))
I.pixel_x = x_offset
I.pixel_y = y_offset

Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/label.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

remove_label()
playsound(parent, 'sound/items/poster_ripped.ogg', 20, TRUE)
to_chat(user, "<span class='warning'>You remove the label from [parent].</span>")
user.balloon_alert(user, "<span class='warning'>You remove the label from [parent].</span>")
qdel(src) // Remove the component from the object.

/**
Expand Down
10 changes: 5 additions & 5 deletions code/datums/components/twohanded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,24 +180,24 @@
if(require_twohands)
if(abstract_check && (world.time > antispam_timer + 0.1 SECONDS))
antispam_timer = world.time
to_chat(user, span_warning("[parent] слишком тяжел и громоздок для Вас!"))
user.balloon_alert(user, span_warning("[parent] is too heavy!"))
user.drop_item_ground(parent, force = TRUE)
else
if(abstract_check && (world.time > antispam_timer + 0.1 SECONDS))
antispam_timer = world.time
to_chat(user, span_warning("Ваши руки для этого не приспособлены."))
user.balloon_alert(user, span_warning("Your hands can't handle this."))
return

if(user.get_inactive_hand())
if(require_twohands)
if(abstract_check && (world.time > antispam_timer + 0.1 SECONDS))
antispam_timer = world.time
to_chat(user, span_warning("[parent] слишком громоздок, чтобы носить в одной руке!"))
user.balloon_alert(user, span_warning("[parent] is too heavy to hold in one hand!"))
user.drop_item_ground(parent, force = TRUE)
else
if(abstract_check && (world.time > antispam_timer + 0.1 SECONDS))
antispam_timer = world.time
to_chat(user, span_warning("Вторая рука должна быть свободна!"))
user.balloon_alert(user, span_warning("Inactive hand should be free!"))
return

if(user.l_arm_broken() || user.r_arm_broken())
Expand All @@ -213,7 +213,7 @@
user.drop_item_ground(parent, force = TRUE)
if(abstract_check && (world.time > antispam_timer + 0.1 SECONDS))
antispam_timer = world.time
to_chat(user, span_warning("У Вас отсутствует вторая рука!"))
user.balloon_alert(user, span_warning("You don't have second hand!"))
return

// wield update status
Expand Down
6 changes: 3 additions & 3 deletions code/datums/multitool_menu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

/datum/multitool_menu_host/proc/notify_if_no_access(mob/user)
if(!multitool.allowed(user))
to_chat(user, "<span class='warning'>Access denied.</span>")
user.balloon_alert(user, "<span class='warning'>Access denied.</span>")
return TRUE
return FALSE

Expand Down Expand Up @@ -142,7 +142,7 @@
return
holder.add_fingerprint(user)
if(inoperable())
to_chat(user, "<span class='warning'>You attach [multitool] to [holder], but nothing happens. [holder] seems to be inoperable.</span>")
user.balloon_alert(user, "<span class='warning'>You attach [multitool] to [holder], but nothing happens. [holder] seems to be inoperable.</span>")
return
src.multitool = multitool
src.multitool.menu.interact(user, src)
Expand All @@ -161,7 +161,7 @@
Used to check if we still need to apply changes (returns true if we don't), e.g. after input() call.
*/
if(!multitool)
to_chat(user, "<span class='warning'>You are unable to reach [holder ? holder : "the thing"].</span>")
user.balloon_alert(user, "<span class='warning'>You are unable to reach [holder ? holder : "the thing"].</span>")
return TRUE
return FALSE

Expand Down
8 changes: 4 additions & 4 deletions code/datums/spells/high_rp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@

/obj/item/organ/internal/high_rp_tumor/on_life()
if(world.time > (last_pump + (pump_delay - pump_window)))
to_chat(owner, "Мне начинает не хватать воздуха.")
owner.balloon_alert(owner, "Мне начинает не хватать воздуха.")
warned = 1

if(world.time > (last_pump + pump_delay))
var/mob/living/carbon/human/H = owner
H.setOxyLoss(H.oxyloss + oxy_loss)
H.custom_emote(EMOTE_VISIBLE, "задыха%(ет,ют)%ся!")
to_chat(H, "<span class='userdanger'>Я должен дышать, иначе просто задохнусь!</span>")
H.balloon_alert(H, "<span class='userdanger'>Я должен дышать, иначе просто задохнусь!</span>")
last_pump = world.time
warned = 0

Expand All @@ -47,10 +47,10 @@
var/obj/item/organ/internal/high_rp_tumor/hrp_tumor = target

if(world.time < (hrp_tumor.last_pump + (hrp_tumor.pump_delay - hrp_tumor.pump_window))) //no spam
to_chat(owner, "<span class='userdanger'>Слишком рано!</span>")
owner.balloon_alert(owner, "<span class='userdanger'>Слишком рано!</span>")
hrp_tumor.owner.setOxyLoss(hrp_tumor.owner.oxyloss + hrp_tumor.oxy_loss/5)
return

hrp_tumor.last_pump = world.time
to_chat(owner, "<span class = 'notice'>Вы дышите.</span>")
owner.balloon_alert(owner, "<span class = 'notice'>Вы дышите.</span>")
owner.custom_emote(EMOTE_VISIBLE, "дыш%(ит,ат)%.")
2 changes: 1 addition & 1 deletion code/datums/spells/horsemask.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/obj/effect/proc_holder/spell/horsemask/cast(list/targets, mob/user = usr)
if(!targets.len)
to_chat(user, "<span class='notice'>No target found in range.</span>")
user.balloon_alert(user, "<span class='notice'>No target found in range.</span>")
return

var/mob/living/carbon/human/target = targets[1]
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spells/spacetime_dist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
. = ..()
var/list/turf/to_switcharoo = targets
if(!length(to_switcharoo))
to_chat(user, "<span class='warning'>For whatever reason, the strings nearby aren't keen on being tangled.</span>")
user.balloon_alert(user, "<span class='warning'>The strings nearby aren't keen on being tangled.</span>")
return

ready = FALSE
Expand Down
6 changes: 3 additions & 3 deletions code/datums/supplypacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ GLOBAL_LIST_INIT(all_supply_groups, list(SUPPLY_EMERGENCY,SUPPLY_SECURITY,SUPPLY

/datum/supply_packs/proc/can_approve(mob/user)
if(SSshuttle.points < cost)
to_chat(user, span_warning("There are insufficient supply points for this request."))
user.balloon_alert(user, span_warning("There are insufficient supply points for this request."))
return FALSE
if(credits_cost && SSshuttle.cargo_money_account.money < credits_cost)
to_chat(user, span_warning("There are not enough money on cargo account for this request."))
user.balloon_alert(user, span_warning("There are not enough money on cargo account for this request."))
return FALSE
if(!length(required_tech))
return TRUE
for(var/tech_id in required_tech)
if(!SSshuttle.techLevels[tech_id] || required_tech[tech_id] > SSshuttle.techLevels[tech_id])
to_chat(user, span_warning("You have not sent the necessary technological disks to Centcomm."))
user.balloon_alert(user, span_warning("You have not sent the necessary technological disks to Centcomm."))
return FALSE
return TRUE

Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/OpTable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
/obj/machinery/optable/Crossed(atom/movable/AM, oldloc)
. = ..()
if(iscarbon(AM) && LAZYLEN(injected_reagents))
to_chat(AM, span_danger("You feel a series of tiny pricks!"))
balloon_alert(AM, span_danger("You feel a series of tiny pricks!"))

/obj/machinery/optable/process()
update_patient()
Expand Down Expand Up @@ -117,14 +117,14 @@
if(!I.tool_start_check(src, user, 0))
return
if(I.use_tool(src, user, 20, volume = I.tool_volume))
to_chat(user, span_notice("You deconstruct the table."))
user.balloon_alert(user, span_notice("You deconstruct the table."))
new /obj/item/stack/sheet/plasteel(loc, 5)
qdel(src)

/obj/machinery/optable/proc/check_table()
update_patient()
if(patient != null)
to_chat(usr, span_notice("The table is already occupied!"))
balloon_alert(usr, span_notice("The table is already occupied!"))
return FALSE
else
return TRUE
6 changes: 3 additions & 3 deletions code/game/machinery/gameboard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
. = ..()
if(.)
return
if(src.in_use)
to_chat(user, "This gameboard is already in use!")
if(in_use)
balloon_alert(user, "This gameboard is already in use!")
return
if(!anchored)
to_chat(user, "The gameboard is not secured!")
balloon_alert(user, "The gameboard is not secured!")
return
interact(user)

Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/tcomms/relay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@
if(linked_core)
linked_core.refresh_zlevels()
else
to_chat(usr, span_warning("Error: Another relay is already active in this sector. Power-up cancelled due to radio interference."))
balloon_alert(usr, span_warning("Error: Another relay is already active in this sector. Power-up cancelled due to radio interference."))

// Set network ID
if("network_id")
var/new_id = input(usr, "Please enter a new network ID", "Network ID", network_id)
log_action(usr, "renamed core with ID [network_id] to [new_id]")
to_chat(usr, span_notice("Device ID changed from <b>[network_id]</b> to <b>[new_id]</b>."))
balloon_alert(usr, span_notice("Device ID changed from <b>[network_id]</b> to <b>[new_id]</b>."))
network_id = new_id

// Only do these hrefs if we are linked to prevent bugs/exploits
Expand Down
16 changes: 8 additions & 8 deletions code/game/objects/items/devices/laserpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@
if(!diode)
user.drop_transfer_item_to_loc(W, src)
diode = W
to_chat(user, "<span class='notice'>You install a [diode.name] in [src].</span>")
user.balloon_alert(user, "<span class='notice'>You install a [diode.name] in [src].</span>")
else
to_chat(user, "<span class='notice'>[src] already has a cell.</span>")
user.balloon_alert(user, "<span class='notice'>[src] already has a cell.</span>")
return

return ..()

/obj/item/laser_pointer/screwdriver_act(mob/living/user, obj/item/I)
. = TRUE
if(diode)
to_chat(user, "<span class='notice'>You remove the [diode.name] from the [src].</span>")
user.balloon_alert(user, "<span class='notice'>You remove the [diode.name] from the [src].</span>")
diode.forceMove(get_turf(loc))
diode = null

Expand All @@ -78,16 +78,16 @@
if( !(user in (viewers(7,target))) )
return
if(!diode)
to_chat(user, "<span class='notice'>You point [src] at [target], but nothing happens!</span>")
user.balloon_alert(user, "<span class='notice'>Nothing happens!</span>")
return
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
user.balloon_alert(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
add_fingerprint(user)

//nothing happens if the battery is drained
if(recharge_locked)
to_chat(user, "<span class='notice'>You point [src] at [target], but it's still charging.</span>")
user.balloon_alert(user, "<span class='notice'>It's still charging.</span>")
return

var/outmsg
Expand Down Expand Up @@ -155,9 +155,9 @@
I.pixel_y = target.pixel_y + rand(-5,5)

if(outmsg)
to_chat(user, outmsg)
user.balloon_alert(user, outmsg)
else
to_chat(user, "<span class='info'>You point [src] at [target].</span>")
user.balloon_alert(user, "<span class='info'>You point [src] at [target].</span>")

energy -= 1
if(energy <= max_energy)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/voice.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
active = !active
icon_state = "voice_changer_[active ? "on" : "off"]"
if(inform_about_toggle)
to_chat(user, span_notice("You toggle [src] [active ? "on" : "off"]."))
user.balloon_alert(user, span_notice("You toggle [src] [active ? "on" : "off"]."))

for(var/X in actions)
var/datum/action/A = X
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/cosmetics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@


/obj/item/lipstick/attack_self(mob/user)
to_chat(user, "<span class='notice'>You twist \the [src] [open ? "closed" : "open"].</span>")
user.balloon_alert(user, "<span class='notice'>You twist \the [src] [open ? "closed" : "open"].</span>")
open = !open
update_icon()

Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/items/weapons/garrote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@
var/mob/living/carbon/human/U = user

if(!wielded)
to_chat(user, "<span class = 'warning'>You must use both hands to garrote [M]!</span>")
user.balloon_alert(user, "<span class = 'warning'>You must use both hands to garrote [M]!</span>")
return

if(!ishuman(M))
to_chat(user, "<span class = 'warning'>You don't think that garroting [M] would be very effective...</span>")
user.balloon_alert(user, "<span class = 'warning'>You don't think that garroting [M] would be very effective...</span>")
return

if(M == U)
U.suicide() // This will display a prompt for confirmation first.
return

if(M.dir != U.dir)
to_chat(user, "<span class='warning'>You cannot use [src] on [M] from that angle!</span>")
user.balloon_alert(user, "<span class='warning'>You cannot use [src] on [M] from that angle!</span>")
return

if(improvised && ((M.head && (M.head.flags_cover & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags_cover & MASKCOVERSMOUTH)))) // Improvised garrotes are blocked by mouth-covering items.
Expand Down
Loading
Loading