Add observer HUD from /tg/, refactor HUDs

This commit is contained in:
Aronai Sieyes
2020-05-14 16:28:19 -04:00
parent 7f192eba2b
commit 3992b7a50a
14 changed files with 592 additions and 578 deletions

View File

@@ -150,3 +150,10 @@
#define ui_spell_master "EAST-2:16,NORTH-1:26" #define ui_spell_master "EAST-2:16,NORTH-1:26"
#define ui_genetic_master "EAST-1:16,NORTH-3:16" #define ui_genetic_master "EAST-1:16,NORTH-3:16"
// Ghost ones
#define ui_ghost_jumptomob "SOUTH:6,CENTER-2:24"
#define ui_ghost_orbit "SOUTH:6,CENTER-1:24"
#define ui_ghost_reenter_corpse "SOUTH:6,CENTER:24"
#define ui_ghost_teleport "SOUTH:6,CENTER+1:24"
#define ui_ghost_pai "SOUTH: 6, CENTER+2:24"

View File

@@ -1,169 +1,170 @@
/obj/screen/ai/multicam
name = "Multicamera Mode"
icon = 'icons/mob/screen_ai.dmi'
icon_state = "multicam"
/obj/screen/ai/multicam/Click() /obj/screen/ai/multicam/Click()
if(..()) if(..())
return return
var/mob/living/silicon/ai/AI = usr var/mob/living/silicon/ai/AI = usr
AI.toggle_multicam() AI.toggle_multicam()
/obj/screen/ai/add_multicam
name = "New Camera"
icon = 'icons/mob/screen_ai.dmi'
icon_state = "new_cam"
/obj/screen/ai/add_multicam/Click() /obj/screen/ai/add_multicam/Click()
if(..()) if(..())
return return
var/mob/living/silicon/ai/AI = usr var/mob/living/silicon/ai/AI = usr
AI.drop_new_multicam() AI.drop_new_multicam()
/datum/hud/proc/ai_hud() /mob/living/silicon/ai/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE)
adding = list() ..()
other = list()
HUD.ui_style = 'icons/mob/screen_ai.dmi'
HUD.adding = list()
HUD.other = list()
var/obj/screen/using var/obj/screen/using
//AI core //AI core
using = new /obj/screen() using = new /obj/screen()
using.name = "AI Core" using.name = "AI Core"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "ai_core" using.icon_state = "ai_core"
using.screen_loc = ui_ai_core using.screen_loc = ui_ai_core
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//Camera list //Camera list
using = new /obj/screen() using = new /obj/screen()
using.name = "Show Camera List" using.name = "Show Camera List"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "camera" using.icon_state = "camera"
using.screen_loc = ui_ai_camera_list using.screen_loc = ui_ai_camera_list
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//Track //Track
using = new /obj/screen() using = new /obj/screen()
using.name = "Track With Camera" using.name = "Track With Camera"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "track" using.icon_state = "track"
using.screen_loc = ui_ai_track_with_camera using.screen_loc = ui_ai_track_with_camera
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//Camera light //Camera light
using = new /obj/screen() using = new /obj/screen()
using.name = "Toggle Camera Light" using.name = "Toggle Camera Light"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "camera_light" using.icon_state = "camera_light"
using.screen_loc = ui_ai_camera_light using.screen_loc = ui_ai_camera_light
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//Crew Monitoring //Crew Monitoring
using = new /obj/screen() using = new /obj/screen()
using.name = "Crew Monitoring" using.name = "Crew Monitoring"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "crew_monitor" using.icon_state = "crew_monitor"
using.screen_loc = ui_ai_crew_monitor using.screen_loc = ui_ai_crew_monitor
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//Crew Manifest //Crew Manifest
using = new /obj/screen() using = new /obj/screen()
using.name = "Show Crew Manifest" using.name = "Show Crew Manifest"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "manifest" using.icon_state = "manifest"
using.screen_loc = ui_ai_crew_manifest using.screen_loc = ui_ai_crew_manifest
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//Alerts //Alerts
using = new /obj/screen() using = new /obj/screen()
using.name = "Show Alerts" using.name = "Show Alerts"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "alerts" using.icon_state = "alerts"
using.screen_loc = ui_ai_alerts using.screen_loc = ui_ai_alerts
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//Announcement //Announcement
using = new /obj/screen() using = new /obj/screen()
using.name = "Announcement" using.name = "Announcement"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "announcement" using.icon_state = "announcement"
using.screen_loc = ui_ai_announcement using.screen_loc = ui_ai_announcement
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//Shuttle //Shuttle
using = new /obj/screen() using = new /obj/screen()
using.name = "Call Emergency Shuttle" using.name = "Call Emergency Shuttle"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "call_shuttle" using.icon_state = "call_shuttle"
using.screen_loc = ui_ai_shuttle using.screen_loc = ui_ai_shuttle
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//Laws //Laws
using = new /obj/screen() using = new /obj/screen()
using.name = "State Laws" using.name = "State Laws"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "state_laws" using.icon_state = "state_laws"
using.screen_loc = ui_ai_state_laws using.screen_loc = ui_ai_state_laws
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//PDA message //PDA message
using = new /obj/screen() using = new /obj/screen()
using.name = "PDA - Send Message" using.name = "PDA - Send Message"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "pda_send" using.icon_state = "pda_send"
using.screen_loc = ui_ai_pda_send using.screen_loc = ui_ai_pda_send
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//PDA log //PDA log
using = new /obj/screen() using = new /obj/screen()
using.name = "PDA - Show Message Log" using.name = "PDA - Show Message Log"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "pda_receive" using.icon_state = "pda_receive"
using.screen_loc = ui_ai_pda_log using.screen_loc = ui_ai_pda_log
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//Take image //Take image
using = new /obj/screen() using = new /obj/screen()
using.name = "Take Image" using.name = "Take Image"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "take_picture" using.icon_state = "take_picture"
using.screen_loc = ui_ai_take_picture using.screen_loc = ui_ai_take_picture
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//View images //View images
using = new /obj/screen() using = new /obj/screen()
using.name = "View Images" using.name = "View Images"
using.icon = 'icons/mob/screen_ai.dmi' using.icon = HUD.ui_style
using.icon_state = "view_images" using.icon_state = "view_images"
using.screen_loc = ui_ai_view_images using.screen_loc = ui_ai_view_images
using.layer = SCREEN_LAYER using.layer = SCREEN_LAYER
adding += using HUD.adding += using
//Multicamera mode //Multicamera mode
using = new /obj/screen/ai/multicam() using = new /obj/screen/ai/multicam() // special
using.name = "Multicamera Mode"
using.icon = HUD.ui_style
using.icon_state = "multicam"
using.screen_loc = ui_ai_multicam using.screen_loc = ui_ai_multicam
adding += using using.layer = SCREEN_LAYER
HUD.adding += using
//Add multicamera camera //Add multicamera camera
using = new /obj/screen/ai/add_multicam() using = new /obj/screen/ai/add_multicam() // special
using.name = "New Camera"
using.icon = HUD.ui_style
using.icon_state = "new_cam"
using.screen_loc = ui_ai_add_multicam using.screen_loc = ui_ai_add_multicam
adding += using using.layer = SCREEN_LAYER
HUD.adding += using
mymob.client.screen = list() if(client && apply_to_client)
mymob.client.screen += adding + other client.screen = list()
mymob.client.screen += mymob.client.void client.screen += HUD.adding + HUD.other
client.screen += client.void
return

View File

