This commit is contained in:
Zuhayr
2015-01-02 19:55:50 +10:30
parent a255fe48ca
commit 15801e9f50

View File

@@ -135,37 +135,57 @@ var/list/global_huds = list(
var/list/obj/screen/item_action/item_action_list = list() //Used for the item action ui buttons.
datum/hud/New(mob/owner)
mymob = owner
instantiate()
..()
/datum/hud/proc/hidden_inventory_update()
if(!mymob) return
if(ishuman(mymob))
var/mob/living/carbon/human/H = mymob
if(inventory_shown && hud_shown)
if(H.shoes) H.shoes.screen_loc = ui_shoes
if(H.gloves) H.gloves.screen_loc = ui_gloves
if(H.l_ear) H.l_ear.screen_loc = ui_l_ear
if(H.r_ear) H.r_ear.screen_loc = ui_r_ear
if(H.glasses) H.glasses.screen_loc = ui_glasses
if(H.w_uniform) H.w_uniform.screen_loc = ui_iclothing
if(H.wear_suit) H.wear_suit.screen_loc = ui_oclothing
if(H.wear_mask) H.wear_mask.screen_loc = ui_mask
if(H.head) H.head.screen_loc = ui_head
else
if(H.shoes) H.shoes.screen_loc = null
if(H.gloves) H.gloves.screen_loc = null
if(H.l_ear) H.l_ear.screen_loc = null
if(H.r_ear) H.r_ear.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
for(var/gear_slot in H.species.hud.gear)
var/list/hud_data = H.species.hud.gear[gear_slot]
if(inventory_shown && hud_shown)
switch(hud_data["slot"])
if(slot_head)
if(H.head) H.head.screen_loc = hud_data["loc"]
if(slot_shoes)
if(H.shoes) H.shoes.screen_loc = hud_data["loc"]
if(slot_l_ear)
if(H.l_ear) H.l_ear.screen_loc = hud_data["loc"]
if(slot_r_ear)
if(H.r_ear) H.r_ear.screen_loc = hud_data["loc"]
if(slot_gloves)
if(H.gloves) H.gloves.screen_loc = hud_data["loc"]
if(slot_glasses)
if(H.glasses) H.glasses.screen_loc = hud_data["loc"]
if(slot_w_uniform)
if(H.w_uniform) H.w_uniform.screen_loc = hud_data["loc"]
if(slot_wear_suit)
if(H.wear_suit) H.wear_suit.screen_loc = hud_data["loc"]
if(slot_wear_mask)
if(H.wear_mask) H.wear_mask.screen_loc = hud_data["loc"]
else
switch(hud_data["slot"])
if(slot_head)
if(H.head) H.head.screen_loc = null
if(slot_shoes)
if(H.shoes) H.shoes.screen_loc = null
if(slot_l_ear)
if(H.l_ear) H.l_ear.screen_loc = null
if(slot_r_ear)
if(H.r_ear) H.r_ear.screen_loc = null
if(slot_gloves)
if(H.gloves) H.gloves.screen_loc = null
if(slot_glasses)
if(H.glasses) H.glasses.screen_loc = null
if(slot_w_uniform)
if(H.w_uniform) H.w_uniform.screen_loc = null
if(slot_wear_suit)
if(H.wear_suit) H.wear_suit.screen_loc = null
if(slot_wear_mask)
if(H.wear_mask) H.wear_mask.screen_loc = null
/datum/hud/proc/persistant_inventory_update()
@@ -174,20 +194,36 @@ datum/hud/New(mob/owner)
if(ishuman(mymob))
var/mob/living/carbon/human/H = mymob
if(hud_shown)
if(H.s_store) H.s_store.screen_loc = ui_sstore1
if(H.wear_id) H.wear_id.screen_loc = ui_id
if(H.belt) H.belt.screen_loc = ui_belt
if(H.back) H.back.screen_loc = ui_back
if(H.l_store) H.l_store.screen_loc = ui_storage1
if(H.r_store) H.r_store.screen_loc = ui_storage2
else
if(H.s_store) H.s_store.screen_loc = null
if(H.wear_id) H.wear_id.screen_loc = null
if(H.belt) H.belt.screen_loc = null
if(H.back) H.back.screen_loc = null
if(H.l_store) H.l_store.screen_loc = null
if(H.r_store) H.r_store.screen_loc = null
for(var/gear_slot in H.species.hud.gear)
var/list/hud_data = H.species.hud.gear[gear_slot]
if(hud_shown)
switch(hud_data["slot"])
if(slot_s_store)
if(H.s_store) H.s_store.screen_loc = hud_data["loc"]
if(slot_wear_id)
if(H.wear_id) H.wear_id.screen_loc = hud_data["loc"]
if(slot_belt)
if(H.belt) H.belt.screen_loc = hud_data["loc"]
if(slot_back)
if(H.back) H.back.screen_loc = hud_data["loc"]
if(slot_l_store)
if(H.l_store) H.l_store.screen_loc = hud_data["loc"]
if(slot_r_store)
if(H.r_store) H.r_store.screen_loc = hud_data["loc"]
else
switch(hud_data["slot"])
if(slot_s_store)
if(H.s_store) H.s_store.screen_loc = null
if(slot_wear_id)
if(H.wear_id) H.wear_id.screen_loc = null
if(slot_belt)
if(H.belt) H.belt.screen_loc = null
if(slot_back)
if(H.back) H.back.screen_loc = null
if(slot_l_store)
if(H.l_store) H.l_store.screen_loc = null
if(slot_r_store)
if(H.r_store) H.r_store.screen_loc = null
/datum/hud/proc/instantiate()