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

Span class cleaning #65

Merged
merged 5 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions code/__DEFINES/span.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define span_adminhelp(str) ("<span class='adminhelp'>" + str + "</span>")
#define span_adminnotice(str) ("<span class='adminnotice'>" + str + "</span>")
#define span_adminooc(str) ("<span class='adminooc'>" + str + "</span>")
#define span_adminprefix(str) ("<span class='admin prefix'>" + str + "</span>")
#define span_alert(str) ("<span class='alert'>" + str + "</span>")
#define span_alertalien(str) ("<span class='alertalien'>" + str + "</span>")
#define span_alien(str) ("<span class='alien'>" + str + "</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/alerts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Override makes it so the alert is not replaced until cleared by a clear_alert wi
return
var/paramslist = params2list(params)
if(paramslist["shift"]) // screen objects don't do the normal Click() stuff so we'll cheat
to_chat(usr, span_boldnotice("[name]</span> - <span class='info'>[desc]"))
to_chat(usr, span_boldnotice("[name]") + " - " + span_info("[desc]"))
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 @@ -301,6 +301,6 @@

if(hud_used && client)
hud_used.show_hud()
to_chat(usr, "<span class ='info'>Switched HUD mode. Press F12 to toggle.</span>")
to_chat(usr, span_info("Switched HUD mode. Press F12 to toggle."))
else
to_chat(usr, "<span class ='warning'>This mob type does not use a HUD.</span>")
to_chat(usr, span_warning("This mob type does not use a HUD."))
2 changes: 1 addition & 1 deletion code/_onclick/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

var/datum/limb/temp = get_limb(hand ? "l_hand" : "r_hand")
if(temp && !temp.is_usable())
to_chat(src, "<span class='notice'>You try to move your [temp.display_name], but cannot!")
to_chat(src, span_notice("You try to move your [temp.display_name], but cannot!"))
return

if(LAZYACCESS(modifiers, "right"))
Expand Down
30 changes: 15 additions & 15 deletions code/datums/components/riding/riding_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
if(!kick_us_off)
return TRUE

rider.visible_message("<span class='warning'>[rider] falls off of [living_parent]!</span>", \
"<span class='warning'>You fall off of [living_parent]!</span>")
rider.visible_message(span_warning("[rider] falls off of [living_parent]!"), \
span_warning("You fall off of [living_parent]!"))
rider.Paralyze(1 SECONDS)
rider.Knockdown(4 SECONDS)
living_parent.unbuckle_mob(rider)
Expand All @@ -74,7 +74,7 @@
if(!keycheck(user))
if(ispath(keytype, /obj/item))
var/obj/item/key = keytype
to_chat(user, "<span class='warning'>You need a [initial(key.name)] to ride [movable_parent]!</span>")
to_chat(user, span_warning("You need a [initial(key.name)] to ride [movable_parent]!"))
return COMPONENT_DRIVER_BLOCK_MOVE
last_move_diagonal = ISDIAGONALDIR(direction)
var/new_delay = (last_move_diagonal ? DIAG_MOVEMENT_ADDED_DELAY_MULTIPLIER : 1) * vehicle_move_delay
Expand All @@ -96,12 +96,12 @@
rider.Move(targetm)
rider.Knockdown(3 SECONDS)
if(gentle)
rider.visible_message("<span class='warning'>[rider] is thrown clear of [movable_parent]!</span>", \
"<span class='warning'>You're thrown clear of [movable_parent]!</span>")
rider.visible_message(span_warning("[rider] is thrown clear of [movable_parent]!"), \
span_warning("You're thrown clear of [movable_parent]!"))
rider.throw_at(target, 8, 3, movable_parent)
else
rider.visible_message("<span class='warning'>[rider] is thrown violently from [movable_parent]!</span>", \
"<span class='warning'>You're thrown violently from [movable_parent]!</span>")
rider.visible_message(span_warning("[rider] is thrown violently from [movable_parent]!"), \
span_warning("You're thrown violently from [movable_parent]!"))
rider.throw_at(target, 14, 5, movable_parent)

