obj/hud is now datum/hud. There was no need for it to be an object.

Moved some of the static overlays such as the dither effects, druggy effect and blurry-eyes into datum/global_hud. Meaning that only one object is instanced per server rather than per mob. It reduces on code.
Commented out a green and red overlay which aren't used, which were being instanced for every mob.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4767 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-09-28 23:02:11 +00:00
parent b903680fbd
commit eb10f04ea3
26 changed files with 212 additions and 547 deletions

View File

@@ -1,4 +1,3 @@
//Upper left action buttons, displayed when you pick up an item that has this enabled.
#define ui_action_slot1 "1:6,14:26"
#define ui_action_slot2 "2:8,14:26"
@@ -55,18 +54,15 @@
#define ui_alien_fire "14:28,12:25"
#define ui_alien_oxygen "14:28,11:25"
//Middle right (status indicators)
#define ui_nutrition "14:28,5:11"
#define ui_temp "14:28,6:13"
#define ui_health "14:28,7:15"
#define ui_internal "14:28,8:17"
//borgs
#define ui_borg_health "14:28,6:13" //borgs have the health display where humans have the pressure damage indicator.
#define ui_alien_health "14:28,6:13" //aliens have the health display where humans have the pressure damage indicator.
//Pop-up inventory
#define ui_shoes "2:8,1:5"
@@ -80,20 +76,14 @@
#define ui_head "2:8,4:11"
//Intent small buttons
#define ui_help_small "12:8,1:1"
#define ui_disarm_small "12:15,1:18"
#define ui_grab_small "12:32,1:18"
#define ui_harm_small "12:39,1:1"
//#define ui_swapbutton "6:-16,1:5" //Unused
//#define ui_headset "SOUTH,8"
#define ui_hand "6:14,1:5"
#define ui_hstore1 "5,5"
@@ -105,16 +95,126 @@
#define ui_iarrowleft "SOUTH-1,11"
#define ui_iarrowright "SOUTH-1,13"
var/datum/global_hud/global_hud = new()
/datum/global_hud
var/h_type = /obj/screen
var/obj/screen/druggy
var/obj/screen/blurry
// var/obj/screen/alien_view
// var/obj/screen/g_dither
var/list/vimpaired
var/list/darkMask
New()
//420erryday psychedellic colours screen overlay for when you are high
druggy = new h_type()
druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
druggy.icon_state = "druggy"
druggy.layer = 17
druggy.mouse_opacity = 0
//that white blurry effect you get when you eyes are damaged
blurry = new h_type()
blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
blurry.icon_state = "blurry"
blurry.layer = 17
blurry.mouse_opacity = 0
var/obj/screen/O
var/i
//that nasty looking dither you get when you're short-sighted
vimpaired = newlist(h_type,h_type,h_type,h_type)
O = vimpaired[1]
O.screen_loc = "1,1 to 5,15"
O = vimpaired[2]
O.screen_loc = "5,1 to 10,5"
O = vimpaired[3]
O.screen_loc = "6,11 to 10,15"
O = vimpaired[4]
O.screen_loc = "11,1 to 15,15"
//welding mask overlay black/dither
darkMask = newlist(h_type,h_type,h_type,h_type,h_type,h_type,h_type,h_type)
O = darkMask[1]
O.screen_loc = "3,3 to 5,13"
O = darkMask[2]
O.screen_loc = "5,3 to 10,5"
O = darkMask[3]
O.screen_loc = "6,11 to 10,13"
O = darkMask[4]
O.screen_loc = "11,3 to 13,13"
O = darkMask[5]
O.screen_loc = "1,1 to 15,2"
O = darkMask[6]
O.screen_loc = "1,3 to 2,15"
O = darkMask[7]
O.screen_loc = "14,3 to 15,15"
O = darkMask[8]
O.screen_loc = "3,14 to 13,15"
for(i=1,i<=4,i++)
O = vimpaired[i]
O.icon_state = "dither50"
O.layer = 17
O.mouse_opacity = 0
O = darkMask[i]
O.icon_state = "dither50"
O.layer = 17
O.mouse_opacity = 0
for(i=5,i<=8,i++)
O = darkMask[i]
O.icon_state = "black"
O.layer = 17
O.mouse_opacity = 0
/*
//not used
alien_view = new h_type()
alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
alien_view.icon_state = "alien"
alien_view.layer = 18
alien_view.mouse_opacity = 0
g_dither = new h_type()
g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
g_dither.icon_state = "dither12g"
g_dither.layer = 18
g_dither.mouse_opacity = 0
*/
obj/hud/New(var/type = 0)
instantiate(type)
/datum/hud
var/mob/mymob
var/h_type = /obj/screen //this is like...the most pointless thing ever. Use a god damn define!
var/hud_shown = 1 //Used for the HUD toggle (F12)
var/inventory_shown = 1 //the inventory
var/show_intent_icons = 0
var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)
var/obj/screen/r_hand_hud_object
var/obj/screen/l_hand_hud_object
var/obj/screen/action_intent
var/obj/screen/move_intent
var/list/adding
var/list/other
var/list/obj/screen/hotkeybuttons
var/list/obj/screen/item_action/item_action_list //Used for the item action ui buttons.
datum/hud/New(mob/owner)
mymob = owner
instantiate()
..()
return
/obj/hud/proc/hidden_inventory_update()
/datum/hud/proc/hidden_inventory_update()
if(!mymob) return
if(inventory_shown && hud_shown)
if(ishuman(mymob))
@@ -137,7 +237,7 @@ obj/hud/New(var/type = 0)
if(mymob:wear_mask) mymob:wear_mask:screen_loc = null
if(mymob:head) mymob:head:screen_loc = null
/obj/hud/proc/persistant_inventory_update()
/datum/hud/proc/persistant_inventory_update()
if(!mymob) return
if(hud_shown)
if(ishuman(mymob))
@@ -157,16 +257,8 @@ obj/hud/New(var/type = 0)
if(mymob:r_store) mymob:r_store:screen_loc = null
/obj/hud
var/obj/screen/action_intent
var/obj/screen/move_intent
var/hud_shown = 1 //Used for the HUD toggle (F12)
var/inventory_shown = 1 //the inventory
/obj/hud/proc/instantiate(var/type = 0)
mymob = loc
if(!istype(mymob, /mob)) return 0
/datum/hud/proc/instantiate()
if(!ismob(mymob)) return 0
if(ishuman(mymob))
human_hud(mymob.UI) // Pass the player the UI style chosen in preferences

