Merge pull request #11391 from Ghommie/Ghommie-cit612
Porting "Further update_icon splitup"
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user