diff --git a/code/__defines/subsystems.dm b/code/__defines/subsystems.dm index 1d09ecc799..8ed8125dac 100644 --- a/code/__defines/subsystems.dm +++ b/code/__defines/subsystems.dm @@ -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 diff --git a/code/controllers/subsystems/skybox.dm b/code/controllers/subsystems/skybox.dm index 05053fbb0f..99f69ec595 100644 --- a/code/controllers/subsystems/skybox.dm +++ b/code/controllers/subsystems/skybox.dm @@ -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 diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 0eb4775c23..d41b8057a7 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -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 diff --git a/code/modules/overmap/overmap_object.dm b/code/modules/overmap/overmap_object.dm index f79741bd3a..ad5bf60dd2 100644 --- a/code/modules/overmap/overmap_object.dm +++ b/code/modules/overmap/overmap_object.dm @@ -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) diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm index f9d41780f8..4b461a6a52 100644 --- a/code/modules/overmap/sectors.dm +++ b/code/modules/overmap/sectors.dm @@ -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()