View File

@@ -1,21 +0,0 @@
/obj/hud
name = "hud"
unacidable = 1
var/mob/mymob = null
var/list/adding = null
var/list/other = null
var/obj/screen/druggy = null
var/vimpaired = null
var/obj/screen/alien_view = null
var/obj/screen/g_dither = null
var/obj/screen/blurry = null
var/list/darkMask = null
var/obj/screen/r_hand_hud_object = null
var/obj/screen/l_hand_hud_object = null
var/show_intent_icons = 0
var/list/obj/screen/hotkeybuttons = null
var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)
var/list/obj/screen/item_action/item_action_list = null //Used for the item action ui buttons.
var/h_type = /obj/screen //this is like...the most pointless thing ever. Use a god damn define!

View File

@@ -201,7 +201,7 @@
return
/obj/structure/closet/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
if(istype(O, /obj/screen) || istype(O, /obj/hud)) //fix for HUD elements making their way into the world -Pete
if(istype(O, /obj/screen)) //fix for HUD elements making their way into the world -Pete
return
if(O.loc == user)
return

View File

@@ -4,7 +4,6 @@ var/global/obj/effect/datacore/data_core = null
var/global/obj/effect/overlay/plmaster = null
var/global/obj/effect/overlay/slmaster = null
//obj/hud/main_hud1 = null
var/global/list/machines = list()
var/global/list/processing_objects = list()

View File

@@ -1,3 +1,3 @@
/obj/hud/proc/ghost_hud()
/datum/hud/proc/ghost_hud()
return

View File

@@ -1,37 +1,7 @@
/obj/hud/proc/alien_hud()
/datum/hud/proc/alien_hud()
src.adding = list( )
src.other = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
var/obj/screen/using
var/obj/screen/inventory/inv_box
@@ -206,42 +176,6 @@
src.adding += using
*/
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "1,1 to 5,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "5,1 to 10,5"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "6,11 to 10,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "11,1 to 15,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
mymob.throw_icon = new /obj/screen(null)
mymob.throw_icon.icon = 'icons/mob/screen1_alien.dmi'
mymob.throw_icon.icon_state = "act_throw_off"

View File

@@ -486,9 +486,7 @@
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
//blame the person who coded them. Temporary fix added.
client.screen -= hud_used.blurry
client.screen -= hud_used.druggy
client.screen -= hud_used.vimpaired
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((blinded))
@@ -497,13 +495,13 @@
blind.layer = 0
if (disabilities & NEARSIGHTED)
client.screen += hud_used.vimpaired
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += hud_used.blurry
client.screen += global_hud.blurry
if (druggy)
client.screen += hud_used.druggy
client.screen += global_hud.druggy
if (stat != 2)
if (machine)