@@ -1,27 +1,31 @@
/datum/hud/proc/larva_hud() /mob/living/carbon/alien/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE)
..()
src.adding = list() HUD.ui_style = 'icons/mob/screen1_alien.dmi'
src.other = list()
HUD.adding = list()
HUD.other = list()
var/obj/screen/using var/obj/screen/using
using = new /obj/screen() using = new /obj/screen()
using.name = "mov_intent" using.name = "mov_intent"
using.set_dir(SOUTHWEST) using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_alien.dmi' using.icon = HUD.ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.icon_state = (m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.layer = HUD_LAYER using.layer = HUD_LAYER
src.adding += using HUD.adding += using
move_intent = using HUD.move_intent = using
mymob.healths = new /obj/screen() healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_alien.dmi' healths.icon = HUD.ui_style
mymob.healths.icon_state = "health0" healths.icon_state = "health0"
mymob.healths.name = "health" healths.name = "health"
mymob.healths.screen_loc = ui_alien_health healths.screen_loc = ui_alien_health
mymob.client.screen = list() if(client && apply_to_client)
mymob.client.screen += list( mymob.healths) //, mymob.rest, mymob.sleep, mymob.mach ) client.screen = list()
mymob.client.screen += src.adding + src.other client.screen += list(healths)
mymob.client.screen += mymob.client.void client.screen += HUD.adding + HUD.other
client.screen += client.void

115
code/_onclick/hud/ghost.dm Normal file
View File

@@ -0,0 +1,115 @@
/obj/screen/ghost
icon = 'icons/mob/screen_ghost.dmi'
/obj/screen/ghost/MouseEntered()
flick(icon_state + "_anim", src)
/obj/screen/ghost/jumptomob
name = "Jump to mob"
icon_state = "jumptomob"
/obj/screen/ghost/jumptomob/Click()
var/mob/observer/dead/G = usr
G.jumptomob()
/obj/screen/ghost/orbit
name = "Orbit"
icon_state = "orbit"
/obj/screen/ghost/orbit/Click()
var/mob/observer/dead/G = usr
G.follow()
/obj/screen/ghost/reenter_corpse
name = "Reenter corpse"
icon_state = "reenter_corpse"
/obj/screen/ghost/reenter_corpse/Click()
var/mob/observer/dead/G = usr
G.reenter_corpse()
/obj/screen/ghost/teleport
name = "Teleport"
icon_state = "teleport"
/obj/screen/ghost/teleport/Click()
var/mob/observer/dead/G = usr
G.dead_tele()
/obj/screen/ghost/pai
name = "pAI Candidate"
icon_state = "pai"
/obj/screen/ghost/pai/Click()
var/mob/observer/dead/G = usr
G.paialert()
/mob/observer/dead/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE)
..()
var/list/adding = list()
HUD.adding = adding
var/obj/screen/using
using = new /obj/screen/ghost/jumptomob()
using.screen_loc = ui_ghost_jumptomob
using.hud = src
adding += using
using = new /obj/screen/ghost/orbit()
using.screen_loc = ui_ghost_orbit
using.hud = src
adding += using
using = new /obj/screen/ghost/reenter_corpse()
using.screen_loc = ui_ghost_reenter_corpse
using.hud = src
adding += using
using = new /obj/screen/ghost/teleport()
using.screen_loc = ui_ghost_teleport
using.hud = src
adding += using
using = new /obj/screen/ghost/pai()
using.screen_loc = ui_ghost_pai
using.hud = src
adding += using
/*
using = new /obj/screen/language_menu
using.icon = ui_style
using.hud = src
adding += using
*/
if(client && apply_to_client)
client.screen = list()
client.screen += HUD.adding
client.screen += client.void
/* I wish we had this. Not yet, though.
/datum/hud/ghost/show_hud(version = 0, mob/viewmob)
// don't show this HUD if observing; show the HUD of the observee
var/mob/dead/observer/O = mymob
if (istype(O) && O.observetarget)
plane_masters_update()
return FALSE
. = ..()
if(!.)
return
var/mob/screenmob = viewmob || mymob
if(!screenmob.client.prefs.ghost_hud)
screenmob.client.screen -= static_inventory
else
screenmob.client.screen += static_inventory
//We should only see observed mob alerts.
/datum/hud/ghost/reorganize_alerts(mob/viewmob)
var/mob/dead/observer/O = mymob
if (istype(O) && O.observetarget)
return
. = ..()
*/

View File

@@ -191,6 +191,8 @@ var/list/global_huds = list(
var/list/slot_info var/list/slot_info
var/icon/ui_style var/icon/ui_style
var/ui_color
var/ui_alpha
datum/hud/New(mob/owner) datum/hud/New(mob/owner)
mymob = owner mymob = owner
@@ -305,35 +307,23 @@ datum/hud/New(mob/owner)
/datum/hud/proc/instantiate() /datum/hud/proc/instantiate()
if(!ismob(mymob)) return 0 if(!ismob(mymob))
if(!mymob.client) return 0 return 0
ui_style = ui_style2icon(mymob.client.prefs.UI_style) mymob.create_mob_hud(src)
var/ui_color = mymob.client.prefs.UI_style_color
var/ui_alpha = mymob.client.prefs.UI_style_alpha
if(ishuman(mymob))
human_hud(ui_style, ui_color, ui_alpha, mymob) // Pass the player the UI style chosen in preferences
else if(isrobot(mymob))
robot_hud(ui_style, ui_color, ui_alpha, mymob)
else if(isbrain(mymob))
mymob.instantiate_hud(src)
else if(isalien(mymob))
larva_hud()
else if(isAI(mymob))
ai_hud()
else if(isobserver(mymob))
ghost_hud()
else
mymob.instantiate_hud(src)
persistant_inventory_update() persistant_inventory_update()
mymob.reload_fullscreen() // Reload any fullscreen overlays this mob has. mymob.reload_fullscreen() // Reload any fullscreen overlays this mob has.
mymob.update_action_buttons() mymob.update_action_buttons()
reorganize_alerts() reorganize_alerts()
/mob/proc/instantiate_hud(var/datum/hud/HUD) /mob/proc/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE)
return if(!client)
return 0
HUD.ui_style = ui_style2icon(client?.prefs?.UI_style)
HUD.ui_color = client?.prefs?.UI_style_color
HUD.ui_alpha = client?.prefs?.UI_style_alpha
//Triggered when F12 is pressed (Unless someone changed something in the DMF) //Triggered when F12 is pressed (Unless someone changed something in the DMF)
/mob/verb/button_pressed_F12(var/full = 0 as null) /mob/verb/button_pressed_F12(var/full = 0 as null)

View File