// ***************************************
Expand Down Expand Up @@ -153,9 +153,9 @@
human_parent.unbuckle_mob(rider)
rider.Paralyze(1 SECONDS)
rider.Knockdown(4 SECONDS)
human_parent.visible_message("<span class='danger'>[rider] topples off of [human_parent] as they both fall to the ground!</span>", \
"<span class='warning'>You fall to the ground, bringing [rider] with you!</span>", "<span class='hear'>You hear two consecutive thuds.</span>")
to_chat(rider, "<span class='danger'>[human_parent] falls to the ground, bringing you with [human_parent.p_them()]!</span>")
human_parent.visible_message(span_danger("[rider] topples off of [human_parent] as they both fall to the ground!"), \
span_warning("You fall to the ground, bringing [rider] with you!"), span_hear("You hear two consecutive thuds."))
to_chat(rider, span_danger("[human_parent] falls to the ground, bringing you with [human_parent.p_them()]!"))

/datum/component/riding/creature/human/handle_vehicle_layer(dir)
var/atom/movable/AM = parent
Expand Down Expand Up @@ -189,8 +189,8 @@
AM.unbuckle_mob(dismounted_rider)
dismounted_rider.Paralyze(1 SECONDS)
dismounted_rider.Knockdown(4 SECONDS)
dismounted_rider.visible_message("<span class='warning'>[AM] pushes [dismounted_rider] off of [AM.p_them()]!</span>", \
"<span class='warning'>[AM] pushes you off of [AM.p_them()]!</span>")
dismounted_rider.visible_message(span_warning("[AM] pushes [dismounted_rider] off of [AM.p_them()]!"), \
span_warning("[AM] pushes you off of [AM.p_them()]!"))

// ***************************************
// *********** Simple Animals
Expand Down Expand Up @@ -265,9 +265,9 @@
for(var/mob/living/rider AS in carrying_crusher.buckled_mobs)
carrying_crusher.unbuckle_mob(rider)
rider.Knockdown(1 SECONDS)
carrying_crusher.visible_message("<span class='danger'>[rider] topples off of [carrying_crusher] as they both fall to the ground!</span>", \
"<span class='warning'>You fall to the ground, bringing [rider] with you!</span>", "<span class='hear'>You hear two consecutive thuds.</span>")
to_chat(rider, "<span class='danger'>[carrying_crusher] falls to the ground, bringing you with [carrying_crusher.p_them()]!</span>")
carrying_crusher.visible_message(span_danger("[rider] topples off of [carrying_crusher] as they both fall to the ground!"), \
span_warning("You fall to the ground, bringing [rider] with you!"), span_hear("You hear two consecutive thuds."))
to_chat(rider, span_danger("[carrying_crusher] falls to the ground, bringing you with [carrying_crusher.p_them()]!"))

//Override this to set your vehicle's various pixel offsets
/datum/component/riding/creature/crusher/get_offsets(pass_index, mob_type) // list(dir = x, y, layer)
Expand Down
22 changes: 11 additions & 11 deletions code/datums/components/riding/riding_vehicle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,40 @@

if(!keycheck(user))
if(COOLDOWN_CHECK(src, message_cooldown))
to_chat(user, "<span class='warning'>[vehicle_parent] has no key inserted!</span>")
to_chat(user, span_warning("[vehicle_parent] has no key inserted!"))
COOLDOWN_START(src, message_cooldown, 5 SECONDS)
return COMPONENT_DRIVER_BLOCK_MOVE

if(HAS_TRAIT(user, TRAIT_INCAPACITATED))
if(ride_check_flags & UNBUCKLE_DISABLED_RIDER)
vehicle_parent.unbuckle_mob(user, TRUE)
user.visible_message("<span class='danger'>[user] falls off \the [vehicle_parent].</span>",\
"<span class='danger'>You slip off \the [vehicle_parent] as your body slumps!</span>")
user.visible_message(span_danger("[user] falls off \the [vehicle_parent]."),\
span_danger("You slip off \the [vehicle_parent] as your body slumps!"))

