mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 14:37:04 +01:00
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.
Conflicts: code/_onclick/hud/_defines.dm code/_onclick/hud/robot.dm code/game/objects/items.dm code/modules/mob/living/silicon/robot/inventory.dm code/modules/mob/living/silicon/robot/robot.dm code/modules/mob/mob_defines.dm
This commit is contained in:
@@ -47,7 +47,9 @@
|
||||
#define ui_inv1 "6:16,1:5" //borgs
|
||||
#define ui_inv2 "7:16,1:5" //borgs
|
||||
#define ui_inv3 "8:16,1:5" //borgs
|
||||
#define ui_borg_store "9:16,1:5" //borgs
|
||||
#define ui_borg_module "CENTER+1:16,SOUTH:5"
|
||||
#define ui_borg_store "CENTER+2:16,SOUTH:5" //borgs
|
||||
|
||||
|
||||
#define ui_monkey_mask "5:14,1:5" //monkey
|
||||
#define ui_monkey_back "6:14,1:5" //monkey
|
||||
@@ -61,9 +63,8 @@
|
||||
#define ui_zonesel "14:28,1:5"
|
||||
#define ui_acti_alt "14:28,1:5" //alternative intent switcher for when the interface is hidden (F12)
|
||||
|
||||
#define ui_borg_pull "12:24,2:7"
|
||||
#define ui_borg_module "13:26,2:7"
|
||||
#define ui_borg_panel "14:28,2:7"
|
||||
#define ui_borg_pull "EAST-2:26,SOUTH+1:7"
|
||||
#define ui_borg_panel "EAST-1:28,SOUTH+1:7"
|
||||
|
||||
//Gun buttons
|
||||
#define ui_gun1 "13:26,3:7"
|
||||
|
||||
@@ -164,7 +164,69 @@
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += list(mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += src.adding + src.other
|
||||
|
||||
return
|
||||
|
||||
|
||||
/datum/hud/proc/toggle_show_robot_modules()
|
||||
if(!isrobot(mymob)) return
|
||||
|
||||
var/mob/living/silicon/robot/r = mymob
|
||||
|
||||
r.shown_robot_modules = !r.shown_robot_modules
|
||||
update_robot_modules_display()
|
||||
|
||||
/datum/hud/proc/update_robot_modules_display()
|
||||
if(!isrobot(mymob)) return
|
||||
|
||||
var/mob/living/silicon/robot/r = mymob
|
||||
|
||||
if(r.shown_robot_modules)
|
||||
//Modules display is shown
|
||||
r.client.screen += r.throw_icon //"store" icon
|
||||
|
||||
if(!r.module)
|
||||
usr << "\red No module selected"
|
||||
return
|
||||
|
||||
if(!r.module.modules)
|
||||
usr << "\red Selected module has no modules to select"
|
||||
return
|
||||
|
||||
if(!r.robot_modules_background)
|
||||
return
|
||||
|
||||
var/display_rows = round((r.module.modules.len) / 8) +1 //+1 because round() returns floor of number
|
||||
r.robot_modules_background.screen_loc = "CENTER-4:16,SOUTH+1:7 to CENTER+3:16,SOUTH+[display_rows]:7"
|
||||
r.client.screen += r.robot_modules_background
|
||||
|
||||
var/x = -4 //Start at CENTER-4,SOUTH+1
|
||||
var/y = 1
|
||||
|
||||
for(var/atom/movable/A in r.module.modules)
|
||||
if( (A != r.module_state_1) && (A != r.module_state_2) && (A != r.module_state_3) )
|
||||
//Module is not currently active
|
||||
r.client.screen += A
|
||||
if(x < 0)
|
||||
A.screen_loc = "CENTER[x]:16,SOUTH+[y]:7"
|
||||
else
|
||||
A.screen_loc = "CENTER+[x]:16,SOUTH+[y]:7"
|
||||
A.layer = 20
|
||||
|
||||
x++
|
||||
if(x == 4)
|
||||
x = -4
|
||||
y++
|
||||
|
||||
else
|
||||
//Modules display is hidden
|
||||
r.client.screen -= r.throw_icon //"store" icon
|
||||
|
||||
for(var/atom/A in r.module.modules)
|
||||
if( (A != r.module_state_1) && (A != r.module_state_2) && (A != r.module_state_3) )
|
||||
//Module is not currently active
|
||||
r.client.screen -= A
|
||||
r.shown_robot_modules = 0
|
||||
r.client.screen -= r.robot_modules_background
|
||||
|
||||
@@ -331,10 +331,12 @@
|
||||
usr.drop_item_v()
|
||||
|
||||
if("module")
|
||||
if(issilicon(usr))
|
||||
if(usr:module)
|
||||
if(isrobot(usr))
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
if(R.module)
|
||||
R.hud_used.toggle_show_robot_modules()
|
||||
return 1
|
||||
usr:pick_module()
|
||||
R.pick_module()
|
||||
|
||||
if("radio")
|
||||
if(issilicon(usr))
|
||||
@@ -344,8 +346,10 @@
|
||||
usr:installed_modules()
|
||||
|
||||
if("store")
|
||||
if(issilicon(usr))
|
||||
usr:uneq_active()
|
||||
if(isrobot(usr))
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
R.uneq_active()
|
||||
R.hud_used.update_robot_modules_display()
|
||||
|
||||
if("module1")
|
||||
if(istype(usr, /mob/living/silicon/robot))
|
||||
|
||||
Reference in New Issue
Block a user