mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
[MIRROR] improved robot HUD handling (#7381)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
This commit is contained in:
@@ -217,13 +217,13 @@ var/obj/screen/robot_inventory
|
|||||||
update_robot_modules_display()
|
update_robot_modules_display()
|
||||||
|
|
||||||
|
|
||||||
/datum/hud/proc/update_robot_modules_display()
|
/datum/hud/proc/update_robot_modules_display(var/reset = FALSE)
|
||||||
if(!isrobot(mymob))
|
if(!isrobot(mymob))
|
||||||
return
|
return
|
||||||
|
|
||||||
var/mob/living/silicon/robot/r = mymob
|
var/mob/living/silicon/robot/r = mymob
|
||||||
|
|
||||||
if(r.shown_robot_modules)
|
if(r.shown_robot_modules && !reset)
|
||||||
//Modules display is shown
|
//Modules display is shown
|
||||||
//r.client.screen += robot_inventory //"store" icon
|
//r.client.screen += robot_inventory //"store" icon
|
||||||
|
|
||||||
@@ -292,4 +292,4 @@ var/obj/screen/robot_inventory
|
|||||||
return sprite_datum.sprite_hud_icon_state
|
return sprite_datum.sprite_hud_icon_state
|
||||||
if(modtype)
|
if(modtype)
|
||||||
return lowertext(modtype)
|
return lowertext(modtype)
|
||||||
return "nomod"
|
return "nomod"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
if(!check_rights(R_ADMIN))
|
if(!check_rights(R_ADMIN))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(!istype(target))
|
if(!istype(target) || !target.module)
|
||||||
return
|
return
|
||||||
|
|
||||||
if(!target.module.modules)
|
if(!target.module.modules)
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
robot.module.contents.Remove(add_item)
|
robot.module.contents.Remove(add_item)
|
||||||
target.module.modules.Add(add_item)
|
target.module.modules.Add(add_item)
|
||||||
target.module.contents.Add(add_item)
|
target.module.contents.Add(add_item)
|
||||||
|
target.hud_used.update_robot_modules_display()
|
||||||
to_chat(usr, "<span class='danger'>You added \"[add_item]\" to [target].</span>")
|
to_chat(usr, "<span class='danger'>You added \"[add_item]\" to [target].</span>")
|
||||||
if(istype(add_item, /obj/item/stack/))
|
if(istype(add_item, /obj/item/stack/))
|
||||||
var/obj/item/stack/item_with_synth = add_item
|
var/obj/item/stack/item_with_synth = add_item
|
||||||
@@ -94,6 +95,8 @@
|
|||||||
if(!istype(selected_module_module, /obj/item/))
|
if(!istype(selected_module_module, /obj/item/))
|
||||||
break
|
break
|
||||||
to_chat(usr, "<span class='danger'>You removed \"[selected_module_module]\" from [target]</span>")
|
to_chat(usr, "<span class='danger'>You removed \"[selected_module_module]\" from [target]</span>")
|
||||||
|
target.uneq_all()
|
||||||
|
target.hud_used.update_robot_modules_display(TRUE)
|
||||||
target.module.emag.Remove(selected_module_module)
|
target.module.emag.Remove(selected_module_module)
|
||||||
target.module.modules.Remove(selected_module_module)
|
target.module.modules.Remove(selected_module_module)
|
||||||
target.module.contents.Remove(selected_module_module)
|
target.module.contents.Remove(selected_module_module)
|
||||||
|
|||||||
@@ -349,6 +349,7 @@
|
|||||||
hands.icon_state = get_hud_module_icon()
|
hands.icon_state = get_hud_module_icon()
|
||||||
feedback_inc("cyborg_[lowertext(modtype)]",1)
|
feedback_inc("cyborg_[lowertext(modtype)]",1)
|
||||||
updatename()
|
updatename()
|
||||||
|
hud_used.update_robot_modules_display()
|
||||||
notify_ai(ROBOT_NOTIFICATION_NEW_MODULE, module.name)
|
notify_ai(ROBOT_NOTIFICATION_NEW_MODULE, module.name)
|
||||||
|
|
||||||
/mob/living/silicon/robot/proc/update_braintype()
|
/mob/living/silicon/robot/proc/update_braintype()
|
||||||
@@ -775,6 +776,7 @@
|
|||||||
to_chat(usr, "<span class='filter_notice'>You apply the upgrade to [src]!</span>")
|
to_chat(usr, "<span class='filter_notice'>You apply the upgrade to [src]!</span>")
|
||||||
usr.drop_item()
|
usr.drop_item()
|
||||||
U.loc = src
|
U.loc = src
|
||||||
|
hud_used.update_robot_modules_display()
|
||||||
else
|
else
|
||||||
to_chat(usr, "<span class='filter_notice'>Upgrade error!</span>")
|
to_chat(usr, "<span class='filter_notice'>Upgrade error!</span>")
|
||||||
|
|
||||||
@@ -812,12 +814,13 @@
|
|||||||
/mob/living/silicon/robot/proc/module_reset()
|
/mob/living/silicon/robot/proc/module_reset()
|
||||||
transform_with_anim() //VOREStation edit: sprite animation
|
transform_with_anim() //VOREStation edit: sprite animation
|
||||||
uneq_all()
|
uneq_all()
|
||||||
|
hud_used.update_robot_modules_display(TRUE)
|
||||||
modtype = initial(modtype)
|
modtype = initial(modtype)
|
||||||
hands.icon_state = get_hud_module_icon()
|
hands.icon_state = get_hud_module_icon()
|
||||||
|
|
||||||
notify_ai(ROBOT_NOTIFICATION_MODULE_RESET, module.name)
|
notify_ai(ROBOT_NOTIFICATION_MODULE_RESET, module.name)
|
||||||
module.Reset(src)
|
module.Reset(src)
|
||||||
qdel(module)
|
module.Destroy()
|
||||||
module = null
|
module = null
|
||||||
updatename("Default")
|
updatename("Default")
|
||||||
|
|
||||||
@@ -1383,6 +1386,7 @@
|
|||||||
laws.show_laws(src)
|
laws.show_laws(src)
|
||||||
to_chat(src, "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands.</span>")
|
to_chat(src, "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands.</span>")
|
||||||
update_icon()
|
update_icon()
|
||||||
|
hud_used.update_robot_modules_display()
|
||||||
else
|
else
|
||||||
to_chat(user, "<span class='filter_warning'>You fail to hack [src]'s interface.</span>")
|
to_chat(user, "<span class='filter_warning'>You fail to hack [src]'s interface.</span>")
|
||||||
to_chat(src, "<span class='filter_warning'>Hack attempt detected.</span>")
|
to_chat(src, "<span class='filter_warning'>Hack attempt detected.</span>")
|
||||||
|
|||||||
Reference in New Issue
Block a user