if(COOLDOWN_CHECK(src, message_cooldown))
to_chat(user, "<span class='warning'>You cannot operate \the [vehicle_parent] right now!</span>")
to_chat(user, span_warning("You cannot operate \the [vehicle_parent] right now!"))
COOLDOWN_START(src, message_cooldown, 5 SECONDS)
return COMPONENT_DRIVER_BLOCK_MOVE

if(ride_check_flags & RIDER_NEEDS_LEGS && HAS_TRAIT(user, TRAIT_FLOORED))
if(ride_check_flags & UNBUCKLE_DISABLED_RIDER)
vehicle_parent.unbuckle_mob(user, TRUE)
user.visible_message("<span class='danger'>[user] falls off \the [vehicle_parent].</span>",\
"<span class='danger'>You fall off \the [vehicle_parent] while trying to operate it while unable to stand!</span>")
user.visible_message(span_danger("[user] falls off \the [vehicle_parent]."),\
span_danger("You fall off \the [vehicle_parent] while trying to operate it while unable to stand!"))

if(COOLDOWN_CHECK(src, message_cooldown))
to_chat(user, "<span class='warning'>You can't seem to manage that while unable to stand up enough to move \the [vehicle_parent]...</span>")
to_chat(user, span_warning("You can't seem to manage that while unable to stand up enough to move \the [vehicle_parent]..."))
COOLDOWN_START(src, message_cooldown, 5 SECONDS)
return COMPONENT_DRIVER_BLOCK_MOVE

if(ride_check_flags & RIDER_NEEDS_ARMS && user.restrained())
if(ride_check_flags & UNBUCKLE_DISABLED_RIDER)
vehicle_parent.unbuckle_mob(user, TRUE)
user.visible_message("<span class='danger'>[user] falls off \the [vehicle_parent].</span>",\
"<span class='danger'>You fall off \the [vehicle_parent] while trying to operate it without being able to hold on!</span>")
user.visible_message(span_danger("[user] falls off \the [vehicle_parent]."),\
span_danger("You fall off \the [vehicle_parent] while trying to operate it without being able to hold on!"))

if(COOLDOWN_CHECK(src, message_cooldown))
to_chat(user, "<span class='warning'>You can't seem to hold onto \the [vehicle_parent] to move it...</span>")
to_chat(user, span_warning("You can't seem to hold onto \the [vehicle_parent] to move it..."))
COOLDOWN_START(src, message_cooldown, 5 SECONDS)
return COMPONENT_DRIVER_BLOCK_MOVE

Expand All @@ -68,7 +68,7 @@
if(!istype(next) || !istype(current))
return //not happening.
if(!turf_check(next, current))
to_chat(user, "<span class='warning'>\The [movable_parent] can not go onto [next]!</span>")
to_chat(user, span_warning("\The [movable_parent] can not go onto [next]!"))
return
if(!isturf(movable_parent.loc))
return
Expand Down
12 changes: 6 additions & 6 deletions code/datums/elements/riding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
return

if(target_hands_needed && !equip_buckle_inhands(potential_rider, target_hands_needed, target_movable)) // can be either 1 (cyborg riding) or 2 (human piggybacking) hands
potential_rider.visible_message("<span class='warning'>[potential_rider] can't get a grip on [target_movable] because [potential_rider.p_their()] hands are full!</span>",
"<span class='warning'>You can't get a grip on [target_movable] because your hands are full!</span>")
potential_rider.visible_message(span_warning("[potential_rider] can't get a grip on [target_movable] because [potential_rider.p_their()] hands are full!"),
span_warning("You can't get a grip on [target_movable] because your hands are full!"))
return COMPONENT_BLOCK_BUCKLE
/*
if((ride_check_flags & RIDER_NEEDS_LEGS) && HAS_TRAIT(potential_rider, TRAIT_FLOORED))
potential_rider.visible_message("<span class='warning'>[potential_rider] can't get [potential_rider.p_their()] footing on [target_movable]!</span>",
"<span class='warning'>You can't get your footing on [target_movable]!</span>")
potential_rider.visible_message(span_warning("[potential_rider] can't get [potential_rider.p_their()] footing on [target_movable]!"),
span_warning("You can't get your footing on [target_movable]!"))
return COMPONENT_BLOCK_BUCKLE
*/

