Files
Polaris/code/modules/clothing/masks/monitor.dm
Rykka 61ff2cbbce Earlyport Hover Inventory and Body Indicators
The body zone selector now indicates which body part you are about to select when hovered over, and the hover inventory indicator basically shows where you are trying to put an item, and then shows an item ghost in red or green, giving visual feedback as to if that item will go in the slot or not.

Gifs of this in action:
![https://i.imgur.com/MTi7Kpn.gif](https://i.imgur.com/MTi7Kpn.gif) 
Body Selection parts.

![https://i.imgur.com/KbLqWKy.gif](https://i.imgur.com/KbLqWKy.gif) 
Inventory Icon Overlays!

Credit goes to @ShadowLarkens for original port to Paradise and assistance with port.
2020-05-10 08:09:24 -04:00

69 lines
2.2 KiB
Plaintext

//IPC-face object for FPB.
/obj/item/clothing/mask/monitor
name = "display monitor"
desc = "A rather clunky old CRT-style display screen, fit for mounting on an optical output."
body_parts_covered = FACE
dir = SOUTH
icon = 'icons/mob/monitor_icons.dmi'
icon_override = 'icons/mob/monitor_icons.dmi'
icon_state = "monitor"
var/monitor_state_index = "blank"
var/global/list/monitor_states = list()
/obj/item/clothing/mask/monitor/set_dir()
dir = SOUTH
return
/obj/item/clothing/mask/monitor/equipped()
..()
var/mob/living/carbon/human/H = loc
if(istype(H) && H.wear_mask == src)
var/obj/item/organ/external/E = H.organs_by_name[BP_HEAD]
var/datum/robolimb/robohead = all_robolimbs[E.model]
canremove = 0
if(robohead.monitor_styles)
monitor_states = params2list(robohead.monitor_styles)
icon_state = monitor_states[monitor_state_index]
to_chat(H, "<span class='notice'>\The [src] connects to your display output.</span>")
/obj/item/clothing/mask/monitor/dropped()
canremove = 1
return ..()
/obj/item/clothing/mask/monitor/mob_can_equip(var/mob/living/carbon/human/user, var/slot, disable_warning = FALSE)
if (!..())
return 0
if(istype(user))
var/obj/item/organ/external/E = user.organs_by_name[BP_HEAD]
var/datum/robolimb/robohead = all_robolimbs[E.model]
if(istype(E) && (E.robotic >= ORGAN_ROBOT) && robohead.monitor_styles)
return 1
to_chat(user, "<span class='warning'>You must have a compatible robotic head to install this upgrade.</span>")
return 0
/obj/item/clothing/mask/monitor/verb/set_monitor_state()
set name = "Set Monitor State"
set desc = "Choose an icon for your monitor."
set category = "IC"
set src in usr
var/mob/living/carbon/human/H = loc
if(!istype(H) || H != usr)
return
if(H.wear_mask != src)
to_chat(usr, "<span class='warning'>You have not installed \the [src] yet.</span>")
return
var/choice = input("Select a screen icon.") as null|anything in monitor_states
if(choice)
monitor_state_index = choice
update_icon()
/obj/item/clothing/mask/monitor/update_icon()
if(!(monitor_state_index in monitor_states))
monitor_state_index = initial(monitor_state_index)
icon_state = monitor_states[monitor_state_index]
var/mob/living/carbon/human/H = loc
if(istype(H)) H.update_inv_wear_mask()