Merge pull request #11391 from Ghommie/Ghommie-cit612

Porting "Further update_icon splitup"
This commit is contained in:
kevinz000
2020-03-10 05:58:17 -07:00
committed by GitHub
157 changed files with 698 additions and 827 deletions
+1 -1
View File
@@ -63,7 +63,7 @@
addtimer(CALLBACK(src, .proc/emagNotify), 150)
return TRUE
/obj/machinery/vr_sleeper/update_icon()
/obj/machinery/vr_sleeper/update_icon_state()
icon_state = "[initial(icon_state)][state_open ? "-open" : ""]"
/obj/machinery/vr_sleeper/open_machine()
@@ -419,8 +419,9 @@
<br>
Congratulations! You are now trained for invasive xenobiology research!"}
/obj/item/paper/guides/antag/abductor/update_icon()
return
/obj/item/paper/guides/antag/abductor/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/item/paper/guides/antag/abductor/AltClick()
return //otherwise it would fold into a paperplane.
@@ -442,6 +443,10 @@
w_class = WEIGHT_CLASS_NORMAL
actions_types = list(/datum/action/item_action/toggle_mode)
/obj/item/abductor/baton/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/abductor/baton/proc/toggle(mob/living/user=usr)
mode = (mode+1)%BATON_MODES
var/txt
@@ -458,7 +463,7 @@
to_chat(usr, "<span class='notice'>You switch the baton to [txt] mode.</span>")
update_icon()
/obj/item/abductor/baton/update_icon()
/obj/item/abductor/baton/update_icon_state()
switch(mode)
if(BATON_STUN)
icon_state = "wonderprodStun"
@@ -223,7 +223,7 @@
return
/obj/machinery/abductor/experiment/update_icon()
/obj/machinery/abductor/experiment/update_icon_state()
if(state_open)
icon_state = "experiment-open"
else
@@ -258,7 +258,7 @@
/obj/structure/bloodsucker/vassalrack/proc/torture_victim(mob/living/user, mob/living/target)
var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
// Check Bloodmob/living/M, force = FALSE, check_loc = TRUE
var/convert_cost = 200 + 200 * bloodsuckerdatum.vassals
var/convert_cost = 200 + 200 * bloodsuckerdatum.vassals
if(user.blood_volume < convert_cost + 5)
to_chat(user, "<span class='notice'>You don't have enough blood to initiate the Dark Communion with [target].</span>")
return
@@ -449,7 +449,7 @@
/obj/structure/bloodsucker/candelabrum/Destroy()
STOP_PROCESSING(SSobj, src)
/obj/structure/bloodsucker/candelabrum/update_icon()
/obj/structure/bloodsucker/candelabrum/update_icon_state()
icon_state = "candelabrum[lit ? "_lit" : ""]"
/obj/structure/bloodsucker/candelabrum/examine(mob/user)
@@ -251,6 +251,7 @@
return TRUE
/obj/effect/clockwork/sigil/transmission/update_icon()
. = ..()
var/power_charge = get_clockwork_power()
if(GLOB.ratvar_awakens)
alpha = 255
+2 -2
View File
@@ -372,7 +372,7 @@
max = 40
prefix = "darkened"
/obj/item/sharpener/cult/update_icon()
/obj/item/sharpener/cult/update_icon_state()
var/old_state = icon_state
icon_state = "cult_sharpener[used ? "_used" : ""]"
if(old_state != icon_state)
@@ -688,7 +688,7 @@
qdel(spear_act)
..()
/obj/item/twohanded/cult_spear/update_icon()
/obj/item/twohanded/cult_spear/update_icon_state()
icon_state = "bloodspear[wielded]"
/obj/item/twohanded/cult_spear/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
@@ -49,7 +49,7 @@
else
to_chat(user, "<span class='warning'>[user] fails to implant [M].</span>")
/obj/item/overthrow_converter/update_icon()
/obj/item/overthrow_converter/update_icon_state()
if(uses)
icon_state = "implanter1"
else
@@ -76,8 +76,9 @@
icon_state = "demon_heart-on"
decay_factor = 0
/obj/item/organ/heart/demon/update_icon()
return //always beating visually
/obj/item/organ/heart/demon/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/item/organ/heart/demon/attack(mob/M, mob/living/carbon/user, obj/target)
if(M != user)
+7 -5
View File
@@ -19,15 +19,17 @@
/obj/item/onetankbomb/examine(mob/user)
bombtank.examine(user)
/obj/item/onetankbomb/update_icon()
cut_overlays()
/obj/item/onetankbomb/update_icon_state()
if(bombtank)
icon = bombtank.icon
icon_state = bombtank.icon_state
/obj/item/onetankbomb/update_overlays()
. = ..()
if(bombassembly)
add_overlay(bombassembly.icon_state)
copy_overlays(bombassembly)
add_overlay("bomb_assembly")
. += bombassembly.icon_state
. += bombassembly.overlays
. += "bomb_assembly"
/obj/item/onetankbomb/wrench_act(mob/living/user, obj/item/I)
to_chat(user, "<span class='notice'>You disassemble [src]!</span>")
+20 -19
View File
@@ -624,10 +624,7 @@
"set_internal_pressure" = 0
))
/obj/machinery/airalarm/update_icon()
set_light(0)
cut_overlays()
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
/obj/machinery/airalarm/update_icon_state()
if(stat & NOPOWER)
icon_state = "alarm0"
return
@@ -636,35 +633,39 @@
icon_state = "alarmx"
return
if(panel_open)
switch(buildstage)
if(2)
icon_state = "alarmx"
if(1)
icon_state = "alarm_b2"
if(0)
icon_state = "alarm_b1"
if(!panel_open)
icon_state = "alarm1"
return
icon_state = "alarm1"
switch(buildstage)
if(2)
icon_state = "alarmx"
if(1)
icon_state = "alarm_b2"
if(0)
icon_state = "alarm_b1"
/obj/machinery/airalarm/update_overlays()
. = ..()
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
var/overlay_state = AALARM_OVERLAY_OFF
var/area/A = get_base_area(src)
switch(max(danger_level, A.atmosalm))
if(0)
add_overlay(AALARM_OVERLAY_GREEN)
overlay_state = AALARM_OVERLAY_GREEN
light_color = LIGHT_COLOR_GREEN
set_light(brightness_on)
if(1)
add_overlay(AALARM_OVERLAY_WARN)
overlay_state = AALARM_OVERLAY_WARN
light_color = LIGHT_COLOR_LAVA
set_light(brightness_on)
if(2)
add_overlay(AALARM_OVERLAY_DANGER)
overlay_state = AALARM_OVERLAY_DANGER
light_color = LIGHT_COLOR_RED
set_light(brightness_on)
if(overlay_state != AALARM_OVERLAY_OFF)
. += overlay_state
set_light(brightness_on)
else
set_light(0)
SSvis_overlays.add_vis_overlay(src, icon, overlay_state, ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
update_light()
@@ -34,7 +34,6 @@
var/restricted = FALSE
req_access = list()
var/update = 0
var/static/list/label2types = list(
"n2" = /obj/machinery/portable_atmospherics/canister/nitrogen,
"o2" = /obj/machinery/portable_atmospherics/canister/oxygen,
@@ -213,61 +212,26 @@
air_contents.gases[/datum/gas/oxygen] = (O2STANDARD * maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
air_contents.gases[/datum/gas/nitrogen] = (N2STANDARD * maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
#define HOLDING (1<<0)
#define CONNECTED (1<<1)
#define EMPTY (1<<2)
#define LOW (1<<3)
#define MEDIUM (1<<4)
#define FULL (1<<5)
#define DANGER (1<<6)
/obj/machinery/portable_atmospherics/canister/update_icon()
/obj/machinery/portable_atmospherics/canister/update_icon_state()
if(stat & BROKEN)
cut_overlays()
icon_state = "[icon_state]-1"
return
var/last_update = update
update = 0
/obj/machinery/portable_atmospherics/canister/update_overlays()
. = ..()
if(holding)
update |= HOLDING
. += "can-open"
if(connected_port)
update |= CONNECTED
. += "can-connector"
var/pressure = air_contents.return_pressure()
if(pressure < 10)
update |= EMPTY
else if(pressure < 5 * ONE_ATMOSPHERE)
update |= LOW
else if(pressure < 10 * ONE_ATMOSPHERE)
update |= MEDIUM
else if(pressure < 40 * ONE_ATMOSPHERE)
update |= FULL
else
update |= DANGER
if(update == last_update)
return
cut_overlays()
if(update & HOLDING)
add_overlay("can-open")
if(update & CONNECTED)
add_overlay("can-connector")
if(update & LOW)
add_overlay("can-o0")
else if(update & MEDIUM)
add_overlay("can-o1")
else if(update & FULL)
add_overlay("can-o2")
else if(update & DANGER)
add_overlay("can-o3")
#undef HOLDING
#undef CONNECTED
#undef EMPTY
#undef LOW
#undef MEDIUM
#undef FULL
#undef DANGER
if(pressure >= 40 * ONE_ATMOSPHERE)
. += "can-o3"
else if(pressure >= 10 * ONE_ATMOSPHERE)
. += "can-o2"
else if(pressure >= 5 * ONE_ATMOSPHERE)
. += "can-o1"
else if(pressure >= 10)
. += "can-o0"
/obj/machinery/portable_atmospherics/canister/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > temperature_resistance)
@@ -29,14 +29,16 @@
QDEL_NULL(pump)
return ..()
/obj/machinery/portable_atmospherics/pump/update_icon()
/obj/machinery/portable_atmospherics/pump/update_icon_state()
icon_state = "psiphon:[on]"
cut_overlays()
/obj/machinery/portable_atmospherics/pump/update_overlays()
. = ..()
if(holding)
add_overlay("siphon-open")
. += "siphon-open"
if(connected_port)
add_overlay("siphon-connector")
. += "siphon-connector"
/obj/machinery/portable_atmospherics/pump/process_atmos()
..()
@@ -5,6 +5,7 @@
var/on = FALSE
var/volume_rate = 1000
var/use_overlays = TRUE
volume = 1000
var/list/scrubbing = list(/datum/gas/plasma, /datum/gas/carbon_dioxide, /datum/gas/nitrous_oxide, /datum/gas/bz, /datum/gas/nitryl, /datum/gas/tritium, /datum/gas/hypernoblium, /datum/gas/water_vapor)
@@ -15,14 +16,17 @@
air_update_turf()
return ..()
/obj/machinery/portable_atmospherics/scrubber/update_icon()
/obj/machinery/portable_atmospherics/scrubber/update_icon_state()
icon_state = "pscrubber:[on]"
cut_overlays()
/obj/machinery/portable_atmospherics/scrubber/update_overlays()
. = ..()
if(!use_overlays)
return
if(holding)
add_overlay("scrubber-open")
. += "scrubber-open"
if(connected_port)
add_overlay("scrubber-connector")
. += "scrubber-connector"
/obj/machinery/portable_atmospherics/scrubber/process_atmos()
..()
@@ -117,11 +121,12 @@
volume = 50000
var/movable = FALSE
use_overlays = FALSE
/obj/machinery/portable_atmospherics/scrubber/huge/movable
movable = TRUE
/obj/machinery/portable_atmospherics/scrubber/huge/update_icon()
/obj/machinery/portable_atmospherics/scrubber/huge/update_icon_state()
icon_state = "scrubber:[on]"
/obj/machinery/portable_atmospherics/scrubber/huge/process_atmos()
+6 -15
View File
@@ -53,11 +53,8 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
ready = TRUE
return ready
/obj/machinery/gateway/update_icon()
if(active)
icon_state = "on"
return
icon_state = "off"
/obj/machinery/gateway/update_icon_state()
icon_state = active ? "on" : "off"
/obj/machinery/gateway/attack_hand(mob/user)
. = ..()
@@ -100,11 +97,8 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
var/obj/machinery/gateway/centeraway/awaygate = null
can_link = TRUE
/obj/machinery/gateway/centerstation/update_icon()
if(active)
icon_state = "oncenter"
return
icon_state = "offcenter"
/obj/machinery/gateway/centerstation/update_icon_state()
icon_state = active ? "oncenter" : "offcenter"
/obj/machinery/gateway/centerstation/process()
if((stat & (NOPOWER)) && use_power)
@@ -185,11 +179,8 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
stationgate = locate(/obj/machinery/gateway/centerstation)
/obj/machinery/gateway/centeraway/update_icon()
if(active)
icon_state = "oncenter"
return
icon_state = "offcenter"
/obj/machinery/gateway/centeraway/update_icon_state()
icon_state = active ? "oncenter" : "offcenter"
/obj/machinery/gateway/centeraway/toggleon(mob/user)
if(!detect())
@@ -337,8 +337,9 @@
icon_state = "1"
color = rgb(0,0,255)
/obj/structure/ladder/unbreakable/rune/update_icon()
return
/obj/structure/ladder/unbreakable/rune/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/structure/ladder/unbreakable/rune/show_fluff_message(up,mob/user)
user.visible_message("[user] activates \the [src].","<span class='notice'>You activate \the [src].</span>")
+3 -2
View File
@@ -35,5 +35,6 @@
environs."
//we don't want the silly text overlay!
/obj/item/paper/pamphlet/update_icon()
return
/obj/item/paper/pamphlet/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
+2 -3
View File
@@ -27,7 +27,7 @@
update_icon()
return 1
/obj/screen/buildmode/mode/update_icon()
/obj/screen/buildmode/mode/update_icon_state()
icon_state = bd.mode.get_button_iconstate()
/obj/screen/buildmode/help
@@ -44,9 +44,8 @@
screen_loc = "NORTH,WEST+2"
name = "Change Dir"
/obj/screen/buildmode/bdir/update_icon()
/obj/screen/buildmode/bdir/update_icon_state()
dir = bd.build_dir
return
/obj/screen/buildmode/bdir/Click()
bd.toggle_dirswitch()
+5 -6
View File
@@ -78,15 +78,14 @@
. = ..()
setStyle(style, TRUE) //Upon initialization, give the supplypod an iconstate, name, and description based on the "style" variable. This system is important for the centcom_podlauncher to function correctly
/obj/structure/closet/supplypod/update_icon()
cut_overlays()
/obj/structure/closet/supplypod/closet_update_overlays(list/new_overlays)
. = new_overlays
if (style == STYLE_SEETHROUGH || style == STYLE_INVISIBLE) //If we're invisible, we dont bother adding any overlays
return
if (opened)
. += "[icon_state]_open"
else
if (opened)
add_overlay("[icon_state]_open")
else
add_overlay("[icon_state]_door")
. += "[icon_state]_door"
/obj/structure/closet/supplypod/proc/setStyle(chosenStyle, var/duringInit = FALSE) //Used to give the sprite an icon state, name, and description
if (!duringInit && style == chosenStyle) //Check if the input style is already the same as the pod's style. This happens in centcom_podlauncher, and as such we set the style to STYLE_CENTCOM.
+5 -5
View File
@@ -31,14 +31,14 @@
ready = FALSE
update_icon()
/obj/item/supplypod_beacon/update_icon()
cut_overlays()
/obj/item/supplypod_beacon/update_overlays()
. = ..()
if (launched)
add_overlay("sp_green")
. += "sp_green"
else if (ready)
add_overlay("sp_yellow")
. += "sp_yellow"
else if (linked)
add_overlay("sp_orange")
. += "sp_orange"
/obj/item/supplypod_beacon/proc/endLaunch()
launched = FALSE
+8 -11
View File
@@ -441,17 +441,14 @@ BLIND // can't see anything
return TRUE
/obj/item/clothing/update_icon() // Polychrome stuff
..()
/obj/item/clothing/update_overlays() // Polychrome stuff
. = ..()
if(hasprimary) //Checks if the overlay is enabled
var/mutable_appearance/primary_overlay = mutable_appearance(icon, "[item_color]-primary") //Automagically picks overlays
primary_overlay.color = primary_color //Colors the greyscaled overlay
add_overlay(primary_overlay) //Applies the coloured overlay onto the item sprite. but NOT the mob sprite.
var/mutable_appearance/primary_overlay = mutable_appearance(icon, "[item_color]-primary", color = primary_color) //Automagically picks overlays
. += primary_overlay //Applies the coloured overlay onto the item sprite. but NOT the mob sprite.
if(hassecondary)
var/mutable_appearance/secondary_overlay = mutable_appearance(icon, "[item_color]-secondary")
secondary_overlay.color = secondary_color
add_overlay(secondary_overlay)
var/mutable_appearance/secondary_overlay = mutable_appearance(icon, "[item_color]-secondary", color = secondary_color)
. += secondary_overlay
if(hastertiary)
var/mutable_appearance/tertiary_overlay = mutable_appearance(icon, "[item_color]-tertiary")
tertiary_overlay.color = tertiary_color
add_overlay(tertiary_overlay)
var/mutable_appearance/tertiary_overlay = mutable_appearance(icon, "[item_color]-tertiary", color = tertiary_color)
. += tertiary_overlay
+5 -6
View File
@@ -35,16 +35,15 @@
. = ..()
update_icon()
/obj/item/clothing/ears/headphones/update_icon()
/obj/item/clothing/ears/headphones/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/clothing/ears/headphones/update_icon_state()
icon_state = "[initial(icon_state)]_[headphones_on? "on" : "off"]"
item_state = "[initial(item_state)]_[headphones_on? "on" : "off"]"
/obj/item/clothing/ears/headphones/proc/toggle(owner)
headphones_on = !headphones_on
update_icon()
var/mob/living/carbon/human/H = owner
if(istype(H))
H.update_inv_ears()
H.update_inv_neck()
H.update_inv_head()
to_chat(owner, "<span class='notice'>You turn the music [headphones_on? "on. Untz Untz Untz!" : "off."]</span>")
@@ -31,6 +31,10 @@
START_PROCESSING(SSobj, src)
update_icon()
/obj/item/clothing/glasses/meson/engine/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/clothing/glasses/meson/engine/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
@@ -120,18 +124,8 @@
pic = new('icons/turf/overlays.dmi', place, "redOverlay", AREA_LAYER)
flick_overlay(pic, list(user.client), 8)
/obj/item/clothing/glasses/meson/engine/update_icon()
/obj/item/clothing/glasses/meson/engine/update_icon_state()
icon_state = "trayson-[mode]"
update_mob()
/obj/item/clothing/glasses/meson/engine/proc/update_mob()
item_state = icon_state
if(isliving(loc))
var/mob/living/user = loc
if(user.get_item_by_slot(SLOT_GLASSES) == src)
user.update_inv_glasses()
else
user.update_inv_hands()
/obj/item/clothing/glasses/meson/engine/tray //atmos techs have lived far too long without tray goggles while those damned engineers get their dual-purpose gogles all to themselves
name = "optical t-ray scanner"
+9 -11
View File
@@ -16,6 +16,11 @@
dog_fashion = /datum/dog_fashion/head
/obj/item/clothing/head/hardhat/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/clothing/head/hardhat/attack_self(mob/living/user)
toggle_helmet_light(user)
@@ -27,15 +32,9 @@
turn_off(user)
update_icon()
/obj/item/clothing/head/hardhat/update_icon()
/obj/item/clothing/head/hardhat/update_icon_state()
icon_state = "hardhat[on]_[item_color]"
item_state = "hardhat[on]_[item_color]"
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.update_inv_head()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon(force = TRUE)
/obj/item/clothing/head/hardhat/proc/turn_on(mob/user)
set_light(brightness_on, power_on)
@@ -132,11 +131,10 @@
if(!up)
. += mutable_appearance('icons/mob/head.dmi', "weldvisor")
/obj/item/clothing/head/hardhat/weldhat/update_icon()
cut_overlays()
/obj/item/clothing/head/hardhat/weldhat/update_overlays()
. = ..()
if(!up)
add_overlay("weldvisor")
..()
. += "weldvisor"
/obj/item/clothing/head/hardhat/weldhat/orange
icon_state = "hardhat0_orange"
+5 -5
View File
@@ -258,7 +258,11 @@
//LightToggle
/obj/item/clothing/head/helmet/update_icon()
/obj/item/clothing/head/helment/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/clothing/head/helmet/update_icon_state()
var/state = "[initial(icon_state)]"
if(F)
if(F.on)
@@ -268,10 +272,6 @@
icon_state = state
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.update_inv_head()
/obj/item/clothing/head/helmet/ui_action_click(mob/user, action)
if(istype(action, /datum/action/item_action/toggle_helmet_flashlight))
toggle_helmlight()
+9 -6
View File
@@ -197,16 +197,19 @@
. = ..()
update_icon()
/obj/item/clothing/head/wig/update_icon()
cut_overlays()
/obj/item/clothing/head/wig/update_icon_state()
var/datum/sprite_accessory/S = GLOB.hair_styles_list[hair_style]
if(!S)
icon = 'icons/obj/clothing/hats.dmi'
icon_state = "pwig"
else
var/mutable_appearance/M = mutable_appearance(S.icon,S.icon_state)
/obj/item/clothing/head/wig/update_overlays()
. = ..()
var/datum/sprite_accessory/S = GLOB.hair_styles_list[hair_style]
if(S)
var/mutable_appearance/M = mutable_appearance(S.icon, S.icon_state, color = hair_color)
M.appearance_flags |= RESET_COLOR
M.color = hair_color
add_overlay(M)
. += M
/obj/item/clothing/head/wig/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE)
. = list()
+8 -11
View File
@@ -10,11 +10,15 @@
/obj/item/clothing/shoes/clown_shoes/banana_shoes/Initialize()
. = ..()
AddComponent(/datum/component/material_container, list(/datum/material/bananium), 200000, TRUE, /obj/item/stack)
AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 75)
if(always_noslip)
clothing_flags |= NOSLIP
/obj/item/clothing/shoes/clown_shoes/banana_shoes/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
AddComponent(/datum/component/material_container, list(/datum/material/bananium), 200000, TRUE, /obj/item/stack)
AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 75)
/obj/item/clothing/shoes/clown_shoes/banana_shoes/step_action()
. = ..()
var/datum/component/material_container/bananium = GetComponent(/datum/component/material_container)
@@ -55,12 +59,5 @@
else
to_chat(user, "<span class='warning'>You need bananium to turn the prototype shoes on!</span>")
/obj/item/clothing/shoes/clown_shoes/banana_shoes/update_icon()
if(on)
icon_state = "clown_prototype_on"
else
icon_state = "clown_prototype_off"
usr.update_inv_shoes()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/clothing/shoes/clown_shoes/banana_shoes/update_icon_state()
icon_state = "clown_prototype_[on? "on" : "off"]"
+7 -19
View File
@@ -275,7 +275,7 @@
visor_flags_inv = HIDEMASK|HIDEEYES|HIDEFACE|HIDEFACIALHAIR
visor_flags = STOPSPRESSUREDAMAGE
/obj/item/clothing/head/helmet/space/hardsuit/syndi/update_icon()
/obj/item/clothing/head/helmet/space/hardsuit/syndi/update_icon_state()
icon_state = "hardsuit[on]-[item_color]"
/obj/item/clothing/head/helmet/space/hardsuit/syndi/Initialize()
@@ -943,15 +943,9 @@
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/clothing/head/helmet/space/hardsuit/lavaknight/update_icon()
var/mutable_appearance/helm_overlay = mutable_appearance(icon, "knight_cydonia_overlay")
if(energy_color)
helm_overlay.color = energy_color
cut_overlays() //So that it doesn't keep stacking overlays non-stop on top of each other
add_overlay(helm_overlay)
/obj/item/clothing/head/helmet/space/hardsuit/lavaknight/update_overlays()
. = ..()
. += mutable_appearance(icon, "knight_cydonia_overlay", color = energy_color)
/obj/item/clothing/head/helmet/space/hardsuit/lavaknight/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE)
. = ..()
@@ -980,15 +974,9 @@
set_light(1)
update_icon()
/obj/item/clothing/suit/space/hardsuit/lavaknight/update_icon()
var/mutable_appearance/suit_overlay = mutable_appearance(icon, "knight_cydonia_overlay")
if(energy_color)
suit_overlay.color = energy_color
cut_overlays() //So that it doesn't keep stacking overlays non-stop on top of each other
add_overlay(suit_overlay)
/obj/item/clothing/suit/space/hardsuit/lavaknight/update_overlays()
. = ..()
. += mutable_appearance(icon, "knight_cydonia_overlay", color = energy_color)
/obj/item/clothing/suit/space/hardsuit/lavaknight/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE)
. = ..()
+1 -1
View File
@@ -157,7 +157,7 @@
active = FALSE
STOP_PROCESSING(SSobj,src)
/obj/machinery/shuttle_scrambler/update_icon()
/obj/machinery/shuttle_scrambler/update_icon_state()
if(active)
icon_state = "dominator-blue"
else
@@ -318,14 +318,17 @@
..()
update_icon()
/obj/item/reagent_containers/glass/bowl/update_icon()
cut_overlays()
/obj/item/reagent_containers/glass/bowl/update_icon_state()
if(!reagents || !reagents.total_volume)
icon_state = "bowl"
/obj/item/reagent_containers/glass/bowl/update_overlays()
. = ..()
if(reagents && reagents.total_volume)
var/mutable_appearance/filling = mutable_appearance('icons/obj/food/soupsalad.dmi', "fullbowl")
filling.color = mix_color_from_reagents(reagents.reagent_list)
add_overlay(filling)
else
icon_state = "bowl"
. += filling
#undef INGREDIENTS_FILL
#undef INGREDIENTS_SCATTER
@@ -38,18 +38,18 @@
if(M.rating >= 2)
. += "<span class='notice'>Gibber has been upgraded to process inorganic materials.</span>"
/obj/machinery/gibber/update_icon()
cut_overlays()
/obj/machinery/gibber/update_overlays()
. = ..()
if (dirty)
add_overlay("grbloody")
. += "grbloody"
if(stat & (NOPOWER|BROKEN))
return
if (!occupant)
add_overlay("grjam")
. += "grjam"
else if (operating)
add_overlay("gruse")
. += "gruse"
else
add_overlay("gridle")
. += "gridle"
/obj/machinery/gibber/attack_paw(mob/user)
return attack_hand(user)
@@ -15,7 +15,7 @@
. = ..()
grill_loop = new(list(src), FALSE)
/obj/machinery/grill/update_icon()
/obj/machinery/grill/update_icon_state()
if(grilled_item)
icon_state = "grill"
else if(grill_fuel)
@@ -85,7 +85,7 @@
. += "<span class='notice'>- Capacity: <b>[max_n_of_items]</b> items.<span>"
. += "<span class='notice'>- Cook time reduced by <b>[(efficiency - 1) * 25]%</b>.<span>"
/obj/machinery/microwave/update_icon()
/obj/machinery/microwave/update_icon_state()
if(broken)
icon_state = "mwb"
else if(dirty_anim_playing)
@@ -42,7 +42,7 @@
..()
update_icon()
/obj/machinery/smartfridge/update_icon()
/obj/machinery/smartfridge/update_icon_state()
if(!stat)
if(visible_contents)
switch(contents.len)
@@ -289,13 +289,12 @@
..()
update_icon()
/obj/machinery/smartfridge/drying_rack/update_icon()
..()
cut_overlays()
/obj/machinery/smartfridge/drying_rack/update_overlays()
. = ..()
if(drying)
add_overlay("drying_rack_drying")
. += "drying_rack_drying"
if(contents.len)
add_overlay("drying_rack_filled")
. += "drying_rack_filled"
/obj/machinery/smartfridge/drying_rack/process()
..()
+2 -2
View File
@@ -93,7 +93,7 @@
qdel(SC)
update_icon()
/obj/item/toy/cards/deck/cas/update_icon()
/obj/item/toy/cards/deck/cas/update_icon_state()
if(cards.len < 26)
icon_state = "deck_[deckstyle]_low"
@@ -136,7 +136,7 @@
Flip()
return TRUE
/obj/item/toy/cards/singlecard/cas/update_icon()
/obj/item/toy/cards/singlecard/cas/update_icon_state()
if(flipped)
icon_state = "[card_face]_flipped"
else
+1 -1
View File
@@ -196,7 +196,7 @@
if(numbuttons == numready)
begin_event()
/obj/machinery/readybutton/update_icon()
/obj/machinery/readybutton/update_icon_state()
if(ready)
icon_state = "auth_on"
else
@@ -20,13 +20,13 @@
update_icon()
/obj/item/reagent_containers/honeycomb/update_icon()
cut_overlays()
/obj/item/reagent_containers/honeycomb/update_overlays()
. = ..()
var/mutable_appearance/honey_overlay = mutable_appearance(icon, "honey")
if(honey_color)
honey_overlay.icon_state = "greyscale_honey"
honey_overlay.color = honey_color
add_overlay(honey_overlay)
. += honey_overlay
/obj/item/reagent_containers/honeycomb/proc/set_reagent(reagent)
+1 -1
View File
@@ -61,7 +61,7 @@
/obj/machinery/biogenerator/on_reagent_change(changetype) //When the reagents change, change the icon as well.
update_icon()
/obj/machinery/biogenerator/update_icon()
/obj/machinery/biogenerator/update_icon_state()
if(panel_open)
icon_state = "biogen-empty-o"
else if(!src.beaker)
@@ -64,7 +64,7 @@
to_chat(user, "<span class='notice'>You close [src], letting you draw from its tap.</span>")
update_icon()
/obj/structure/fermenting_barrel/update_icon()
/obj/structure/fermenting_barrel/update_icon_state()
if(open)
icon_state = "barrel_open"
else
+6 -5
View File
@@ -53,17 +53,18 @@
min_wchance = 0
min_wrate = 0
/obj/machinery/plantgenes/update_icon()
..()
cut_overlays()
/obj/machinery/plantgenes/update_icon_state()
if((stat & (BROKEN|NOPOWER)))
icon_state = "dnamod-off"
else
icon_state = "dnamod"
/obj/machinery/plantgenes/update_overlays()
. = ..()
if(seed)
add_overlay("dnamod-dna")
. += "dnamod-dna"
if(panel_open)
add_overlay("dnamod-open")
. += "dnamod-open"
/obj/machinery/plantgenes/attackby(obj/item/I, mob/user, params)
if(default_deconstruction_screwdriver(user, "dnamod", "dnamod", I))
@@ -305,17 +305,17 @@
/obj/item/electronic_assembly/proc/can_move()
return FALSE
/obj/item/electronic_assembly/update_icon()
/obj/item/electronic_assembly/update_icon_state()
if(opened)
icon_state = initial(icon_state) + "-open"
else
icon_state = initial(icon_state)
cut_overlays()
/obj/item/electronic_assembly/update_overlays()
. = ..()
if(detail_color == COLOR_ASSEMBLY_BLACK) //Black colored overlay looks almost but not exactly like the base sprite, so just cut the overlay and avoid it looking kinda off.
return
var/mutable_appearance/detail_overlay = mutable_appearance('icons/obj/assemblies/electronic_setups.dmi', "[icon_state]-color")
detail_overlay.color = detail_color
add_overlay(detail_overlay)
. += mutable_appearance('icons/obj/assemblies/electronic_setups.dmi', "[icon_state]-color", color = detail_color)
/obj/item/electronic_assembly/proc/return_total_complexity()
. = 0
@@ -34,18 +34,17 @@
.=..()
update_icon()
/obj/item/integrated_electronics/detailer/update_icon()
cut_overlays()
var/mutable_appearance/detail_overlay = mutable_appearance('icons/obj/assemblies/electronic_tools.dmi', "detailer-color")
detail_overlay.color = detail_color
add_overlay(detail_overlay)
/obj/item/integrated_electronics/detailer/update_overlays()
. = ..()
. += mutable_appearance('icons/obj/assemblies/electronic_tools.dmi', "detailer-color", color = detail_color)
/obj/item/integrated_electronics/detailer/attack_self(mob/user)
var/color_choice = input(user, "Select color.", "Assembly Detailer") as null|anything in color_list
if(!color_list[color_choice])
return
if(!in_range(src, user))
return
return
if(color_choice == "custom")
detail_color = input(user,"","Choose Color",detail_color) as color|null
else
@@ -15,7 +15,7 @@
var/datum/integrated_io/selected_io = null
var/mode = WIRE
/obj/item/integrated_electronics/wirer/update_icon()
/obj/item/integrated_electronics/wirer/update_icon_state()
icon_state = "wirer-[mode]"
/obj/item/integrated_electronics/wirer/proc/wire(var/datum/integrated_io/io, mob/user)
@@ -27,7 +27,7 @@
selected_io = io
to_chat(user, "<span class='notice'>You attach a data wire to \the [selected_io.holder]'s [selected_io.name] data channel.</span>")
mode = WIRING
update_icon()
update_icon()
if(WIRING)
if(io == selected_io)
to_chat(user, "<span class='warning'>Wiring \the [selected_io.holder]'s [selected_io.name] into itself is rather pointless.</span>")
+2 -5
View File
@@ -147,11 +147,8 @@
qdel(src)
/obj/structure/bookcase/update_icon()
if(contents.len < 5)
icon_state = "book-[contents.len]"
else
icon_state = "book-5"
/obj/structure/bookcase/update_icon_state()
icon_state = "book-[min(length(contents), 5)]"
/obj/structure/bookcase/manuals/medical
@@ -110,12 +110,12 @@
AddComponent(/datum/component/spraycan_paintable)
update_icon()
/obj/item/clothing/head/helmet/space/hostile_environment/update_icon()
..()
cut_overlays()
/obj/item/clothing/head/helmet/space/hostile_environment/update_overlays()
. = ..()
var/mutable_appearance/glass_overlay = mutable_appearance(icon, "hostile_env_glass")
glass_overlay.appearance_flags = RESET_COLOR
add_overlay(glass_overlay)
. += glass_overlay
/obj/item/clothing/head/helmet/space/hostile_environment/worn_overlays(isinhands, icon_file, style_flags = NONE)
. = ..()
@@ -155,19 +155,16 @@
else
set_light(0)
/obj/item/twohanded/kinetic_crusher/update_icon()
..()
cut_overlays()
if(!charged)
add_overlay("[icon_state]_uncharged")
if(light_on)
add_overlay("[icon_state]_lit")
spawn(1)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/twohanded/kinetic_crusher/update_icon_state()
item_state = "crusher[wielded]"
/obj/item/twohanded/kinetic_crusher/update_overlays()
. = ..()
if(!charged)
. += "[icon_state]_uncharged"
if(light_on)
. += "[icon_state]_lit"
//destablizing force
/obj/item/projectile/destabilizer
name = "destabilizing force"
@@ -40,7 +40,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
. += "<span class='notice'>Use in-hand to place a [singular_name].</span>"
. += "<span class='notice'>Alt-click to select a color. Current color is [picked_color].</span>"
/obj/item/stack/marker_beacon/update_icon()
/obj/item/stack/marker_beacon/update_icon_state()
icon_state = "[initial(icon_state)][lowertext(picked_color)]"
/obj/item/stack/marker_beacon/attack_self(mob/user)
@@ -129,14 +129,13 @@
. = ..()
update_icon()
/obj/item/organ/regenerative_core/update_icon()
/obj/item/organ/regenerative_core/update_icon_state()
icon_state = inert ? "legion_soul_inert" : "legion_soul"
cut_overlays()
/obj/item/organ/regenerative_core/update_overlays()
. = ..()
if(!inert && !preserved)
add_overlay("legion_soul_crackle")
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
. += "legion_soul_crackle"
/obj/item/organ/regenerative_core/legion/go_inert()
..()
@@ -139,11 +139,10 @@
icon = 'icons/obj/lavaland/survival_pod.dmi'
icon_state = "sleeper"
/obj/machinery/sleeper/survival_pod/update_icon()
if(state_open)
cut_overlays()
else
add_overlay("sleeper_cover")
/obj/machinery/sleeper/survival_pod/update_overlays()
. = ..()
if(!state_open)
. += "sleeper_cover"
//Computer
/obj/item/gps/computer
@@ -190,8 +189,9 @@
flags_1 = NODECONSTRUCT_1
var/empty = FALSE
/obj/machinery/smartfridge/survival_pod/update_icon()
return
/obj/machinery/stasis/survival_pod/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/machinery/smartfridge/survival_pod/Initialize(mapload)
. = ..()
+7 -7
View File
@@ -201,15 +201,15 @@
icon = 'icons/obj/lavaland/ash_flora.dmi'
icon_state = "mushroom_bowl"
/obj/item/reagent_containers/glass/bowl/mushroom_bowl/update_icon()
cut_overlays()
if(reagents && reagents.total_volume)
var/mutable_appearance/filling = mutable_appearance('icons/obj/lavaland/ash_flora.dmi', "fullbowl")
filling.color = mix_color_from_reagents(reagents.reagent_list)
add_overlay(filling)
else
/obj/item/reagent_containers/glass/bowl/mushroom_bowl/update_icon_state()
if(!reagents || !reagents.total_volume)
icon_state = "mushroom_bowl"
/obj/item/reagent_containers/glass/bowl/mushroom_bowl/update_overlays()
. = ..()
if(reagents && reagents.total_volume)
. += mutable_appearance('icons/obj/lavaland/ash_flora.dmi', "fullbowl", color = mix_color_from_reagents(reagents.reagent_list))
/obj/item/reagent_containers/glass/bowl/mushroom_bowl/attackby(obj/item/I,mob/user, params)
if(istype(I, /obj/item/reagent_containers/food/snacks))
var/obj/item/reagent_containers/food/snacks/S = I
@@ -561,7 +561,7 @@
desc = "A flask with an almost-holy aura emitting from it. The label on the bottle says: 'erqo'hyy tvi'rf lbh jv'atf'."
list_reagents = list(/datum/reagent/flightpotion = 5)
/obj/item/reagent_containers/glass/bottle/potion/update_icon()
/obj/item/reagent_containers/glass/bottle/potion/update_icon_state()
if(reagents.total_volume)
icon_state = "potionflask"
else
@@ -1072,6 +1072,10 @@
var/teleporting = FALSE //if we ARE teleporting
var/friendly_fire_check = FALSE //if the blasts we make will consider our faction against the faction of hit targets
/obj/item/hierophant_club/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/hierophant_club/examine(mob/user)
. = ..()
. += "<span class='hierophant_warning'>The[beacon ? " beacon is not currently":"re is a beacon"] attached.</span>"
@@ -1134,13 +1138,8 @@
chaser_speed = max(chaser_speed + health_percent, 0.5) //one tenth of a second faster for each missing 10% of health
blast_range -= round(health_percent * 10) //one additional range for each missing 10% of health
/obj/item/hierophant_club/update_icon()
icon_state = "hierophant_club[timer <= world.time ? "_ready":""][(beacon && !QDELETED(beacon)) ? "":"_beacon"]"
item_state = icon_state
if(ismob(loc))
var/mob/M = loc
M.update_inv_hands()
M.update_inv_back()
/obj/item/hierophant_club/update_icon_state()
icon_state = item_state = "hierophant_club[timer <= world.time ? "_ready":""][(beacon && !QDELETED(beacon)) ? "":"_beacon"]"
/obj/item/hierophant_club/proc/prepare_icon_update()
update_icon()
+1 -2
View File
@@ -341,9 +341,8 @@
..()
update_icon()
/obj/machinery/mineral/ore_redemption/update_icon()
/obj/machinery/mineral/ore_redemption/update_icon_state()
if(powered())
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]-off"
return
+1 -1
View File
@@ -87,7 +87,7 @@
..()
update_icon()
/obj/machinery/mineral/equipment_vendor/update_icon()
/obj/machinery/mineral/equipment_vendor/update_icon_state()
if(powered())
icon_state = initial(icon_state)
else
+4 -5
View File
@@ -20,25 +20,24 @@
mats_per_stack = MINERAL_MATERIAL_AMOUNT
var/list/stack_overlays
/obj/item/stack/ore/update_icon()
/obj/item/stack/ore/update_overlays()
. = ..()
var/difference = min(ORESTACK_OVERLAYS_MAX, amount) - (LAZYLEN(stack_overlays)+1)
if(difference == 0)
return
else if(difference < 0 && LAZYLEN(stack_overlays)) //amount < stack_overlays, remove excess.
cut_overlays()
if (LAZYLEN(stack_overlays)-difference <= 0)
stack_overlays = null;
stack_overlays = null
else
stack_overlays.len += difference
else if(difference > 0) //amount > stack_overlays, add some.
cut_overlays()
for(var/i in 1 to difference)
var/mutable_appearance/newore = mutable_appearance(icon, icon_state)
newore.pixel_x = rand(-8,8)
newore.pixel_y = rand(-8,8)
LAZYADD(stack_overlays, newore)
if (stack_overlays)
add_overlay(stack_overlays)
. += stack_overlays
/obj/item/stack/ore/welder_act(mob/living/user, obj/item/I)
if(!refined_type)
+1 -2
View File
@@ -41,9 +41,8 @@
..()
update_icon()
/obj/machinery/point_bank/update_icon()
/obj/machinery/point_bank/update_icon_state()
if(powered())
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]-off"
return
+16 -9
View File
@@ -14,20 +14,20 @@
var/force_replace_ai_name = FALSE
var/overrides_aicore_laws = FALSE // Whether the laws on the MMI, if any, override possible pre-existing laws loaded on the AI core.
/obj/item/mmi/update_icon()
/obj/item/mmi/update_icon_state()
if(!brain)
icon_state = "mmi_off"
return
if(istype(brain, /obj/item/organ/brain/alien))
else if(istype(brain, /obj/item/organ/brain/alien))
icon_state = "mmi_brain_alien"
braintype = "Xenoborg" //HISS....Beep.
else
icon_state = "mmi_brain"
braintype = "Cyborg"
/obj/item/mmi/update_overlays()
. = ..()
if(brainmob && brainmob.stat != DEAD)
add_overlay("mmi_alive")
. += "mmi_alive"
else
add_overlay("mmi_dead")
. += "mmi_dead"
/obj/item/mmi/Initialize()
. = ..()
@@ -68,6 +68,10 @@
name = "Man-Machine Interface: [brainmob.real_name]"
update_icon()
if(istype(brain, /obj/item/organ/brain/alien))
braintype = "Xenoborg" //HISS....Beep.
else
braintype = "Cyborg"
SSblackbox.record_feedback("amount", "mmis_filled", 1)
@@ -85,7 +89,7 @@
to_chat(user, "<span class='notice'>You unlock and upend the MMI, spilling the brain onto the floor.</span>")
eject_brain(user)
update_icon()
name = "Man-Machine Interface"
name = initial(name)
/obj/item/mmi/proc/eject_brain(mob/user)
brainmob.container = null //Reset brainmob mmi var.
@@ -129,7 +133,10 @@
name = "Man-Machine Interface: [brainmob.real_name]"
update_icon()
return
if(istype(brain, /obj/item/organ/brain/alien))
braintype = "Xenoborg" //HISS....Beep.
else
braintype = "Cyborg"
/obj/item/mmi/proc/replacement_ai_name()
return brainmob.name
+2 -3
View File
@@ -184,11 +184,10 @@ GLOBAL_VAR(posibrain_notify_cooldown)
return
/obj/item/mmi/posibrain/update_icon()
/obj/item/mmi/posibrain/update_icon_state()
if(searching)
icon_state = "[initial(icon_state)]-searching"
return
if(brainmob && brainmob.key)
else if(brainmob && brainmob.key)
icon_state = "[initial(icon_state)]-occupied"
else
icon_state = initial(icon_state)
@@ -100,6 +100,9 @@
var/obj/item/light_eater/blade
decay_factor = 0
/obj/item/organ/heart/nightmare/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/item/organ/heart/nightmare/attack(mob/M, mob/living/carbon/user, obj/target)
if(M != user)
@@ -130,9 +133,6 @@
/obj/item/organ/heart/nightmare/Stop()
return 0
/obj/item/organ/heart/nightmare/update_icon()
return //always beating visually
/obj/item/organ/heart/nightmare/on_death()
if(!owner)
return
@@ -633,8 +633,9 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
<br>
"}
/obj/item/paper/guides/antag/guardian/update_icon()
return
/obj/item/paper/guides/antag/guardian/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/item/paper/guides/antag/guardian/wizard
name = "Guardian Guide"
@@ -244,8 +244,9 @@ Difficulty: Very Hard
var/list/stored_items = list()
var/list/blacklist = list()
/obj/machinery/smartfridge/black_box/update_icon()
return
/obj/machinery/smartfridge/black_box/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/machinery/smartfridge/black_box/accept_check(obj/item/O)
if(!istype(O))
@@ -26,6 +26,7 @@
var/icon_state_unpowered = null // Icon state when the computer is turned off.
var/icon_state_powered = null // Icon state when the computer is turned on.
var/icon_state_menu = "menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen.
var/display_overlays = TRUE // If FALSE, don't draw overlays on this device at all
var/max_hardware_size = 0 // Maximal hardware w_class. Tablets/PDAs have 1, laptops 2, consoles 4.
var/steel_sheet_cost = 5 // Amount of steel sheets refunded when disassembling an empty frame of this computer.
@@ -208,20 +209,26 @@
else if(obj_integrity < max_integrity)
. += "<span class='warning'>It is damaged.</span>"
/obj/item/modular_computer/update_icon()
cut_overlays()
/obj/item/modular_computer/update_icon_state()
if(!enabled)
icon_state = icon_state_unpowered
else
icon_state = icon_state_powered
/obj/item/modular_computer/update_overlays()
. = ..()
if(!display_overlays)
return
if(enabled)
if(active_program)
add_overlay(active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu)
. += active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu
else
add_overlay(icon_state_menu)
. += icon_state_menu
if(obj_integrity <= integrity_failure * max_integrity)
add_overlay("bsod")
add_overlay("broken")
. += "bsod"
. += "broken"
// On-click handling. Turns on the computer if it's off and opens the GUI.
@@ -18,6 +18,7 @@
screen_on = 0 // Starts closed
var/start_open = TRUE // unless this var is set to 1
var/icon_state_closed = "laptop-closed"
display_overlays = FALSE
var/w_class_open = WEIGHT_CLASS_BULKY
/obj/item/modular_computer/laptop/examine(mob/user)
@@ -31,12 +32,11 @@
if(start_open && !screen_on)
toggle_open()
/obj/item/modular_computer/laptop/update_icon()
if(screen_on)
..()
else
cut_overlays()
/obj/item/modular_computer/laptop/update_icon_state()
if(!screen_on)
icon_state = icon_state_closed
else
. = ..()
/obj/item/modular_computer/laptop/attack_self(mob/user)
if(!screen_on)
@@ -97,6 +97,7 @@
w_class = w_class_open
screen_on = !screen_on
display_overlays = screen_on
update_icon()
@@ -16,15 +16,15 @@
machinery_computer.cpu = null
machinery_computer = null
/obj/item/modular_computer/processor/New(comp)
/obj/item/modular_computer/processor/Initialize(mapload)
. = ..()
if(!comp || !istype(comp, /obj/machinery/modular_computer))
if(!loc || !istype(loc, /obj/machinery/modular_computer))
CRASH("Inapropriate type passed to obj/item/modular_computer/processor/New()! Aborting.")
return
// Obtain reference to machinery computer
all_components = list()
idle_threads = list()
machinery_computer = comp
machinery_computer = loc
machinery_computer.cpu = src
hardware_flag = machinery_computer.hardware_flag
max_hardware_size = machinery_computer.max_hardware_size
@@ -34,14 +34,11 @@
integrity_failure = machinery_computer.integrity_failure
base_active_power_usage = machinery_computer.base_active_power_usage
base_idle_power_usage = machinery_computer.base_idle_power_usage
machinery_computer.RegisterSignal(src, COMSIG_ATOM_UPDATED_ICON, /atom/proc/update_icon) //when we update_icon, also update the computer
/obj/item/modular_computer/processor/relay_qdel()
qdel(machinery_computer)
/obj/item/modular_computer/processor/update_icon()
if(machinery_computer)
return machinery_computer.update_icon()
// This thing is not meant to be used on it's own, get topic data from our machinery owner.
//obj/item/modular_computer/processor/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
// if(!machinery_computer)
@@ -15,14 +15,11 @@
var/has_variants = TRUE
var/finish_color = null
/obj/item/modular_computer/tablet/update_icon()
..()
/obj/item/modular_computer/tablet/update_icon_state()
if(has_variants)
if(!finish_color)
finish_color = pick("red","blue","brown","green","black")
icon_state = "tablet-[finish_color]"
icon_state_unpowered = "tablet-[finish_color]"
icon_state_powered = "tablet-[finish_color]"
icon_state = icon_state_powered = icon_state_unpowered = "tablet-[finish_color]"
/obj/item/modular_computer/tablet/syndicate_contract_uplink
name = "contractor tablet"
@@ -48,26 +48,28 @@
if(cpu)
. |= cpu.emag_act(user)
/obj/machinery/modular_computer/update_icon()
cut_overlays()
icon_state = icon_state_powered
/obj/machinery/modular_computer/update_icon_state()
if(cpu?.enabled)
icon_state = icon_state_powered
else if(stat & NOPOWER || !(cpu?.use_power()))
icon_state = icon_state_unpowered
/obj/machinery/modular_computer/update_overlays()
. = ..()
if(!cpu || !cpu.enabled)
if (!(stat & NOPOWER) && (cpu && cpu.use_power()))
add_overlay(screen_icon_screensaver)
else
icon_state = icon_state_unpowered
. += screen_icon_screensaver
set_light(0)
else
set_light(light_strength)
if(cpu.active_program)
add_overlay(cpu.active_program.program_icon_state ? cpu.active_program.program_icon_state : screen_icon_state_menu)
. += cpu.active_program.program_icon_state ? cpu.active_program.program_icon_state : screen_icon_state_menu
else
add_overlay(screen_icon_state_menu)
. += screen_icon_state_menu
if(cpu && cpu.obj_integrity <= cpu.integrity_failure * cpu.max_integrity)
add_overlay("bsod")
add_overlay("broken")
. += "bsod"
. += "broken"
// Eject ID card from computer, if it has ID slot with card inside.
/obj/machinery/modular_computer/proc/eject_id()
@@ -53,7 +53,7 @@ GLOBAL_LIST_EMPTY(allCasters)
picture = null
return ..()
/obj/machinery/newscaster/update_icon()
/obj/machinery/newscaster/update_icon_state()
if(stat & (NOPOWER|BROKEN))
icon_state = "newscaster_off"
else
+6 -6
View File
@@ -25,14 +25,14 @@
QDEL_NULL(toppaper) //let movable/Destroy handle the rest
return ..()
/obj/item/clipboard/update_icon()
cut_overlays()
/obj/item/clipboard/update_overlays()
. = ..()
if(toppaper)
add_overlay(toppaper.icon_state)
copy_overlays(toppaper)
. += toppaper.icon_state
. += toppaper.overlays
if(haspen)
add_overlay("clipboard_pen")
add_overlay("clipboard_over")
. += "clipboard_pen"
. += "clipboard_over"
/obj/item/clipboard/attackby(obj/item/W, mob/user, params)
+5 -4
View File
@@ -7,13 +7,14 @@
var/datum/mind/target
item_flags = NOBLUDGEON
/obj/item/paper/contract/ComponentInitialize()
return
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/item/paper/contract/proc/update_text()
return
/obj/item/paper/contract/update_icon()
return
/obj/item/paper/contract/employment
icon_state = "paper_words"
+3 -4
View File
@@ -28,11 +28,10 @@
icon_state = "folder_white"
/obj/item/folder/update_icon()
cut_overlays()
/obj/item/folder/update_overlays()
. = ..()
if(contents.len)
add_overlay("folder_paper")
. += "folder_paper"
/obj/item/folder/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo) || istype(W, /obj/item/documents))
+4 -4
View File
@@ -78,8 +78,7 @@
return get_dist(src, target) < 2
return ..()
/obj/item/paper/update_icon()
/obj/item/paper/update_icon_state()
if(resistance_flags & ON_FIRE)
icon_state = "paper_onfire"
return
@@ -379,8 +378,9 @@
icon_state = "scrap"
slot_flags = null
/obj/item/paper/crumpled/update_icon()
return
/obj/item/paper/crumpled/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/item/paper/crumpled/bloody
icon_state = "scrap_bloodied"
+5 -5
View File
@@ -34,13 +34,13 @@
return (BRUTELOSS)
/obj/item/papercutter/update_icon()
..()
cut_overlays()
/obj/item/papercutter/update_icon_state()
icon_state = (storedcutter ? "[initial(icon_state)]-cutter" : "[initial(icon_state)]")
if(storedpaper)
add_overlay("paper")
/obj/item/papercutter/update_overlays()
. = ..()
if(storedpaper)
. += "paper"
/obj/item/papercutter/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/paper) && !storedpaper)
+6 -4
View File
@@ -51,7 +51,7 @@
else if(istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
else
. = ..()
@@ -125,14 +125,16 @@
. += "It doesn't contain anything."
/obj/item/paper_bin/update_icon()
/obj/item/paper_bin/update_icon_state()
if(total_paper < 1)
icon_state = "paper_bin0"
else
icon_state = "[initial(icon_state)]"
cut_overlays()
/obj/item/paper_bin/update_overlays()
. = ..()
if(bin_pen)
add_overlay(mutable_appearance(bin_pen.icon, bin_pen.icon_state))
. += mutable_appearance(bin_pen.icon, bin_pen.icon_state)
/obj/item/paper_bin/construction
name = "construction paper bin"
+3 -3
View File
@@ -55,12 +55,12 @@
sleep(10)
return (BRUTELOSS)
/obj/item/paperplane/update_icon()
cut_overlays()
/obj/item/paperplane/update_overlays()
. = ..()
var/list/stamped = internalPaper.stamped
if(stamped)
for(var/S in stamped)
add_overlay("paperplane_[S]")
. += "paperplane_[S]"
/obj/item/paperplane/attack_self(mob/user)
to_chat(user, "<span class='notice'>You unfold [src].</span>")
+4 -4
View File
@@ -179,9 +179,10 @@
sharpness = IS_SHARP
var/on = FALSE
/obj/item/pen/edagger/Initialize()
/obj/item/pen/edagger/ComponentInitialize()
. = ..()
AddComponent(/datum/component/butchering, 60, 100, 0, 'sound/weapons/blade1.ogg')
AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/pen/edagger/get_sharpness()
return on * sharpness
@@ -209,10 +210,9 @@
to_chat(user, "<span class='warning'>[src] is now active.</span>")
update_icon()
/obj/item/pen/edagger/update_icon()
/obj/item/pen/edagger/update_icon_state()
if(on)
icon_state = "edagger"
item_state = "edagger"
icon_state = item_state = "edagger"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
else
+6 -6
View File
@@ -43,10 +43,10 @@
return list()
return ..()
/obj/item/wallframe/picture/update_icon()
cut_overlays()
/obj/item/wallframe/picture/update_overlays()
. = ..()
if(displayed)
add_overlay(image(displayed))
. += image(displayed)
/obj/item/wallframe/picture/after_attach(obj/O)
..()
@@ -145,10 +145,10 @@
if(framed)
framed.show(user)
/obj/structure/sign/picture_frame/update_icon()
cut_overlays()
/obj/structure/sign/picture_frame/update_overlays()
. = ..()
if(framed)
add_overlay(image(framed))
. += image(framed)
/obj/structure/sign/picture_frame/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
+1 -1
View File
@@ -32,7 +32,7 @@
if(setdesc && P.picture_desc)
desc = P.picture_desc
/obj/item/photo/update_icon()
/obj/item/photo/update_icon_state()
if(!istype(picture) || !picture.picture_image)
return
var/icon/I = picture.get_small_icon()
+2 -3
View File
@@ -297,8 +297,7 @@
mist_on()
update_icon()
/obj/machinery/pool/controller/update_icon()
. = ..()
/obj/machinery/pool/controller/update_icon_state()
icon_state = "poolc_[temperature]"
/obj/machinery/pool/controller/proc/CanUpTemp(mob/user)
@@ -412,7 +411,7 @@
/obj/machinery/pool/controller/proc/mist_on() //Spawn /obj/effect/mist (from the shower) on all linked pool tiles
if(mist_state)
return
mist_off() //make sure it cycles and deletes everything
mist_off() //make sure it cycles and deletes everything
mist_state = TRUE
for(var/X in linked_turfs)
var/turf/open/pool/W = X
+3 -2
View File
@@ -151,10 +151,11 @@
return
/obj/machinery/power/am_control_unit/update_icon()
/obj/machinery/power/am_control_unit/update_icon_state()
if(active)
icon_state = "control_on"
else icon_state = "control"
else
icon_state = "control"
//No other icons for it atm
+4 -3
View File
@@ -107,10 +107,9 @@
check_stability()
/obj/machinery/am_shielding/update_icon()
/obj/machinery/am_shielding/update_icon_state()
dirs = 0
coredirs = 0
cut_overlays()
for(var/direction in GLOB.alldirs)
var/turf/T = get_step(loc, direction)
for(var/obj/machinery/machine in T)
@@ -137,8 +136,10 @@
icon_state = "[prefix]shield_[icondirs]"
/obj/machinery/am_shielding/update_overlays()
. = ..()
if(core_check())
add_overlay("core[control_unit && control_unit.active]")
. += "core[control_unit?.active]"
if(!processing)
setup_core()
else if(processing)
+1 -1
View File
@@ -130,7 +130,7 @@ By design, d1 is the smallest direction and d2 is the highest
invisibility = i ? INVISIBILITY_MAXIMUM : 0
update_icon()
/obj/structure/cable/update_icon()
/obj/structure/cable/update_icon_state()
icon_state = "[d1]-[d2]"
color = null
add_atom_colour(cable_color, FIXED_COLOUR_PRIORITY)
+8 -7
View File
@@ -58,16 +58,16 @@
else
return PROCESS_KILL
/obj/item/stock_parts/cell/update_icon()
cut_overlays()
/obj/item/stock_parts/cell/update_overlays()
. = ..()
if(grown_battery)
add_overlay(image('icons/obj/power.dmi',"grown_wires"))
. += image('icons/obj/power.dmi',"grown_wires")
if(charge < 0.01)
return
else if(charge/maxcharge >=0.995)
add_overlay("cell-o2")
. += "cell-o2"
else
add_overlay("cell-o1")
. += "cell-o1"
/obj/item/stock_parts/cell/proc/percent() // return % charge of cell
return 100*charge/maxcharge
@@ -281,8 +281,9 @@
maxcharge = 50000
ratingdesc = FALSE
/obj/item/stock_parts/cell/infinite/abductor/update_icon()
return
/obj/item/stock_parts/cell/infinite/abductor/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/item/stock_parts/cell/potato
+5 -9
View File
@@ -30,19 +30,15 @@
SSair.atmos_machinery -= src
return ..()
/obj/machinery/power/generator/update_icon()
if(stat & (NOPOWER|BROKEN))
cut_overlays()
else
cut_overlays()
/obj/machinery/power/generator/update_overlays()
. = ..()
if(!(stat & (NOPOWER|BROKEN)))
var/L = min(round(lastgenlev/100000),11)
if(L != 0)
add_overlay(image('icons/obj/power.dmi', "teg-op[L]"))
. += image('icons/obj/power.dmi', "teg-op[L]")
if(hot_circ && cold_circ)
add_overlay("teg-oc[lastcirc]")
. += "teg-oc[lastcirc]"
#define GENRATE 800 // generator output coefficient from Q
+3 -8
View File
@@ -44,8 +44,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
if(tesla_flags & TESLA_MACHINE_EXPLOSIVE)
qdel(src)//like the singulo, tesla deletes it. stops it from exploding over and over
/obj/machinery/gravity_generator/update_icon()
..()
/obj/machinery/gravity_generator/update_icon_state()
icon_state = "[get_status()]_[sprite_number]"
/obj/machinery/gravity_generator/proc/get_status()
@@ -156,6 +155,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
part.main_part = src
parts += part
part.update_icon()
part.RegisterSignal(src, COMSIG_ATOM_UPDATED_ICON, /atom/proc/update_icon)
/obj/machinery/gravity_generator/main/proc/connected_parts()
return parts.len == 8
@@ -235,7 +235,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
data["charging_state"] = charging_state
data["on"] = on
data["operational"] = (stat & BROKEN) ? FALSE : TRUE
return data
/obj/machinery/gravity_generator/main/ui_act(action, params)
@@ -259,11 +259,6 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
return "fix[min(broken_state, 3)]"
return on || charging_state != POWER_IDLE ? "on" : "off"
/obj/machinery/gravity_generator/main/update_icon()
..()
for(var/obj/O in parts)
O.update_icon()
// Set the charging state based on power/breaker.
/obj/machinery/gravity_generator/main/proc/set_power()
var/new_state = FALSE
+9 -7
View File
@@ -291,8 +291,7 @@
QDEL_NULL(cell)
return ..()
/obj/machinery/light/update_icon()
cut_overlays()
/obj/machinery/light/update_icon_state()
switch(status) // set icon_states
if(LIGHT_OK)
var/area/A = get_base_area(src)
@@ -303,17 +302,20 @@
icon_state = "[base_state]_hijacked"
else
icon_state = "[base_state]"
if(on)
var/mutable_appearance/glowybit = mutable_appearance(overlayicon, base_state, ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE)
glowybit.alpha = CLAMP(light_power*250, 30, 200)
add_overlay(glowybit)
if(LIGHT_EMPTY)
icon_state = "[base_state]-empty"
if(LIGHT_BURNED)
icon_state = "[base_state]-burned"
if(LIGHT_BROKEN)
icon_state = "[base_state]-broken"
return
/obj/machinery/light/update_overlays()
. = ..()
if(on && status == LIGHT_OK)
var/mutable_appearance/glowybit = mutable_appearance(overlayicon, base_state, ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE)
glowybit.alpha = CLAMP(light_power*250, 30, 200)
. += glowybit
// update the icon_state and luminosity of the light depending on its state
/obj/machinery/light/proc/update(trigger = TRUE)
+1 -1
View File
@@ -39,7 +39,7 @@
/obj/machinery/power/port_gen/proc/handleInactive()
return
/obj/machinery/power/port_gen/update_icon()
/obj/machinery/power/port_gen/update_icon_state()
icon_state = "[base_icon]_[active]"
/obj/machinery/power/port_gen/process()
+4 -4
View File
@@ -204,14 +204,14 @@
if(loaded_tank && active && pulse_strength > RAD_COLLECTOR_EFFICIENCY)
stored_power += (pulse_strength-RAD_COLLECTOR_EFFICIENCY)*RAD_COLLECTOR_COEFFICIENT
/obj/machinery/power/rad_collector/update_icon()
cut_overlays()
/obj/machinery/power/rad_collector/update_overlays()
. = ..()
if(loaded_tank)
add_overlay("ptank")
. += "ptank"
if(stat & (NOPOWER|BROKEN))
return
if(active)
add_overlay("on")
. += "on"
/obj/machinery/power/rad_collector/proc/toggle_power()
+1 -1
View File
@@ -112,7 +112,7 @@
QDEL_NULL(sparks)
return ..()
/obj/machinery/power/emitter/update_icon()
/obj/machinery/power/emitter/update_icon_state()
if (active && powernet && avail(active_power_usage))
icon_state = icon_state_on
else
@@ -44,14 +44,14 @@ field_generator power level display
var/list/obj/machinery/field/generator/connected_gens
var/clean_up = 0
/obj/machinery/field/generator/update_icon()
cut_overlays()
/obj/machinery/field/generator/update_overlays()
. = ..()
if(warming_up)
add_overlay("+a[warming_up]")
. += "+a[warming_up]"
if(fields.len)
add_overlay("+on")
. += "+on"
if(power_level)
add_overlay("+p[power_level]")
. += "+p[power_level]"
/obj/machinery/field/generator/Initialize()
@@ -124,7 +124,7 @@
investigate_log("was moved whilst active; it <font color='red'>powered down</font>.", INVESTIGATE_SINGULO)
/obj/structure/particle_accelerator/update_icon()
/obj/structure/particle_accelerator/update_icon_state()
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED,PA_CONSTRUCTION_UNWIRED)
icon_state="[reference]"
@@ -60,7 +60,7 @@
active = 0
connected_parts.Cut()
/obj/machinery/particle_accelerator/control_box/update_icon()
/obj/machinery/particle_accelerator/control_box/update_icon_state()
if(active)
icon_state = "control_boxp1"
else
+8 -12
View File
@@ -199,29 +199,25 @@
stat |= BROKEN
/obj/machinery/power/smes/update_icon()
cut_overlays()
if(stat & BROKEN)
return
if(panel_open)
/obj/machinery/power/smes/update_overlays()
. = ..()
if((stat & BROKEN) || panel_open)
return
if(outputting)
add_overlay("smes-op1")
. += "smes-op1"
else
add_overlay("smes-op0")
. += "smes-op0"
if(inputting)
add_overlay("smes-oc1")
. += "smes-oc1"
else
if(input_attempt)
add_overlay("smes-oc0")
. += "smes-oc0"
var/clevel = chargedisplay()
if(clevel>0)
add_overlay("smes-og[clevel]")
. += "smes-og[clevel]"
/obj/machinery/power/smes/proc/chargedisplay()
return CLAMP(round(5.5*charge/capacity),0,5)
@@ -39,8 +39,7 @@
QDEL_NULL(BB)
return ..()
/obj/item/ammo_casing/update_icon()
..()
/obj/item/ammo_casing/update_icon_state()
icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
desc = "[initial(desc)][BB ? "" : " This one is spent."]"
@@ -11,6 +11,5 @@
else
return FALSE
/obj/item/ammo_casing/caseless/update_icon()
..()
/obj/item/ammo_casing/caseless/update_icon_state()
icon_state = "[initial(icon_state)]"
@@ -9,8 +9,7 @@
harmful = FALSE
var/modified = FALSE
/obj/item/ammo_casing/caseless/foam_dart/update_icon()
..()
/obj/item/ammo_casing/caseless/foam_dart/update_icon_state()
if (modified)
icon_state = "foamdart_empty"
desc = "It's nerf or nothing! ... Although, this one doesn't look too safe."
+1 -2
View File
@@ -19,8 +19,7 @@
chamber_round()
update_icon()
/obj/item/gun/ballistic/update_icon()
..()
/obj/item/gun/ballistic/update_icon_state()
if(current_skin)
icon_state = "[unique_reskin[current_skin]][suppressed ? "-suppressed" : ""][sawn_off ? "-sawn" : ""]"
else
@@ -44,7 +44,7 @@
to_chat(user, "<span class='notice'>You notch the arrow.</span>")
update_icon()
/obj/item/gun/ballistic/bow/update_icon()
/obj/item/gun/ballistic/bow/update_icon_state()
icon_state = "[initial(icon_state)]_[get_ammo() ? (chambered ? "firing" : "loaded") : "unloaded"]"
/obj/item/gun/ballistic/bow/can_shoot()
@@ -73,7 +73,7 @@
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
/obj/item/minigunpack/update_icon()
/obj/item/minigunpack/update_icon_state()
if(armed)
icon_state = "notholstered"
else
-3
View File
@@ -73,9 +73,6 @@
recharge_newshot()
return 1
/obj/item/gun/magic/update_icon()
return
/obj/item/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
to_chat(user, "<span class='warning'>The [name] whizzles quietly.</span>")
+1 -1
View File
@@ -21,7 +21,7 @@
. = ..()
. += "Has [charges] charge\s remaining."
/obj/item/gun/magic/wand/update_icon()
/obj/item/gun/magic/wand/update_icon_state()
icon_state = "[initial(icon_state)][charges ? "" : "-drained"]"
/obj/item/gun/magic/wand/attack(atom/target, mob/living/user)
@@ -144,14 +144,14 @@
..()
icon_state = "[(nopower_state && !powered()) ? nopower_state : initial(icon_state)]"
/obj/machinery/chem_dispenser/update_icon()
cut_overlays()
/obj/machinery/chem_dispenser/update_overlays()
. = ..()
if(has_panel_overlay && panel_open)
add_overlay(mutable_appearance(icon, "[initial(icon_state)]_panel-o"))
. += mutable_appearance(icon, "[initial(icon_state)]_panel-o")
if(beaker)
beaker_overlay = display_beaker()
add_overlay(beaker_overlay)
. += beaker_overlay
/obj/machinery/chem_dispenser/emag_act(mob/user)
. = ..()
@@ -22,7 +22,7 @@
beaker = null
update_icon()
/obj/machinery/chem_heater/update_icon()
/obj/machinery/chem_heater/update_icon_state()
if(beaker)
icon_state = "mixer1b"
else

Some files were not shown because too many files have changed in this diff Show More