From f99d904dc7c1eb1f334ed4e8f3f73166b30f44d2 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 1 May 2020 12:14:04 -0700 Subject: [PATCH] ports /tg/station vis_flags related fixes (#12064) * fixes * Update layers_planes.dm * kay --- code/__DEFINES/layers_planes.dm | 8 ++++---- code/_globalvars/bitfields.dm | 10 ++++++++++ code/_onclick/hud/plane_master.dm | 6 +++--- code/game/atoms_movable.dm | 2 +- code/game/objects/effects/effects.dm | 2 +- code/game/objects/effects/overlays.dm | 1 + code/game/objects/objs.dm | 1 + code/game/turfs/openspace/openspace.dm | 18 ++++++++++++++++-- code/game/turfs/turf.dm | 2 ++ .../atmospherics/gasmixtures/gas_types.dm | 1 + code/modules/mob/mob_defines.dm | 2 ++ 11 files changed, 42 insertions(+), 11 deletions(-) diff --git a/code/__DEFINES/layers_planes.dm b/code/__DEFINES/layers_planes.dm index aabe4f117f..f4a30cd482 100644 --- a/code/__DEFINES/layers_planes.dm +++ b/code/__DEFINES/layers_planes.dm @@ -8,6 +8,10 @@ #define PLANE_SPACE_PARALLAX -90 #define PLANE_SPACE_PARALLAX_RENDER_TARGET "PLANE_SPACE_PARALLAX" +#define OPENSPACE_LAYER 17 //Openspace layer over all +#define OPENSPACE_PLANE -4 //Openspace plane below all turfs +#define OPENSPACE_BACKDROP_PLANE -3 //Black square just over openspace plane to guaranteed cover all in openspace turf + #define FLOOR_PLANE -2 #define FLOOR_PLANE_RENDER_TARGET "FLOOR_PLANE" #define GAME_PLANE -1 @@ -105,10 +109,6 @@ #define ABOVE_LIGHTING_LAYER 16 #define ABOVE_LIGHTING_RENDER_TARGET "ABOVE_LIGHTING_PLANE" -#define FLOOR_OPENSPACE_PLANE 17 -#define OPENSPACE_LAYER 17 -#define OPENSPACE_RENDER_TARGET "OPENSPACE_PLANE" - #define BYOND_LIGHTING_PLANE 18 #define BYOND_LIGHTING_LAYER 18 #define BYOND_LIGHTING_RENDER_TARGET "BYOND_LIGHTING_PLANE" diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index c1ca671044..c4ed2d9266 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -265,5 +265,15 @@ GLOBAL_LIST_INIT(bitfields, list( "STORAGE_LIMIT_MAX_W_CLASS" = STORAGE_LIMIT_MAX_W_CLASS, "STORAGE_LIMIT_COMBINED_W_CLASS" = STORAGE_LIMIT_COMBINED_W_CLASS, "STORAGE_LIMIT_VOLUME" = STORAGE_LIMIT_VOLUME + ), + "vis_flags" = list( + "VIS_INHERIT_ICON" = VIS_INHERIT_ICON, + "VIS_INHERIT_ICON_STATE" = VIS_INHERIT_ICON_STATE, + "VIS_INHERIT_DIR" = VIS_INHERIT_DIR, + "VIS_INHERIT_LAYER" = VIS_INHERIT_LAYER, + "VIS_INHERIT_PLANE" = VIS_INHERIT_PLANE, + "VIS_INHERIT_ID" = VIS_INHERIT_ID, + "VIS_UNDERLAY" = VIS_UNDERLAY, + "VIS_HIDE" = VIS_HIDE ) )) diff --git a/code/_onclick/hud/plane_master.dm b/code/_onclick/hud/plane_master.dm index 7a8cc20d76..a0dade37bd 100644 --- a/code/_onclick/hud/plane_master.dm +++ b/code/_onclick/hud/plane_master.dm @@ -19,7 +19,7 @@ ///Things rendered on "openspace"; holes in multi-z /obj/screen/plane_master/openspace name = "open space plane master" - plane = FLOOR_OPENSPACE_PLANE + plane = OPENSPACE_BACKDROP_PLANE appearance_flags = PLANE_MASTER blend_mode = BLEND_MULTIPLY alpha = 255 @@ -106,8 +106,8 @@ * * You really shouldn't be directly using this, use atom helpers instead */ -/obj/screen/plane_master/emissive_unblockable - name = "emissive mob plane master" +/obj/screen/plane_master/emissive_blocker + name = "emissive blocker plane master" plane = EMISSIVE_BLOCKER_PLANE mouse_opacity = MOUSE_OPACITY_TRANSPARENT render_target = EMISSIVE_BLOCKER_RENDER_TARGET diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index cc6f84a18f..b86c7e9729 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -68,7 +68,7 @@ if(vs.plane == EMISSIVE_BLOCKER_PLANE) SSvis_overlays.remove_vis_overlay(src, list(vs)) break - SSvis_overlays.add_vis_overlay(src, icon, icon_state, EMISSIVE_BLOCKER_LAYER, EMISSIVE_BLOCKER_PLANE) + SSvis_overlays.add_vis_overlay(src, icon, icon_state, EMISSIVE_BLOCKER_LAYER, EMISSIVE_BLOCKER_PLANE, dir) /atom/movable/proc/can_zFall(turf/source, levels = 1, turf/target, direction) if(!direction) diff --git a/code/game/objects/effects/effects.dm b/code/game/objects/effects/effects.dm index 8f0ce83c82..979b811bc5 100644 --- a/code/game/objects/effects/effects.dm +++ b/code/game/objects/effects/effects.dm @@ -7,7 +7,7 @@ move_resist = INFINITY obj_flags = 0 - vis_flags = NONE + vis_flags = VIS_INHERIT_PLANE /obj/effect/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) return diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm index 596e428c7f..b310119827 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -49,5 +49,6 @@ /obj/effect/overlay/vis mouse_opacity = MOUSE_OPACITY_TRANSPARENT anchored = TRUE + vis_flags = NONE var/unused = 0 //When detected to be unused it gets set to world.time, after a while it gets removed var/cache_expiration = 2 MINUTES // overlays which go unused for 2 minutes get cleaned up diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index d2d72193b7..5acbb2f231 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -3,6 +3,7 @@ var/crit_fail = FALSE animate_movement = 2 speech_span = SPAN_ROBOT + vis_flags = VIS_INHERIT_PLANE //when this be added to vis_contents of something it inherit something.plane, important for visualisation of obj in openspace. var/obj_flags = CAN_BE_HIT var/set_obj_flags // ONLY FOR MAPPING: Sets flags from a string list, handled in Initialize. Usage: set_obj_flags = "EMAGGED;!CAN_BE_HIT" to set EMAGGED and clear CAN_BE_HIT. diff --git a/code/game/turfs/openspace/openspace.dm b/code/game/turfs/openspace/openspace.dm index 66507e7053..41c77cd57c 100644 --- a/code/game/turfs/openspace/openspace.dm +++ b/code/game/turfs/openspace/openspace.dm @@ -1,7 +1,20 @@ +GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdrop, new) + +/atom/movable/openspace_backdrop + name = "openspace_backdrop" + + anchored = TRUE + + icon = 'icons/turf/floors.dmi' + icon_state = "grey" + plane = OPENSPACE_BACKDROP_PLANE + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + layer = SPLASHSCREEN_LAYER + /turf/open/openspace name = "open space" desc = "Watch your step!" - icon_state = "grey" + icon_state = "transparent" baseturfs = /turf/open/openspace CanAtmosPassVertical = ATMOS_PASS_YES //mouse_opacity = MOUSE_OPACITY_TRANSPARENT @@ -14,8 +27,9 @@ /turf/open/openspace/Initialize() // handle plane and layer here so that they don't cover other obs/turfs in Dream Maker . = ..() - plane = FLOOR_OPENSPACE_PLANE + plane = OPENSPACE_PLANE layer = OPENSPACE_LAYER + vis_contents += GLOB.openspace_backdrop_one_for_all //Special grey square for projecting backdrop darkness filter on it. return INITIALIZE_HINT_LATELOAD /turf/open/openspace/LateInitialize() diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 849b6cf45d..88f6dd6962 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -1,6 +1,8 @@ /turf icon = 'icons/turf/floors.dmi' level = 1 + vis_flags = VIS_INHERIT_PLANE|VIS_INHERIT_ID //when this be added to vis_contents of something it inherit something.plane and be associatet with something on clicking, + //important for visualisation of turf in openspace and interraction with openspace that show you turf. var/intact = 1 diff --git a/code/modules/atmospherics/gasmixtures/gas_types.dm b/code/modules/atmospherics/gasmixtures/gas_types.dm index 5c34ece723..c7ffc51458 100644 --- a/code/modules/atmospherics/gasmixtures/gas_types.dm +++ b/code/modules/atmospherics/gasmixtures/gas_types.dm @@ -192,6 +192,7 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/g anchored = TRUE // should only appear in vis_contents, but to be safe layer = FLY_LAYER appearance_flags = TILE_BOUND + vis_flags = NONE /obj/effect/overlay/gas/New(state, alph) . = ..() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 7d177e7ac2..825f015ef4 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -10,6 +10,8 @@ throwforce = 10 blocks_emissive = EMISSIVE_BLOCK_GENERIC + vis_flags = VIS_INHERIT_PLANE //when this be added to vis_contents of something it inherit something.plane, important for visualisation of mob in openspace. + var/lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE var/datum/mind/mind var/list/datum/action/actions = list()