Fix annoying skybox bugs

This commit is contained in:
Aronai Sieyes
2021-07-10 17:43:33 -04:00
parent edc62e88fa
commit a2e89aebc6
5 changed files with 22 additions and 14 deletions
+2 -1
View File
@@ -59,7 +59,6 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
#define INIT_ORDER_INPUT 37
#define INIT_ORDER_CHEMISTRY 35
#define INIT_ORDER_VIS 32
#define INIT_ORDER_SKYBOX 30
#define INIT_ORDER_MAPPING 25
#define INIT_ORDER_SOUNDS 23
#define INIT_ORDER_INSTRUMENTS 22
@@ -86,10 +85,12 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
#define INIT_ORDER_AI_FAST -23
#define INIT_ORDER_GAME_MASTER -24
#define INIT_ORDER_PERSISTENCE -25
#define INIT_ORDER_SKYBOX -30 //Visual only, irrelevant to gameplay, but needs to be late enough to have overmap populated fully
#define INIT_ORDER_TICKER -50
#define INIT_ORDER_CHAT -100 //Should be last to ensure chat remains smooth during init.
// Subsystem fire priority, from lowest to highest priority
// If the subsystem isn't listed here it's either DEFAULT or PROCESS (if it's a processing subsystem child)
#define FIRE_PRIORITY_SHUTTLES 5
+15 -8
View File
@@ -93,13 +93,17 @@ SUBSYSTEM_DEF(skybox)
. = ..()
/datum/controller/subsystem/skybox/proc/get_skybox(z)
if(!subsystem_initialized)
return // WAIT
if(!skybox_cache["[z]"])
skybox_cache["[z]"] = generate_skybox(z)
return skybox_cache["[z]"]
/datum/controller/subsystem/skybox/proc/generate_skybox(z)
var/datum/skybox_settings/settings = global.using_map.get_skybox_datum(z)
var/new_overlays = list()
var/image/res = image(settings.icon)
res.appearance_flags = KEEP_TOGETHER
@@ -111,23 +115,26 @@ SUBSYSTEM_DEF(skybox)
stars.appearance_flags = RESET_COLOR
base.overlays += stars
res.overlays += base
new_overlays += base
if(global.using_map.use_overmap && settings.use_overmap_details)
var/obj/effect/overmap/visitable/O = get_overmap_sector(z)
if(istype(O))
var/image/overmap = image(settings.icon)
overmap.overlays += O.generate_skybox()
var/image/self_image = O.generate_skybox(z)
new_overlays += self_image
for(var/obj/effect/overmap/visitable/other in O.loc)
if(other != O)
overmap.overlays += other.get_skybox_representation()
overmap.appearance_flags = RESET_COLOR
res.overlays += overmap
new_overlays += other.get_skybox_representation(z)
// Allow events to apply custom overlays to skybox! (Awesome!)
for(var/datum/event/E in SSevents.active_events)
if(E.has_skybox_image && E.isRunning && (z in E.affecting_z))
res.overlays += E.get_skybox_image()
new_overlays += E.get_skybox_image()
for(var/image/I in new_overlays)
I.appearance_flags |= RESET_COLOR
res.overlays = new_overlays
return res
+1 -1
View File
@@ -11,7 +11,7 @@
var/glass = 1
var/datum/tgui_module/appearance_changer/mirror/M
/obj/structure/mirror/New(var/loc, var/dir, var/building = 0, mob/user as mob)
/obj/structure/mirror/Initialize(mapload, var/dir, var/building = 0, mob/user as mob)
M = new(src, null)
if(building)
glass = 0
+3 -3
View File
@@ -37,12 +37,12 @@
return ..()
//Overlay of how this object should look on other skyboxes
/obj/effect/overmap/proc/get_skybox_representation()
/obj/effect/overmap/proc/get_skybox_representation(zlevel)
if(!cached_skybox_image)
build_skybox_representation()
build_skybox_representation(zlevel)
return cached_skybox_image
/obj/effect/overmap/proc/build_skybox_representation()
/obj/effect/overmap/proc/build_skybox_representation(zlevel)
if(!skybox_icon)
return
var/image/I = image(icon = skybox_icon, icon_state = skybox_icon_state)
+1 -1
View File
@@ -165,7 +165,7 @@
for(var/thing in restricted_waypoints[shuttle_name])
.[thing] = name
/obj/effect/overmap/visitable/proc/generate_skybox()
/obj/effect/overmap/visitable/proc/generate_skybox(zlevel)
return
/obj/effect/overmap/visitable/proc/cleanup()