Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Life/Vision/mob hud refactor #15177

Merged
merged 11 commits into from
Feb 7, 2016
Merged
5 changes: 4 additions & 1 deletion code/__DEFINES/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,7 @@
#define MASKCOVERSEYES 2 // get rid of some of the other retardation in these flags
#define HEADCOVERSEYES 4 // feel free to realloc these numbers for other purposes
#define MASKCOVERSMOUTH 8 // on other items, these are just for mask/head
#define HEADCOVERSMOUTH 16
#define HEADCOVERSMOUTH 16

#define TINT_DARKENED 2 //Threshold of tint level to apply weld mask overlay
#define TINT_BLIND 3 //Threshold of tint level to obscure vision fully
10 changes: 5 additions & 5 deletions code/__DEFINES/sight.dm
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

#define SEE_INVISIBLE_MINIMUM 5

#define SEE_INVISIBLE_OBSERVER_NOLIGHTING 15
#define SEE_INVISIBLE_NOLIGHTING 15 //to not see the lighting objects. Used for nightvision and observer with darkness toggled.

#define INVISIBILITY_LIGHTING 20

#define SEE_INVISIBLE_LIVING 25

#define SEE_INVISIBLE_LEVEL_ONE 35 //Used by some stuff in code. It's really poorly organized.
#define INVISIBILITY_LEVEL_ONE 35 //Used by some stuff in code. It's really poorly organized.
#define SEE_INVISIBLE_LEVEL_ONE 35 //currently unused
#define INVISIBILITY_LEVEL_ONE 35 //currently unused

#define SEE_INVISIBLE_LEVEL_TWO 45 //Used by some other stuff in code. It's really poorly organized.
#define INVISIBILITY_LEVEL_TWO 45 //Used by some other stuff in code. It's really poorly organized.
#define SEE_INVISIBLE_LEVEL_TWO 45 //currently unused
#define INVISIBILITY_LEVEL_TWO 45 //currently unused

#define INVISIBILITY_OBSERVER 60
#define SEE_INVISIBLE_OBSERVER 60
Expand Down
42 changes: 21 additions & 21 deletions code/_onclick/hud/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,87 +132,87 @@
S.sensor_mode()


/datum/hud/proc/ai_hud()
adding = list()
other = list()

/datum/hud/ai/New(mob/owner)
..()
var/obj/screen/using

//AI core
using = new /obj/screen/ai/aicore()
using.screen_loc = ui_ai_core
adding += using
static_inventory += using

//Camera list
using = new /obj/screen/ai/camera_list()
using.screen_loc = ui_ai_camera_list
adding += using
static_inventory += using

//Track
using = new /obj/screen/ai/camera_track()
using.screen_loc = ui_ai_track_with_camera
adding += using
static_inventory += using

//Camera light
using = new /obj/screen/ai/camera_light()
using.screen_loc = ui_ai_camera_light
adding += using
static_inventory += using

//Crew Monitoring
using = new /obj/screen/ai/crew_monitor()
using.screen_loc = ui_ai_crew_monitor
adding += using
static_inventory += using

//Crew Manifest
using = new /obj/screen/ai/crew_manifest()
using.screen_loc = ui_ai_crew_manifest
adding += using
static_inventory += using

//Alerts
using = new /obj/screen/ai/alerts()
using.screen_loc = ui_ai_alerts
adding += using
static_inventory += using

//Announcement
using = new /obj/screen/ai/announcement()
using.screen_loc = ui_ai_announcement
adding += using
static_inventory += using

//Shuttle
using = new /obj/screen/ai/call_shuttle()
using.screen_loc = ui_ai_shuttle
adding += using
static_inventory += using

//Laws
using = new /obj/screen/ai/state_laws()
using.screen_loc = ui_ai_state_laws
adding += using
static_inventory += using

//PDA message
using = new /obj/screen/ai/pda_msg_send()
using.screen_loc = ui_ai_pda_send
adding += using
static_inventory += using

//PDA log
using = new /obj/screen/ai/pda_msg_show()
using.screen_loc = ui_ai_pda_log
adding += using
static_inventory += using

//Take image
using = new /obj/screen/ai/image_take()
using.screen_loc = ui_ai_take_picture
adding += using
static_inventory += using

//View images
using = new /obj/screen/ai/image_view()
using.screen_loc = ui_ai_view_images
adding += using
static_inventory += using


//Medical/Security sensors
using = new /obj/screen/ai/sensors()
using.screen_loc = ui_ai_sensor
adding += using
static_inventory += using


mymob.client.screen += adding + other
return
/mob/living/silicon/ai/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/ai(src)
6 changes: 1 addition & 5 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@
/mob/proc/throw_alert(category, type, severity, obj/new_master)

/* Proc to create or update an alert. Returns the alert if the alert is new or updated, 0 if it was thrown already

category is a text string. Each mob may only have one alert per category; the previous one will be replaced

path is a type path of the actual alert type to throw

severity is an optional number that will be placed at the end of the icon_state for this alert
For example, high pressure's icon_state is "highpressure" and can be serverity 1 or 2 to get "highpressure1" or "highpressure2"

new_master is optional and sets the alert's icon state to "template" in the ui_style icons with the master as an overlay.
Clicks are forwarded to master */

Expand All @@ -30,7 +26,7 @@
else if(alert.type != type)
clear_alert(category)
return .()
else if(!severity || severity == alert.severity)
else if(!severity || severity == alert.severity)
if(alert.timeout)
clear_alert(category)
return .()
Expand Down
109 changes: 64 additions & 45 deletions code/_onclick/hud/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
icon_state = "leap_off"

