Finishes up hud stuff.

Remaining issue: hide action buttons action button changing icon for both.
Also action buttons arent shown for observer, but the button is shifted over.
This commit is contained in:
Shadowlight213
2016-06-28 20:31:45 -07:00
parent b177b4c7b7
commit 892fcf3393
6 changed files with 56 additions and 24 deletions
+1 -1
View File
@@ -197,7 +197,7 @@
/datum/hud/proc/hidden_inventory_update()
return
/datum/hud/proc/persistant_inventory_update()
/datum/hud/proc/persistant_inventory_update(mob/viewer)
return
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
+30 -22
View File
@@ -6,14 +6,22 @@
icon_state = "toggle"
/obj/screen/human/toggle/Click()
if(usr.hud_used.inventory_shown)
var/mob/targetmob = usr
if(isobserver(usr))
if(ishuman(usr.client.eye) && (usr.client.eye != usr))
var/mob/M = usr.client.eye
targetmob = M
if(usr.hud_used.inventory_shown && targetmob.hud_used)
usr.hud_used.inventory_shown = 0
usr.client.screen -= usr.hud_used.toggleable_inventory
usr.client.screen -= targetmob.hud_used.toggleable_inventory
else
usr.hud_used.inventory_shown = 1
usr.client.screen += usr.hud_used.toggleable_inventory
usr.client.screen += targetmob.hud_used.toggleable_inventory
usr.hud_used.hidden_inventory_update()
targetmob.hud_used.hidden_inventory_update(usr)
/obj/screen/human/equip
name = "equip"
@@ -321,7 +329,7 @@
if(viewer)
screenmob = viewer
if(inventory_shown && hud_shown)
if(screenmob.hud_used.inventory_shown && screenmob.hud_used.hud_shown)
if(H.shoes)
H.shoes.screen_loc = ui_shoes
screenmob.client.screen += H.shoes
@@ -347,14 +355,14 @@
H.head.screen_loc = ui_head
screenmob.client.screen += H.head
else
if(H.shoes) H.shoes.screen_loc = null
if(H.gloves) H.gloves.screen_loc = null
if(H.ears) H.ears.screen_loc = null
if(H.glasses) H.glasses.screen_loc = null
if(H.w_uniform) H.w_uniform.screen_loc = null
if(H.wear_suit) H.wear_suit.screen_loc = null
if(H.wear_mask) H.wear_mask.screen_loc = null
if(H.head) H.head.screen_loc = null
if(H.shoes) screenmob.client.screen -= H.shoes
if(H.gloves) screenmob.client.screen -= H.gloves
if(H.ears) screenmob.client.screen -= H.ears
if(H.glasses) screenmob.client.screen -= H.glasses
if(H.w_uniform) screenmob.client.screen -= H.w_uniform
if(H.wear_suit) screenmob.client.screen -= H.wear_suit
if(H.wear_mask) screenmob.client.screen -= H.wear_mask
if(H.head) screenmob.client.screen -= H.head
/datum/hud/human/persistant_inventory_update(mob/viewer)
if(!mymob)
@@ -365,7 +373,7 @@
if(viewer)
screenmob = viewer
if(hud_shown)
if(screenmob.hud_used.hud_shown)
if(H.s_store)
H.s_store.screen_loc = ui_sstore1
screenmob.client.screen += H.s_store
@@ -386,17 +394,17 @@
screenmob.client.screen += H.r_store
else
if(H.s_store)
H.s_store.screen_loc = null
screenmob.client.screen -= H.s_store
if(H.wear_id)
H.wear_id.screen_loc = null
screenmob.client.screen -= H.wear_id
if(H.belt)
H.belt.screen_loc = null
screenmob.client.screen -= H.belt
if(H.back)
H.back.screen_loc = null
screenmob.client.screen -= H.back
if(H.l_store)
H.l_store.screen_loc = null
screenmob.client.screen -= H.l_store
if(H.r_store)
H.r_store.screen_loc = null
screenmob.client.screen -= H.r_store
if(hud_version != HUD_STYLE_NOHUD)
if(H.r_hand)
@@ -407,9 +415,9 @@
screenmob.client.screen += H.l_hand
else
if(H.r_hand)
H.r_hand.screen_loc = null
screenmob.client.screen -= H.r_hand
if(H.l_hand)
H.l_hand.screen_loc = null
screenmob.client.screen -= H.l_hand
/mob/living/carbon/human/verb/toggle_hotkey_verbs()
set category = "OOC"
+2
View File
@@ -54,6 +54,8 @@
/obj/screen/inventory/craft/Click()
var/mob/living/M = usr
if(isobserver(usr))
return
M.OpenCraftingMenu()
/obj/screen/inventory
@@ -49,6 +49,11 @@
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
r_hand.screen_loc = ui_rhand
client.screen += r_hand
if(observers && observers.len)
for(var/M in observers)
var/mob/dead/observe = M
if(observe.client)
observe.client.screen += r_hand
var/t_state = r_hand.item_state
if(!t_state)
@@ -68,6 +73,11 @@
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
l_hand.screen_loc = ui_lhand
client.screen += l_hand
if(observers && observers.len)
for(var/M in observers)
var/mob/dead/observe = M
if(observe.client)
observe.client.screen += l_hand
var/t_state = l_hand.item_state
if(!t_state)
+10
View File
@@ -276,6 +276,13 @@ var/next_mob_id = 0
update_pipe_vision()
/mob/dead/reset_perspective(atom/A)
if(client)
if(ismob(client.eye) && (client.eye != src))
var/mob/target = client.eye
target.observers -= src
var/list/L = target.observers
if(!L.len)
target.observers = null
if(..())
if(hud_used)
client.screen = list()
@@ -508,6 +515,9 @@ var/next_mob_id = 0
if(isobserver(src))
src.client.screen = list()
if(mob_eye.hud_used)
if(!mob_eye.observers)
mob_eye.observers = list()
mob_eye.observers |= src
mob_eye.hud_used.show_hud(1,src)
/mob/verb/cancel_camera()
+3 -1
View File
@@ -141,4 +141,6 @@
var/list/permanent_huds = list()
var/resize = 1 //Badminnery resize
var/resize = 1 //Badminnery resize
var/list/observers = null //The list of people observing this mob.