Spans to procs (#9495)

This commit is contained in:
Tom
2021-11-16 23:29:43 +00:00
committed by GitHub
parent bca78f3cf9
commit 21f894e9b8
183 changed files with 1004 additions and 995 deletions
@@ -108,18 +108,18 @@ component_cell_out_of_charge/component_cell_removed proc using loc where necessa
if(!inserted_cell)
if(user)
to_chat(user, "<span class='danger'>There is no cell inside [equipment]</span>")
to_chat(user, span_danger("There is no cell inside [equipment]"))
return COMPONENT_NO_CELL
if(check_only && inserted_cell.charge < use_amount)
if(user)
to_chat(user, "<span class='danger'>The cell inside [equipment] does not have enough charge to perform this action!</span>")
to_chat(user, span_danger("The cell inside [equipment] does not have enough charge to perform this action!"))
return COMPONENT_NO_CHARGE
if(!inserted_cell.use(use_amount))
inserted_cell.update_appearance() //Updates the attached cell sprite - Why does this not happen in cell.use?
if(user)
to_chat(user, "<span class='danger'>The cell inside [equipment] does not have enough charge to perform this action!</span>")
to_chat(user, span_danger("The cell inside [equipment] does not have enough charge to perform this action!"))
return COMPONENT_NO_CHARGE
inserted_cell.update_appearance()
@@ -130,12 +130,12 @@ component_cell_out_of_charge/component_cell_removed proc using loc where necessa
SIGNAL_HANDLER
if(!inserted_cell)
examine_list += "<span class='danger'>It does not have a cell inserted!</span>"
examine_list += span_danger("It does not have a cell inserted!")
else if(!inside_robot)
examine_list += "<span class='notice'>It has [inserted_cell] inserted. It has <b>[inserted_cell.percent()]%</b> charge left. \
Ctrl+Shift+Click to remove the [inserted_cell]."
examine_list += span_notice("It has [inserted_cell] inserted. It has <b>[inserted_cell.percent()]%</b> charge left. \
Ctrl+Shift+Click to remove the [inserted_cell].")
else
examine_list += "<span class='notice'>It is drawing power from an external powersource, reading <b>[inserted_cell.percent()]%</b> charge.</span>"
examine_list += span_notice("It is drawing power from an external powersource, reading <b>[inserted_cell.percent()]%</b> charge.")
/// Handling of cell removal.
/datum/component/cell/proc/remove_cell(datum/source, mob/user)
@@ -153,7 +153,7 @@ component_cell_out_of_charge/component_cell_removed proc using loc where necessa
return
if(inserted_cell)
to_chat(user, "<span class='notice'>You remove [inserted_cell] from [equipment]!</span>")
to_chat(user, span_notice("You remove [inserted_cell] from [equipment]!"))
playsound(equipment, 'sound/weapons/magout.ogg', 40, TRUE)
inserted_cell.forceMove(get_turf(equipment))
INVOKE_ASYNC(user, /mob/living.proc/put_in_hands, inserted_cell)
@@ -162,7 +162,7 @@ component_cell_out_of_charge/component_cell_removed proc using loc where necessa
on_cell_removed.Invoke()
handle_cell_overlays(TRUE)
else
to_chat(user, "<span class='danger'>There is no cell inserted in [equipment]!</span>")
to_chat(user, span_danger("There is no cell inserted in [equipment]!"))
/// Handling of cell insertion.
/datum/component/cell/proc/insert_cell(datum/source, obj/item/inserting_item, mob/living/user, params)
@@ -177,10 +177,10 @@ component_cell_out_of_charge/component_cell_removed proc using loc where necessa
return
if(inserted_cell) //No quickswap compatibility
to_chat(user, "<span class='danger'>There is already a cell inserted in [equipment]!</span>")
to_chat(user, span_danger("There is already a cell inserted in [equipment]!"))
return
to_chat(user, "<span class='notice'>You insert [inserting_item] into [equipment]!</span>")
to_chat(user, span_notice("You insert [inserting_item] into [equipment]!"))
playsound(equipment, 'sound/weapons/magin.ogg', 40, TRUE)
inserted_cell = inserting_item
inserting_item.forceMove(parent)
@@ -29,7 +29,7 @@
/obj/item/flashlight/examine(mob/user)
. = ..()
if(has_modes)
. += "<span class='notice'>This flashlight has modes! Ctrl+click it to change the mode.</span>"
. += span_notice("This flashlight has modes! Ctrl+click it to change the mode.")
/obj/item/flashlight/CtrlClick(mob/user)
. = ..()
@@ -41,21 +41,21 @@
light_power = initial(light_power)
set_light_on(on)
flashlight_mode = 1
to_chat(user, "<span class='notice'>You set [src] to low.</span>")
to_chat(user, span_notice("You set [src] to low."))
if(1)
power_use_amount = POWER_CELL_USE_VERY_LOW
light_range = initial(light_range) + 2
light_power = initial(light_power) + 1
set_light_on(on)
flashlight_mode = 2
to_chat(user, "<span class='notice'>You set [src] to medium.</span>")
to_chat(user, span_notice("You set [src] to medium."))
if(2)
power_use_amount = POWER_CELL_USE_LOW
light_range = initial(light_range) + 4
light_power = initial(light_power) + 2
set_light_on(on)
flashlight_mode = 0
to_chat(user, "<span class='notice'>You set [src] to high.</span>")
to_chat(user, span_notice("You set [src] to high."))
/obj/item/flashlight/attack_self(mob/user)
. = ..()