@@ -1,20 +1,24 @@
/mob/living/carbon/human/instantiate_hud(var/datum/hud/HUD, var/ui_style, var/ui_color, var/ui_alpha) /mob/living/carbon/human/create_mob_hud(datum/hud/HUD)
HUD.human_hud(ui_style, ui_color, ui_alpha, src) ..()
/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_White.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255, var/mob/living/carbon/human/target)
var/datum/hud_data/hud_data var/datum/hud_data/hud_data
if(!istype(target)) if(species?.hud)
hud_data = new() hud_data = species.hud
else else
hud_data = target.species.hud hud_data = new ()
if(hud_data.icon) if(hud_data.icon) // Species wants a specific dmi for the HUD
ui_style = hud_data.icon HUD.ui_style = hud_data.icon
src.adding = list() var/adding = list()
src.other = list() var/other = list()
src.hotkeybuttons = list() //These can be disabled for hotkey users var/hotkeybuttons = list()
src.slot_info = list() var/slot_info = list()
HUD.adding = adding
HUD.other = other
HUD.hotkeybuttons = hotkeybuttons //These can be disabled for hotkey users
HUD.slot_info = slot_info
var/list/hud_elements = list() var/list/hud_elements = list()
var/obj/screen/using var/obj/screen/using
@@ -25,10 +29,10 @@
for(var/gear_slot in hud_data.gear) for(var/gear_slot in hud_data.gear)
inv_box = new /obj/screen/inventory() inv_box = new /obj/screen/inventory()
inv_box.icon = ui_style inv_box.icon = HUD.ui_style
inv_box.color = ui_color inv_box.color = HUD.ui_color
inv_box.alpha = ui_alpha inv_box.alpha = HUD.ui_alpha
inv_box.hud = src inv_box.hud = HUD
var/list/slot_data = hud_data.gear[gear_slot] var/list/slot_data = hud_data.gear[gear_slot]
inv_box.name = gear_slot inv_box.name = gear_slot
@@ -41,294 +45,291 @@
inv_box.set_dir(slot_data["dir"]) inv_box.set_dir(slot_data["dir"])
if(slot_data["toggle"]) if(slot_data["toggle"])
src.other += inv_box other += inv_box
has_hidden_gear = 1 has_hidden_gear = 1
else else
src.adding += inv_box adding += inv_box
if(has_hidden_gear) if(has_hidden_gear)
using = new /obj/screen() using = new /obj/screen()
using.name = "toggle" using.name = "toggle"
using.icon = ui_style using.icon = HUD.ui_style
using.icon_state = "other" using.icon_state = "other"
using.screen_loc = ui_inventory using.screen_loc = ui_inventory
using.hud_layerise() using.hud_layerise()
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
src.adding += using adding += using
// Draw the attack intent dialogue. // Draw the attack intent dialogue.
if(hud_data.has_a_intent) if(hud_data.has_a_intent)
using = new /obj/screen() using = new /obj/screen()
using.name = "act_intent" using.name = "act_intent"
using.icon = ui_style using.icon = HUD.ui_style
using.icon_state = "intent_"+mymob.a_intent using.icon_state = "intent_"+a_intent
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
src.adding += using adding += using
action_intent = using HUD.action_intent = using
hud_elements |= using hud_elements |= using
//intent small hud objects //intent small hud objects
var/icon/ico var/icon/ico
ico = new(ui_style, "black") ico = new(HUD.ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height()) ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
using = new /obj/screen() using = new /obj/screen()
using.name = I_HELP using.name = I_HELP
using.icon = ico using.icon = ico
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.layer = LAYER_HUD_ITEM //These sit on the intent box using.layer = LAYER_HUD_ITEM //These sit on the intent box
src.adding += using adding += using
help_intent = using HUD.help_intent = using
ico = new(ui_style, "black") ico = new(HUD.ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height()) ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
using = new /obj/screen() using = new /obj/screen()
using.name = I_DISARM using.name = I_DISARM
using.icon = ico using.icon = ico
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.layer = LAYER_HUD_ITEM using.layer = LAYER_HUD_ITEM
src.adding += using adding += using
disarm_intent = using HUD.disarm_intent = using
ico = new(ui_style, "black") ico = new(HUD.ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2) ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
using = new /obj/screen() using = new /obj/screen()
using.name = I_GRAB using.name = I_GRAB
using.icon = ico using.icon = ico
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.layer = LAYER_HUD_ITEM using.layer = LAYER_HUD_ITEM
src.adding += using adding += using
grab_intent = using HUD.grab_intent = using
ico = new(ui_style, "black") ico = new(HUD.ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2) ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
using = new /obj/screen() using = new /obj/screen()
using.name = I_HURT using.name = I_HURT
using.icon = ico using.icon = ico
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.layer = LAYER_HUD_ITEM using.layer = LAYER_HUD_ITEM
src.adding += using adding += using
hurt_intent = using HUD.hurt_intent = using
//end intent small hud objects //end intent small hud objects
if(hud_data.has_m_intent) if(hud_data.has_m_intent)
using = new /obj/screen() using = new /obj/screen()
using.name = "mov_intent" using.name = "mov_intent"
using.icon = ui_style using.icon = HUD.ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.icon_state = (m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi using.screen_loc = ui_movi
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
src.adding += using adding += using
move_intent = using HUD.move_intent = using
if(hud_data.has_drop) if(hud_data.has_drop)
using = new /obj/screen() using = new /obj/screen()
using.name = "drop" using.name = "drop"
using.icon = ui_style using.icon = HUD.ui_style
using.icon_state = "act_drop" using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw using.screen_loc = ui_drop_throw
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
src.hotkeybuttons += using hotkeybuttons += using
if(hud_data.has_hands) if(hud_data.has_hands)
using = new /obj/screen() using = new /obj/screen()
using.name = "equip" using.name = "equip"
using.icon = ui_style using.icon = HUD.ui_style
using.icon_state = "act_equip" using.icon_state = "act_equip"
using.screen_loc = ui_equip using.screen_loc = ui_equip
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
src.adding += using adding += using
inv_box = new /obj/screen/inventory/hand() inv_box = new /obj/screen/inventory/hand()
inv_box.hud = src inv_box.hud = HUD
inv_box.name = "r_hand" inv_box.name = "r_hand"
inv_box.icon = ui_style inv_box.icon = HUD.ui_style
inv_box.icon_state = "r_hand_inactive" inv_box.icon_state = "r_hand_inactive"
if(!target.hand) //This being 0 or null means the right hand is in use if(!hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "r_hand_active" inv_box.icon_state = "r_hand_active"
inv_box.screen_loc = ui_rhand inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand inv_box.slot_id = slot_r_hand
inv_box.color = ui_color inv_box.color = HUD.ui_color
inv_box.alpha = ui_alpha inv_box.alpha = HUD.ui_alpha
src.r_hand_hud_object = inv_box HUD.r_hand_hud_object = inv_box
src.adding += inv_box adding += inv_box
slot_info["[slot_r_hand]"] = inv_box.screen_loc slot_info["[slot_r_hand]"] = inv_box.screen_loc
inv_box = new /obj/screen/inventory/hand() inv_box = new /obj/screen/inventory/hand()
inv_box.hud = src inv_box.hud = HUD
inv_box.name = "l_hand" inv_box.name = "l_hand"
inv_box.icon = ui_style inv_box.icon = HUD.ui_style
inv_box.icon_state = "l_hand_inactive" inv_box.icon_state = "l_hand_inactive"
if(target.hand) //This being 1 means the left hand is in use if(hand) //This being 1 means the left hand is in use
inv_box.icon_state = "l_hand_active" inv_box.icon_state = "l_hand_active"
inv_box.screen_loc = ui_lhand inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand inv_box.slot_id = slot_l_hand
inv_box.color = ui_color inv_box.color = HUD.ui_color
inv_box.alpha = ui_alpha inv_box.alpha = HUD.ui_alpha
src.l_hand_hud_object = inv_box HUD.l_hand_hud_object = inv_box
src.adding += inv_box adding += inv_box
slot_info["[slot_l_hand]"] = inv_box.screen_loc slot_info["[slot_l_hand]"] = inv_box.screen_loc
using = new /obj/screen/inventory() using = new /obj/screen/inventory()
using.name = "hand" using.name = "hand"
using.icon = ui_style using.icon = HUD.ui_style
using.icon_state = "hand1" using.icon_state = "hand1"
using.screen_loc = ui_swaphand1 using.screen_loc = ui_swaphand1
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.hud = src using.hud = HUD
src.adding += using adding += using
using = new /obj/screen/inventory() using = new /obj/screen/inventory()
using.name = "hand" using.name = "hand"
using.icon = ui_style using.icon = HUD.ui_style
using.icon_state = "hand2" using.icon_state = "hand2"
using.screen_loc = ui_swaphand2 using.screen_loc = ui_swaphand2
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.hud = src using.hud = HUD
src.adding += using adding += using
if(hud_data.has_resist) if(hud_data.has_resist)
using = new /obj/screen() using = new /obj/screen()
using.name = "resist" using.name = "resist"
using.icon = ui_style using.icon = HUD.ui_style
using.icon_state = "act_resist" using.icon_state = "act_resist"
using.screen_loc = ui_pull_resist using.screen_loc = ui_pull_resist
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
src.hotkeybuttons += using hotkeybuttons += using
if(hud_data.has_throw) if(hud_data.has_throw)
mymob.throw_icon = new /obj/screen() throw_icon = new /obj/screen()
mymob.throw_icon.icon = ui_style throw_icon.icon = HUD.ui_style
mymob.throw_icon.icon_state = "act_throw_off" throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw" throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw throw_icon.screen_loc = ui_drop_throw
mymob.throw_icon.color = ui_color throw_icon.color = HUD.ui_color
mymob.throw_icon.alpha = ui_alpha throw_icon.alpha = HUD.ui_alpha
src.hotkeybuttons += mymob.throw_icon hotkeybuttons += throw_icon
hud_elements |= mymob.throw_icon hud_elements |= throw_icon
mymob.pullin = new /obj/screen() pullin = new /obj/screen()
mymob.pullin.icon = ui_style pullin.icon = HUD.ui_style
mymob.pullin.icon_state = "pull0" pullin.icon_state = "pull0"
mymob.pullin.name = "pull" pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist pullin.screen_loc = ui_pull_resist
src.hotkeybuttons += mymob.pullin hotkeybuttons += pullin
hud_elements |= mymob.pullin hud_elements |= pullin
if(hud_data.has_internals) if(hud_data.has_internals)
mymob.internals = new /obj/screen() internals = new /obj/screen()
mymob.internals.icon = ui_style internals.icon = HUD.ui_style
mymob.internals.icon_state = "internal0" internals.icon_state = "internal0"
if(istype(target.internal, /obj/item/weapon/tank)) //Internals on already? Iight, prove it if(istype(internal, /obj/item/weapon/tank)) //Internals on already? Iight, prove it
mymob.internals.icon_state = "internal1" internals.icon_state = "internal1"
mymob.internals.name = "internal" internals.name = "internal"
mymob.internals.screen_loc = ui_internal internals.screen_loc = ui_internal
hud_elements |= mymob.internals hud_elements |= internals
if(hud_data.has_warnings) if(hud_data.has_warnings)
mymob.healths = new /obj/screen() healths = new /obj/screen()
mymob.healths.icon = ui_style healths.icon = HUD.ui_style
mymob.healths.icon_state = "health0" healths.icon_state = "health0"
mymob.healths.name = "health" healths.name = "health"
mymob.healths.screen_loc = ui_health healths.screen_loc = ui_health
hud_elements |= mymob.healths hud_elements |= healths
//VOREStation Addition begin //VOREStation Addition begin
mymob.shadekin_dark_display = new /obj/screen/shadekin/darkness() shadekin_dark_display = new /obj/screen/shadekin/darkness()
mymob.shadekin_dark_display.screen_loc = ui_shadekin_dark_display shadekin_dark_display.screen_loc = ui_shadekin_dark_display
mymob.shadekin_dark_display.icon_state = "dark" shadekin_dark_display.icon_state = "dark"
hud_elements |= mymob.shadekin_dark_display hud_elements |= shadekin_dark_display
mymob.shadekin_energy_display = new /obj/screen/shadekin/energy() shadekin_energy_display = new /obj/screen/shadekin/energy()
mymob.shadekin_energy_display.screen_loc = ui_shadekin_energy_display shadekin_energy_display.screen_loc = ui_shadekin_energy_display
mymob.shadekin_energy_display.icon_state = "energy0" shadekin_energy_display.icon_state = "energy0"
hud_elements |= mymob.shadekin_energy_display hud_elements |= shadekin_energy_display
mymob.xenochimera_danger_display = new /obj/screen/xenochimera/danger_level() xenochimera_danger_display = new /obj/screen/xenochimera/danger_level()
mymob.xenochimera_danger_display.screen_loc = ui_xenochimera_danger_display xenochimera_danger_display.screen_loc = ui_xenochimera_danger_display
mymob.xenochimera_danger_display.icon_state = "danger00" xenochimera_danger_display.icon_state = "danger00"
hud_elements |= mymob.xenochimera_danger_display hud_elements |= xenochimera_danger_display
//VOREStation Addition end //VOREStation Addition end
mymob.ling_chem_display = new /obj/screen/ling/chems() ling_chem_display = new /obj/screen/ling/chems()
mymob.ling_chem_display.screen_loc = ui_ling_chemical_display ling_chem_display.screen_loc = ui_ling_chemical_display
mymob.ling_chem_display.icon_state = "ling_chems" ling_chem_display.icon_state = "ling_chems"
hud_elements |= mymob.ling_chem_display hud_elements |= ling_chem_display
mymob.wiz_instability_display = new /obj/screen/wizard/instability() wiz_instability_display = new /obj/screen/wizard/instability()
mymob.wiz_instability_display.screen_loc = ui_wiz_instability_display wiz_instability_display.screen_loc = ui_wiz_instability_display
mymob.wiz_instability_display.icon_state = "wiz_instability_none" wiz_instability_display.icon_state = "wiz_instability_none"
hud_elements |= mymob.wiz_instability_display hud_elements |= wiz_instability_display
mymob.wiz_energy_display = new/obj/screen/wizard/energy() wiz_energy_display = new/obj/screen/wizard/energy()
mymob.wiz_energy_display.screen_loc = ui_wiz_energy_display wiz_energy_display.screen_loc = ui_wiz_energy_display
mymob.wiz_energy_display.icon_state = "wiz_energy" wiz_energy_display.icon_state = "wiz_energy"
hud_elements |= mymob.wiz_energy_display hud_elements |= wiz_energy_display
mymob.pain = new /obj/screen( null ) pain = new /obj/screen( null )
mymob.zone_sel = new /obj/screen/zone_sel( null ) zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel.icon = ui_style zone_sel.icon = HUD.ui_style
mymob.zone_sel.color = ui_color zone_sel.color = HUD.ui_color
mymob.zone_sel.alpha = ui_alpha zone_sel.alpha = HUD.ui_alpha
mymob.zone_sel.overlays.Cut() zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[zone_sel.selecting]")
hud_elements |= mymob.zone_sel hud_elements |= zone_sel
//Handle the gun settings buttons //Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null) gun_setting_icon = new /obj/screen/gun/mode(null)
mymob.gun_setting_icon.icon = ui_style gun_setting_icon.icon = HUD.ui_style
mymob.gun_setting_icon.color = ui_color gun_setting_icon.color = HUD.ui_color
mymob.gun_setting_icon.alpha = ui_alpha gun_setting_icon.alpha = HUD.ui_alpha
hud_elements |= mymob.gun_setting_icon hud_elements |= gun_setting_icon
mymob.item_use_icon = new /obj/screen/gun/item(null) item_use_icon = new /obj/screen/gun/item(null)
mymob.item_use_icon.icon = ui_style item_use_icon.icon = HUD.ui_style
mymob.item_use_icon.color = ui_color item_use_icon.color = HUD.ui_color
mymob.item_use_icon.alpha = ui_alpha item_use_icon.alpha = HUD.ui_alpha
mymob.gun_move_icon = new /obj/screen/gun/move(null) gun_move_icon = new /obj/screen/gun/move(null)
mymob.gun_move_icon.icon = ui_style gun_move_icon.icon = HUD.ui_style
mymob.gun_move_icon.color = ui_color gun_move_icon.color = HUD.ui_color
mymob.gun_move_icon.alpha = ui_alpha gun_move_icon.alpha = HUD.ui_alpha
mymob.radio_use_icon = new /obj/screen/gun/radio(null) radio_use_icon = new /obj/screen/gun/radio(null)
mymob.radio_use_icon.icon = ui_style radio_use_icon.icon = HUD.ui_style
mymob.radio_use_icon.color = ui_color radio_use_icon.color = HUD.ui_color
mymob.radio_use_icon.alpha = ui_alpha radio_use_icon.alpha = HUD.ui_alpha
if(mymob.client) if(client)
mymob.client.screen = list() client.screen = list()
mymob.client.screen += hud_elements client.screen += hud_elements
mymob.client.screen += src.adding + src.hotkeybuttons client.screen += adding + hotkeybuttons
mymob.client.screen += mymob.client.void client.screen += client.void
inventory_shown = 0
return
HUD.inventory_shown = 0
/mob/living/carbon/human/verb/toggle_hotkey_verbs() /mob/living/carbon/human/verb/toggle_hotkey_verbs()
set category = "OOC" set category = "OOC"

View File

@@ -1,143 +0,0 @@
/datum/hud/proc/unplayer_hud()
return
/datum/hud/proc/ghost_hud()
return
/datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
blobpwrdisplay = new /obj/screen()
blobpwrdisplay.name = "blob power"
blobpwrdisplay.icon_state = "block"
blobpwrdisplay.screen_loc = ui_health
blobpwrdisplay.layer = HUD_LAYER
blobhealthdisplay = new /obj/screen()
blobhealthdisplay.name = "blob health"
blobhealthdisplay.icon_state = "block"
blobhealthdisplay.screen_loc = ui_internal
blobhealthdisplay.layer = HUD_LAYER
mymob.client.screen = list()
mymob.client.screen += list(blobpwrdisplay, blobhealthdisplay)
mymob.client.screen += mymob.client.void
/*
/datum/hud/proc/slime_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
src.adding = list()
var/obj/screen/using
using = new /obj/screen()
using.name = "act_intent"
using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = "intent_"+mymob.a_intent
using.screen_loc = ui_zonesel
using.layer = HUD_LAYER
src.adding += using
action_intent = using
//intent small hud objects
var/icon/ico
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
using = new /obj/screen( src )
using.name = "help"
using.icon = ico
using.screen_loc = ui_zonesel
using.layer = HUD_LAYER+0.01
src.adding += using
help_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
using = new /obj/screen( src )
using.name = "disarm"
using.icon = ico
using.screen_loc = ui_zonesel
using.layer = HUD_LAYER+0.01
src.adding += using
disarm_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
using = new /obj/screen( src )
using.name = "grab"
using.icon = ico
using.screen_loc = ui_zonesel
using.layer = HUD_LAYER+0.01
src.adding += using
grab_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
using = new /obj/screen( src )
using.name = I_HURT
using.icon = ico
using.screen_loc = ui_zonesel
using.layer = HUD_LAYER+0.01
src.adding += using
hurt_intent = using
mymob.client.screen = list()
mymob.client.screen += src.adding
mymob.client.screen += mymob.client.void
return
*/
// HUD.construct_hud() //Archaic.
/*
/datum/hud/proc/construct_hud()
var/constructtype
if(istype(mymob,/mob/living/simple_mob/construct/armoured) || istype(mymob,/mob/living/simple_mob/construct/behemoth))
constructtype = "juggernaut"
else if(istype(mymob,/mob/living/simple_mob/construct/builder))
constructtype = "artificer"
else if(istype(mymob,/mob/living/simple_mob/construct/wraith))
constructtype = "wraith"
else if(istype(mymob,/mob/living/simple_mob/construct/harvester))
constructtype = "harvester"
if(constructtype)
mymob.fire.icon = 'icons/mob/screen1_construct.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_construct_fire
mymob.healths.icon = 'icons/mob/screen1_construct.dmi'
mymob.healths.icon_state = "[constructtype]_health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_construct_health
mymob.pullin.icon = 'icons/mob/screen1_construct.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_construct_pull
mymob.zone_sel.icon = 'icons/mob/screen1_construct.dmi'
mymob.zone_sel.overlays.len = 0
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
mymob.purged.icon = 'icons/mob/screen1_construct.dmi'
mymob.purged.icon_state = "purge0"
mymob.purged.name = "purged"
mymob.purged.screen_loc = ui_construct_purge
mymob.client.screen = list()
mymob.client.screen += list(mymob.fire, mymob.healths, mymob.pullin, mymob.zone_sel, mymob.purged)
mymob.client.screen += mymob.client.void
*/

View File

@@ -1,23 +1,19 @@
var/obj/screen/robot_inventory var/obj/screen/robot_inventory
/*
/mob/living/silicon/robot/instantiate_hud(var/datum/hud/HUD, var/ui_style, var/ui_color, var/ui_alpha)
HUD.robot_hud(ui_style, ui_color, ui_alpha, src)*/
/datum/hud/proc/robot_hud(ui_style='icons/mob/screen1_robot.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255, var/mob/living/silicon/robot/target) /mob/living/silicon/robot/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE)
/* var/datum/hud_data/hud_data ..()
if(!istype(target))
hud_data = new()
if(hud_data.icon) // Don't care about your prefs! Our icon is more important
ui_style = hud_data.icon*/ if(HUD.ui_style == 'icons/mob/screen/minimalist.dmi')
HUD.ui_style = 'icons/mob/screen1_robot_minimalist.dmi'
if(ui_style == 'icons/mob/screen/minimalist.dmi')
ui_style = 'icons/mob/screen1_robot_minimalist.dmi'
else else
ui_style = 'icons/mob/screen1_robot.dmi' HUD.ui_style = 'icons/mob/screen1_robot.dmi'
src.adding = list() var/list/adding = list()
src.other = list() var/list/other = list()
HUD.adding = adding
HUD.other = other
var/obj/screen/using var/obj/screen/using
@@ -25,51 +21,51 @@ var/obj/screen/robot_inventory
using = new /obj/screen() using = new /obj/screen()
using.name = "radio" using.name = "radio"
using.set_dir(SOUTHWEST) using.set_dir(SOUTHWEST)
using.icon = ui_style using.icon = HUD.ui_style
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.icon_state = "radio" using.icon_state = "radio"
using.screen_loc = ui_movi using.screen_loc = ui_movi
using.layer = HUD_LAYER using.layer = HUD_LAYER
src.adding += using adding += using
//Module select //Module select
using = new /obj/screen() using = new /obj/screen()
using.name = "module1" using.name = "module1"
using.set_dir(SOUTHWEST) using.set_dir(SOUTHWEST)
using.icon = ui_style using.icon = HUD.ui_style
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.icon_state = "inv1" using.icon_state = "inv1"
using.screen_loc = ui_inv1 using.screen_loc = ui_inv1
using.layer = HUD_LAYER using.layer = HUD_LAYER
src.adding += using adding += using
mymob:inv1 = using inv1 = using
using = new /obj/screen() using = new /obj/screen()
using.name = "module2" using.name = "module2"
using.set_dir(SOUTHWEST) using.set_dir(SOUTHWEST)
using.icon = ui_style using.icon = HUD.ui_style
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.icon_state = "inv2" using.icon_state = "inv2"
using.screen_loc = ui_inv2 using.screen_loc = ui_inv2
using.layer = HUD_LAYER using.layer = HUD_LAYER
src.adding += using adding += using
mymob:inv2 = using inv2 = using
using = new /obj/screen() using = new /obj/screen()
using.name = "module3" using.name = "module3"
using.set_dir(SOUTHWEST) using.set_dir(SOUTHWEST)
using.icon = ui_style using.icon = HUD.ui_style
using.color = ui_color using.color = HUD.ui_color
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.icon_state = "inv3" using.icon_state = "inv3"
using.screen_loc = ui_inv3 using.screen_loc = ui_inv3
using.layer = HUD_LAYER using.layer = HUD_LAYER
src.adding += using adding += using
mymob:inv3 = using inv3 = using
//End of module select //End of module select
@@ -77,98 +73,96 @@ var/obj/screen/robot_inventory
using = new /obj/screen() using = new /obj/screen()
using.name = "act_intent" using.name = "act_intent"
using.set_dir(SOUTHWEST) using.set_dir(SOUTHWEST)
using.icon = ui_style using.icon = HUD.ui_style
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.icon_state = mymob.a_intent using.icon_state = a_intent
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.layer = HUD_LAYER using.layer = HUD_LAYER
src.adding += using adding += using
action_intent = using HUD.action_intent = using
//Health //Health
mymob.healths = new /obj/screen() healths = new /obj/screen()
mymob.healths.icon = ui_style healths.icon = HUD.ui_style
mymob.healths.icon_state = "health0" healths.icon_state = "health0"
mymob.healths.alpha = ui_alpha healths.alpha = HUD.ui_alpha
mymob.healths.name = "health" healths.name = "health"
mymob.healths.screen_loc = ui_borg_health healths.screen_loc = ui_borg_health
src.other += mymob.healths other += healths
//Installed Module //Installed Module
mymob.hands = new /obj/screen() hands = new /obj/screen()
mymob.hands.icon = ui_style hands.icon = HUD.ui_style
mymob.hands.icon_state = "nomod" hands.icon_state = "nomod"
mymob.hands.alpha = ui_alpha hands.alpha = HUD.ui_alpha
mymob.hands.name = "module" hands.name = "module"
mymob.hands.screen_loc = ui_borg_module hands.screen_loc = ui_borg_module
src.other += mymob.hands other += hands
//Module Panel //Module Panel
using = new /obj/screen() using = new /obj/screen()
using.name = "panel" using.name = "panel"
using.icon = ui_style using.icon = HUD.ui_style
using.icon_state = "panel" using.icon_state = "panel"
using.alpha = ui_alpha using.alpha = HUD.ui_alpha
using.screen_loc = ui_borg_panel using.screen_loc = ui_borg_panel
using.layer = HUD_LAYER-0.01 using.layer = HUD_LAYER-0.01
src.adding += using adding += using
//Store //Store
mymob.throw_icon = new /obj/screen() throw_icon = new /obj/screen()
mymob.throw_icon.icon = ui_style throw_icon.icon = HUD.ui_style
mymob.throw_icon.icon_state = "store" throw_icon.icon_state = "store"
mymob.throw_icon.alpha = ui_alpha throw_icon.alpha = HUD.ui_alpha
mymob.throw_icon.color = ui_color throw_icon.color = HUD.ui_color
mymob.throw_icon.name = "store" throw_icon.name = "store"
mymob.throw_icon.screen_loc = ui_borg_store throw_icon.screen_loc = ui_borg_store
src.other += mymob.throw_icon other += throw_icon
//Inventory //Inventory
robot_inventory = new /obj/screen() robot_inventory = new /obj/screen()
robot_inventory.name = "inventory" robot_inventory.name = "inventory"
robot_inventory.icon = ui_style robot_inventory.icon = HUD.ui_style
robot_inventory.icon_state = "inventory" robot_inventory.icon_state = "inventory"
robot_inventory.alpha = ui_alpha robot_inventory.alpha = HUD.ui_alpha
robot_inventory.color = ui_color robot_inventory.color = HUD.ui_color
robot_inventory.screen_loc = ui_borg_inventory robot_inventory.screen_loc = ui_borg_inventory
src.other += robot_inventory other += robot_inventory
mymob.pullin = new /obj/screen() pullin = new /obj/screen()
mymob.pullin.icon = ui_style pullin.icon = HUD.ui_style
mymob.pullin.icon_state = "pull0" pullin.icon_state = "pull0"
mymob.pullin.alpha = ui_alpha pullin.alpha = HUD.ui_alpha
mymob.pullin.color = ui_color pullin.color = HUD.ui_color
mymob.pullin.name = "pull" pullin.name = "pull"
mymob.pullin.screen_loc = ui_borg_pull pullin.screen_loc = ui_borg_pull
src.other += mymob.pullin other += pullin
mymob.zone_sel = new /obj/screen/zone_sel() zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = ui_style zone_sel.icon = HUD.ui_style
mymob.zone_sel.alpha = ui_alpha zone_sel.alpha = HUD.ui_alpha
mymob.zone_sel.overlays.Cut() zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[zone_sel.selecting]")
//Handle the gun settings buttons //Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null) gun_setting_icon = new /obj/screen/gun/mode(null)
mymob.gun_setting_icon.icon = ui_style gun_setting_icon.icon = HUD.ui_style
mymob.gun_setting_icon.alpha = ui_alpha gun_setting_icon.alpha = HUD.ui_alpha
mymob.item_use_icon = new /obj/screen/gun/item(null) item_use_icon = new /obj/screen/gun/item(null)
mymob.item_use_icon.icon = ui_style item_use_icon.icon = HUD.ui_style
mymob.item_use_icon.alpha = ui_alpha item_use_icon.alpha = HUD.ui_alpha
mymob.gun_move_icon = new /obj/screen/gun/move(null) gun_move_icon = new /obj/screen/gun/move(null)
mymob.gun_move_icon.icon = ui_style gun_move_icon.icon = HUD.ui_style
mymob.gun_move_icon.alpha = ui_alpha gun_move_icon.alpha = HUD.ui_alpha
mymob.radio_use_icon = new /obj/screen/gun/radio(null) radio_use_icon = new /obj/screen/gun/radio(null)
mymob.radio_use_icon.icon = ui_style radio_use_icon.icon = HUD.ui_style
mymob.radio_use_icon.alpha = ui_alpha radio_use_icon.alpha = HUD.ui_alpha
mymob.client.screen = list() if(client && apply_to_client)
client.screen = list()
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.hands, mymob.healths, mymob.pullin, robot_inventory, mymob.gun_setting_icon) client.screen += list( throw_icon, zone_sel, hands, healths, pullin, robot_inventory, gun_setting_icon)
mymob.client.screen += src.adding + src.other client.screen += HUD.adding + HUD.other
mymob.client.screen += mymob.client.void client.screen += client.void
return
/datum/hud/proc/toggle_show_robot_modules() /datum/hud/proc/toggle_show_robot_modules()

View File

@@ -20,7 +20,7 @@
if(istype(src, /mob/living/carbon/human)) if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src var/mob/living/carbon/human/H = src
H.hud_used = new /datum/hud(H) H.hud_used = new /datum/hud(H)
H.instantiate_hud(H.hud_used) H.create_mob_hud(H.hud_used)
return ..() return ..()
/mob/living/Destroy() /mob/living/Destroy()

View File

@@ -129,6 +129,7 @@
if(!name) //To prevent nameless ghosts if(!name) //To prevent nameless ghosts
name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))
real_name = name real_name = name
animate(src, pixel_y = 2, time = 10, loop = -1)
..() ..()
/mob/observer/dead/Topic(href, href_list) /mob/observer/dead/Topic(href, href_list)
@@ -318,6 +319,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
to_chat(usr, "Not when you're not dead!") to_chat(usr, "Not when you're not dead!")
return return
if(!A)
A = input(usr, "Select an area:", "Ghost Teleport") as null|anything in return_sorted_areas()
if(!A)
return
usr.forceMove(pick(get_area_turfs(A))) usr.forceMove(pick(get_area_turfs(A)))
usr.on_mob_jump() usr.on_mob_jump()
@@ -326,6 +332,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set name = "Follow" // "Haunt" set name = "Follow" // "Haunt"
set desc = "Follow and haunt a mob." set desc = "Follow and haunt a mob."
if(!input)
input = input(usr, "Select a mob:", "Ghost Follow") as null|anything in getmobs()
if(!input)
return
var/target = getmobs()[input] var/target = getmobs()[input]
if(!target) return if(!target) return
ManualFollow(target) ManualFollow(target)
@@ -359,6 +370,45 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
forceMove(T) forceMove(T)
sleep(15) sleep(15)
var/icon/I = icon(target.icon,target.icon_state,target.dir)
var/orbitsize = (I.Width()+I.Height())*0.5
orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25)
var/rot_seg
/* We don't have this pref yet
switch(ghost_orbit)
if(GHOST_ORBIT_TRIANGLE)
rot_seg = 3
if(GHOST_ORBIT_SQUARE)
rot_seg = 4
if(GHOST_ORBIT_PENTAGON)
rot_seg = 5
if(GHOST_ORBIT_HEXAGON)
rot_seg = 6
else //Circular
rot_seg = 36 //360/10 bby, smooth enough aproximation of a circle
*/
orbit(target, orbitsize, FALSE, 20, rot_seg)
/mob/observer/dead/orbit()
set_dir(2) //reset dir so the right directional sprites show up
return ..()
/mob/observer/dead/stop_orbit(datum/component/orbiter/orbits)
. = ..()
//restart our floating animation after orbit is done.
pixel_y = 0
pixel_x = 0
transform = null
animate(src, pixel_y = 2, time = 10, loop = -1)
/mob/observer/dead/proc/stop_following()
following = null
stop_orbit()
/mob/proc/update_following() /mob/proc/update_following()
. = get_turf(src) . = get_turf(src)
for(var/mob/observer/dead/M in following_mobs) for(var/mob/observer/dead/M in following_mobs)
@@ -373,7 +423,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/Destroy() /mob/Destroy()
for(var/mob/observer/dead/M in following_mobs) for(var/mob/observer/dead/M in following_mobs)
M.following = null M.stop_following()
following_mobs = null following_mobs = null
return ..() return ..()
@@ -381,7 +431,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(ismob(following)) if(ismob(following))
var/mob/M = following var/mob/M = following
M.following_mobs -= src M.following_mobs -= src
following = null stop_following()
return ..() return ..()
/mob/Moved(atom/old_loc, direction, forced = FALSE) /mob/Moved(atom/old_loc, direction, forced = FALSE)
@@ -406,8 +456,16 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set category = "Ghost" set category = "Ghost"
set name = "Jump to Mob" set name = "Jump to Mob"
set desc = "Teleport to a mob" set desc = "Teleport to a mob"
set popup_menu = FALSE //VOREStation Edit - Declutter. set popup_menu = FALSE
if(istype(usr, /mob/observer/dead)) //Make sure they're an observer!
if(!istype(usr, /mob/observer/dead)) //Make sure they're an observer!
return
if(!input)
input = input(usr, "Select a mob:", "Ghost Jump") as null|anything in getmobs()
if(!input)
return
var/target = getmobs()[input] var/target = getmobs()[input]
if (!target)//Make sure we actually have a target if (!target)//Make sure we actually have a target
return return
@@ -417,24 +475,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination. if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination.
forceMove(T) forceMove(T)
following = null stop_following()
else else
to_chat(src, "This mob is not located in the game world.") to_chat(src, "This mob is not located in the game world.")
/*
/mob/observer/dead/verb/boo()
set category = "Ghost"
set name = "Boo!"
set desc= "Scare your crew members because of boredom!"
if(bootime > world.time) return
var/obj/machinery/light/L = locate(/obj/machinery/light) in view(1, src)
if(L)
L.flicker()
bootime = world.time + 600
return
//Maybe in the future we can add more <i>spooky</i> code here!
return
*/
/mob/observer/dead/memory() /mob/observer/dead/memory()
set hidden = 1 set hidden = 1
@@ -445,7 +488,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
to_chat(src, "<font color='red'>You are dead! You have no mind to store memory!</font>") to_chat(src, "<font color='red'>You are dead! You have no mind to store memory!</font>")
/mob/observer/dead/Post_Incorpmove() /mob/observer/dead/Post_Incorpmove()
following = null stop_following()
/mob/observer/dead/verb/analyze_air() /mob/observer/dead/verb/analyze_air()
set name = "Analyze Air" set name = "Analyze Air"
@@ -813,14 +856,20 @@ mob/observer/dead/MayRespawn(var/feedback = 0)
set category = "Ghost" set category = "Ghost"
set name = "Blank pAI alert" set name = "Blank pAI alert"
set desc = "Flash an indicator light on available blank pAI devices for a smidgen of hope." set desc = "Flash an indicator light on available blank pAI devices for a smidgen of hope."
if(usr.client.prefs.be_special & BE_PAI)
if(usr.client.prefs?.be_special & BE_PAI)
var/count = 0
for(var/obj/item/device/paicard/p in all_pai_cards) for(var/obj/item/device/paicard/p in all_pai_cards)
var/obj/item/device/paicard/PP = p var/obj/item/device/paicard/PP = p
if(PP.pai == null) if(PP.pai == null)
count++
PP.icon = 'icons/obj/pda_vr.dmi' // VOREStation Edit PP.icon = 'icons/obj/pda_vr.dmi' // VOREStation Edit
PP.overlays += "pai-ghostalert" PP.overlays += "pai-ghostalert"
spawn(54) spawn(54)
PP.overlays.Cut() PP.overlays.Cut()
to_chat(usr,"<span class='notice'>Flashing the displays of [count] unoccupied PAIs.</span>")
else
to_chat(usr,"<span class='warning'>You have 'Be pAI' disabled in your character prefs, so we can't help you.</span>")
/mob/observer/dead/speech_bubble_appearance() /mob/observer/dead/speech_bubble_appearance()
return "ghost" return "ghost"

