Merge pull request #3456 from VOREStation/vplk-frame-icons

Enhance machine frames to be flexible about icons and icon states.
This commit is contained in:
Anewbe
2017-05-21 13:13:23 -05:00
committed by GitHub

View File

@@ -17,13 +17,20 @@
construction_frame_floor += cancel construction_frame_floor += cancel
/datum/frame/frame_types /datum/frame/frame_types
var/name var/icon/icon_override // Icon to set on frame object when building. If null icon is unchanged.
var/frame_size = 5 var/name // Name assigned to the frame object.
var/frame_class var/frame_size = 5 // Sheets of metal required to build.
var/circuit var/frame_class // Determines construction method. "machine", "computer", "alarm", or "display"
var/frame_style = "floor" var/circuit // Type path of the circuit board that comes built in with this frame. Null to require adding a circuit.
var/x_offset var/frame_style = "floor" // "floor" or "wall"
var/y_offset var/x_offset // For wall frames: pixel_x
var/y_offset // For wall frames: pixel_y
// Get the icon state to use at a given state. Default implementation is based on the frame's name
/datum/frame/frame_types/proc/get_icon_state(var/state)
var/type = lowertext(name)
type = replacetext(type, " ", "_")
return "[type]_[state]"
/datum/frame/frame_types/computer /datum/frame/frame_types/computer
name = "Computer" name = "Computer"
@@ -203,9 +210,9 @@
/obj/structure/frame/update_icon() /obj/structure/frame/update_icon()
..() ..()
var/type = lowertext(frame_type.name) if(frame_type.icon_override)
type = replacetext(type, " ", "_") icon = frame_type.icon_override
icon_state = "[type]_[state]" icon_state = frame_type.get_icon_state(state)
/obj/structure/frame/proc/check_components(mob/user as mob) /obj/structure/frame/proc/check_components(mob/user as mob)
components = list() components = list()