equipping and unequipping borg modules now adds and removes item actions

This commit is contained in:
Birdtalon
2018-09-21 19:46:50 +01:00
parent 4269c56eab
commit 5e3f4b40db
@@ -20,6 +20,9 @@
contents -= O
if(module)
O.loc = module //Return item to module so it appears in its contents, so it can be taken out again.
for(var/X in O.actions) // Remove assocated actions
var/datum/action/A = X
A.Remove(src)
if(module_active == O)
module_active = null
@@ -56,6 +59,7 @@
O.plane = HUD_PLANE
O.screen_loc = inv1.screen_loc
contents += O
set_actions(O)
else if(!module_state_2)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_2 = O
@@ -63,6 +67,7 @@
O.plane = HUD_PLANE
O.screen_loc = inv2.screen_loc
contents += O
set_actions(O)
else if(!module_state_3)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_3 = O
@@ -70,10 +75,16 @@
O.plane = HUD_PLANE
O.screen_loc = inv3.screen_loc
contents += O
set_actions(O)
else
to_chat(src, "You need to disable a module first!")
update_icons()
/mob/living/silicon/robot/proc/set_actions(obj/item/I)
for(var/X in I.actions)
var/datum/action/A = X
A.Grant(src)
/mob/living/silicon/robot/proc/uneq_active()
uneq_module(module_active)