View File

@@ -1,39 +1,9 @@
/obj/hud/proc/larva_hud()
/datum/hud/proc/larva_hud()
src.adding = list( )
src.other = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
var/obj/screen/using
@@ -108,43 +78,6 @@
src.adding += using
*/
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "1,1 to 5,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "5,1 to 10,5"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "6,11 to 10,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "dither50"
using.screen_loc = "11,1 to 15,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
mymob.oxygen = new /obj/screen( null )
mymob.oxygen.icon = 'icons/mob/screen1_alien.dmi'
mymob.oxygen.icon_state = "oxy0"

View File

@@ -385,9 +385,7 @@
//blame the person who coded them. Temporary fix added.
client.screen -= hud_used.blurry
client.screen -= hud_used.druggy
client.screen -= hud_used.vimpaired
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((blinded))
@@ -396,13 +394,13 @@
blind.layer = 0
if (disabilities & NEARSIGHTED)
client.screen += hud_used.vimpaired
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += hud_used.blurry
client.screen += global_hud.blurry
if (druggy)
client.screen += hud_used.druggy
client.screen += global_hud.druggy
if (stat != 2)
if (machine)

View File

@@ -1,23 +1,7 @@
/obj/hud/proc/brain_hud(var/ui_style='icons/mob/screen1_old.dmi')
/datum/hud/proc/brain_hud(var/ui_style='icons/mob/screen1_old.dmi')
//ui_style='icons/mob/screen1_old.dmi' //Overriding the parameter. Only this UI style is acceptable with the 'sleek' layout.
blurry = new h_type( src )
blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
blurry.name = "Blurry"
blurry.icon = ui_style
blurry.icon_state = "blurry"
blurry.layer = 17
blurry.mouse_opacity = 0
druggy = new h_type( src )
druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
druggy.name = "Druggy"
druggy.icon = ui_style
druggy.icon_state = "druggy"
druggy.layer = 17
druggy.mouse_opacity = 0
mymob.blind = new /obj/screen( null )
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"

View File

@@ -246,9 +246,7 @@
if(pullin) pullin.icon_state = "pull[pulling ? 1 : 0]"
client.screen -= hud_used.blurry
client.screen -= hud_used.druggy
client.screen -= hud_used.vimpaired
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((blinded))
@@ -257,13 +255,13 @@
blind.layer = 0
if (disabilities & NEARSIGHTED)
client.screen += hud_used.vimpaired
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += hud_used.blurry
client.screen += global_hud.blurry
if (druggy)
client.screen += hud_used.druggy
client.screen += global_hud.druggy
if (stat != 2)
if (machine)

View File

@@ -1,43 +1,9 @@
/obj/hud/proc/human_hud(var/ui_style='icons/mob/screen1_old.dmi')
/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_old.dmi')
src.adding = list( )
src.other = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.hotkeybuttons = list( ) //These can be disabled for hotkey usersx
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon = ui_style
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon = ui_style
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon = ui_style
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon = ui_style
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
var/obj/screen/using
var/obj/screen/inventory/inv_box
@@ -388,107 +354,6 @@
src.mov_int += using
*/
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "1,1 to 5,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "5,1 to 10,5"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "6,11 to 10,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "11,1 to 15,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
//welding mask dither
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "3,3 to 5,13"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "5,3 to 10,5"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "6,11 to 10,13"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "11,3 to 13,13"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
//welding mask blackness
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "black"
using.screen_loc = "1,1 to 15,2"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "black"
using.screen_loc = "1,3 to 2,15"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "black"
using.screen_loc = "14,3 to 15,15"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "black"
using.screen_loc = "3,14 to 13,15"
using.layer = 17
using.mouse_opacity = 0
src.darkMask += using
mymob.throw_icon = new /obj/screen(null)
mymob.throw_icon.icon = ui_style
mymob.throw_icon.icon_state = "act_throw_off"

View File

@@ -926,7 +926,7 @@
if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe
del(hud)
client.screen.Remove(hud_used.blurry, hud_used.druggy, hud_used.vimpaired, hud_used.darkMask)
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
update_action_buttons()
@@ -1147,18 +1147,18 @@
else blind.layer = 0
if( disabilities & NEARSIGHTED && !istype(glasses, /obj/item/clothing/glasses/regular) )
client.screen += hud_used.vimpaired
if(eye_blurry) client.screen += hud_used.blurry
if(druggy) client.screen += hud_used.druggy
client.screen += global_hud.vimpaired
if(eye_blurry) client.screen += global_hud.blurry
if(druggy) client.screen += global_hud.druggy
if( istype(head, /obj/item/clothing/head/welding) )
var/obj/item/clothing/head/welding/O = head
if(!O.up && tinted_weldhelh)
client.screen += hud_used.darkMask
client.screen += global_hud.darkMask
if(eye_stat > 20)
if(eye_stat > 30) client.screen += hud_used.darkMask
else client.screen += hud_used.vimpaired
if(eye_stat > 30) client.screen += global_hud.darkMask
else client.screen += global_hud.vimpaired
if(machine)
if(!machine.check_eye(src)) reset_view(null)

