Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 90dece1

Browse files
config, stat panel message, and rename
1 parent 053664d commit 90dece1

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

code/controllers/configuration/entries/general.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,3 +555,8 @@
555555
/datum/config_entry/flag/demos_enabled
556556

557557
/datum/config_entry/flag/toast_notification_on_init
558+
559+
/// Whether the backrooms will spawn at roundstart or not. This is a very intensive process that can tack an extra 30+ seconds to roundstart
560+
/// and creates an extra z-level full of mobs that will add extra load to the server. Only enable this if you're sure you want it. Or optimize it for me.
561+
/datum/config_entry/flag/backrooms_enabled
562+
default = FALSE

code/controllers/subsystem/backrooms.dm

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
SUBSYSTEM_DEF(backrooms)
2-
name = "Procedural Generation"
2+
name = "Backrooms Procedural Generation"
33
init_order = INIT_ORDER_BACKROOMS
4-
flags = SS_NO_FIRE
4+
flags = SS_TICKER | SS_BACKGROUND
5+
6+
var/noNeed = FALSE
57

68
var/datum/map_generator/dungeon_generator/backrooms_generator
79
var/datum/generator_theme/picked_theme = /datum/generator_theme
@@ -16,16 +18,20 @@ SUBSYSTEM_DEF(backrooms)
1618
/obj/item/toy/plush/lizard/azeel = 5000
1719
)
1820

19-
/datum/controller/subsystem/backrooms/Initialize(timeofday)
20-
var/noNeed = FALSE
21+
/datum/controller/subsystem/backrooms/PreInit()
2122
#ifdef LOWMEMORYMODE
2223
noNeed = TRUE
2324
#endif
2425
#ifdef UNIT_TESTS // This whole subsystem just introduces a lot of odd confounding variables into unit test situations, so let's just not bother with doing an initialize here.
2526
noNeed = TRUE
2627
#endif
2728

28-
if(noNeed) //we do it this way so things can pass linter while in low memory mode or unit tests
29+
/datum/controller/subsystem/backrooms/Initialize(timeofday)
30+
if(!CONFIG_GET(flag/backrooms_enabled))
31+
noNeed = TRUE
32+
33+
if(noNeed)
34+
flags |= SS_NO_FIRE
2935
return SS_INIT_NO_NEED
3036

3137
pick_theme()
@@ -34,6 +40,15 @@ SUBSYSTEM_DEF(backrooms)
3440
spawn_loot()
3541
return SS_INIT_SUCCESS
3642

43+
/datum/controller/subsystem/backrooms/stat_entry(msg)
44+
if(noNeed)
45+
msg = "DISABLED"
46+
else if(!noNeed && !initialized)
47+
msg = "Generating..."
48+
else
49+
msg = "Theme: [picked_theme]"
50+
return ..()
51+
3752
/datum/controller/subsystem/backrooms/proc/pick_theme()
3853
var/list/themes = typesof(/datum/generator_theme)
3954
for(var/datum/generator_theme/possible as anything in themes) //assign the weight

config/config.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,3 +463,6 @@ MAX_SHUTTLE_SIZE 300
463463
## Comment to disable sending a toast notification on the host server when initializations complete.
464464
## Even if this is enabled, a notification will only be sent if there are no clients connected.
465465
TOAST_NOTIFICATION_ON_INIT
466+
467+
## Enable/Disable Backrooms z-level generation at startup
468+
BACKROOMS_ENABLED

0 commit comments

Comments
 (0)