/obj/screen/alien/leap/Click()
if(istype(usr, /mob/living/carbon/alien/humanoid))
if(istype(usr, /mob/living/carbon/alien/humanoid/hunter))
var/mob/living/carbon/alien/humanoid/hunter/AH = usr
AH.toggle_leap()

/obj/screen/alien/nightvision
name = "toggle night-vision"
icon_state = "nightvision1"
screen_loc = ui_alien_nightvision

/obj/screen/alien/nightvision/Click()
var/mob/living/carbon/alien/A = usr
Expand All @@ -21,9 +22,14 @@
T.fire(A)


/datum/hud/proc/alien_hud()
adding = list()
other = list()
/obj/screen/alien/plasma_display
icon = 'icons/mob/screen_gen.dmi'
icon_state = "power_display2"
name = "plasma stored"
screen_loc = ui_alienplasmadisplay

/datum/hud/alien/New(mob/living/carbon/alien/humanoid/owner)
..()

var/obj/screen/using
var/obj/screen/inventory/inv_box
Expand All @@ -39,9 +45,11 @@
inv_box.icon_state = "hand_r_active"
inv_box.screen_loc = ui_rhand
inv_box.layer = 19
r_hand_hud_object = inv_box
inv_box.slot_id = slot_r_hand
adding += inv_box
r_hand_hud_object = inv_box
if(owner.handcuffed)
inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus")
static_inventory += inv_box

inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
Expand All @@ -53,7 +61,9 @@
inv_box.layer = 19
inv_box.slot_id = slot_l_hand
l_hand_hud_object = inv_box
adding += inv_box
if(owner.handcuffed)
inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle")
static_inventory += inv_box

//begin buttons

Expand All @@ -63,71 +73,80 @@
using.icon_state = "swap_1"
using.screen_loc = ui_swaphand1
using.layer = 19
adding += using
static_inventory += using

using = new /obj/screen/inventory()
using.name = "hand"
using.icon = 'icons/mob/screen_alien.dmi'
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand2
using.layer = 19
adding += using
static_inventory += using

using = new /obj/screen/act_intent()
using.icon = 'icons/mob/screen_alien.dmi'
using = new /obj/screen/act_intent/alien()
using.icon_state = mymob.a_intent
using.screen_loc = ui_movi
adding += using
static_inventory += using
action_intent = using

if(istype(mymob, /mob/living/carbon/alien/humanoid/hunter))
var/mob/living/carbon/alien/humanoid/hunter/H = mymob
H.leap_icon = new /obj/screen/alien/leap()
H.leap_icon.screen_loc = ui_alien_storage_r
adding += H.leap_icon
static_inventory += H.leap_icon

using = new /obj/screen/drop()
using.icon = 'icons/mob/screen_alien.dmi'
using.screen_loc = ui_drop_throw
adding += using
static_inventory += using

using = new /obj/screen/resist()
using.icon = 'icons/mob/screen_alien.dmi'
using.screen_loc = ui_pull_resist
adding += using
hotkeybuttons += using

mymob.throw_icon = new /obj/screen/throw_catch()
mymob.throw_icon.icon = 'icons/mob/screen_alien.dmi'
mymob.throw_icon.screen_loc = ui_drop_throw
throw_icon = new /obj/screen/throw_catch()
throw_icon.icon = 'icons/mob/screen_alien.dmi'
throw_icon.screen_loc = ui_drop_throw
hotkeybuttons += throw_icon

mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = 'icons/mob/screen_alien.dmi'
mymob.pullin.update_icon(mymob)
mymob.pullin.screen_loc = ui_pull_resist
pull_icon = new /obj/screen/pull()
pull_icon.icon = 'icons/mob/screen_alien.dmi'
pull_icon.update_icon(mymob)
pull_icon.screen_loc = ui_pull_resist
static_inventory += pull_icon

//begin indicators

mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen_alien.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_alien_health
healths = new /obj/screen/healths/alien()
infodisplay += healths

nightvisionicon = new /obj/screen/alien/nightvision()
nightvisionicon.screen_loc = ui_alien_nightvision

alien_plasma_display = new /obj/screen()
alien_plasma_display.icon = 'icons/mob/screen_gen.dmi'
alien_plasma_display.icon_state = "power_display2"
alien_plasma_display.name = "plasma stored"
alien_plasma_display.screen_loc = ui_alienplasmadisplay

mymob.zone_sel = new /obj/screen/zone_sel/alien()
mymob.zone_sel.icon = 'icons/mob/screen_alien.dmi'
mymob.zone_sel.update_icon()

mymob.client.screen = list()

mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.healths, nightvisionicon, alien_plasma_display, mymob.pullin) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += adding + other
mymob.client.screen += mymob.client.void
infodisplay += nightvisionicon

alien_plasma_display = new /obj/screen/alien/plasma_display()
infodisplay += alien_plasma_display

zone_select = new /obj/screen/zone_sel/alien()
zone_select.update_icon(mymob)
static_inventory += zone_select

/datum/hud/alien/persistant_inventory_update()
if(!mymob)
return
var/mob/living/carbon/alien/humanoid/H = mymob
if(hud_version != HUD_STYLE_NOHUD)
if(H.r_hand)
H.r_hand.screen_loc = ui_rhand
H.client.screen += H.r_hand
if(H.l_hand)
H.l_hand.screen_loc = ui_lhand
H.client.screen += H.l_hand
else
if(H.r_hand)
H.r_hand.screen_loc = null
if(H.l_hand)
H.l_hand.screen_loc = null

/mob/living/carbon/alien/humanoid/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/alien(src)
Loading