mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 03:57:48 +01:00
Rewrite and refactor vending.dm
Remove some redundant procs and /obj/machinery/vending members. Rework the way product lists and advert lists are stored within /obj/machinery/vending. /obj/machinery/vending now uses a simpler way of storing the product list. The old variables, `products`, `contraband`, etc., are still used for initialization of the new list, but are not used beyond that. This commit removes colors from vending lists in anticipation of introducing NanoUI.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#define CAT_HIDDEN 2 // Also in code/game/machinery/vending.dm
|
||||
|
||||
/datum/wires/vending
|
||||
holder_type = /obj/machinery/vending
|
||||
wire_count = 4
|
||||
@@ -27,7 +29,7 @@ var/const/VENDING_WIRE_IDSCAN = 8
|
||||
. += ..()
|
||||
. += "<BR>The orange light is [V.seconds_electrified ? "off" : "on"].<BR>"
|
||||
. += "The red light is [V.shoot_inventory ? "off" : "blinking"].<BR>"
|
||||
. += "The green light is [V.extended_inventory ? "on" : "off"].<BR>"
|
||||
. += "The green light is [(V.categories & CAT_HIDDEN) ? "on" : "off"].<BR>"
|
||||
. += "The [V.scan_id ? "purple" : "yellow"] light is on.<BR>"
|
||||
|
||||
/datum/wires/vending/UpdatePulsed(var/index)
|
||||
@@ -36,7 +38,7 @@ var/const/VENDING_WIRE_IDSCAN = 8
|
||||
if(VENDING_WIRE_THROW)
|
||||
V.shoot_inventory = !V.shoot_inventory
|
||||
if(VENDING_WIRE_CONTRABAND)
|
||||
V.extended_inventory = !V.extended_inventory
|
||||
V.categories ^= CAT_HIDDEN
|
||||
if(VENDING_WIRE_ELECTRIFY)
|
||||
V.seconds_electrified = 30
|
||||
if(VENDING_WIRE_IDSCAN)
|
||||
@@ -48,7 +50,7 @@ var/const/VENDING_WIRE_IDSCAN = 8
|
||||
if(VENDING_WIRE_THROW)
|
||||
V.shoot_inventory = !mended
|
||||
if(VENDING_WIRE_CONTRABAND)
|
||||
V.extended_inventory = 0
|
||||
V.categories &= ~CAT_HIDDEN
|
||||
if(VENDING_WIRE_ELECTRIFY)
|
||||
if(mended)
|
||||
V.seconds_electrified = 0
|
||||
|
||||
Reference in New Issue
Block a user