Expand All @@ -53,8 +53,8 @@
// need to see if !equip_buckle_inhands() checks are enough to skip any needed incapac/restrain checks
// CARRIER_NEEDS_ARM shouldn't apply if the ridden isn't even a living mob
if(hands_needed && !equip_buckle_inhands(target_living, hands_needed, target_living, potential_rider))
target_living.visible_message("<span class='warning'>[target_living] can't get a grip on [potential_rider] because [target_living.p_their()] hands are full!</span>",
"<span class='warning'>You can't get a grip on [potential_rider] because your hands are full!</span>")
target_living.visible_message(span_warning("[target_living] can't get a grip on [potential_rider] because [target_living.p_their()] hands are full!"),
span_warning("You can't get a grip on [potential_rider] because your hands are full!"))
return COMPONENT_BLOCK_BUCKLE

target_living.AddComponent(riding_component_type, potential_rider, force, check_loc, lying_buckle, hands_needed, target_hands_needed, silent)
Expand Down
18 changes: 9 additions & 9 deletions code/datums/elements/strippable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
if(isliving(user))
var/mob/living/L = user
if(CHECK_BITFIELD(L.status_flags, INCORPOREAL)) // Mobs that can walk through walls cannot grasp items to strip
to_chat(user, "<span class='warning'>You can't interact with the physical plane while you are incorporeal!</span>")
to_chat(user, span_warning("You can't interact with the physical plane while you are incorporeal!"))
return FALSE
return TRUE
else
Expand All @@ -91,7 +91,7 @@
if(!equipping)
return
if(HAS_TRAIT(equipping, TRAIT_NODROP))
to_chat(user, "<span class='warning'>You can't put [equipping] on [source], it's stuck to your hand!</span>")
to_chat(user, span_warning("You can't put [equipping] on [source], it's stuck to your hand!"))
return FALSE
//This is important due to the fact otherwise it will be equipped without a proper existing icon, because it's forced on through the strip menu
//if(ismonkey(source)) //Todo delete this if monkeys arent strippable
Expand All @@ -103,12 +103,12 @@
/datum/strippable_item/proc/start_equip(atom/source, obj/item/equipping, mob/user)
if(isclothing(source))
source.visible_message(
"<span class='notice'>[user] tries to put [equipping] on [source].</span>",
"<span class='notice'>[user] tries to put [equipping] on you.</span>",
span_notice("[user] tries to put [equipping] on [source]."),
span_notice("[user] tries to put [equipping] on you."),
ignored_mob = user
)

to_chat(user, "<span class='notice'>You try to put [equipping] on [source]...</span>")
to_chat(user, span_notice("You try to put [equipping] on [source]..."))

var/log = "[key_name(source)] is having [equipping] put on them by [key_name(user)]"
source.log_message(log, LOG_ATTACK, color="red")
Expand Down Expand Up @@ -149,12 +149,12 @@
return FALSE

source.visible_message(
"<span class='warning'>[user] tries to remove [source]'s [item.name].</span>",
"<span class='userdanger'>[user] tries to remove your [item.name].</span>",
span_warning("[user] tries to remove [source]'s [item.name]."),
span_userdanger("[user] tries to remove your [item.name]."),
ignored_mob = user,
)

to_chat(user, "<span class='danger'>You try to remove [source]'s [item.name]...</span>")
to_chat(user, span_danger("You try to remove [source]'s [item.name]..."))
source.log_message("[key_name(source)] is being stripped of [item.name] by [key_name(user)]", LOG_ATTACK, color="red")
user.log_message("[key_name(source)] is being stripped of [item.name] by [key_name(user)]", LOG_ATTACK, color="red", log_globally=FALSE)
item.add_fingerprint(user, "stripping")
Expand Down Expand Up @@ -208,7 +208,7 @@
return FALSE

if(!equipping.mob_can_equip(source, item_slot, warning = TRUE, override_nodrop = FALSE, bitslot = TRUE))
to_chat(user, "<span class='warning'>\The [equipping] doesn't fit in that place!</span>")
to_chat(user, span_warning("\The [equipping] doesn't fit in that place!"))
return FALSE

