From 93fbc17428bb72e3c20361988cf99f4ee8939175 Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Mon, 16 Dec 2019 17:58:50 +0100
Subject: [PATCH] ports "Standardize obj/updateicon() and update_icons() to
update_icon()"
---
code/_onclick/hud/action_button.dm | 6 +++---
code/game/area/areas.dm | 6 +++---
code/game/machinery/Beacon.dm | 6 +++---
code/game/machinery/cell_charger.dm | 8 ++++----
code/game/machinery/lightswitch.dm | 10 +++++-----
code/game/machinery/magnet.dm | 6 +++---
code/game/machinery/navbeacon.dm | 6 +++---
code/game/objects/items/pneumaticCannon.dm | 7 +++----
code/game/objects/items/robot/robot_parts.dm | 18 +++++++++---------
code/game/objects/structures/divine.dm | 6 +++---
code/modules/mob/living/silicon/robot/robot.dm | 2 +-
code/modules/power/singularity/collector.dm | 8 ++++----
12 files changed, 44 insertions(+), 45 deletions(-)
diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm
index d2508b3e8e..858b8dbd06 100644
--- a/code/_onclick/hud/action_button.dm
+++ b/code/_onclick/hud/action_button.dm
@@ -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))
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 612c3cba42..f5e285a5c2 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -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
diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm
index 3d0931d534..c98795c90b 100644
--- a/code/game/machinery/Beacon.dm
+++ b/code/game/machinery/Beacon.dm
@@ -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()
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index 1839e44e3b..1c0635fd3d 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -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].", "You insert a cell into [src].")
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()
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index 694df02eb5..2a4b903906 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -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)
. = ..()
diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm
index 094db5a676..370621e0c8 100644
--- a/code/game/machinery/magnet.dm
+++ b/code/game/machinery/magnet.dm
@@ -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
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index d64ae75e2c..0f57bea656 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -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.", "You [open ? "open" : "close"] the beacon's cover.")
- updateicon()
+ update_icon()
else if (istype(I, /obj/item/card/id)||istype(I, /obj/item/pda))
if(open)
diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm
index 72d27ae544..e63b4d7a3a 100644
--- a/code/game/objects/items/pneumaticCannon.dm
+++ b/code/game/objects/items/pneumaticCannon.dm
@@ -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, "You hook \the [thetank] up to \the [src].")
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))
diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index 95110692c9..ab8030c9c2 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -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, "You disassemble the cyborg shell.")
else
to_chat(user, "There is nothing to remove from the endoskeleton.")
- 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, "You need to attach wires to it first!")
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, "You need to attach a flash to it first!")
diff --git a/code/game/objects/structures/divine.dm b/code/game/objects/structures/divine.dm
index 5fd480f6fd..b8137d831b 100644
--- a/code/game/objects/structures/divine.dm
+++ b/code/game/objects/structures/divine.dm
@@ -40,11 +40,11 @@
last_process = world.time
to_chat(user, "The water feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards.")
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
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 01edaba8ec..c5c2beb999 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -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)
diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm
index b1b0d2d718..054b91f273 100644
--- a/code/modules/power/singularity/collector.dm
+++ b/code/modules/power/singularity/collector.dm
@@ -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