refactors most spans

This commit is contained in:
Kashargul
2024-10-02 21:10:31 +02:00
parent 5417c7772c
commit a2c673ab7a
1517 changed files with 12436 additions and 12347 deletions
@@ -56,11 +56,11 @@
else if(LAZYLEN(V.restricted_waypoints))
target = V.restricted_waypoints[1]
else
to_chat(C, "<span class='warning'>Unable to jump to [V].</span>")
to_chat(C, span_warning("Unable to jump to [V]."))
return
var/turf/T = get_turf(target)
if(!istype(T))
to_chat(C, "<span class='warning'>Unable to jump to [V].</span>")
to_chat(C, span_warning("Unable to jump to [V]."))
return
C.jumptoturf(T)
return TRUE
@@ -77,7 +77,7 @@
var/list/possible_d = shuttle.get_possible_destinations()
var/D
if(!LAZYLEN(possible_d))
to_chat(usr, "<span class='warning'>There are no possible destinations for [shuttle] ([shuttle.type])</span>")
to_chat(usr, span_warning("There are no possible destinations for [shuttle] ([shuttle.type])"))
return FALSE
D = tgui_input_list(usr, "Choose shuttle destination", "Shuttle Destination", possible_d)
if(D)
@@ -88,9 +88,9 @@
if(tgui_alert(usr, "Are you sure you want to launch [shuttle]?", "Launching Shuttle", list("Yes", "No")) == "Yes")
shuttle.launch(src)
else
to_chat(usr, "<span class='notice'>The shuttle control panel isn't quite sure how to move [S] ([S?.type]).</span>")
to_chat(usr, span_notice("The shuttle control panel isn't quite sure how to move [S] ([S?.type])."))
return FALSE
to_chat(usr, "<span class='notice'>Launching shuttle [S].</span>")
to_chat(usr, span_notice("Launching shuttle [S]."))
return TRUE
if("overmap_control")
var/obj/effect/overmap/visitable/ship/V = locate(params["ref"])
+12 -12
View File
@@ -43,7 +43,7 @@
switch(action)
if("electronic_warfare")
S.electronic_warfare = !S.electronic_warfare
to_chat(usr, "<span class='notice'>Electronic warfare [S.electronic_warfare ? "enabled" : "disabled"].</span>")
to_chat(usr, span_notice("Electronic warfare [S.electronic_warfare ? "enabled" : "disabled"]."))
. = TRUE
if("age")
var/new_age = tgui_input_number(usr,"What age would you like to put on this card?","Agent Card Age", S.age)
@@ -52,7 +52,7 @@
S.age = initial(S.age)
else
S.age = new_age
to_chat(usr, "<span class='notice'>Age has been set to '[S.age]'.</span>")
to_chat(usr, span_notice("Age has been set to '[S.age]'."))
. = TRUE
if("appearance")
var/datum/card_state/choice = tgui_input_list(usr, "Select the appearance for this card.", "Agent Card Appearance", id_card_states())
@@ -61,13 +61,13 @@
S.item_state = choice.item_state
S.sprite_stack = choice.sprite_stack
S.update_icon()
to_chat(usr, "<span class='notice'>Appearance changed to [choice].</span>")
to_chat(usr, span_notice("Appearance changed to [choice]."))
. = TRUE
if("assignment")
var/new_job = sanitize(tgui_input_text(usr,"What assignment would you like to put on this card?\nChanging assignment will not grant or remove any access levels.","Agent Card Assignment", S.assignment))
if(!isnull(new_job) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.assignment = new_job
to_chat(usr, "<span class='notice'>Occupation changed to '[new_job]'.</span>")
to_chat(usr, span_notice("Occupation changed to '[new_job]'."))
S.update_name()
. = TRUE
if("bloodtype")
@@ -79,7 +79,7 @@
var/new_blood_type = sanitize(tgui_input_text(usr,"What blood type would you like to be written on this card?","Agent Card Blood Type",default))
if(!isnull(new_blood_type) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.blood_type = new_blood_type
to_chat(usr, "<span class='notice'>Blood type changed to '[new_blood_type]'.</span>")
to_chat(usr, span_notice("Blood type changed to '[new_blood_type]'."))
. = TRUE
if("dnahash")
var/default = S.dna_hash
@@ -90,7 +90,7 @@
var/new_dna_hash = sanitize(tgui_input_text(usr,"What DNA hash would you like to be written on this card?","Agent Card DNA Hash",default))
if(!isnull(new_dna_hash) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.dna_hash = new_dna_hash
to_chat(usr, "<span class='notice'>DNA hash changed to '[new_dna_hash]'.</span>")
to_chat(usr, span_notice("DNA hash changed to '[new_dna_hash]'."))
. = TRUE
if("fingerprinthash")
var/default = S.fingerprint_hash
@@ -101,30 +101,30 @@
var/new_fingerprint_hash = sanitize(tgui_input_text(usr,"What fingerprint hash would you like to be written on this card?","Agent Card Fingerprint Hash",default))
if(!isnull(new_fingerprint_hash) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.fingerprint_hash = new_fingerprint_hash
to_chat(usr, "<span class='notice'>Fingerprint hash changed to '[new_fingerprint_hash]'.</span>")
to_chat(usr, span_notice("Fingerprint hash changed to '[new_fingerprint_hash]'."))
. = TRUE
if("name")
var/new_name = sanitizeName(tgui_input_text(usr,"What name would you like to put on this card?","Agent Card Name", S.registered_name))
if(!isnull(new_name) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.registered_name = new_name
S.update_name()
to_chat(usr, "<span class='notice'>Name changed to '[new_name]'.</span>")
to_chat(usr, span_notice("Name changed to '[new_name]'."))
. = TRUE
if("photo")
S.set_id_photo(usr)
to_chat(usr, "<span class='notice'>Photo changed.</span>")
to_chat(usr, span_notice("Photo changed."))
. = TRUE
if("sex")
var/new_sex = sanitize(tgui_input_text(usr,"What sex would you like to put on this card?","Agent Card Sex", S.sex))
if(!isnull(new_sex) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.sex = new_sex
to_chat(usr, "<span class='notice'>Sex changed to '[new_sex]'.</span>")
to_chat(usr, span_notice("Sex changed to '[new_sex]'."))
. = TRUE
if("species")
var/new_species = sanitize(tgui_input_text(usr,"What species would you like to put on this card?","Agent Card Species", S.species))
if(!isnull(new_species) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.species = new_species
to_chat(usr, "<span class='notice'>Species changed to '[new_species]'.</span>")
to_chat(usr, span_notice("Species changed to '[new_species]'."))
. = TRUE
if("factoryreset")
if(tgui_alert(usr, "This will factory reset the card, including access and owner. Continue?", "Factory Reset", list("No", "Yes")) == "Yes" && tgui_status(usr, state) == STATUS_INTERACTIVE)
@@ -145,5 +145,5 @@
S.sex = initial(S.sex)
S.species = initial(S.species)
S.update_icon()
to_chat(usr, "<span class='notice'>All information has been deleted from \the [src].</span>")
to_chat(usr, span_notice("All information has been deleted from \the [src]."))
. = TRUE
@@ -26,23 +26,23 @@
switch(flag)
if(APPEARANCECHANGER_CHANGED_RACE)
to_chat(M, "<span class='notice'>You lose sensation of your body, feeling only the warmth of everything around you... </span>")
to_chat(O, "<span class='notice'>Your body shifts as you make dramatic changes to your captive's body.</span>")
to_chat(M, span_notice("You lose sensation of your body, feeling only the warmth of everything around you... "))
to_chat(O, span_notice("Your body shifts as you make dramatic changes to your captive's body."))
if(APPEARANCECHANGER_CHANGED_GENDER)
to_chat(M, "<span class='notice'>Your body feels very strange...</span>")
to_chat(O, "<span class='notice'>You feel strange as you alter your captive's gender.</span>")
to_chat(M, span_notice("Your body feels very strange..."))
to_chat(O, span_notice("You feel strange as you alter your captive's gender."))
if(APPEARANCECHANGER_CHANGED_GENDER_ID)
to_chat(M, "<span class='notice'>You start to feel... [capitalize(M.gender)]?</span>")
to_chat(O, "<span class='notice'>You feel strange as you alter your captive's gender identity.</span>")
to_chat(M, span_notice("You start to feel... [capitalize(M.gender)]?"))
to_chat(O, span_notice("You feel strange as you alter your captive's gender identity."))
if(APPEARANCECHANGER_CHANGED_SKINTONE, APPEARANCECHANGER_CHANGED_SKINCOLOR)
to_chat(M, "<span class='notice'>Your body tingles all over...</span>")
to_chat(O, "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>")
to_chat(M, span_notice("Your body tingles all over..."))
to_chat(O, span_notice("You tingle as you make noticeable changes to your captive's body."))
if(APPEARANCECHANGER_CHANGED_HAIRSTYLE, APPEARANCECHANGER_CHANGED_HAIRCOLOR, APPEARANCECHANGER_CHANGED_F_HAIRSTYLE, APPEARANCECHANGER_CHANGED_F_HAIRCOLOR)
to_chat(M, "<span class='notice'>Your body tingles all over...</span>")
to_chat(O, "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>")
to_chat(M, span_notice("Your body tingles all over..."))
to_chat(O, span_notice("You tingle as you make noticeable changes to your captive's body."))
if(APPEARANCECHANGER_CHANGED_EYES)
to_chat(M, "<span class='notice'>You feel lightheaded and drowsy...</span>")
to_chat(O, "<span class='notice'>You feel warm as you make subtle changes to your captive's body.</span>")
to_chat(M, span_notice("You feel lightheaded and drowsy..."))
to_chat(O, span_notice("You feel warm as you make subtle changes to your captive's body."))
// Cocoon Stuff
/datum/tgui_module/appearance_changer/cocoon
@@ -54,4 +54,4 @@
//if(!istype(owner.loc, /obj/item/storage/vore_egg/bugcocoon))
if(!owner.transforming)
return STATUS_CLOSE
return ..()
return ..()
+15 -15
View File
@@ -45,7 +45,7 @@
/datum/tgui_module/communications/tgui_interact(mob/user, datum/tgui/ui)
if(using_map && !(get_z(user) in using_map.contact_levels))
to_chat(user, "<span class='danger'>Unable to establish a connection: You're too far away from the station!</span>")
to_chat(user, span_danger("Unable to establish a connection: You're too far away from the station!"))
return FALSE
. = ..()
@@ -60,7 +60,7 @@
return COMM_AUTHENTICATION_MIN
else
if(message)
to_chat(user, "<span class='warning'>Access denied.</span>")
to_chat(user, span_warning("Access denied."))
return COMM_AUTHENTICATION_NONE
/datum/tgui_module/communications/proc/change_security_level(new_level)
@@ -201,13 +201,13 @@
if(..())
return TRUE
if(using_map && !(get_z(usr) in using_map.contact_levels))
to_chat(usr, "<span class='danger'>Unable to establish a connection: You're too far away from the station!</span>")
to_chat(usr, span_danger("Unable to establish a connection: You're too far away from the station!"))
return FALSE
. = TRUE
if(action == "auth")
if(!ishuman(usr))
to_chat(usr, "<span class='warning'>Access denied.</span>")
to_chat(usr, span_warning("Access denied."))
return FALSE
// Logout function.
if(authenticated != COMM_AUTHENTICATION_NONE)
@@ -225,7 +225,7 @@
if(istype(id))
crew_announcement.announcer = GetNameAndAssignmentFromId(id)
if(authenticated == COMM_AUTHENTICATION_NONE)
to_chat(usr, "<span class='warning'>You need to wear your ID.</span>")
to_chat(usr, span_warning("You need to wear your ID."))
// All functions below this point require authentication.
if(!is_authenticated(usr))
@@ -238,7 +238,7 @@
if("newalertlevel")
if(isAI(usr) || isrobot(usr))
to_chat(usr, "<span class='warning'>Firewalls prevent you from changing the alert level.</span>")
to_chat(usr, span_warning("Firewalls prevent you from changing the alert level."))
return
else if(isobserver(usr))
var/mob/observer/dead/D = usr
@@ -246,25 +246,25 @@
change_security_level(text2num(params["level"]))
return TRUE
else if(!ishuman(usr))
to_chat(usr, "<span class='warning'>Security measures prevent you from changing the alert level.</span>")
to_chat(usr, span_warning("Security measures prevent you from changing the alert level."))
return
if(is_authenticated(usr))
change_security_level(text2num(params["level"]))
else
to_chat(usr, "<span class='warning'>You are not authorized to do this.</span>")
to_chat(usr, span_warning("You are not authorized to do this."))
setMenuState(usr, COMM_SCREEN_MAIN)
if("announce")
if(is_authenticated(usr) == COMM_AUTHENTICATION_MAX)
if(message_cooldown > world.time)
to_chat(usr, "<span class='warning'>Please allow at least one minute to pass between announcements.</span>")
to_chat(usr, span_warning("Please allow at least one minute to pass between announcements."))
return
var/input = tgui_input_text(usr, "Please write a message to announce to the station crew.", "Priority Announcement", multiline = TRUE, prevent_enter = TRUE)
if(!input || message_cooldown > world.time || ..() || !(is_authenticated(usr) == COMM_AUTHENTICATION_MAX))
return
if(length(input) < COMM_MSGLEN_MINIMUM)
to_chat(usr, "<span class='warning'>Message '[input]' is too short. [COMM_MSGLEN_MINIMUM] character minimum.</span>")
to_chat(usr, span_warning("Message '[input]' is too short. [COMM_MSGLEN_MINIMUM] character minimum."))
return
crew_announcement.Announce(input)
message_cooldown = world.time + 600 //One minute
@@ -280,7 +280,7 @@
if("cancelshuttle")
if(isAI(usr) || isrobot(usr))
to_chat(usr, "<span class='warning'>Firewalls prevent you from recalling the shuttle.</span>")
to_chat(usr, span_warning("Firewalls prevent you from recalling the shuttle."))
return
var/response = tgui_alert(usr, "Are you sure you wish to recall the shuttle?", "Confirm", list("Yes", "No"))
if(response == "Yes")
@@ -335,7 +335,7 @@
if("MessageCentCom")
if(is_authenticated(usr) == COMM_AUTHENTICATION_MAX)
if(centcomm_message_cooldown > world.time)
to_chat(usr, "<span class='warning'>Arrays recycling. Please stand by.</span>")
to_chat(usr, span_warning("Arrays recycling. Please stand by."))
return
var/input = sanitize(tgui_input_text(usr, "Please choose a message to transmit to [using_map.boss_short] via quantum entanglement. \
Please be aware that this process is very expensive, and abuse will lead to... termination. \
@@ -344,7 +344,7 @@
if(!input || ..() || !(is_authenticated(usr) == COMM_AUTHENTICATION_MAX))
return
if(length(input) < COMM_CCMSGLEN_MINIMUM)
to_chat(usr, "<span class='warning'>Message '[input]' is too short. [COMM_CCMSGLEN_MINIMUM] character minimum.</span>")
to_chat(usr, span_warning("Message '[input]' is too short. [COMM_CCMSGLEN_MINIMUM] character minimum."))
return
CentCom_announce(input, usr)
to_chat(usr, span_blue("Message transmitted."))
@@ -362,7 +362,7 @@
if(!input || ..() || !(is_authenticated(usr) == COMM_AUTHENTICATION_MAX))
return
if(length(input) < COMM_CCMSGLEN_MINIMUM)
to_chat(usr, "<span class='warning'>Message '[input]' is too short. [COMM_CCMSGLEN_MINIMUM] character minimum.</span>")
to_chat(usr, span_warning("Message '[input]' is too short. [COMM_CCMSGLEN_MINIMUM] character minimum."))
return
Syndicate_announce(input, usr)
to_chat(usr, span_blue("Message transmitted."))
@@ -387,7 +387,7 @@
return
if(!universe.OnShuttleCall(usr))
to_chat(user, "<span class='notice'>Cannot establish a bluespace connection.</span>")
to_chat(user, span_notice("Cannot establish a bluespace connection."))
return
if(deathsquad.deployed)
+2 -2
View File
@@ -16,7 +16,7 @@
var/turf/T = get_turf(usr)
if(!T || !(T.z in using_map.player_levels))
to_chat(usr, "<span class='warning'><b>Unable to establish a connection</b>: You're too far away from the station!</span>")
to_chat(usr, span_warning("<b>Unable to establish a connection</b>: You're too far away from the station!"))
return FALSE
switch(action)
@@ -36,7 +36,7 @@
var/list/map_levels = using_map.get_map_levels(z, TRUE, om_range = DEFAULT_OVERMAP_RANGE)
if(!map_levels.len)
to_chat(user, "<span class='warning'>The crew monitor doesn't seem like it'll work here.</span>")
to_chat(user, span_warning("The crew monitor doesn't seem like it'll work here."))
if(ui)
ui.close()
return null
+3 -3
View File
@@ -130,15 +130,15 @@
return TRUE
if("notify_laws")
to_chat(owner, "<span class='danger'>Law Notice</span>")
to_chat(owner, span_danger("Law Notice"))
owner.laws.show_laws(owner)
if(isAI(owner))
var/mob/living/silicon/ai/AI = owner
for(var/mob/living/silicon/robot/R in AI.connected_robots)
to_chat(R, "<span class='danger'>Law Notice</span>")
to_chat(R, span_danger("Law Notice"))
R.laws.show_laws(R)
if(usr != owner)
to_chat(usr, "<span class='notice'>Laws displayed.</span>")
to_chat(usr, span_notice("Laws displayed."))
return TRUE
/datum/tgui_module/law_manager/tgui_interact(mob/user, datum/tgui/ui)
@@ -148,7 +148,7 @@
contents += " [get_access_desc(A)]"
if(!computer.nano_printer.print_text(contents,"access report"))
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
to_chat(usr, span_notice("Hardware error: Printer was unable to print the file. It may be out of paper."))
return
else
computer.visible_message("<b>\The [computer]</b> prints out paper.")
@@ -158,7 +158,7 @@
[data_core ? data_core.get_manifest(0) : ""]
"}
if(!computer.nano_printer.print_text(contents,text("crew manifest ([])", stationtime2text())))
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
to_chat(usr, span_notice("Hardware error: Printer was unable to print the file. It may be out of paper."))
return
else
computer.visible_message("<b>\The [computer]</b> prints out paper.")
@@ -181,7 +181,7 @@
if(temp_name)
id_card.registered_name = temp_name
else
computer.visible_message("<span class='notice'>[computer] buzzes rudely.</span>")
computer.visible_message(span_notice("[computer] buzzes rudely."))
. = TRUE
if("account")
if(computer && program.can_run(usr, 1))
@@ -208,7 +208,7 @@
jobdatum = J
break
if(!jobdatum)
to_chat(usr, "<span class='warning'>No log exists for this job: [t1]</span>")
to_chat(usr, span_warning("No log exists for this job: [t1]"))
return
access = jobdatum.get_access()
+5 -5
View File
@@ -45,11 +45,11 @@
if("switch_uav")
var/obj/item/uav/U = locate(params["switch_uav"]) //This is a \ref to the UAV itself
if(!istype(U))
to_chat(usr,"<span class='warning'>Something is blocking the connection to that UAV. In-person investigation is required.</span>")
to_chat(usr,span_warning("Something is blocking the connection to that UAV. In-person investigation is required."))
return FALSE
if(!get_signal_to(U))
to_chat(usr,"<span class='warning'>The screen freezes for a moment, before returning to the UAV selection menu. It's not able to connect to that UAV.</span>")
to_chat(usr,span_warning("The screen freezes for a moment, before returning to the UAV selection menu. It's not able to connect to that UAV."))
return FALSE
set_current(U)
@@ -71,7 +71,7 @@
return FALSE
if(current_uav.check_eye(usr) < 0)
to_chat(usr,"<span class='warning'>The screen freezes for a moment, before returning to the UAV selection menu. It's not able to connect to that UAV.</span>")
to_chat(usr,span_warning("The screen freezes for a moment, before returning to the UAV selection menu. It's not able to connect to that UAV."))
else
viewing_uav(usr) ? unlook(usr) : look(usr)
return TRUE
@@ -114,7 +114,7 @@
for(var/datum/weakref/W in viewers)
var/M = W.resolve()
if(M)
to_chat(M, "<span class='warning'>You're disconnected from the UAV's camera!</span>")
to_chat(M, span_warning("You're disconnected from the UAV's camera!"))
unlook(M)
/datum/tgui_module/uav/proc/current_uav_changed_z(old_z, new_z)
@@ -195,7 +195,7 @@
/datum/tgui_module/uav/proc/look(mob/user)
if(issilicon(user)) //Too complicated for me to want to mess with at the moment
to_chat(user, "<span class='warning'>Regulations prevent you from controlling several corporeal forms at the same time!</span>")
to_chat(user, span_warning("Regulations prevent you from controlling several corporeal forms at the same time!"))
return
if(!current_uav)
+2 -2
View File
@@ -90,7 +90,7 @@
// NTOS Path
if(!sync_linked())
to_chat(user, "<span class='warning'>You don't appear to be on a spaceship...</span>")
to_chat(user, span_warning("You don't appear to be on a spaceship..."))
if(ui)
ui.close(can_be_suspended = FALSE)
if(ntos)
@@ -314,7 +314,7 @@
sec_name = "Sector #[known_sectors.len]"
R.fields["name"] = sec_name
if(sec_name in known_sectors)
to_chat(usr, "<span class='warning'>Sector with that name already exists, please input a different name.</span>")
to_chat(usr, span_warning("Sector with that name already exists, please input a different name."))
return TRUE
switch(params["add"])
if("current")