return TRUE
Expand Down
11 changes: 5 additions & 6 deletions code/datums/gamemodes/_game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -573,27 +573,26 @@ GLOBAL_LIST_INIT(bioscan_locations, list(
if(!isnewplayer(NP))
return FALSE
if(!NP.IsJobAvailable(job, TRUE))
to_chat(usr, "<span class='warning'>Selected job is not available.<spawn>")
to_chat(usr, span_warning("Selected job is not available."))
return FALSE
if(!SSticker || SSticker.current_state != GAME_STATE_PLAYING)
to_chat(usr, "<span class='warning'>The round is either not ready, or has already finished!<spawn>")
to_chat(usr, span_warning("The round is either not ready, or has already finished!"))
return FALSE
if(!GLOB.enter_allowed || (!GLOB.xeno_enter_allowed && istype(job, /datum/job/xenomorph)))
to_chat(usr, "<span class='warning'>Spawning currently disabled, please observe.<spawn>")
to_chat(usr, span_warning("Spawning currently disabled, please observe."))
return FALSE
if(!NP.client.prefs.random_name)
var/name_to_check = NP.client.prefs.real_name
if(job.job_flags & JOB_FLAG_SPECIALNAME)
name_to_check = job.get_special_name(NP.client)
if(CONFIG_GET(flag/prevent_dupe_names) && GLOB.real_names_joined.Find(name_to_check))
to_chat(usr, "<span class='warning'>Someone has already joined the round with this character name. Please pick another.<spawn>")
to_chat(usr, span_warning("Someone has already joined the round with this character name. Please pick another."))
return FALSE
if(!SSjob.AssignRole(NP, job, TRUE))
to_chat(usr, "<span class='warning'>Failed to assign selected role.<spawn>")
to_chat(usr, span_warning("Failed to assign selected role."))
return FALSE
return TRUE


/datum/game_mode/proc/LateSpawn(mob/new_player/player)
player.close_spawn_windows()
player.spawning = TRUE
Expand Down
10 changes: 5 additions & 5 deletions code/datums/gamemodes/campaign.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

var/respawn_delay = CAMPAIGN_RESPAWN_TIME + stat_list[respawnee.faction]?.respawn_delay_modifier
if((player_death_times[respawnee.key] + respawn_delay) > world.time)
to_chat(respawnee, "<span class='warning'>Respawn timer has [round((player_death_times[respawnee.key] + respawn_delay - world.time) / 10)] seconds remaining.<spawn>")
to_chat(respawnee, span_warning("Respawn timer has [round((player_death_times[respawnee.key] + respawn_delay - world.time) / 10)] seconds remaining."))
return

attempt_attrition_respawn(respawnee)
Expand Down Expand Up @@ -226,16 +226,16 @@
///Actually respawns the player, if still able
/datum/game_mode/hvh/campaign/proc/attrition_respawn(mob/new_player/ready_candidate, datum/job/job_datum)
if(!ready_candidate.IsJobAvailable(job_datum, TRUE))
to_chat(usr, "<span class='warning'>Selected job is not available.<spawn>")
to_chat(usr, span_warning("Selected job is not available."))
return
if(!SSticker || SSticker.current_state != GAME_STATE_PLAYING)
to_chat(usr, "<span class='warning'>The round is either not ready, or has already finished!<spawn>")
to_chat(usr, span_warning("The round is either not ready, or has already finished!"))
return
if(!GLOB.enter_allowed)
to_chat(usr, "<span class='warning'>Spawning currently disabled, please observe.<spawn>")
to_chat(usr, span_warning("Spawning currently disabled, please observe."))
return
if(!SSjob.AssignRole(ready_candidate, job_datum, TRUE))
to_chat(usr, "<span class='warning'>Failed to assign selected role.<spawn>")
to_chat(usr, span_warning("Failed to assign selected role."))
return

if(current_mission.mission_state == MISSION_STATE_ACTIVE)
Expand Down
Loading
Loading