Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMelbert committed Jan 30, 2025
1 parent 6d938ac commit d772587
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 7 deletions.
2 changes: 1 addition & 1 deletion code/controllers/master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ GLOBAL_REAL(Master, /datum/controller/master)
screen_display = "<font color='yellow'>ERRORED</font>"
always_show = TRUE

if(screen_display && (always_show || (seconds > 0.01 && !(subsystem.flags & SS_NO_INIT_MESSAGE))))
if(screen_display && (always_show || (seconds > 0.1 && !(subsystem.flags & SS_NO_INIT_MESSAGE))))
SStitle.add_init_text(subsystem.type, "- [subsystem.name]", screen_display, seconds, major_update = TRUE)
else
SStitle.remove_init_text(subsystem.type)
Expand Down
25 changes: 21 additions & 4 deletions code/controllers/subsystem/assets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,27 @@ SUBSYSTEM_DEF(assets)


/datum/controller/subsystem/assets/Initialize()
for(var/type in typesof(/datum/asset))
var/datum/asset/A = type
if (type != initial(A._abstract))
load_asset_datum(type)
for(var/datum/asset/asset_type as anything in typesof(/datum/asset))
if (asset_type == initial(asset_type._abstract))
continue

if (initial(asset_type.early))
continue

var/pre_init = REALTIMEOFDAY
var/list/typepath_split = splittext("[asset_type]", "/")
var/typepath_readable = capitalize(replacetext(typepath_split[length(typepath_split)], "_", " "))

SStitle.add_init_text(asset_type, "> [typepath_readable]", "<font color='yellow'>CREATING...</font>")
if (load_asset_datum(asset_type))
var/time = (REALTIMEOFDAY - pre_init) / (1 SECONDS)
if(time <= 0.1)
SStitle.remove_init_text(asset_type)
else
SStitle.add_init_text(asset_type, "> [typepath_readable]", "<font color='green'>DONE</font>", time)
else
stack_trace("Could not initialize early asset [asset_type]!")
SStitle.add_init_text(asset_type, "> [typepath_readable]", "<font color='red'>FAILED</font>")

transport.Initialize(cache)

Expand Down
14 changes: 13 additions & 1 deletion code/controllers/subsystem/early_assets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ SUBSYSTEM_DEF(early_assets)
if (!initial(asset_type.early))
continue

if (!load_asset_datum(asset_type))
var/pre_init = REALTIMEOFDAY
var/list/typepath_split = splittext("[asset_type]", "/")
var/typepath_readable = capitalize(replacetext(typepath_split[length(typepath_split)], "_", " "))

SStitle.add_init_text(asset_type, "> [typepath_readable]", "<font color='yellow'>CREATING...</font>")
if (load_asset_datum(asset_type))
var/time = (REALTIMEOFDAY - pre_init) / (1 SECONDS)
if(time <= 0.1)
SStitle.remove_init_text(asset_type)
else
SStitle.add_init_text(asset_type, "> [typepath_readable]", "<font color='green'>DONE</font>", time)
else
stack_trace("Could not initialize early asset [asset_type]!")
SStitle.add_init_text(asset_type, "> [typepath_readable]", "<font color='red'>FAILED</font>")

CHECK_TICK

Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ SUBSYSTEM_DEF(mapping)
load_all_away_missions()
SStitle.add_init_text("Away Mission", "> All Away Missions", "<font color='green'>DONE</font>", (REALTIMEOFDAY - start_time) / (1 SECONDS))
else
SStitle.add_init_text("Away Mission", "> Away Mission", "<font color='yellow'>SKIPPED</font>", (REALTIMEOFDAY - start_time) / (1 SECONDS))
SStitle.add_init_text("Away Mission", "> Away Mission", "<font color='yellow'>SKIPPED</font>")

start_time = REALTIMEOFDAY
SStitle.add_init_text("Ruins", "> Ruins", "<font color='yellow'>LOADING...</font>")
Expand Down
5 changes: 5 additions & 0 deletions code/controllers/subsystem/title.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ SUBSYSTEM_DEF(title)
previous_icon = SStitle.previous_icon
init_infos = SStitle.init_infos

#define MAX_INIT_TEXT 40

/**
* Adds an entry to the initialization information list
*
Expand All @@ -102,8 +104,11 @@ SUBSYSTEM_DEF(title)
init_infos[init_category][3] += seconds
if(major_update)
num_dots = (num_dots % 6 + 1)
if(length(init_infos) > MAX_INIT_TEXT)
init_infos.Cut(1, length(init_infos) - MAX_INIT_TEXT + 1)
update_init_text()

#undef MAX_INIT_TEXT

/// Removes the passed category from the initialization information list
/datum/controller/subsystem/title/proc/remove_init_text(init_category)
Expand Down

0 comments on commit d772587

Please sign in to comment.