View File

@@ -5,7 +5,7 @@
del(hud)
/*
/obj/hud/proc/metroid_hud()
/datum/hud/proc/metroid_hud()
src.adding = list( )
src.other = list( )

View File

@@ -1,46 +1,12 @@
/obj/hud/proc/monkey_hud(var/ui_style='icons/mob/screen1_old.dmi')
/datum/hud/proc/monkey_hud(var/ui_style='icons/mob/screen1_old.dmi')
//ui_style='icons/mob/screen1_old.dmi' //Overriding the parameter. Only this UI style is acceptable with the 'sleek' layout.
src.adding = list( )
src.other = list( )
src.vimpaired = list( )
src.darkMask = list( )
//var/icon/blocked = icon(ui_style,"blocked")
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon = ui_style
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon = ui_style
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon = ui_style
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon = ui_style
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
var/obj/screen/using
var/obj/screen/inventory/inv_box
@@ -357,39 +323,6 @@
src.mov_int += using
*/
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "1,1 to 5,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "5,1 to 10,5"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "6,11 to 10,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
using = new src.h_type( src )
using.name = null
using.icon = ui_style
using.icon_state = "dither50"
using.screen_loc = "11,1 to 15,15"
using.layer = 17
using.mouse_opacity = 0
src.vimpaired += using
mymob.throw_icon = new /obj/screen(null)
mymob.throw_icon.icon = ui_style
mymob.throw_icon.icon_state = "act_throw_off"
@@ -408,18 +341,6 @@
mymob.pressure.name = "pressure"
mymob.pressure.screen_loc = ui_pressure
/*
mymob.i_select = new /obj/screen( null )
mymob.i_select.icon_state = "selector"
mymob.i_select.name = "intent"
mymob.i_select.screen_loc = "16:-11,15"
mymob.m_select = new /obj/screen( null )
mymob.m_select.icon_state = "selector"
mymob.m_select.name = "moving"
mymob.m_select.screen_loc = "16:-11,14"
*/
mymob.toxin = new /obj/screen( null )
mymob.toxin.icon = ui_style
mymob.toxin.icon_state = "tox0"

View File

@@ -532,24 +532,22 @@
else
bodytemp.icon_state = "temp-4"
client.screen -= hud_used.blurry
client.screen -= hud_used.druggy
client.screen -= hud_used.vimpaired
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((blinded))
if(blind && stat != DEAD)
if(blinded)
blind.layer = 18
else
blind.layer = 0
if(disabilities & NEARSIGHTED)
client.screen += hud_used.vimpaired
client.screen += global_hud.vimpaired
if(eye_blurry)
client.screen += hud_used.blurry
client.screen += global_hud.blurry
if(druggy)
client.screen += hud_used.druggy
client.screen += global_hud.druggy
if (stat != 2)
if (machine)

View File

@@ -1,2 +1,2 @@
/obj/hud/proc/ai_hud()
/datum/hud/proc/ai_hud()
return

View File

@@ -1,38 +1,8 @@
/obj/hud/proc/robot_hud()
/datum/hud/proc/robot_hud()
src.adding = list( )
src.other = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
//
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
var/obj/screen/using

View File

@@ -237,23 +237,21 @@
// if (src.oxygen) src.oxygen.icon_state = "oxy[src.oxygen_alert ? 1 : 0]"
// if (src.fire) src.fire.icon_state = "fire[src.fire_alert ? 1 : 0]"
src.client.screen -= src.hud_used.blurry
src.client.screen -= src.hud_used.druggy
src.client.screen -= src.hud_used.vimpaired
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((src.blind && src.stat != 2))
if ((src.blinded))
if(src.blinded)
src.blind.layer = 18
else
src.blind.layer = 0
if (src.disabilities & NEARSIGHTED)
src.client.screen += src.hud_used.vimpaired
src.client.screen += global_hud.vimpaired
if (src.eye_blurry)
src.client.screen += src.hud_used.blurry
src.client.screen += global_hud.blurry
if (src.druggy)
src.client.screen += src.hud_used.druggy
src.client.screen += global_hud.druggy
if (src.stat != 2)
if (src.machine)