View File

@@ -1,6 +1,5 @@
/mob/living/simple_mob/instantiate_hud(var/datum/hud/hud) /mob/living/simple_mob/create_mob_hud(datum/hud/HUD)
if(!client) ..()
return //Why bother.
var/ui_style = 'icons/mob/screen1_animal.dmi' var/ui_style = 'icons/mob/screen1_animal.dmi'
if(ui_icons) if(ui_icons)
@@ -14,9 +13,9 @@
var/list/hotkeybuttons = list() var/list/hotkeybuttons = list()
var/list/slot_info = list() var/list/slot_info = list()
hud.adding = adding HUD.adding = adding
hud.other = other HUD.other = other
hud.hotkeybuttons = hotkeybuttons HUD.hotkeybuttons = hotkeybuttons
var/list/hud_elements = list() var/list/hud_elements = list()
var/obj/screen/using var/obj/screen/using
@@ -65,8 +64,8 @@
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.color = ui_color using.color = ui_color
using.alpha = ui_alpha using.alpha = ui_alpha
hud.adding += using HUD.adding += using
hud.action_intent = using HUD.action_intent = using
hud_elements |= using hud_elements |= using
@@ -82,8 +81,8 @@
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.alpha = ui_alpha using.alpha = ui_alpha
using.layer = LAYER_HUD_ITEM //These sit on the intent box using.layer = LAYER_HUD_ITEM //These sit on the intent box
hud.adding += using HUD.adding += using
hud.help_intent = using HUD.help_intent = using
ico = new(ui_style, "black") ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
@@ -94,8 +93,8 @@
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.alpha = ui_alpha using.alpha = ui_alpha
using.layer = LAYER_HUD_ITEM using.layer = LAYER_HUD_ITEM
hud.adding += using HUD.adding += using
hud.disarm_intent = using HUD.disarm_intent = using
ico = new(ui_style, "black") ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
@@ -106,8 +105,8 @@
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.alpha = ui_alpha using.alpha = ui_alpha
using.layer = LAYER_HUD_ITEM using.layer = LAYER_HUD_ITEM
hud.adding += using HUD.adding += using
hud.grab_intent = using HUD.grab_intent = using
ico = new(ui_style, "black") ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
@@ -118,8 +117,8 @@
using.screen_loc = ui_acti using.screen_loc = ui_acti
using.alpha = ui_alpha using.alpha = ui_alpha
using.layer = LAYER_HUD_ITEM using.layer = LAYER_HUD_ITEM
hud.adding += using HUD.adding += using
hud.hurt_intent = using HUD.hurt_intent = using
//Move intent (walk/run) //Move intent (walk/run)
using = new /obj/screen() using = new /obj/screen()
@@ -129,8 +128,8 @@
using.screen_loc = ui_movi using.screen_loc = ui_movi
using.color = ui_color using.color = ui_color
using.alpha = ui_alpha using.alpha = ui_alpha
hud.adding += using HUD.adding += using
hud.move_intent = using HUD.move_intent = using
//Resist button //Resist button
using = new /obj/screen() using = new /obj/screen()
@@ -140,7 +139,7 @@
using.screen_loc = ui_pull_resist using.screen_loc = ui_pull_resist
using.color = ui_color using.color = ui_color
using.alpha = ui_alpha using.alpha = ui_alpha
hud.hotkeybuttons += using HUD.hotkeybuttons += using
//Pull button //Pull button
pullin = new /obj/screen() pullin = new /obj/screen()
@@ -148,7 +147,7 @@
pullin.icon_state = "pull0" pullin.icon_state = "pull0"
pullin.name = "pull" pullin.name = "pull"
pullin.screen_loc = ui_pull_resist pullin.screen_loc = ui_pull_resist
hud.hotkeybuttons += pullin HUD.hotkeybuttons += pullin
hud_elements |= pullin hud_elements |= pullin
//Health status //Health status
@@ -159,8 +158,6 @@
healths.screen_loc = ui_health healths.screen_loc = ui_health
hud_elements |= healths hud_elements |= healths
pain = new /obj/screen( null ) pain = new /obj/screen( null )
zone_sel = new /obj/screen/zone_sel( null ) zone_sel = new /obj/screen/zone_sel( null )
@@ -181,7 +178,7 @@
using.screen_loc = ui_drop_throw using.screen_loc = ui_drop_throw
using.color = ui_color using.color = ui_color
using.alpha = ui_alpha using.alpha = ui_alpha
hud.hotkeybuttons += using HUD.hotkeybuttons += using
//Equip detail //Equip detail
using = new /obj/screen() using = new /obj/screen()
@@ -191,7 +188,7 @@
using.screen_loc = ui_equip using.screen_loc = ui_equip
using.color = ui_color using.color = ui_color
using.alpha = ui_alpha using.alpha = ui_alpha
hud.adding += using HUD.adding += using
//Hand slots themselves //Hand slots themselves
inv_box = new /obj/screen/inventory/hand() inv_box = new /obj/screen/inventory/hand()
@@ -205,8 +202,8 @@
inv_box.slot_id = slot_r_hand inv_box.slot_id = slot_r_hand
inv_box.color = ui_color inv_box.color = ui_color
inv_box.alpha = ui_alpha inv_box.alpha = ui_alpha
hud.r_hand_hud_object = inv_box HUD.r_hand_hud_object = inv_box
hud.adding += inv_box HUD.adding += inv_box
slot_info["[slot_r_hand]"] = inv_box.screen_loc slot_info["[slot_r_hand]"] = inv_box.screen_loc
inv_box = new /obj/screen/inventory/hand() inv_box = new /obj/screen/inventory/hand()
@@ -220,8 +217,8 @@
inv_box.slot_id = slot_l_hand inv_box.slot_id = slot_l_hand
inv_box.color = ui_color inv_box.color = ui_color
inv_box.alpha = ui_alpha inv_box.alpha = ui_alpha
hud.l_hand_hud_object = inv_box HUD.l_hand_hud_object = inv_box
hud.adding += inv_box HUD.adding += inv_box
slot_info["[slot_l_hand]"] = inv_box.screen_loc slot_info["[slot_l_hand]"] = inv_box.screen_loc
//Swaphand titlebar //Swaphand titlebar
@@ -232,7 +229,7 @@
using.screen_loc = ui_swaphand1 using.screen_loc = ui_swaphand1
using.color = ui_color using.color = ui_color
using.alpha = ui_alpha using.alpha = ui_alpha
hud.adding += using HUD.adding += using
using = new /obj/screen/inventory() using = new /obj/screen/inventory()
using.name = "hand" using.name = "hand"
@@ -241,7 +238,7 @@
using.screen_loc = ui_swaphand2 using.screen_loc = ui_swaphand2
using.color = ui_color using.color = ui_color
using.alpha = ui_alpha using.alpha = ui_alpha
hud.adding += using HUD.adding += using
//Throw button //Throw button
throw_icon = new /obj/screen() throw_icon = new /obj/screen()
@@ -251,15 +248,13 @@
throw_icon.screen_loc = ui_drop_throw throw_icon.screen_loc = ui_drop_throw
throw_icon.color = ui_color throw_icon.color = ui_color
throw_icon.alpha = ui_alpha throw_icon.alpha = ui_alpha
hud.hotkeybuttons += throw_icon HUD.hotkeybuttons += throw_icon
hud_elements |= throw_icon hud_elements |= throw_icon
extra_huds(hud,ui_style,hud_elements) extra_huds(HUD, HUD.ui_style, hud_elements)
if(client)
client.screen = list() client.screen = list()
client.screen += hud_elements client.screen += hud_elements
client.screen += adding + hotkeybuttons client.screen += adding + hotkeybuttons
client.screen += client.void client.screen += client.void
return

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 133 KiB

BIN
icons/mob/screen_ghost.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -152,6 +152,7 @@
#include "code\_onclick\hud\alert.dm" #include "code\_onclick\hud\alert.dm"
#include "code\_onclick\hud\alien_larva.dm" #include "code\_onclick\hud\alien_larva.dm"
#include "code\_onclick\hud\fullscreen.dm" #include "code\_onclick\hud\fullscreen.dm"
#include "code\_onclick\hud\ghost.dm"
#include "code\_onclick\hud\gun_mode.dm" #include "code\_onclick\hud\gun_mode.dm"
#include "code\_onclick\hud\hud.dm" #include "code\_onclick\hud\hud.dm"
#include "code\_onclick\hud\human.dm" #include "code\_onclick\hud\human.dm"