refactors clickcatchers/parallax/fullsceren (#15460)
* :) * that * move those there * refactor that too * wew * stuff * almost. * sigh * just need speed * stuf * pain * hm * tweaks * that * eh * wack * a * done * that's important * wacky * all that * fixes * typo * that * a * funny * that * that * woo * help im losing my fucking mind * okay * fix
This commit is contained in:
@@ -126,5 +126,5 @@ INITIALIZE_IMMEDIATE(/mob/dead)
|
||||
return ..()
|
||||
|
||||
/mob/dead/onTransitZ(old_z,new_z)
|
||||
..()
|
||||
. = ..()
|
||||
update_z(new_z)
|
||||
|
||||
@@ -578,8 +578,6 @@
|
||||
Spl.Fade(TRUE)
|
||||
character.playsound_local(get_turf(character), 'sound/voice/ApproachingTG.ogg', 25)
|
||||
|
||||
character.update_parallax_teleport()
|
||||
|
||||
job.standard_assign_skills(character.mind)
|
||||
|
||||
SSticker.minds += character.mind
|
||||
|
||||
@@ -377,8 +377,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
return
|
||||
ghostize(0, penalize = TRUE)
|
||||
|
||||
|
||||
|
||||
/mob/dead/observer/Move(NewLoc, direct)
|
||||
if (SEND_SIGNAL(src, COMSIG_MOVABLE_PRE_MOVE, NewLoc) & COMPONENT_MOVABLE_BLOCK_PRE_MOVE)
|
||||
return
|
||||
@@ -388,7 +386,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
if(NewLoc)
|
||||
forceMove(NewLoc)
|
||||
update_parallax_contents()
|
||||
else
|
||||
forceMove(get_turf(src)) //Get out of closets and such as a ghost
|
||||
if((direct & NORTH) && y < world.maxy)
|
||||
@@ -487,9 +484,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(!L || !L.len)
|
||||
to_chat(usr, "No area available.")
|
||||
return
|
||||
|
||||
usr.forceMove(pick(L))
|
||||
update_parallax_contents()
|
||||
|
||||
/mob/dead/observer/proc/view_gas()
|
||||
set category = "Ghost"
|
||||
@@ -568,7 +563,6 @@ 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.
|
||||
A.forceMove(T)
|
||||
A.update_parallax_contents()
|
||||
else
|
||||
to_chat(A, "This mob is not located in the game world.")
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
|
||||
/**
|
||||
* Actual proc that removes us and puts us back on lobby
|
||||
*
|
||||
*
|
||||
* Returns the new mob.
|
||||
*/
|
||||
/mob/dead/observer/proc/transfer_to_lobby()
|
||||
@@ -174,8 +174,7 @@
|
||||
return
|
||||
client.screen.Cut()
|
||||
client.view_size.resetToDefault()
|
||||
client.generate_clickcatcher()
|
||||
client.apply_clickcatcher()
|
||||
client.update_clickcatcher()
|
||||
client.view_size.setDefault(getScreenSize(client.prefs.widescreenpref))
|
||||
client.view_size.resetToDefault()
|
||||
|
||||
|
||||
@@ -646,7 +646,7 @@
|
||||
become_blind(EYES_COVERED)
|
||||
else if(tinttotal >= TINT_DARKENED)
|
||||
cure_blind(EYES_COVERED)
|
||||
overlay_fullscreen("tint", /atom/movable/screen/fullscreen/impaired, 2)
|
||||
overlay_fullscreen("tint", /atom/movable/screen/fullscreen/scaled/impaired, 2)
|
||||
else
|
||||
cure_blind(EYES_COVERED)
|
||||
clear_fullscreen("tint", 0)
|
||||
@@ -722,10 +722,10 @@
|
||||
visionseverity = 9
|
||||
if(-INFINITY to -24)
|
||||
visionseverity = 10
|
||||
overlay_fullscreen("critvision", /atom/movable/screen/fullscreen/crit/vision, visionseverity)
|
||||
overlay_fullscreen("critvision", /atom/movable/screen/fullscreen/scaled/crit/vision, visionseverity)
|
||||
else
|
||||
clear_fullscreen("critvision")
|
||||
overlay_fullscreen("crit", /atom/movable/screen/fullscreen/crit, severity)
|
||||
overlay_fullscreen("crit", /atom/movable/screen/fullscreen/scaled/crit, severity)
|
||||
else
|
||||
clear_fullscreen("crit")
|
||||
clear_fullscreen("critvision")
|
||||
@@ -749,7 +749,7 @@
|
||||
severity = 6
|
||||
if(45 to INFINITY)
|
||||
severity = 7
|
||||
overlay_fullscreen("oxy", /atom/movable/screen/fullscreen/oxy, severity)
|
||||
overlay_fullscreen("oxy", /atom/movable/screen/fullscreen/scaled/oxy, severity)
|
||||
else
|
||||
clear_fullscreen("oxy")
|
||||
|
||||
@@ -770,7 +770,7 @@
|
||||
severity = 5
|
||||
if(85 to INFINITY)
|
||||
severity = 6
|
||||
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/brute, severity)
|
||||
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/scaled/brute, severity)
|
||||
else
|
||||
clear_fullscreen("brute")
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@
|
||||
|
||||
return embeds
|
||||
|
||||
/mob/living/carbon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/flash, override_protection = 0)
|
||||
/mob/living/carbon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/tiled/flash, override_protection = 0)
|
||||
. = ..()
|
||||
|
||||
var/damage = override_protection ? intensity : intensity - get_eye_protection()
|
||||
|
||||
@@ -209,7 +209,7 @@
|
||||
update_tint()
|
||||
if(G.vision_correction)
|
||||
if(HAS_TRAIT(src, TRAIT_NEARSIGHT))
|
||||
overlay_fullscreen("nearsighted", /atom/movable/screen/fullscreen/impaired, 1)
|
||||
overlay_fullscreen("nearsighted", /atom/movable/screen/fullscreen/scaled/impaired, 1)
|
||||
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha))
|
||||
update_sight()
|
||||
if(!QDELETED(src))
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/mob/living/carbon/adjust_drugginess(amount)
|
||||
druggy = max(druggy+amount, 0)
|
||||
if(druggy)
|
||||
overlay_fullscreen("high", /atom/movable/screen/fullscreen/high)
|
||||
overlay_fullscreen("high", /atom/movable/screen/fullscreen/tiled/high)
|
||||
throw_alert("high", /atom/movable/screen/alert/high)
|
||||
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "high", /datum/mood_event/high)
|
||||
sound_environment_override = SOUND_ENVIRONMENT_DRUGGED
|
||||
@@ -18,7 +18,7 @@
|
||||
/mob/living/carbon/set_drugginess(amount)
|
||||
druggy = max(amount, 0)
|
||||
if(druggy)
|
||||
overlay_fullscreen("high", /atom/movable/screen/fullscreen/high)
|
||||
overlay_fullscreen("high", /atom/movable/screen/fullscreen/tiled/high)
|
||||
throw_alert("high", /atom/movable/screen/alert/high)
|
||||
else
|
||||
clear_fullscreen("high")
|
||||
|
||||
@@ -579,7 +579,7 @@
|
||||
UNLINT(livingdoll.filters += filter(type="alpha", icon = mob_mask))
|
||||
livingdoll.filters += filter(type="drop_shadow", size = -1)
|
||||
if(severity > 0)
|
||||
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/brute, severity)
|
||||
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/scaled/brute, severity)
|
||||
else
|
||||
clear_fullscreen("brute")
|
||||
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
|
||||
|
||||
//called when the mob receives a bright flash
|
||||
/mob/living/proc/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/flash, override_protection = 0)
|
||||
/mob/living/proc/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/tiled/flash, override_protection = 0)
|
||||
if((override_protection || get_eye_protection() < intensity) && (override_blindness_check || !(HAS_TRAIT(src, TRAIT_BLIND))))
|
||||
overlay_fullscreen("flash", type)
|
||||
addtimer(CALLBACK(src, .proc/clear_fullscreen, "flash", 25), 25)
|
||||
|
||||
@@ -84,7 +84,6 @@
|
||||
if(ai.client && !ai.multicam_on)
|
||||
ai.client.eye = src
|
||||
update_ai_detect_hud()
|
||||
update_parallax_contents()
|
||||
//Holopad
|
||||
if(istype(ai.current, /obj/machinery/holopad))
|
||||
var/obj/machinery/holopad/H = ai.current
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
stat = DEAD
|
||||
update_mobility()
|
||||
update_sight()
|
||||
clear_fullscreens()
|
||||
wipe_fullscreens()
|
||||
|
||||
//New pAI's get a brand new mind to prevent meta stuff from their previous life. This new mind causes problems down the line if it's not deleted here.
|
||||
remove_from_alive_mob_list()
|
||||
|
||||
@@ -144,6 +144,6 @@
|
||||
P.on_hit(src, 0, def_zone)
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/mob/living/silicon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/flash/static)
|
||||
/mob/living/silicon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/tiled/flash/static)
|
||||
if(affect_silicon)
|
||||
return ..()
|
||||
|
||||
@@ -113,7 +113,7 @@ While using this makes the system rely on OnFire, it still gives options for tim
|
||||
severity = 7
|
||||
hud_used.healths.icon_state = "elite_health[severity]"
|
||||
if(severity > 0)
|
||||
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/brute, severity)
|
||||
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/scaled/brute, severity)
|
||||
else
|
||||
clear_fullscreen("brute")
|
||||
|
||||
|
||||
@@ -599,7 +599,7 @@
|
||||
|
||||
/mob/living/proc/become_nearsighted(source)
|
||||
if(!HAS_TRAIT(src, TRAIT_NEARSIGHT))
|
||||
overlay_fullscreen("nearsighted", /atom/movable/screen/fullscreen/impaired, 1)
|
||||
overlay_fullscreen("nearsighted", /atom/movable/screen/fullscreen/scaled/impaired, 1)
|
||||
ADD_TRAIT(src, TRAIT_NEARSIGHT, source)
|
||||
|
||||
/mob/living/proc/cure_husk(source)
|
||||
|
||||
@@ -58,10 +58,6 @@
|
||||
//readd this mob's HUDs (antag, med, etc)
|
||||
reload_huds()
|
||||
|
||||
reload_fullscreen() // Reload any fullscreen overlays this mob has.
|
||||
|
||||
add_click_catcher()
|
||||
|
||||
sync_mind()
|
||||
|
||||
//Reload alternate appearances
|
||||
@@ -93,6 +89,9 @@
|
||||
if(has_field_of_vision && CONFIG_GET(flag/use_field_of_vision))
|
||||
LoadComponent(/datum/component/field_of_vision, field_of_vision_type)
|
||||
|
||||
// load rendering
|
||||
reload_rendering()
|
||||
|
||||
AddElement(/datum/element/weather_listener, /datum/weather/ash_storm, ZTRAIT_ASHSTORM, GLOB.ash_storm_sounds)
|
||||
|
||||
// optimized area sound effects. Enable during events (compile flag when 😳)
|
||||
|
||||
+24
-22
@@ -1,25 +1,3 @@
|
||||
/mob/Destroy()//This makes sure that mobs with clients/keys are not just deleted from the game.
|
||||
remove_from_mob_list()
|
||||
remove_from_dead_mob_list()
|
||||
remove_from_alive_mob_list()
|
||||
GLOB.all_clockwork_mobs -= src
|
||||
focus = null
|
||||
LAssailant = null
|
||||
movespeed_modification = null
|
||||
for (var/alert in alerts)
|
||||
clear_alert(alert, TRUE)
|
||||
if(observers && observers.len)
|
||||
for(var/M in observers)
|
||||
var/mob/dead/observe = M
|
||||
observe.reset_perspective(null)
|
||||
qdel(hud_used)
|
||||
for(var/cc in client_colours)
|
||||
qdel(cc)
|
||||
client_colours = null
|
||||
ghostize()
|
||||
..()
|
||||
return QDEL_HINT_HARDDEL
|
||||
|
||||
/mob/Initialize()
|
||||
add_to_mob_list()
|
||||
if(stat == DEAD)
|
||||
@@ -38,8 +16,32 @@
|
||||
update_config_movespeed()
|
||||
update_movespeed(TRUE)
|
||||
initialize_actionspeed()
|
||||
init_rendering()
|
||||
hook_vr("mob_new",list(src))
|
||||
|
||||
/mob/Destroy()//This makes sure that mobs with clients/keys are not just deleted from the game.
|
||||
remove_from_mob_list()
|
||||
remove_from_dead_mob_list()
|
||||
remove_from_alive_mob_list()
|
||||
GLOB.all_clockwork_mobs -= src
|
||||
focus = null
|
||||
LAssailant = null
|
||||
movespeed_modification = null
|
||||
for (var/alert in alerts)
|
||||
clear_alert(alert, TRUE)
|
||||
if(observers && observers.len)
|
||||
for(var/M in observers)
|
||||
var/mob/dead/observe = M
|
||||
observe.reset_perspective(null)
|
||||
dispose_rendering()
|
||||
qdel(hud_used)
|
||||
for(var/cc in client_colours)
|
||||
qdel(cc)
|
||||
client_colours = null
|
||||
ghostize()
|
||||
..()
|
||||
return QDEL_HINT_HARDDEL
|
||||
|
||||
/mob/GenerateTag()
|
||||
tag = "mob_[next_mob_id++]"
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
attack_hand_unwieldlyness = CLICK_CD_MELEE
|
||||
attack_hand_speed = 0
|
||||
|
||||
// Rendering
|
||||
/// Fullscreen objects
|
||||
var/list/fullscreens = list()
|
||||
|
||||
/// What receives our keyboard input. src by default.
|
||||
var/datum/focus
|
||||
|
||||
@@ -143,7 +147,6 @@
|
||||
var/registered_z
|
||||
|
||||
var/list/alerts = list() // contains /atom/movable/screen/alert only // On /mob so clientless mobs will throw alerts properly
|
||||
var/list/screens = list()
|
||||
var/list/client_colours = list()
|
||||
var/hud_type = /datum/hud
|
||||
|
||||
|
||||
@@ -110,6 +110,11 @@
|
||||
|
||||
SEND_SIGNAL(mob, COMSIG_MOB_CLIENT_MOVE, src, direction, n, oldloc, add_delay)
|
||||
|
||||
/mob/Moved(atom/OldLoc, Dir)
|
||||
. = ..()
|
||||
if(client)
|
||||
client.parallax_holder.Update()
|
||||
|
||||
/// Process_Grab(): checks for grab, attempts to break if so. Return TRUE to prevent movement.
|
||||
/client/proc/Process_Grab()
|
||||
if(mob.pulledby)
|
||||
@@ -398,3 +403,8 @@
|
||||
|
||||
/mob/proc/canZMove(direction, turf/target)
|
||||
return FALSE
|
||||
|
||||
/mob/onTransitZ(old_z, new_z)
|
||||
. = ..()
|
||||
if(old_z != new_z)
|
||||
client?.parallax_holder?.Reset()
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
if(eye_blind) // UNCONSCIOUS or has blind trait, or has temporary blindness
|
||||
if(stat == CONSCIOUS || stat == SOFT_CRIT)
|
||||
throw_alert("blind", /atom/movable/screen/alert/blind)
|
||||
overlay_fullscreen("blind", /atom/movable/screen/fullscreen/blind)
|
||||
overlay_fullscreen("blind", /atom/movable/screen/fullscreen/scaled/blind)
|
||||
// You are blind why should you be able to make out details like color, only shapes near you
|
||||
// add_client_colour(/datum/client_colour/monochrome/blind)
|
||||
else // CONSCIOUS no blind trait, no blindness
|
||||
|
||||
Reference in New Issue
Block a user