mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 12:29:46 +01:00
Now possible to change cable coil color using a multitool.
Obviously using the same methods that borgs use to change the cable coil color internally.
This commit is contained in:
+3
-1
@@ -199,11 +199,13 @@
|
||||
#include "code\datums\diseases\advance\symptoms\weight.dm"
|
||||
#include "code\datums\expansions\expansion.dm"
|
||||
#include "code\datums\expansions\multitool\_multitool.dm"
|
||||
#include "code\datums\expansions\multitool\cloning.dm"
|
||||
#include "code\datums\expansions\multitool\multitool.dm"
|
||||
#include "code\datums\expansions\multitool\store.dm"
|
||||
#include "code\datums\expansions\multitool\circuitboards\circuitboards.dm"
|
||||
#include "code\datums\expansions\multitool\circuitboards\stationalert.dm"
|
||||
#include "code\datums\expansions\multitool\items\cable.dm"
|
||||
#include "code\datums\expansions\multitool\items\items.dm"
|
||||
#include "code\datums\expansions\multitool\machinery\cloning.dm"
|
||||
#include "code\datums\helper_datums\construction_datum.dm"
|
||||
#include "code\datums\helper_datums\events.dm"
|
||||
#include "code\datums\helper_datums\getrev.dm"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
var/list/datum/expansion/expansions = list()
|
||||
|
||||
/obj/Destroy()
|
||||
if(expansions)
|
||||
if(istype(expansions))
|
||||
for(var/expansion in expansions)
|
||||
qdel(expansions[expansion])
|
||||
expansions.Cut()
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
. += "</tr>"
|
||||
. += "</table>"
|
||||
|
||||
/datum/expansion/multitool/circuitboards/stationalert/on_topic(href, href_list, usr)
|
||||
/datum/expansion/multitool/circuitboards/stationalert/on_topic(href, href_list, user)
|
||||
var/obj/item/weapon/circuitboard/stationalert/SA = holder
|
||||
if(href_list["add"])
|
||||
var/datum/alarm_handler/AH = locate(href_list["add"]) in alarm_manager.all_handlers
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/obj/item/stack/cable_coil/New()
|
||||
set_expansion(/datum/expansion/multitool, new/datum/expansion/multitool/items/cable(src))
|
||||
..()
|
||||
|
||||
/datum/expansion/multitool/items/cable/get_interact_window(var/obj/item/device/multitool/M, var/mob/user)
|
||||
. += "<b>Available Colors</b><br>"
|
||||
. += "<table>"
|
||||
for(var/cable_color in possible_cable_coil_colours)
|
||||
. += "<tr><td>[cable_color]</td></td><td><a href='?src=\ref[src];select_color=[cable_color]'>Select</a></td></tr>"
|
||||
. += "</table>"
|
||||
|
||||
/datum/expansion/multitool/items/cable/on_topic(href, href_list, user)
|
||||
var/obj/item/stack/cable_coil/cable_coil = holder
|
||||
if(href_list["select_color"] && href_list["select_color"] in possible_cable_coil_colours)
|
||||
cable_coil.set_cable_color(href_list["select_color"], user)
|
||||
return MT_REFRESH
|
||||
|
||||
return ..()
|
||||
@@ -0,0 +1,5 @@
|
||||
/datum/expansion/multitool/items/CanUseTopic(var/mob/user)
|
||||
if(isAI(user)) // No remote AI access
|
||||
return STATUS_CLOSE
|
||||
|
||||
return ..()
|
||||
@@ -75,7 +75,7 @@
|
||||
close_window(user)
|
||||
return 1
|
||||
|
||||
/datum/expansion/multitool/proc/on_topic(href, href_list, usr)
|
||||
/datum/expansion/multitool/proc/on_topic(href, href_list, user)
|
||||
return MT_NOACTION
|
||||
|
||||
/datum/expansion/multitool/proc/send_buffer(var/obj/item/device/multitool/M, var/atom/buffer, var/mob/user)
|
||||
|
||||
+26
-20
@@ -22,6 +22,8 @@ If d1 = dir1 and d2 = dir2, it's a full X-X cable, getting from dir1 to dir2
|
||||
By design, d1 is the smallest direction and d2 is the highest
|
||||
*/
|
||||
|
||||
var/list/possible_cable_coil_colours = list ("Yellow", "Green", "Pink", "Blue", "Orange", "Cyan", "Red")
|
||||
|
||||
/obj/structure/cable
|
||||
level = 1
|
||||
anchored =1
|
||||
@@ -550,6 +552,28 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
icon_state = "coil"
|
||||
name = "cable coil"
|
||||
|
||||
/obj/item/stack/cable_coil/proc/set_cable_color(var/selected_color, var/user)
|
||||
if(!selected_color)
|
||||
return
|
||||
|
||||
switch(selected_color)
|
||||
if("Yellow")
|
||||
color = COLOR_YELLOW
|
||||
if("Green")
|
||||
color = COLOR_LIME
|
||||
if("Pink")
|
||||
color = COLOR_PINK
|
||||
if("Blue")
|
||||
color = COLOR_BLUE
|
||||
if("Orange")
|
||||
color = COLOR_ORANGE
|
||||
if("Cyan")
|
||||
color = COLOR_CYAN
|
||||
else
|
||||
color = COLOR_RED
|
||||
selected_color = "red"
|
||||
user << "<span class='notice'>You change \the [src]'s color to [lowertext(selected_color)].</span>"
|
||||
|
||||
/obj/item/stack/cable_coil/proc/update_wclass()
|
||||
if(amount == 1)
|
||||
w_class = 1.0
|
||||
@@ -590,26 +614,8 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
set name = "Change Colour"
|
||||
set category = "Object"
|
||||
|
||||
var/list/possible_colours = list ("Yellow", "Green", "Pink", "Blue", "Orange", "Cyan", "Red")
|
||||
var/selected_type = input("Pick new colour.", "Cable Colour", null, null) as null|anything in possible_colours
|
||||
|
||||
if(selected_type)
|
||||
switch(selected_type)
|
||||
if("Yellow")
|
||||
color = COLOR_YELLOW
|
||||
if("Green")
|
||||
color = COLOR_LIME
|
||||
if("Pink")
|
||||
color = COLOR_PINK
|
||||
if("Blue")
|
||||
color = COLOR_BLUE
|
||||
if("Orange")
|
||||
color = COLOR_ORANGE
|
||||
if("Cyan")
|
||||
color = COLOR_CYAN
|
||||
else
|
||||
color = COLOR_RED
|
||||
usr << "You change your cable coil's colour to [selected_type]"
|
||||
var/selected_type = input("Pick new colour.", "Cable Colour", null, null) as null|anything in possible_cable_coil_colours
|
||||
set_cable_color(selected_type, usr)
|
||||
|
||||
// Items usable on a cable coil :
|
||||
// - Wirecutters : cut them duh !
|
||||
|
||||
Reference in New Issue
Block a user