Changes all cases of update_icons(), updateicon(), UpdateIcon() etc. to update_icon(). (#9432)

update_icons(), UpdateIcon() and updateicon() are now changed to be update_icon().

Many interactions expect a target to have an update_icon(), so they should all be the same.

Also fixed some stuff that was using relative pathing, along the way.
This commit is contained in:
mikomyazaki
2020-07-26 12:28:36 +03:00
committed by GitHub
parent 9a6168e10a
commit 3f2a515a8b
64 changed files with 677 additions and 701 deletions
+1 -1
View File
@@ -647,7 +647,7 @@
//strip their stuff and stick it in the crate
for(var/obj/item/I in M)
M.drop_from_inventory(I, locker)
M.update_icons()
M.update_icon()
//so they black out before warping
M.Paralyse(5)
+1 -1
View File
@@ -462,7 +462,7 @@ datum/preferences
character.update_body(0)
character.update_hair(0)
character.update_underwear(0)
character.update_icons()
character.update_icon()
/datum/preferences/proc/open_load_dialog_sql(mob/user)
var/dat = "<tt><center>"
+1 -1
View File
@@ -233,7 +233,7 @@
var/mob/M = obj.loc
if(ismob(M))
M.remove_from_mob(obj)
M.update_icons() //so their overlays update
M.update_icon() //so their overlays update
if(!silent)
var/obj/oldobj = obj
@@ -191,7 +191,7 @@
var/mob/living/simple_animal/bee/B = new(pick(spawn_turfs), src)
B.feral = angry
B.strength = swarmsize
B.update_icons()
B.update_icon()
bees_to_release -= swarmsize
//what's left over
@@ -199,7 +199,7 @@
B.strength = bees_to_release
B.icon_state = "bees[B.strength]"
B.feral = angry
B.update_icons()
B.update_icon()
bees_to_release = 0
/obj/item/beehive_assembly
+3 -3
View File
@@ -83,7 +83,7 @@
qdel(target)
if(!QDELETED(target))
target.update_icons()
target.update_icon()
/obj/item/bee_net/proc/deposit_bees(var/obj/machinery/beehive/newhome, var/mob/user)
if(!newhome.closed)
@@ -118,7 +118,7 @@
B.feral = 5
B.target_mob = M
B.strength = 6
B.update_icons()
B.update_icon()
caught_bees -= 6
//what's left over
@@ -128,7 +128,7 @@
if(feralbees)
B.feral = 5
B.target_mob = M
B.update_icons()
B.update_icon()
caught_bees = 0
feralbees = FALSE
+1 -1
View File
@@ -42,7 +42,7 @@
verbs -= /mob/living/silicon/robot/verb/Namepick
verbs -= /mob/living/silicon/robot/drone/verb/set_mail_tag
updateicon()
update_icon()
density = FALSE
/mob/living/silicon/robot/drone/mining/updatename()
@@ -228,7 +228,7 @@
SSatoms.ForceInitializeContents(mannequin)
mannequin.regenerate_icons()
else
mannequin.update_icons()
mannequin.update_icon()
/datum/preferences/proc/update_preview_icon()
var/mob/living/carbon/human/dummy/mannequin/mannequin = SSmob.get_mannequin(client.ckey)
+1 -1
View File
@@ -100,7 +100,7 @@
living_mob_list -= src
dead_mob_list |= src
updateicon()
update_icon()
if(SSticker.mode)
SSticker.mode.check_win()
+1 -1
View File
@@ -188,7 +188,7 @@ var/list/slot_equipment_priority = list( \
if(!(W && W.loc))
return 1
W.forceMove(target)
update_icons()
update_icon()
return 1
return 0
+3 -3
View File
@@ -27,7 +27,7 @@
/mob/living/bot/Initialize()
. = ..()
update_icons()
update_icon()
botcard = new /obj/item/card/id(src)
botcard.access = botcard_access.Copy()
@@ -191,13 +191,13 @@
return FALSE
on = TRUE
set_light(light_strength)
update_icons()
update_icon()
return TRUE
/mob/living/bot/proc/turn_off()
on = FALSE
set_light(0)
update_icons()
update_icon()
/mob/living/bot/proc/explode()
qdel(src)
+3 -3
View File
@@ -211,7 +211,7 @@ var/list/cleanbot_types // Going to use this to generate a list of types once th
cleaning = TRUE
D.being_cleaned = TRUE
update_icons()
update_icon()
var/clean_time = istype(D, /obj/effect/decal/cleanable/dirt) ? 10 : 50
INVOKE_ASYNC(src, .proc/do_clean, D, clean_time)
@@ -228,7 +228,7 @@ var/list/cleanbot_types // Going to use this to generate a list of types once th
target = null
qdel(D)
cleaning = FALSE
update_icons()
update_icon()
/mob/living/bot/cleanbot/explode()
on = FALSE // the first thing i do when i explode is turn off, tbh - geeves
@@ -242,7 +242,7 @@ var/list/cleanbot_types // Going to use this to generate a list of types once th
qdel(src)
return
/mob/living/bot/cleanbot/update_icons()
/mob/living/bot/cleanbot/update_icon()
if(cleaning)
icon_state = "cleanbot-c"
else
+1 -1
View File
@@ -236,7 +236,7 @@
short_name = short_input
return 1
/mob/living/bot/secbot/ed209/update_icons()
/mob/living/bot/secbot/ed209/update_icon()
if(on && is_attacking)
icon_state = "ed209-c"
else
+9 -9
View File
@@ -122,7 +122,7 @@
attack_hand(usr)
return
/mob/living/bot/farmbot/update_icons()
/mob/living/bot/farmbot/update_icon()
if(on && action)
icon_state = "farmbot_[action]"
else
@@ -194,7 +194,7 @@
return
if(FARMBOT_COLLECT)
action = "collect"
update_icons()
update_icon()
visible_message(SPAN_NOTICE("[src] starts [T.dead? "removing the plant from" : "harvesting"] \the [A]."))
attacking = TRUE
if(do_after(src, 30))
@@ -202,7 +202,7 @@
T.attack_hand(src)
if(FARMBOT_WATER)
action = "water"
update_icons()
update_icon()
visible_message(SPAN_NOTICE("[src] starts watering \the [A]."))
attacking = TRUE
if(do_after(src, 30))
@@ -211,7 +211,7 @@
tank.reagents.trans_to(T, 100 - T.waterlevel)
if(FARMBOT_UPROOT)
action = "hoe"
update_icons()
update_icon()
visible_message(SPAN_NOTICE("[src] starts uprooting the weeds in \the [A]."))
attacking = TRUE
if(do_after(src, 30))
@@ -220,7 +220,7 @@
T.update_icon()
if(FARMBOT_PESTKILL)
action = "hoe"
update_icons()
update_icon()
visible_message(SPAN_NOTICE("[src] starts eliminating the pests in \the [A]."))
attacking = TRUE
if(do_after(src, 30))
@@ -230,7 +230,7 @@
T.update_icon()
if(FARMBOT_NUTRIMENT)
action = "fertile"
update_icons()
update_icon()
visible_message(SPAN_NOTICE("[src] starts fertilizing \the [A]."))
attacking = TRUE
if(do_after(src, 30))
@@ -238,13 +238,13 @@
T.reagents.add_reagent(/datum/reagent/ammonia, 10)
attacking = FALSE
action = ""
update_icons()
update_icon()
T.update_icon()
else if(istype(A, /obj/structure/sink))
if(!tank || tank.reagents.total_volume >= tank.reagents.maximum_volume)
return
action = "water"
update_icons()
update_icon()
visible_message(SPAN_NOTICE("[src] starts refilling its tank from \the [A]."))
attacking = TRUE
while(do_after(src, 10) && tank.reagents.total_volume < tank.reagents.maximum_volume)
@@ -253,7 +253,7 @@
playsound(get_turf(src), 'sound/effects/slosh.ogg', 25, TRUE)
attacking = FALSE
action = ""
update_icons()
update_icon()
visible_message(SPAN_NOTICE("[src] finishes refilling its tank."))
else if(emagged && ishuman(A))
var/action = pick("weed", "water")
+11 -11
View File
@@ -17,7 +17,7 @@
var/turf/target
var/floor_build_type = /decl/flooring/tiling // Basic steel floor.
/mob/living/bot/floorbot/update_icons()
/mob/living/bot/floorbot/update_icon()
if(repairing)
icon_state = "floorbot-c"
else if(amount > 0)
@@ -207,7 +207,7 @@
if(emagged && istype(A, /turf/simulated/floor))
var/turf/simulated/floor/F = A
repairing = 1
update_icons()
update_icon()
if(F.is_plating())
visible_message("<span class='warning'>[src] begins to tear the floor tile from the floor!</span>")
if(do_after(src, 50))
@@ -220,7 +220,7 @@
addTiles(1)
target = null
repairing = 0
update_icons()
update_icon()
else if(istype(A, /turf/space))
var/building = 2
if(locate(/obj/structure/lattice, A))
@@ -228,7 +228,7 @@
if(amount < building)
return
repairing = 1
update_icons()
update_icon()
visible_message("<span class='notice'>[src] begins to repair the hole.</span>")
if(do_after(src, 50))
if(A && (locate(/obj/structure/lattice, A) && building == 1 || !locate(/obj/structure/lattice, A) && building == 2)) // Make sure that it still needs repairs
@@ -240,12 +240,12 @@
A.attackby(I, src)
target = null
repairing = 0
update_icons()
update_icon()
else if(istype(A, /turf/simulated/floor))
var/turf/simulated/floor/F = A
if(!F.flooring && amount)
repairing = 1
update_icons()
update_icon()
visible_message("<span class='notice'>[src] begins to improve the floor.</span>")
if(do_after(src, 50))
if(!F.flooring)
@@ -253,12 +253,12 @@
addTiles(-1)
target = null
repairing = 0
update_icons()
update_icon()
else if(istype(A, /obj/item/stack/tile/floor) && amount < maxAmount)
var/obj/item/stack/tile/floor/T = A
visible_message("<span class='notice'>[src] begins to collect tiles.</span>")
repairing = 1
update_icons()
update_icon()
if(do_after(src, 20))
if(T)
var/eaten = min(maxAmount - amount, T.get_amount())
@@ -266,13 +266,13 @@
addTiles(eaten)
target = null
repairing = 0
update_icons()
update_icon()
else if(istype(A, /obj/item/stack/material) && amount + 4 <= maxAmount)
var/obj/item/stack/material/M = A
if(M.get_material_name() == DEFAULT_WALL_MATERIAL)
visible_message("<span class='notice'>[src] begins to make tiles.</span>")
repairing = 1
update_icons()
update_icon()
if(do_after(50))
if(M)
M.use(1)
@@ -389,7 +389,7 @@
amount = 120 // 1 for tile, 2 for lattice
maxAmount = 120
/mob/living/bot/floorbot/floorbob/update_icons()
/mob/living/bot/floorbot/floorbob/update_icon()
if(repairing)
icon_state = "floorbob-c"
else if(amount > 0)
+4 -4
View File
@@ -105,7 +105,7 @@
var/area/location = get_area(src)
broadcast_medical_hud_message("[src] is treating <b>[H]</b> in <b>[location]</b>", src)
currently_healing = 1
update_icons()
update_icon()
if(do_mob(src, H, 30))
if(t == 1)
reagent_glass.reagents.trans_to_mob(H, injection_amount, CHEM_BLOOD)
@@ -113,9 +113,9 @@
H.reagents.add_reagent(t, injection_amount)
visible_message("<span class='warning'>[src] injects [H] with the syringe!</span>")
currently_healing = 0
update_icons()
update_icon()
/mob/living/bot/medbot/update_icons()
/mob/living/bot/medbot/update_icon()
cut_overlays()
if(skin)
add_overlay("medskin_[skin]")
@@ -243,7 +243,7 @@
currently_healing = 0
emagged = 1
on = 1
update_icons()
update_icon()
. = 1
ignored |= user
+4 -4
View File
@@ -86,7 +86,7 @@
frustration = 0
mode = SECBOT_IDLE
/mob/living/bot/secbot/update_icons()
/mob/living/bot/secbot/update_icon()
if(on && is_attacking)
icon_state = "secbot-c"
else
@@ -291,7 +291,7 @@
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
do_attack_animation(C)
is_attacking = 1
update_icons()
update_icon()
addtimer(CALLBACK(src, .proc/stop_attacking_cb), 2)
visible_message("<span class='warning'>[C] was prodded by [src] with a stun baton!</span>")
else
@@ -309,13 +309,13 @@
do_attack_animation(M)
playsound(loc, "swing_hit", 50, 1, -1)
is_attacking = 1
update_icons()
update_icon()
addtimer(CALLBACK(src, .proc/stop_attacking_cb), 2)
visible_message("<span class='warning'>[M] was beaten by [src] with a stun baton!</span>")
/mob/living/bot/secbot/proc/stop_attacking_cb()
is_attacking = FALSE
update_icons()
update_icon()
/mob/living/bot/secbot/explode()
visible_message("<span class='warning'>[src] blows apart!</span>")
@@ -23,7 +23,7 @@
H.put_in_hands(hat)
H.visible_message(SPAN_WARNING("\The [H] removes \the [src]'s [hat]."))
hat = null
update_icons()
update_icon()
else
return ..()
@@ -320,7 +320,7 @@
ear_deaf = max(ear_deaf-1, 0)
ear_damage = max(ear_damage-0.05, 0)
update_icons()
update_icon()
return TRUE
@@ -334,7 +334,7 @@
return
hat = new_hat
new_hat.forceMove(src)
update_icons()
update_icon()
/mob/living/carbon/alien/diona/MiddleClickOn(var/atom/A)
if(istype(A, /mob/living/carbon/alien/diona))
@@ -1,4 +1,4 @@
/mob/living/carbon/alien/diona/update_icons()
/mob/living/carbon/alien/diona/update_icon()
if(stat == DEAD)
icon_state = "[initial(icon_state)]_dead"
else if(lying || resting || stunned)
+2 -2
View File
@@ -13,7 +13,7 @@
blinded = null
//Status updates, death etc.
update_icons()
update_icon()
/mob/living/carbon/alien/proc/can_progress()
return 1
@@ -86,7 +86,7 @@
else if(eye_blurry)
eye_blurry = max(eye_blurry-1, 0)
update_icons()
update_icon()
return 1
@@ -1,8 +1,8 @@
/mob/living/carbon/alien/regenerate_icons()
overlays = list()
update_icons()
update_icon()
/mob/living/carbon/alien/update_icons()
/mob/living/carbon/alien/update_icon()
var/state = 0
if(amount_grown > max_grown*0.75)
@@ -7,7 +7,7 @@
Calling this a system is perhaps a bit trumped up. It is essentially update_clothing dismantled into its
core parts. The key difference is that when we generate overlays we do not generate either lying or standing
versions. Instead, we generate one set of "raw" (non-overlay-list friendly) overlays which are further processed
by SSoverlays when update_icons() runs. A single entry may be an /icon, an /image, or a /list of the former two.
by SSoverlays when update_icon() runs. A single entry may be an /icon, an /image, or a /list of the former two.
var/overlays_raw[26]
@@ -61,19 +61,19 @@ There are several things that need to be remembered:
...eyes were merged into update_body)
update_targeted() // Updates the target overlay when someone points a gun at you
> All of these procs update overlays_raw, and then call update_icons() by default.
> All of these procs update overlays_raw, and then call update_icon() by default.
If you wish to update several overlays at once, you can set the argument to 0 to disable the update and call
it manually:
e.g.
update_inv_head(0)
update_inv_l_hand(0)
update_inv_r_hand() //<---calls update_icons()
update_inv_r_hand() //<---calls update_icon()
or equivalently:
update_inv_head(0)
update_inv_l_hand(0)
update_inv_r_hand(0)
update_icons()
update_icon()
> If you need to update all overlays you can use regenerate_icons(). it works exactly like update_clothing used to.
@@ -130,7 +130,7 @@ There are several things that need to be remembered:
var/previous_damage_appearance // store what the body last looked like, so we only have to update it if something changed
// Updates overlays from overlays_raw.
/mob/living/carbon/human/update_icons()
/mob/living/carbon/human/update_icon()
if (QDELING(src))
return // No point.
@@ -222,7 +222,7 @@ There are several things that need to be remembered:
overlays_raw[DAMAGE_LAYER] = ovr
if(update_icons)
update_icons()
update_icon()
//Overlays for the worn overlay so you can overlay while you overlay
//eg: ammo counters, primed grenade flashing, etc.
@@ -326,7 +326,7 @@ There are several things that need to be remembered:
update_tail_showing(0)
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/proc/update_underwear(update_icons = TRUE)
overlays_raw[UNDERWEAR_LAYER] = list()
@@ -341,7 +341,7 @@ There are several things that need to be remembered:
overlays_raw[UNDERWEAR_LAYER] += UWI.generate_image(all_underwear_metadata[category])
if(update_icons)
update_icons()
update_icon()
// This proc generates & returns an icon representing a human's hair, using a cached icon from SSicon_cache if possible.
// If `hair_is_visible` is FALSE, only facial hair will be drawn.
@@ -386,12 +386,12 @@ There are several things that need to be remembered:
var/obj/item/organ/external/head/head_organ = get_organ(BP_HEAD)
if(!head_organ || head_organ.is_stump() )
if(update_icons) update_icons()
if(update_icons) update_icon()
return
//masks and helmets can obscure our hair.
if( (head && (head.flags_inv & BLOCKHAIR)) || (wear_mask && (wear_mask.flags_inv & BLOCKHAIR)))
if(update_icons) update_icons()
if(update_icons) update_icon()
return
var/has_visible_hair = h_style && !(head && (head.flags_inv & BLOCKHEADHAIR))
@@ -411,7 +411,7 @@ There are several things that need to be remembered:
overlays_raw[HAIR_LAYER] = hair_icon
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_mutations(var/update_icons=1)
if (QDELING(src))
@@ -444,7 +444,7 @@ There are several things that need to be remembered:
else
overlays_raw[MUTATIONS_LAYER] = null
if(update_icons)
update_icons()
update_icon()
/* --------------------------------------- */
//For legacy support.
@@ -481,7 +481,7 @@ There are several things that need to be remembered:
update_surgery(FALSE)
update_underwear(FALSE)
UpdateDamageIcon()
update_icons()
update_icon()
//Hud Stuff
update_hud()
@@ -552,7 +552,7 @@ There are several things that need to be remembered:
overlays_raw[UNIFORM_LAYER] = ovr || standing
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_wear_id(var/update_icons=1)
if (QDELING(src))
@@ -607,7 +607,7 @@ There are several things that need to be remembered:
BITSET(hud_updateflag, WANTED_HUD)
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_gloves(var/update_icons=1)
if (QDELING(src))
@@ -649,7 +649,7 @@ There are several things that need to be remembered:
overlays_raw[GLOVES_LAYER] = null
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_glasses(var/update_icons=1)
if (QDELING(src))
@@ -676,7 +676,7 @@ There are several things that need to be remembered:
overlays_raw[GLASSES_LAYER] = glasses_overlay
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_ears(var/update_icons=1)
if (QDELING(src))
@@ -724,7 +724,7 @@ There are several things that need to be remembered:
overlays_raw[EARS_LAYER] = result_layer
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_shoes(var/update_icons=1)
if (QDELING(src))
@@ -774,7 +774,7 @@ There are several things that need to be remembered:
overlays_raw[SHOES_LAYER_ALT] = null
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_s_store(var/update_icons=1)
if (QDELING(src))
@@ -793,7 +793,7 @@ There are several things that need to be remembered:
else
overlays_raw[SUIT_STORE_LAYER] = null
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_head(update_icons = TRUE, recurse = TRUE)
if (QDELING(src))
@@ -848,7 +848,7 @@ There are several things that need to be remembered:
update_inv_wear_mask(FALSE, FALSE)
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_belt(var/update_icons=1)
if (QDELING(src))
@@ -902,7 +902,7 @@ There are several things that need to be remembered:
overlays_raw[beltlayer] = ovr || standing
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_wear_suit(var/update_icons=1)
if (QDELING(src))
@@ -957,7 +957,7 @@ There are several things that need to be remembered:
update_inv_w_uniform(0)
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_pockets(var/update_icons=1)
if (QDELING(src))
@@ -969,7 +969,7 @@ There are several things that need to be remembered:
r_store.screen_loc = ui_storage2 //TODO
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_wear_mask(update_icons = TRUE, recurse = TRUE)
@@ -1011,7 +1011,7 @@ There are several things that need to be remembered:
update_hair(FALSE)
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_back(var/update_icons=1)
@@ -1063,7 +1063,7 @@ There are several things that need to be remembered:
overlays_raw[BACK_LAYER] = standing
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_hud() //TODO: do away with this if possible
@@ -1102,7 +1102,7 @@ There are several things that need to be remembered:
update_hud_hands()
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_legcuffed(var/update_icons=1)
if (QDELING(src))
@@ -1127,7 +1127,7 @@ There are several things that need to be remembered:
overlays_raw[LEGCUFF_LAYER] = null
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_r_hand(var/update_icons=1)
if (QDELING(src))
@@ -1172,7 +1172,7 @@ There are several things that need to be remembered:
overlays_raw[R_HAND_LAYER] = result_layer
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_inv_l_hand(var/update_icons=1)
if (QDELING(src))
@@ -1217,7 +1217,7 @@ There are several things that need to be remembered:
overlays_raw[L_HAND_LAYER] = result_layer
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/proc/update_tail_showing(var/update_icons=1)
@@ -1235,7 +1235,7 @@ There are several things that need to be remembered:
animate_tail_reset(0)
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/proc/get_tail_icon()
if (QDELING(src))
@@ -1267,7 +1267,7 @@ There are several things that need to be remembered:
if(tail_overlay && species.tail_animation)
if (tail_overlay.icon_state != t_state)
tail_overlay.icon_state = t_state
update_icons()
update_icon()
return tail_overlay
return null
@@ -1323,7 +1323,7 @@ There are several things that need to be remembered:
overlays_raw[COLLAR_LAYER] = null
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/update_fire(var/update_icons=1)
if (QDELING(src))
@@ -1332,7 +1332,7 @@ There are several things that need to be remembered:
overlays_raw[FIRE_LAYER] = on_fire ? image(species.onfire_overlay, "Standing", layer = FIRE_LAYER) : null
if(update_icons)
update_icons()
update_icon()
/mob/living/carbon/human/proc/update_surgery(var/update_icons=1)
overlays_raw[SURGERY_LAYER] = null
@@ -1370,7 +1370,7 @@ There are several things that need to be remembered:
overlays_raw[SURGERY_LAYER] = total
if(update_icons)
update_icons()
update_icon()
//Drawcheck functions
//These functions check if an item should be drawn, or if its covered up by something else
+2 -2
View File
@@ -101,12 +101,12 @@
if(stunned)
stunned = max(stunned-1,0)
if(!stunned)
update_icons()
update_icon()
if(weakened)
weakened = max(weakened-1,0)
if(!weakened)
update_icons()
update_icon()
if(confused)
confused = max(0, confused - 1)
+3 -3
View File
@@ -924,7 +924,7 @@ default behaviour is:
make_jittery(rand(150,200))
adjustHalLoss(rand(50,60))
/mob/living/update_icons()
/mob/living/update_icon()
for(var/aura in auras)
var/obj/aura/A = aura
var/icon/aura_overlay = icon(A.icon, icon_state = A.icon_state)
@@ -932,12 +932,12 @@ default behaviour is:
/mob/living/proc/add_aura(var/obj/aura/aura)
LAZYDISTINCTADD(auras, aura)
update_icons()
update_icon()
return TRUE
/mob/living/proc/remove_aura(var/obj/aura/aura)
LAZYREMOVE(auras, aura)
update_icons()
update_icon()
return TRUE
/mob/living/proc/apply_radiation_effects()
+3 -3
View File
@@ -68,7 +68,7 @@
var/obj/item/cloaking_device/C = locate(/obj/item/cloaking_device) in src
if(C && C.active)
C.attack_self(src)//Should shut it off
update_icons()
update_icon()
to_chat(src, "<span class='notice'>Your [C.name] was disrupted!</span>")
Stun(2)
@@ -398,7 +398,7 @@
if(hud_used.action_buttons_hidden)
if(!hud_used.hide_actions_toggle)
hud_used.hide_actions_toggle = new(hud_used)
hud_used.hide_actions_toggle.UpdateIcon()
hud_used.hide_actions_toggle.update_icon()
if(!hud_used.hide_actions_toggle.moved)
hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(1)
@@ -417,7 +417,7 @@
var/obj/screen/movable/action_button/B = A.button
B.UpdateIcon()
B.update_icon()
B.name = A.UpdateName()
+3 -3
View File
@@ -288,7 +288,7 @@ var/list/ai_verbs_default = list(
selected_sprite = new/datum/ai_icon("Custom", "[sprite.aichassisicon]", "4", "[sprite.aichassisicon]-crash", "#FFFFFF", "#FFFFFF", "#FFFFFF")
else
selected_sprite = default_ai_icon
updateicon()
update_icon()
/mob/living/silicon/ai/pointed(atom/A as mob|obj|turf in view())
set popup_menu = 0
@@ -372,7 +372,7 @@ var/list/ai_verbs_default = list(
if (!custom_sprite)
var/new_sprite = input("Select an icon!", "AI", selected_sprite) as null|anything in ai_icons
if(new_sprite) selected_sprite = new_sprite
updateicon()
update_icon()
// this verb lets the ai see the stations manifest
/mob/living/silicon/ai/proc/ai_roster()
@@ -824,7 +824,7 @@ var/list/ai_verbs_default = list(
multitool_mode = !multitool_mode
to_chat(src, "<span class='notice'>Multitool mode: [multitool_mode ? "E" : "Dise"]ngaged</span>")
/mob/living/silicon/ai/updateicon()
/mob/living/silicon/ai/update_icon()
if(!selected_sprite) selected_sprite = default_ai_icon
if(stat == DEAD)
+5 -5
View File
@@ -43,18 +43,18 @@
to_chat(src, "Alert cancelled. Power has been restored without our assistance.")
ai_restore_power_routine = 0
src.blind.invisibility = 101
updateicon()
update_icon()
return
else if (ai_restore_power_routine==3)
to_chat(src, "Alert cancelled. Power has been restored.")
ai_restore_power_routine = 0
src.blind.invisibility = 101
updateicon()
update_icon()
return
else if (APU_power)
ai_restore_power_routine = 0
src.blind.invisibility = 101
updateicon()
update_icon()
return
else
var/area/current_area = get_area(src)
@@ -120,7 +120,7 @@
ai_restore_power_routine = 3
to_chat(src, "Here are your current laws:")
show_laws()
updateicon()
update_icon()
sleep(50)
theAPC = null
@@ -145,7 +145,7 @@
/mob/living/silicon/ai/update_sight()
if(is_blinded())
updateicon()
update_icon()
src.blind.screen_loc = ui_entire_screen
if (src.blind.invisibility != 0)
src.blind.invisibility = 0
@@ -155,7 +155,7 @@
C.max_damage = 10
verbs -= /mob/living/silicon/robot/verb/Namepick
updateicon()
update_icon()
density = FALSE
/mob/living/silicon/robot/drone/init()
@@ -182,7 +182,7 @@
/mob/living/silicon/robot/drone/setup_icon_cache()
return
/mob/living/silicon/robot/drone/updateicon()
/mob/living/silicon/robot/drone/update_icon()
cut_overlays()
if(stat == CONSCIOUS && isturf(loc))
if(!emagged)
@@ -203,7 +203,7 @@
return
hat = new_hat
new_hat.forceMove(src)
updateicon()
update_icon()
//Drones cannot be upgraded with borg modules so we need to catch some items before they get used in ..().
/mob/living/silicon/robot/drone/attackby(var/obj/item/W, var/mob/user)
@@ -272,7 +272,7 @@
to_chat(src, "<b>Obey these laws:</b>")
laws.show_laws(src)
to_chat(src, SPAN_DANGER("ALERT: [user.real_name] is your new master. Obey your new laws and \his commands."))
updateicon()
update_icon()
return TRUE
/mob/living/silicon/robot/drone/proc/ai_hack(var/mob/user)
@@ -31,6 +31,6 @@
H.put_in_hands(hat)
H.visible_message(SPAN_WARNING("\The [H] removes \the [src]'s [hat]."))
hat = null
updateicon()
update_icon()
else
return ..()
@@ -68,11 +68,11 @@
store_module(module_state_3)
module_state_3 = null
inv3.icon_state = "inv3"
updateicon()
update_icon()
hud_used.update_robot_modules_display()
/mob/living/silicon/robot/proc/activated(obj/item/O)
updateicon()
update_icon()
if(module_state_1 == O)
return 1
@@ -95,7 +95,7 @@
/obj/item/robot_parts/robot_suit/Initialize()
. = ..()
updateicon()
update_icon()
/obj/item/robot_parts/robot_suit/report_missing_parts(var/mob/user)
if(!head)
@@ -117,9 +117,9 @@
r_leg = new /obj/item/robot_parts/r_leg(src)
l_arm = new /obj/item/robot_parts/l_arm(src)
r_arm = new /obj/item/robot_parts/r_arm(src)
updateicon()
update_icon()
/obj/item/robot_parts/robot_suit/proc/updateicon()
/obj/item/robot_parts/robot_suit/update_icon()
cut_overlays()
if(l_arm)
add_overlay("l_arm+o")
@@ -163,7 +163,7 @@
return
user.drop_from_inventory(W, src)
l_leg = W
updateicon()
update_icon()
return
if(istype(W, /obj/item/robot_parts/r_leg))
@@ -172,7 +172,7 @@
return
user.drop_from_inventory(W, src)
r_leg = W
updateicon()
update_icon()
return
if(istype(W, /obj/item/robot_parts/l_arm))
@@ -181,7 +181,7 @@
return
user.drop_from_inventory(W, src)
l_arm = W
updateicon()
update_icon()
return
if(istype(W, /obj/item/robot_parts/r_arm))
@@ -190,7 +190,7 @@
return
user.drop_from_inventory(W, src)
r_arm = W
updateicon()
update_icon()
return
if(istype(W, /obj/item/robot_parts/chest))
@@ -201,7 +201,7 @@
if(C.wires && C.cell)
user.drop_from_inventory(W, src)
chest = W
updateicon()
update_icon()
else if(!C.wires)
to_chat(user, SPAN_WARNING("You need to attach wires to it first!"))
else
@@ -216,7 +216,7 @@
if(H.right_flash && H.left_flash)
user.drop_from_inventory(W, src)
head = W
updateicon()
update_icon()
else
to_chat(user, SPAN_WARNING("You need to attach a flash to it first!"))
return
@@ -301,7 +301,7 @@
module_state_2:screen_loc = ui_inv2
if(module_state_3)
module_state_3:screen_loc = ui_inv3
updateicon()
update_icon()
/mob/living/silicon/robot/proc/process_killswitch()
if(killswitch)
+10 -10
View File
@@ -53,7 +53,7 @@
if (prob(35))//probability to reduce spam
src.visible_message("<span class='warning'>The bee swarm starts to thin out a little.</span>")
update_icons()
update_icon()
else
..()
@@ -64,7 +64,7 @@
if(strength <= 0)
death()
else
update_icons()
update_icon()
..()
@@ -116,8 +116,8 @@
var/mob/living/simple_animal/bee/B = new(get_turf(src))
B.strength = rand(1,5)
src.strength -= B.strength
update_icons()
B.update_icons()
update_icon()
B.update_icon()
if(src.parent)
B.parent = src.parent
src.parent.owned_bee_swarms.Add(B)
@@ -152,8 +152,8 @@
if(feral > 0)
src.strength += B.strength
B.strength = 0
B.update_icons()
update_icons()
B.update_icon()
update_icon()
else if(prob(10))
//make the other swarm of bees stronger, then move away
@@ -162,8 +162,8 @@
B.strength = min(5, total_bees)
src.strength = total_bees - B.strength
update_icons()
B.update_icons()
update_icon()
B.update_icon()
if(src.strength <= 0)
qdel(src)
return
@@ -219,7 +219,7 @@
animate(src, pixel_x = rand(-12, 12), pixel_y = rand(-12, 12), time = 0.5)
/mob/living/simple_animal/bee/update_icons()
/mob/living/simple_animal/bee/update_icon()
if(strength <= 5)
icon_state = "bees[round(strength,1)]"
else
@@ -260,7 +260,7 @@
/mob/living/simple_animal/bee/standalone/Initialize(mapload, var/obj/machinery/beehive/new_parent)
. = ..()
strength = rand(4,8)
update_icons()
update_icon()
/mob/living/simple_animal/bee/beegun
maxHealth = 30
@@ -57,7 +57,7 @@
add_language(LANGUAGE_OCCULT)
for(var/spell in construct_spells)
src.add_spell(new spell, "const_spell_ready")
updateicon()
update_icon()
add_glow()
/mob/living/simple_animal/construct/death()
@@ -367,10 +367,10 @@
melee_damage_upper = initial(melee_damage_upper)
growl_soft()
update_icons()
update_icon()
/mob/living/simple_animal/hostile/bear/update_icons()
/mob/living/simple_animal/hostile/bear/update_icon()
if (stat == DEAD)
icon_state = "bear_dead"
else if (bearmode == BEARMODE_INDOORS)
@@ -659,7 +659,7 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
wander = 0
walk_to(src,0)
movement_target = null
update_icons()
update_icon()
//Wakes the mob up from sleeping
/mob/living/simple_animal/proc/wake_up()
@@ -668,9 +668,9 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
resting = 0
canmove = 1
wander = 1
update_icons()
update_icon()
/mob/living/simple_animal/update_icons()
/mob/living/simple_animal/update_icon()
if (stat == DEAD)
icon_state = icon_dead
else if ((stat == UNCONSCIOUS || resting) && icon_rest)
@@ -689,7 +689,7 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
to_chat(src, SPAN_NOTICE("You are now [resting ? "resting" : "getting up"]"))
update_icons()
update_icon()
//Todo: add snowflakey shit to it.
/mob/living/simple_animal/electrocute_act(var/shock_damage, var/obj/source, var/base_siemens_coeff = 1.0, var/def_zone = null, var/tesla_shock = 0, var/ground_zero)
+1 -4
View File
@@ -867,7 +867,7 @@
update_icon = 0
regenerate_icons()
else if( lying != lying_prev )
update_icons()
update_icon()
return canmove
@@ -1173,9 +1173,6 @@
//Override for mob-specific functionality
return
/mob/proc/updateicon()
return
/mob/verb/face_direction()
set name = "Face Direction"
set category = "IC"
+1 -1
View File
@@ -205,7 +205,7 @@
mouse_drag_pointer = MOUSE_ACTIVE_POINTER
var/update_icon = 1 //Set to 1 to trigger update_icons() at the next life() call
var/update_icon = 1 //Set to 1 to trigger update_icon() at the next life() call
var/status_flags = CANSTUN|CANWEAKEN|CANPARALYSE|CANPUSH //bitflags defining which status effects can be inflicted (replaces canweaken, canstun, etc)
-3
View File
@@ -4,9 +4,6 @@
/mob/proc/regenerate_icons() //TODO: phase this out completely if possible
return
/mob/proc/update_icons()
return
/mob/proc/update_hud()
return
@@ -71,7 +71,7 @@
A.lying = FALSE
A.switch_from_dead_to_living_mob_list()
A.add_ai_verbs()
A.updateicon()
A.update_icon()
var/obj/item/aicard/AC = A.loc
if(AC)
AC.update_icon()
+1 -1
View File
@@ -42,7 +42,7 @@
. = ..()
if(.)
action.button_icon_state = "puke"
if(action.button) action.button.UpdateIcon()
if(action.button) action.button.update_icon()
/obj/item/organ/internal/stomach/attack_self(mob/user)
. = ..()
+1 -1
View File
@@ -26,7 +26,7 @@
if(activable)
action.button_icon_state = action_button_icon
if(action.button)
action.button.UpdateIcon()
action.button.update_icon()
/obj/item/organ/internal/augment/attack_self(var/mob/user)
. = ..()
+4 -4
View File
@@ -255,7 +255,7 @@
if(.)
action.button_icon_state = "digitool"
if(action.button)
action.button.UpdateIcon()
action.button.update_icon()
/obj/item/organ/external/hand/right/autakh/tool/attack_self(var/mob/user)
. = ..()
@@ -316,7 +316,7 @@
if(.)
action.button_icon_state = "drill"
if(action.button)
action.button.UpdateIcon()
action.button.update_icon()
/obj/item/pickaxe/drill/integrated
name = "integrated mining drill"
@@ -339,7 +339,7 @@
if(.)
action.button_icon_state = "health"
if(action.button)
action.button.UpdateIcon()
action.button.update_icon()
/obj/item/organ/external/hand/right/autakh/medical/attack_self(var/mob/user)
. = ..()
@@ -380,7 +380,7 @@
if(.)
action.button_icon_state = "baton"
if(action.button)
action.button.UpdateIcon()
action.button.update_icon()
/obj/item/organ/external/hand/right/autakh/security/attack_self(var/mob/user)
. = ..()
+7 -7
View File
@@ -97,12 +97,12 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable/hide(var/i)
if(istype(loc, /turf))
invisibility = i ? 101 : 0
updateicon()
update_icon()
/obj/structure/cable/hides_under_flooring()
return TRUE
/obj/structure/cable/proc/updateicon()
/obj/structure/cable/update_icon()
icon_state = "[d1]-[d2]"
alpha = invisibility ? 127 : 255
@@ -767,7 +767,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
C.d1 = 11
C.d2 = dirn
C.add_fingerprint(user)
C.updateicon()
C.update_icon()
var/datum/powernet/PN = new()
PN.add_cable(C)
@@ -780,7 +780,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
D.d1 = 12
D.d2 = 0
D.add_fingerprint(user)
D.updateicon()
D.update_icon()
PN.add_cable(D)
D.mergeConnectedNetworksOnTurf()
@@ -801,7 +801,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
C.d1 = 0 //it's a O-X node cable
C.d2 = dirn
C.add_fingerprint(user)
C.updateicon()
C.update_icon()
//create a new powernet with the cable, if needed it will be merged later
var/datum/powernet/PN = new()
@@ -865,7 +865,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
NC.d1 = 0
NC.d2 = fdirn
NC.add_fingerprint()
NC.updateicon()
NC.update_icon()
//create a new powernet with the cable, if needed it will be merged later
var/datum/powernet/newPN = new()
@@ -912,7 +912,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
C.d2 = nd2
C.add_fingerprint()
C.updateicon()
C.update_icon()
C.mergeConnectedNetworks(C.d1) //merge the powernets...
+3 -3
View File
@@ -70,7 +70,7 @@
circ1 = null
circ2 = null
/obj/machinery/power/generator/proc/updateicon()
/obj/machinery/power/generator/update_icon()
cut_overlays()
if(!(stat & (NOPOWER|BROKEN)) && lastgenlev)
add_overlay("teg-op[lastgenlev]")
@@ -139,7 +139,7 @@
genlev = 1
if(genlev != lastgenlev)
lastgenlev = genlev
updateicon()
update_icon()
add_avail(effective_gen)
/obj/machinery/power/generator/attack_ai(mob/user)
@@ -221,4 +221,4 @@
/obj/machinery/power/generator/power_change()
..()
updateicon()
update_icon()
+4 -4
View File
@@ -19,10 +19,10 @@
input2 = locate(/obj/machinery/atmospherics/unary/generator_input) in get_step(src,turn(dir, -90))
if(!input1 || !input2)
stat |= BROKEN
updateicon()
update_icon()
/obj/machinery/power/generator_type2/proc/updateicon()
/obj/machinery/power/generator_type2/update_icon()
cut_overlays()
if(!(stat & (NOPOWER|BROKEN)))
if(lastgenlev != 0)
@@ -76,7 +76,7 @@
var/genlev = max(0, min( round(11*lastgen / 100000), 11))
if(genlev != lastgenlev)
lastgenlev = genlev
updateicon()
update_icon()
src.updateDialog()
@@ -133,4 +133,4 @@
/obj/machinery/power/generator_type2/power_change()
..()
updateicon()
update_icon()
+4 -4
View File
@@ -64,7 +64,7 @@ var/global/list/rad_collectors = list()
return 1
user.drop_from_inventory(W,src)
src.P = W
update_icons()
update_icon()
return 1
else if(W.iscrowbar())
if(P && !src.locked)
@@ -120,7 +120,7 @@ var/global/list/rad_collectors = list()
if(active)
toggle_power()
else
update_icons()
update_icon()
/obj/machinery/power/rad_collector/proc/receive_pulse(var/pulse_strength)
if(P && active)
@@ -132,7 +132,7 @@ var/global/list/rad_collectors = list()
return
/obj/machinery/power/rad_collector/proc/update_icons()
/obj/machinery/power/rad_collector/update_icon()
cut_overlays()
if(P)
add_overlay("ptank")
@@ -150,6 +150,6 @@ var/global/list/rad_collectors = list()
else
icon_state = "ca"
flick("ca_deactive", src)
update_icons()
update_icon()
return
@@ -273,10 +273,10 @@
var/pipetype = dpipetype()
var/obj/structure/disposalpipe/P = new pipetype(src.loc)
src.transfer_fingerprints_to(P)
P.base_icon_state = base_state
P.icon_state = base_state
P.set_dir(dir)
P.dpdir = dpdir
P.updateicon()
P.update_icon()
//Needs some special treatment ;)
if(ptype==9 || ptype==10)
+4 -13
View File
@@ -704,15 +704,10 @@
dir = 0 // dir will contain dominant direction for junction pipes
var/health = 10 // health points 0-10
layer = 2.3 // slightly lower than wires and other pipes
var/base_icon_state // initial icon state on map
var/sortType = ""
var/subtype = 0
// new pipe, set the icon_state as on map
/obj/structure/disposalpipe/Initialize()
. = ..()
base_icon_state = icon_state
// pipe is deleted
// ensure if holder is present, it is expelled
/obj/structure/disposalpipe/Destroy()
@@ -774,18 +769,14 @@
// change visibility status and force update of icon
/obj/structure/disposalpipe/hide(var/intact)
invisibility = intact ? 101: 0 // hide if floor is intact
updateicon()
update_icon()
// update actual icon_state depending on visibility
// if invisible, append "f" to icon_state to show faded version
// this will be revealed if a T-scanner is used
// if visible, use regular icon_state
/obj/structure/disposalpipe/proc/updateicon()
/* if(invisibility) //we hide things with alpha now, no need for transparent icons
icon_state = "[base_icon_state]f"
else
icon_state = base_icon_state*/
icon_state = base_icon_state
/obj/structure/disposalpipe/update_icon()
icon_state = initial(icon_state)
return
@@ -922,7 +913,7 @@
// called when pipe is cut with welder
/obj/structure/disposalpipe/proc/welded()
var/obj/structure/disposalconstruct/C = new (src.loc)
switch(base_icon_state)
switch(initial(icon_state))
if("pipe-s")
C.ptype = 0
if("pipe-c")