Properly layer and set/clear fullscreen overlays

This fixes ordering issues and admin ghosting
This commit is contained in:
Bjorn Neergaard
2016-02-01 02:11:50 -06:00
parent 7a47b43c53
commit 4a3da5d77a
3 changed files with 45 additions and 43 deletions

View File

@@ -1,10 +1,12 @@
#define FULLSCREEN_LAYER 18
#define DAMAGE_LAYER FULLSCREEN_LAYER + 0.1
#define BLIND_LAYER DAMAGE_LAYER + 0.1
#define CRIT_LAYER BLIND_LAYER + 0.1
/mob
var/list/screens = list()
/mob/proc/overlay_fullscreen(category, type, severity)
if(!category)
return
var/obj/screen/fullscreen/screen
if(screens[category])
screen = screens[category]
@@ -20,15 +22,14 @@
screen.severity = severity
screens[category] = screen
if(client && hud_used)
hud_used.update_fullscreen()
if(client)
client.screen += screen
return screen
/mob/proc/clear_fullscreen(category, animate = 10)
var/obj/screen/fullscreen/screen = screens[category]
if(!screen)
return FALSE
return
if(animate)
animate(screen, alpha = 0, time = animate)
@@ -38,42 +39,44 @@
if(client)
client.screen -= screen
qdel(screen)
return TRUE
/datum/hud/proc/update_fullscreen()
/mob/proc/clear_fullscreens()
for(var/category in screens)
clear_fullscreen(category)
/datum/hud/proc/reload_fullscreen()
var/list/screens = mymob.screens
if(hud_shown)
for(var/screen in screens)
mymob.client.screen |= screens[screen]
else
for(var/screen in screens)
mymob.client.screen -= screens[screen]
for(var/category in screens)
mymob.client.screen |= screens[category]
/obj/screen/fullscreen
icon = 'icons/mob/screen_full.dmi'
icon_state = "default"
screen_loc = "CENTER-7,CENTER-7"
layer = 18
layer = FULLSCREEN_LAYER
mouse_opacity = 0
var/severity = 0
/obj/screen/fullscreen/Destroy()
..()
severity = 0
screen_loc = ""
return QDEL_HINT_PUTINPOOL
/obj/screen/fullscreen/brute
icon_state = "brutedamageoverlay"
layer = DAMAGE_LAYER
/obj/screen/fullscreen/oxy
icon_state = "oxydamageoverlay"
layer = DAMAGE_LAYER
/obj/screen/fullscreen/crit
icon_state = "passage"
layer = CRIT_LAYER
/obj/screen/fullscreen/blind
icon_state = "blackimageoverlay"
layer = BLIND_LAYER
/obj/screen/fullscreen/impaired
icon_state = "impairedoverlay"
@@ -97,3 +100,8 @@
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "druggy"
#undef FULLSCREEN_LAYER
#undef BLIND_LAYER
#undef DAMAGE_LAYER
#undef CRIT_LAYER

View File

@@ -205,6 +205,8 @@
else if(isovermind(mymob))
blob_hud()
reload_fullscreen() // Reload any fullscreen overlays this mob has.
//Version denotes which style should be displayed. blank or 0 means "next version"
/datum/hud/proc/show_hud(version = 0)
if(!ismob(mymob))
@@ -234,11 +236,6 @@
mymob.client.screen += mymob.internals
mymob.client.screen += lingstingdisplay
mymob.client.screen += lingchemdisplay
hidden_inventory_update()
persistant_inventory_update()
mymob.update_action_buttons()
reorganize_alerts()
if(HUD_STYLE_REDUCED) //Reduced HUD
hud_shown = 0 //Governs behavior of other procs
if(adding)
@@ -258,11 +255,6 @@
mymob.client.screen += r_hand_hud_object //we want the hands to be visible
mymob.client.screen += action_intent //we want the intent swticher visible
action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
hidden_inventory_update()
persistant_inventory_update()
mymob.update_action_buttons()
reorganize_alerts()
if(HUD_STYLE_NOHUD) //No HUD
hud_shown = 0 //Governs behavior of other procs
if(adding)
@@ -279,11 +271,11 @@
mymob.client.screen -= mymob.internals
mymob.client.screen -= lingstingdisplay
mymob.client.screen -= lingchemdisplay
hidden_inventory_update()
persistant_inventory_update()
mymob.update_action_buttons()
reorganize_alerts()
hidden_inventory_update()
persistant_inventory_update()
mymob.update_action_buttons()
reorganize_alerts()
hud_version = display_hud_version
//Triggered when F12 is pressed (Unless someone changed something in the DMF)

View File

@@ -1,3 +1,16 @@
/mob/living/death(gibbed)
eye_blind = max(eye_blind, 1)
timeofdeath = world.time
living_mob_list -= src
if(!gibbed)
dead_mob_list += src
else if(buckled)
buckled.unbuckle_mob()
clear_fullscreens()
..()
/mob/living/gib(animation = 1)
var/prev_lying = lying
death(1)
@@ -34,17 +47,6 @@
/mob/living/proc/dust_animation(animate, flick_name = "")
flick(flick_name, animate)
/mob/living/death(gibbed)
eye_blind = max(eye_blind, 1)
timeofdeath = world.time
living_mob_list -= src
if(!gibbed)
dead_mob_list += src
else if(buckled)
buckled.unbuckle_mob()
/mob/living/proc/setup_animation(animation, prev_lying)
var/atom/movable/overlay/animate = null
notransform = 1