Merge pull request #7094 from Neerti/borg_hud_port_2

Semi-ports /tg/'s cyborg HUD, now with less merge conflict!
This commit is contained in:
Ccomp5950
2014-11-22 03:27:10 -05:00
7 changed files with 161 additions and 11 deletions

View File

@@ -6,6 +6,7 @@
return module_active
/*-------TODOOOOOOOOOO--------*/
/mob/living/silicon/robot/proc/uneq_active()
if(isnull(module_active))
return
@@ -16,6 +17,7 @@
client.screen -= module_state_1
contents -= module_state_1
module_active = null
module_state_1:loc = module //So it can be used again later
module_state_1 = null
inv1.icon_state = "inv1"
else if(module_state_2 == module_active)
@@ -25,6 +27,7 @@
client.screen -= module_state_2
contents -= module_state_2
module_active = null
module_state_2:loc = module
module_state_2 = null
inv2.icon_state = "inv2"
else if(module_state_3 == module_active)
@@ -34,6 +37,7 @@
client.screen -= module_state_3
contents -= module_state_3
module_active = null
module_state_3:loc = module
module_state_3 = null
inv3.icon_state = "inv3"
updateicon()
@@ -197,3 +201,33 @@
if(slot_num > 3) slot_num = 1 //Wrap around.
return
/mob/living/silicon/robot/proc/activate_module(var/obj/item/O)
if(!(locate(O) in src.module.modules) && O != src.module.emag)
return
if(activated(O))
src << "<span class='notice'>Already activated</span>"
return
if(!module_state_1)
module_state_1 = O
O.layer = 20
O.screen_loc = inv1.screen_loc
contents += O
if(istype(module_state_1,/obj/item/borg/sight))
sight_mode |= module_state_1:sight_mode
else if(!module_state_2)
module_state_2 = O
O.layer = 20
O.screen_loc = inv2.screen_loc
contents += O
if(istype(module_state_2,/obj/item/borg/sight))
sight_mode |= module_state_2:sight_mode
else if(!module_state_3)
module_state_3 = O
O.layer = 20
O.screen_loc = inv3.screen_loc
contents += O
if(istype(module_state_3,/obj/item/borg/sight))
sight_mode |= module_state_3:sight_mode
else
src << "<span class='notice'>You need to disable a module first!</span>"

View File

@@ -30,6 +30,9 @@ var/list/robot_verbs_default = list(
var/obj/screen/inv2 = null
var/obj/screen/inv3 = null
var/shown_robot_modules = 0 //Used to determine whether they have the module menu shown or not
var/obj/screen/robot_modules_background
//3 Modules can be activated at any one time.
var/obj/item/weapon/robot_module/module = null
var/module_active = null
@@ -84,6 +87,9 @@ var/list/robot_verbs_default = list(
wires = new(src)
robot_modules_background = new()
robot_modules_background.icon_state = "block"
robot_modules_background.layer = 19 //Objects that appear on screen are on layer 20, UI should be just below it.
ident = rand(1, 999)
updatename("Default")
updateicon()