View File

@@ -35,7 +35,7 @@
client.images = null //remove the images such as AIs being unable to see runes
client.screen = null //remove hud items just in case
if(hud_used) del(hud_used) //remove the hud objects
hud_used = new/obj/hud( src )
hud_used = new /datum/hud(src)
if(!dna)
dna = new /datum/dna(null)

View File

@@ -120,7 +120,7 @@
var/seer = 0 //for cult//Carbon, probably Human
var/obj/hud/hud_used = null
var/datum/hud/hud_used = null
//var/list/organs = list( ) //moved to human.
var/list/grabbed_by = list( )

View File

@@ -329,3 +329,49 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
usr << "\red Inventory hiding is currently only supported for human mobs, sorry."
else
usr << "\red This mob type does not use a HUD."
//converts intent-strings into numbers and back
var/list/intents = list("help","disarm","grab","hurt")
/proc/intent_numeric(argument)
if(istext(argument))
switch(argument)
if("help") return 0
if("disarm") return 1
if("grab") return 2
else return 3
else
switch(argument)
if(0) return "help"
if(1) return "disarm"
if(2) return "grab"
else return "hurt"
//change a mob's act-intent. Input the intent as a string such as "help" or use "right"/"left
/mob/verb/a_intent_change(input as text)
set name = "a-intent"
set hidden = 1
if(ishuman(src) || istype(src,/mob/living/carbon/alien/humanoid))
switch(input)
if("help","disarm","grab","hurt")
a_intent = input
if("right")
a_intent = intent_numeric((intent_numeric(a_intent)+1) % 4)
if("left")
a_intent = intent_numeric((intent_numeric(a_intent)+3) % 4)
if(hud_used && hud_used.action_intent)
hud_used.action_intent.icon_state = "intent_[a_intent]"
else if(isrobot(src) || ismonkey(src) || islarva(src))
switch(input)
if("help")
a_intent = "help"
if("hurt")
a_intent = "hurt"
if("right","left")
a_intent = intent_numeric(intent_numeric(a_intent) - 3)
if(hud_used && hud_used.action_intent)
if(a_intent == "hurt")
hud_used.action_intent.icon_state = "harm"
else
hud_used.action_intent.icon_state = "help"

View File

@@ -1,3 +1,3 @@
/obj/hud/proc/unplayer_hud()
/datum/hud/proc/unplayer_hud()
return

View File

@@ -1,5 +1,5 @@
/obj/screen
name = "screen"
name = ""
icon = 'icons/mob/screen1.dmi'
layer = 20.0
unacidable = 1

View File

@@ -31,53 +31,6 @@
src << browse(file(RULES_FILE), "window=rules;size=480x320")
#undef RULES_FILE
//converts intent-strings into numbers and back
var/list/intents = list("help","disarm","grab","hurt")
/proc/intent_numeric(argument)
if(istext(argument))
switch(argument)
if("help") return 0
if("disarm") return 1
if("grab") return 2
else return 3
else
switch(argument)
if(0) return "help"
if(1) return "disarm"
if(2) return "grab"
else return "hurt"
//change a mob's act-intent. Input the intent as a string such as "help" or use "right"/"left
/mob/verb/a_intent_change(input as text)
set name = "a-intent"
set hidden = 1
if(ishuman(src) || istype(src,/mob/living/carbon/alien/humanoid))
switch(input)
if("help","disarm","grab","hurt")
a_intent = input
if("right")
a_intent = intent_numeric((intent_numeric(a_intent)+1) % 4)
if("left")
a_intent = intent_numeric((intent_numeric(a_intent)+3) % 4)
if(hud_used && hud_used.action_intent)
hud_used.action_intent.icon_state = "intent_[a_intent]"
else if(isrobot(src) || ismonkey(src) || islarva(src))
switch(input)
if("help")
a_intent = "help"
if("hurt")
a_intent = "hurt"
if("right","left")
a_intent = intent_numeric(intent_numeric(a_intent) - 3)
if(hud_used && hud_used.action_intent)
if(a_intent == "hurt")
hud_used.action_intent.icon_state = "harm"
else
hud_used.action_intent.icon_state = "help"
/client/verb/hotkeys_help()
set name = "hotkeys-help"
set category = "OOC"

View File

@@ -582,7 +582,6 @@
#include "code\game\objects\empulse.dm"
#include "code\game\objects\explosion.dm"
#include "code\game\objects\explosion_recursive.dm"
#include "code\game\objects\hud.dm"
#include "code\game\objects\items.dm"
#include "code\game\objects\objs.dm"
#include "code\game\objects\structures.dm"