mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 18:33:36 +00:00
Welding tools now use overlays for fuel gauges, rather than icons (#1994)
This commit is contained in:
committed by
kevinz000
parent
798050317f
commit
5e079fa54f
@@ -344,16 +344,14 @@
|
||||
heat = 3800
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/weapon/weldingtool/New()
|
||||
..()
|
||||
/obj/item/weapon/weldingtool/Initialize()
|
||||
. = ..()
|
||||
create_reagents(max_fuel)
|
||||
reagents.add_reagent("welding_fuel", max_fuel)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/weldingtool/proc/update_torch()
|
||||
cut_overlays()
|
||||
if(welding)
|
||||
add_overlay("[initial(icon_state)]-on")
|
||||
item_state = "[initial(item_state)]1"
|
||||
@@ -362,13 +360,11 @@
|
||||
|
||||
|
||||
/obj/item/weapon/weldingtool/update_icon()
|
||||
cut_overlays()
|
||||
if(change_icons)
|
||||
var/ratio = get_fuel() / max_fuel
|
||||
ratio = Ceiling(ratio*4) * 25
|
||||
if(ratio == 100)
|
||||
icon_state = initial(icon_state)
|
||||
else
|
||||
icon_state = "[initial(icon_state)][ratio]"
|
||||
add_overlay("[initial(icon_state)][ratio]")
|
||||
update_torch()
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user