ports "Standardize obj/updateicon() and update_icons() to update_icon()"
This commit is contained in:
@@ -113,7 +113,7 @@
|
||||
name = "Show Buttons"
|
||||
else
|
||||
name = "Hide Buttons"
|
||||
UpdateIcon()
|
||||
update_icon()
|
||||
usr.update_action_buttons()
|
||||
|
||||
/obj/screen/movable/action_button/hide_toggle/AltClick(mob/user)
|
||||
@@ -135,9 +135,9 @@
|
||||
hide_icon = settings["toggle_icon"]
|
||||
hide_state = settings["toggle_hide"]
|
||||
show_state = settings["toggle_show"]
|
||||
UpdateIcon()
|
||||
update_icon()
|
||||
|
||||
/obj/screen/movable/action_button/hide_toggle/proc/UpdateIcon()
|
||||
/obj/screen/movable/action_button/hide_toggle/update_icon()
|
||||
cut_overlays()
|
||||
add_overlay(mutable_appearance(hide_icon, hidden ? show_state : hide_state))
|
||||
|
||||
|
||||
@@ -327,7 +327,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
|
||||
for(var/obj/machinery/light/L in src)
|
||||
L.update()
|
||||
|
||||
/area/proc/updateicon()
|
||||
/area/proc/update_icon()
|
||||
var/weather_icon
|
||||
for(var/V in SSweather.processing)
|
||||
var/datum/weather/W = V
|
||||
@@ -337,7 +337,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
|
||||
if(!weather_icon)
|
||||
icon_state = null
|
||||
|
||||
/area/space/updateicon()
|
||||
/area/space/update_icon()
|
||||
icon_state = null
|
||||
|
||||
/*
|
||||
@@ -370,7 +370,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
|
||||
/area/proc/power_change()
|
||||
for(var/obj/machinery/M in src) // for each machine in the area
|
||||
M.power_change() // reverify power status (to update icons etc.)
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
/area/proc/usage(chan)
|
||||
var/used = 0
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
// update the invisibility and icon
|
||||
/obj/machinery/bluespace_beacon/hide(intact)
|
||||
invisibility = intact ? INVISIBILITY_MAXIMUM : 0
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
// update the icon_state
|
||||
/obj/machinery/bluespace_beacon/proc/updateicon()
|
||||
/obj/machinery/bluespace_beacon/update_icon()
|
||||
var/state="floor_beacon"
|
||||
|
||||
if(invisibility)
|
||||
@@ -45,4 +45,4 @@
|
||||
else if (Beacon.loc != loc)
|
||||
Beacon.forceMove(loc)
|
||||
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
var/chargelevel = -1
|
||||
var/charge_rate = 500
|
||||
|
||||
/obj/machinery/cell_charger/proc/updateicon()
|
||||
/obj/machinery/cell_charger/update_icon()
|
||||
cut_overlays()
|
||||
if(charging)
|
||||
add_overlay(image(charging.icon, charging.icon_state))
|
||||
@@ -53,7 +53,7 @@
|
||||
charging = W
|
||||
user.visible_message("[user] inserts a cell into [src].", "<span class='notice'>You insert a cell into [src].</span>")
|
||||
chargelevel = -1
|
||||
updateicon()
|
||||
update_icon()
|
||||
else
|
||||
if(!charging && default_deconstruction_screwdriver(user, icon_state, icon_state, W))
|
||||
return
|
||||
@@ -76,7 +76,7 @@
|
||||
charging.update_icon()
|
||||
charging = null
|
||||
chargelevel = -1
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/cell_charger/attack_hand(mob/user)
|
||||
. = ..()
|
||||
@@ -127,4 +127,4 @@
|
||||
use_power(charge_rate)
|
||||
charging.give(charge_rate) //this is 2558, efficient batteries exist
|
||||
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
name = "light switch ([area.name])"
|
||||
|
||||
on = area.lightswitch
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/light_switch/proc/updateicon()
|
||||
/obj/machinery/light_switch/update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "light-p"
|
||||
else
|
||||
@@ -41,11 +41,11 @@
|
||||
on = !on
|
||||
|
||||
area.lightswitch = on
|
||||
area.updateicon()
|
||||
area.update_icon()
|
||||
|
||||
for(var/obj/machinery/light_switch/L in area)
|
||||
L.on = on
|
||||
L.updateicon()
|
||||
L.update_icon()
|
||||
|
||||
area.power_change()
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
else
|
||||
stat |= NOPOWER
|
||||
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/light_switch/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
// update the invisibility and icon
|
||||
/obj/machinery/magnetic_module/hide(intact)
|
||||
invisibility = intact ? INVISIBILITY_MAXIMUM : 0
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
// update the icon_state
|
||||
/obj/machinery/magnetic_module/proc/updateicon()
|
||||
/obj/machinery/magnetic_module/update_icon()
|
||||
var/state="floor_magnet"
|
||||
var/onstate=""
|
||||
if(!on)
|
||||
@@ -161,7 +161,7 @@
|
||||
else
|
||||
use_power = NO_POWER_USE
|
||||
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/magnetic_module/proc/magnetic_process() // proc that actually does the magneting
|
||||
|
||||
@@ -72,10 +72,10 @@
|
||||
// hide the object if turf is intact
|
||||
/obj/machinery/navbeacon/hide(intact)
|
||||
invisibility = intact ? INVISIBILITY_MAXIMUM : 0
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
// update the icon_state
|
||||
/obj/machinery/navbeacon/proc/updateicon()
|
||||
/obj/machinery/navbeacon/update_icon()
|
||||
var/state="navbeacon[open]"
|
||||
|
||||
if(invisibility)
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "<span class='notice'>You [open ? "open" : "close"] the beacon's cover.</span>")
|
||||
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
else if (istype(I, /obj/item/card/id)||istype(I, /obj/item/pda))
|
||||
if(open)
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
loadedWeightClass -= I.w_class
|
||||
else if (A == tank)
|
||||
tank = null
|
||||
update_icons()
|
||||
update_icon()
|
||||
|
||||
/obj/item/pneumatic_cannon/ghetto //Obtainable by improvised methods; more gas per use, less capacity, but smaller
|
||||
name = "improvised pneumatic cannon"
|
||||
@@ -239,14 +239,13 @@
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You hook \the [thetank] up to \the [src].</span>")
|
||||
tank = thetank
|
||||
update_icons()
|
||||
update_icon()
|
||||
|
||||
/obj/item/pneumatic_cannon/proc/update_icons()
|
||||
/obj/item/pneumatic_cannon/update_icon()
|
||||
cut_overlays()
|
||||
if(!tank)
|
||||
return
|
||||
add_overlay(tank.icon_state)
|
||||
update_icon()
|
||||
|
||||
/obj/item/pneumatic_cannon/proc/fill_with_type(type, amount)
|
||||
if(!ispath(type, /obj) && !ispath(type, /mob))
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
/obj/item/robot_suit/New()
|
||||
..()
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
/obj/item/robot_suit/prebuilt/New()
|
||||
l_arm = new(src)
|
||||
@@ -39,7 +39,7 @@
|
||||
chest.cell = new /obj/item/stock_parts/cell/high/plus(chest)
|
||||
..()
|
||||
|
||||
/obj/item/robot_suit/proc/updateicon()
|
||||
/obj/item/robot_suit/update_icon()
|
||||
cut_overlays()
|
||||
if(l_arm)
|
||||
add_overlay("[l_arm.icon_state]+o")
|
||||
@@ -96,7 +96,7 @@
|
||||
to_chat(user, "<span class='notice'>You disassemble the cyborg shell.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There is nothing to remove from the endoskeleton.</span>")
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
/obj/item/robot_suit/proc/put_in_hand_or_drop(mob/living/user, obj/item/I) //normal put_in_hands() drops the item ontop of the player, this drops it at the suit's loc
|
||||
if(!user.put_in_hands(I))
|
||||
@@ -160,7 +160,7 @@
|
||||
W.icon_state = initial(W.icon_state)
|
||||
W.cut_overlays()
|
||||
src.l_leg = W
|
||||
src.updateicon()
|
||||
update_icon()
|
||||
|
||||
else if(istype(W, /obj/item/bodypart/r_leg/robot))
|
||||
if(src.r_leg)
|
||||
@@ -170,7 +170,7 @@
|
||||
W.icon_state = initial(W.icon_state)
|
||||
W.cut_overlays()
|
||||
src.r_leg = W
|
||||
src.updateicon()
|
||||
update_icon()
|
||||
|
||||
else if(istype(W, /obj/item/bodypart/l_arm/robot))
|
||||
if(src.l_arm)
|
||||
@@ -180,7 +180,7 @@
|
||||
W.icon_state = initial(W.icon_state)
|
||||
W.cut_overlays()
|
||||
src.l_arm = W
|
||||
src.updateicon()
|
||||
update_icon()
|
||||
|
||||
else if(istype(W, /obj/item/bodypart/r_arm/robot))
|
||||
if(src.r_arm)
|
||||
@@ -190,7 +190,7 @@
|
||||
W.icon_state = initial(W.icon_state)//in case it is a dismembered robotic limb
|
||||
W.cut_overlays()
|
||||
src.r_arm = W
|
||||
src.updateicon()
|
||||
update_icon()
|
||||
|
||||
else if(istype(W, /obj/item/bodypart/chest/robot))
|
||||
var/obj/item/bodypart/chest/robot/CH = W
|
||||
@@ -202,7 +202,7 @@
|
||||
CH.icon_state = initial(CH.icon_state) //in case it is a dismembered robotic limb
|
||||
CH.cut_overlays()
|
||||
src.chest = CH
|
||||
src.updateicon()
|
||||
update_icon()
|
||||
else if(!CH.wired)
|
||||
to_chat(user, "<span class='warning'>You need to attach wires to it first!</span>")
|
||||
else
|
||||
@@ -222,7 +222,7 @@
|
||||
HD.icon_state = initial(HD.icon_state)//in case it is a dismembered robotic limb
|
||||
HD.cut_overlays()
|
||||
src.head = HD
|
||||
src.updateicon()
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need to attach a flash to it first!</span>")
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
last_process = world.time
|
||||
to_chat(user, "<span class='notice'>The water feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards.</span>")
|
||||
user.reagents.add_reagent("godblood",20)
|
||||
update_icons()
|
||||
addtimer(CALLBACK(src, .proc/update_icons), time_between_uses)
|
||||
update_icon()
|
||||
addtimer(CALLBACK(src, .proc/update_icon), time_between_uses)
|
||||
|
||||
|
||||
/obj/structure/healingfountain/proc/update_icons()
|
||||
/obj/structure/healingfountain/update_icon()
|
||||
if(last_process + time_between_uses > world.time)
|
||||
icon_state = "fountain"
|
||||
else
|
||||
|
||||
@@ -834,7 +834,7 @@
|
||||
robot_suit.head.flash2.burn_out()
|
||||
robot_suit.head.flash2 = null
|
||||
robot_suit.head = null
|
||||
robot_suit.updateicon()
|
||||
robot_suit.update_icon()
|
||||
else
|
||||
new /obj/item/robot_suit(T)
|
||||
new /obj/item/bodypart/l_leg/robot(T)
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
loaded_tank = W
|
||||
update_icons()
|
||||
update_icon()
|
||||
else if(W.GetID())
|
||||
if(allowed(user))
|
||||
if(active)
|
||||
@@ -197,14 +197,14 @@
|
||||
if(active)
|
||||
toggle_power()
|
||||
else
|
||||
update_icons()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/power/rad_collector/rad_act(pulse_strength)
|
||||
. = ..()
|
||||
if(loaded_tank && active && pulse_strength > RAD_COLLECTOR_EFFICIENCY)
|
||||
stored_power += (pulse_strength-RAD_COLLECTOR_EFFICIENCY)*RAD_COLLECTOR_COEFFICIENT
|
||||
|
||||
/obj/machinery/power/rad_collector/proc/update_icons()
|
||||
/obj/machinery/power/rad_collector/update_icon()
|
||||
cut_overlays()
|
||||
if(loaded_tank)
|
||||
add_overlay("ptank")
|
||||
@@ -222,7 +222,7 @@
|
||||
else
|
||||
icon_state = "ca"
|
||||
flick("ca_deactive", src)
|
||||
update_icons()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
#undef RAD_COLLECTOR_EFFICIENCY
|
||||
|
||||
Reference in New Issue
Block a user