diff --git a/code/__DEFINES/hud.dm b/code/__DEFINES/hud.dm index 13882afb77..14a3b7dc49 100644 --- a/code/__DEFINES/hud.dm +++ b/code/__DEFINES/hud.dm @@ -145,6 +145,7 @@ #define ui_borg_language_menu "CENTER+4:21,SOUTH+1:5" #define ui_borg_pda_send "CENTER+5:21,SOUTH:5" // To the right of the alert panel #define ui_borg_pda_log "CENTER+6:21,SOUTH:5" +#define ui_borg_movi "CENTER+7:21,SOUTH:5" #define ui_borg_sensor "CENTER-6:16, SOUTH:5" //LEGACY #define ui_borg_thrusters "CENTER-5:16, SOUTH:5" //LEGACY diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 67bc8ad565..f905c31aa1 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -155,12 +155,26 @@ static_inventory += using robit.thruster_button = using +//PDA message + using = new /atom/movable/screen/robot/pda_msg_send + using.screen_loc = ui_borg_pda_send + using.hud = src + static_inventory += using + +//PDA log + using = new /atom/movable/screen/robot/pda_msg_show + using.screen_loc = ui_borg_pda_log + using.hud = src + static_inventory += using + //Intent action_intent = new /atom/movable/screen/act_intent/robot() action_intent.icon_state = mymob.a_intent action_intent.hud = src static_inventory += action_intent + assert_move_intent_ui(owner, TRUE) + //Health healths = new /atom/movable/screen/healths/robot() healths.hud = src @@ -190,6 +204,41 @@ zone_select.update_icon() static_inventory += zone_select +/datum/hud/robot/proc/assert_move_intent_ui(mob/living/silicon/robot/owner = mymob, on_new = FALSE) + var/atom/movable/screen/using + // delete old ones + var/list/atom/movable/screen/victims = list() + victims += locate(/atom/movable/screen/mov_intent) in static_inventory + victims += locate(/atom/movable/screen/sprintbutton) in static_inventory + if(victims) + static_inventory -= victims + if(mymob?.client) + mymob.client.screen -= victims + QDEL_LIST(victims) + + // make new ones + // walk/run + using = new /atom/movable/screen/mov_intent + using.icon = 'modular_citadel/icons/ui/screen_cyborg.dmi' + using.screen_loc = ui_borg_movi + using.hud = src + using.update_icon() + static_inventory += using + if(!on_new) + owner?.client?.screen += using + + if(!CONFIG_GET(flag/sprint_enabled)) + return + + // sprint button + using = new /atom/movable/screen/sprintbutton + using.icon = 'modular_citadel/icons/ui/screen_cyborg.dmi' + using.icon_state = owner.cansprint ? ((owner.combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) ? "act_sprint_on" : "act_sprint") : "act_sprint_locked" + using.screen_loc = ui_borg_movi + using.hud = src + static_inventory += using + if(!on_new) + owner?.client?.screen += using /datum/hud/proc/toggle_show_robot_modules() if(!iscyborg(mymob)) @@ -344,24 +393,6 @@ return robot.modularInterface?.interact(robot) -//borg pda -/datum/hud/robot/New(mob/owner) - . = ..() - - var/atom/movable/screen/using - - //PDA message - using = new /atom/movable/screen/robot/pda_msg_send - using.screen_loc = ui_borg_pda_send - using.hud = src - static_inventory += using - - //PDA log - using = new /atom/movable/screen/robot/pda_msg_show - using.screen_loc = ui_borg_pda_log - using.hud = src - static_inventory += using - /atom/movable/screen/robot/pda_msg_send name = "PDA - Send Message" icon = 'icons/mob/screen_ai.dmi' diff --git a/code/_onclick/hud/screen_objects/sprint.dm b/code/_onclick/hud/screen_objects/sprint.dm index f8760ddd85..b32973f2dd 100644 --- a/code/_onclick/hud/screen_objects/sprint.dm +++ b/code/_onclick/hud/screen_objects/sprint.dm @@ -9,9 +9,9 @@ var/mutable_appearance/flashy /atom/movable/screen/sprintbutton/Click() - if(ishuman(usr)) - var/mob/living/carbon/human/H = usr - H.default_toggle_sprint() + if(isliving(usr)) + var/mob/living/owner = usr + owner.default_toggle_sprint() /atom/movable/screen/sprintbutton/update_icon_state() var/mob/living/user = hud?.mymob diff --git a/code/controllers/configuration/entries/movespeed.dm b/code/controllers/configuration/entries/movespeed.dm index 18d54da9fc..d61b20b5bb 100644 --- a/code/controllers/configuration/entries/movespeed.dm +++ b/code/controllers/configuration/entries/movespeed.dm @@ -68,6 +68,8 @@ . = ..() for(var/datum/hud/human/H) H.assert_move_intent_ui() + for(var/datum/hud/robot/robot) + robot.assert_move_intent_ui() if(!config_entry_value) // disabled for(var/mob/living/L in world) L.disable_intentional_sprint_mode() diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index d8730cc95b..b4917c2500 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -92,6 +92,9 @@ VC = new /obj/effect/proc_holder/silicon/cyborg/vtecControl R.AddAbility(VC) R.cansprint = 0 + var/datum/hud/robot/robohud = R.hud_used + if(istype(robohud)) + robohud.assert_move_intent_ui() /obj/item/borg/upgrade/vtec/deactivate(mob/living/silicon/robot/R, user = usr) . = ..() @@ -99,6 +102,9 @@ R.RemoveAbility(VC) R.vtec = initial(R.vtec) R.cansprint = 1 + var/datum/hud/robot/robohud = R.hud_used + if(istype(robohud)) + robohud.assert_move_intent_ui() /obj/item/borg/upgrade/disablercooler name = "cyborg rapid energy blaster cooling module" diff --git a/modular_citadel/icons/ui/screen_cyborg.dmi b/modular_citadel/icons/ui/screen_cyborg.dmi index bcbfcc1dc2..70554cb93f 100644 Binary files a/modular_citadel/icons/ui/screen_cyborg.dmi and b/modular_citadel/icons/ui/screen_cyborg.dmi differ