Skip to content

Commit

Permalink
Fixes character selection screen preview (#7016)
Browse files Browse the repository at this point in the history
# About the pull request
Fixes not seeing the preview in character selection screen
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
Fixes a bug
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
fix: Fixes not being able to see the preview in the character selection
screen
/:cl:
  • Loading branch information
Git-Nivrak committed Aug 24, 2024
1 parent 0d13c9e commit a032773
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
48 changes: 20 additions & 28 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
///Highest-intensity light affecting us, which determines our visibility.
var/affecting_dynamic_lumi = 0

/// Holds a reference to the emissive blocker overlay
var/emissive_overlay

//===========================================================================
/atom/movable/Destroy(force)
for(var/atom/movable/I in contents)
Expand All @@ -39,6 +42,7 @@
pulledby.stop_pulling()
QDEL_NULL(launch_metadata)
QDEL_NULL(em_block)
QDEL_NULL(emissive_overlay)

if(loc)
loc.on_stored_atom_del(src) //things that container need to do when a movable atom inside it is deleted
Expand Down Expand Up @@ -79,45 +83,33 @@

/atom/movable/Initialize(mapload, ...)
. = ..()

update_emissive_block()

if(opacity)
AddElement(/datum/element/light_blocking)
if(light_system == MOVABLE_LIGHT)
AddComponent(/datum/component/overlay_lighting)
if(light_system == DIRECTIONAL_LIGHT)
AddComponent(/datum/component/overlay_lighting, is_directional = TRUE)

/atom/movable/proc/update_emissive_block()
if(emissive_overlay)
overlays -= emissive_overlay

switch(blocks_emissive)
if(EMISSIVE_BLOCK_GENERIC)
var/mutable_appearance/gen_emissive_blocker = mutable_appearance(icon, icon_state, plane = EMISSIVE_PLANE, alpha = src.alpha)
gen_emissive_blocker.color = GLOB.em_block_color
gen_emissive_blocker.dir = dir
gen_emissive_blocker.appearance_flags |= appearance_flags
emissive_overlay = gen_emissive_blocker
overlays += gen_emissive_blocker
if(EMISSIVE_BLOCK_UNIQUE)
render_target = ref(src)
em_block = new(src, render_target)
emissive_overlay = em_block
overlays += list(em_block)
if(opacity)
AddElement(/datum/element/light_blocking)
if(light_system == MOVABLE_LIGHT)
AddComponent(/datum/component/overlay_lighting)
if(light_system == DIRECTIONAL_LIGHT)
AddComponent(/datum/component/overlay_lighting, is_directional = TRUE)

/*
///Updates this movables emissive overlay
/atom/movable/proc/update_emissive_block()
if(!blocks_emissive)
return
else if (blocks_emissive == EMISSIVE_BLOCK_GENERIC)
var/mutable_appearance/gen_emissive_blocker = emissive_blocker(icon, icon_state, alpha = src.alpha, appearance_flags = src.appearance_flags)
gen_emissive_blocker.dir = dir
if(blocks_emissive == EMISSIVE_BLOCK_UNIQUE)
if(!em_block)
render_target = ref(src)
em_block = new(src, render_target)
return em_block
/atom/movable/update_overlays()
. = ..()
. += update_emissive_block()
*/

/atom/movable/vv_get_dropdown()
. = ..()
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/new_player/preferences_setup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@
var/J = job_pref_to_gear_preset()
if(isnull(preview_dummy))
preview_dummy = new()

preview_dummy.blocks_emissive = FALSE
preview_dummy.update_emissive_block()

clear_equipment()
if(refresh_limb_status)
for(var/obj/limb/L in preview_dummy.limbs)
Expand Down

0 comments on commit a032773

Please sign in to comment.