Partial commit for the cyborg UI upgrade, which gets rid of the pop-up window for module selection, instead displaying the available modules in storage-item like fashion.

This commit is contained in:
errorage
2014-01-06 04:25:28 +01:00
parent 5aa492d961
commit bfcd050b77
7 changed files with 121 additions and 35 deletions
@@ -23,6 +23,8 @@
if(client)
client.screen -= O
contents -= O
if(module)
O.loc = module //Return item to module so it appears in its contents, so it can be taken out again.
if(module_active == O)
module_active = null
@@ -37,6 +39,33 @@
inv3.icon_state = "inv3"
return 1
/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 << "Already activated"
return
if(!module_state_1)
module_state_1 = O
O.layer = 20
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
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
contents += O
if(istype(module_state_3,/obj/item/borg/sight))
sight_mode |= module_state_3:sight_mode
else
src << "You need to disable a module first!"
/mob/living/silicon/robot/proc/uneq_active()
uneq_module(module_active)
+8 -25
View File
@@ -15,6 +15,9 @@
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
@@ -67,6 +70,10 @@
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()
@@ -871,31 +878,7 @@
if (href_list["act"])
var/obj/item/O = locate(href_list["act"])
if(!(locate(O) in src.module.modules) && O != src.module.emag)
return
if(activated(O))
src << "Already activated"
return
if(!module_state_1)
module_state_1 = O
O.layer = 20
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
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
contents += O
if(istype(module_state_3,/obj/item/borg/sight))
sight_mode |= module_state_3:sight_mode
else
src << "You need to disable a module first!"
activate_module(O)
installed_modules()
if (href_list["deact"])
+1 -1
View File
@@ -166,4 +166,4 @@
var/robot_talk_understand = 0
var/alien_talk_understand = 0
var/turf/listed_turf = null //the current turf being examined in the stat panel
var/turf/listed_turf = null //the current turf being examined in the stat panel