@@ -10,10 +10,12 @@ SUBSYSTEM_DEF(title)
1010 var /icon /previous_icon
1111 // / Reference to the turf in the lobby, which is where we hold the title screen
1212 var /turf /closed/indestructible/splashscreen/splash_turf
13- // / A holder for maptext that displays initialization information on the title screen
14- var /obj /effect/abstract/maptext_holder/init/init_stat_holder
15- // / A holder for maptext that displays the playing music on the title screen
16- var /obj /effect/abstract/maptext_holder/music/music_holder
13+ // / Holds the maptext that displays initialization information on the title screen
14+ var /init_stat_maptext
15+ // / Tracks when stats have been faded out for everyone
16+ var /stats_faded = FALSE
17+ // / Holds the maptext that displays the playing music on the title screen
18+ var /music_maptext
1719
1820 // / A list of initialization information
1921 var /list /init_infos = list ()
@@ -89,18 +91,13 @@ SUBSYSTEM_DEF(title)
8991 return
9092 if (! music_string)
9193 return
92- if (! music_holder)
93- if (! splash_turf)
94- return
95- music_holder = new (splash_turf)
96-
97- music_holder. pixel_x = initial(music_holder. pixel_x) - (length(music_string) * 8 )
98- music_holder. maptext = " "
99- music_holder. maptext += " <span class='maptext'>"
100- music_holder. maptext += " <span class='big'>"
101- music_holder. maptext += " Now playing: [ music_string] "
102- music_holder. maptext += " </span>"
103- music_holder. maptext += " </span>"
94+
95+ music_maptext = " "
96+ music_maptext += " <span class='maptext'>"
97+ music_maptext += " <span class='big'>"
98+ music_maptext += " Now playing: [ music_string] "
99+ music_maptext += " </span>"
100+ music_maptext += " </span>"
104101
105102// / Max number of init entries to display
106103// / If this is exceeded, the oldest entry will be removed (but it generally should not be exceeded)
@@ -119,6 +116,8 @@ SUBSYSTEM_DEF(title)
119116 * * major_update: Indicates this init text is a major update, which will update a "dot" animation.
120117 */
121118/ datum / controller/ subsystem/ title/ proc / add_init_text(init_category, name, stage, seconds, override = FALSE , major_update = FALSE )
119+ if (isnum(seconds))
120+ seconds = round(seconds, 0.1 )
122121 if (override || ! init_infos[init_category])
123122 init_infos[init_category] = list (name, stage, seconds)
124123 else
@@ -139,13 +138,8 @@ SUBSYSTEM_DEF(title)
139138
140139// / Updates the displayed initialization text according to all initialization information
141140/ datum / controller/ subsystem/ title/ proc / update_init_text()
142- if (! init_stat_holder)
143- if (! splash_turf)
144- return
145- init_stat_holder = new (splash_turf)
146-
147- init_stat_holder. maptext = " <span class='maptext'>"
148- init_stat_holder. maptext += " <span class='big'>"
141+ init_stat_maptext = " <span class='maptext'>"
142+ init_stat_maptext += " <span class='big'>"
149143 if (SSticker?. current_state == GAME_STATE_PREGAME )
150144 var /total_time_formatted = " [ total_init_time] s"
151145 switch (total_init_time)
@@ -156,83 +150,26 @@ SUBSYSTEM_DEF(title)
156150 if (120 to INFINITY )
157151 total_time_formatted = " <font color='red'>[ total_init_time] s</font>"
158152
159- init_stat_holder . maptext += " Game Ready! ([ total_time_formatted] )"
153+ init_stat_maptext += " Game Ready! ([ total_time_formatted] )"
160154 else
161- init_stat_holder . maptext += " Initializing game"
155+ init_stat_maptext += " Initializing game"
162156 for (var /i in 1 to num_dots)
163- init_stat_holder . maptext += " ."
164- init_stat_holder . maptext += " </span><br>"
157+ init_stat_maptext += " ."
158+ init_stat_maptext += " </span><br>"
165159 for (var /sstype in init_infos)
166160 var /list /init_data = init_infos[sstype]
167161 var /init_name = init_data[1 ]
168162 var /init_stage = init_data[2 ]
169163 var /init_time = isnum(init_data[3 ]) ? " ([ init_data[3 ]] s)" : " "
170- init_stat_holder. maptext += " <br>[ init_name] [ init_stage] [ init_time] "
171- init_stat_holder. maptext += " <br></span>"
164+ init_stat_maptext += " <br>[ init_name] [ init_stage] [ init_time] "
165+ init_stat_maptext += " <br></span>"
166+ for (var /mob /dead/new_player/lobbyguy as anything in GLOB . new_player_list)
167+ for (var /atom/movable /screen/lobby_init_text/text in lobbyguy. hud_used?. static_inventory)
168+ text. maptext = SStitle. init_stat_maptext
172169
173170// / Simply fades out the initialization text
174171/ datum / controller/ subsystem/ title/ proc / fade_init_text()
175- update_init_text ()
176- animate (init_stat_holder, alpha = 0 , time = 8 SECONDS )
177-
178- // / Abstract holder for maptext on the lobby screen
179- / obj / effect/ abstract/ maptext_holder
180- icon = null
181- icon_state = null
182- mouse_opacity = MOUSE_OPACITY_TRANSPARENT
183- plane = SPLASHSCREEN_PLANE
184- // / Conceals the holder from clients who don't want to see it
185- var /image /hide_me
186-
187- / obj / effect/ abstract/ maptext_holder/ Initialize(mapload)
188- . = .. ()
189- for (var /mob /dead/new_player/lobby_goer as anything in GLOB . new_player_list)
190- check_client (lobby_goer. client)
191-
192- // / Check if the client should see or should not see the initialization information. Updates accordingly.
193- / obj / effect/ abstract/ maptext_holder/ proc / check_client( client / seer)
194- if (isnull(seer))
195- return
196- if (! check_preferences(seer))
197- hide_from_client (seer)
198- return
199- show_to_client (seer)
200-
201- // / Return TRUE if this maptext holder should be visible to the client
202- / obj / effect/ abstract/ maptext_holder/ proc / check_preferences( client / seer)
203- // default check for widescreen, because elements at the edge of the screen are cut off and i'm too lazy to fix it
204- return seer. prefs. read_preference(/ datum / preference/ toggle/ widescreen)
205-
206- // / Hides the initialization information from the client
207- / obj / effect/ abstract/ maptext_holder/ proc / hide_from_client( client / seer)
208- if (isnull(hide_me))
209- hide_me = image(loc = src )
210- hide_me. override = TRUE
211- seer?. images |= hide_me
212-
213- // / Shows the initialization information to the client (if already hidden, otherwise nothing happens)
214- / obj / effect/ abstract/ maptext_holder/ proc / show_to_client( client / seer)
215- seer?. images -= hide_me
216-
217- / obj / effect/ abstract/ maptext_holder/ init
218- maptext_height = 500
219- maptext_width = 200
220- maptext_x = 12
221- maptext_y = 12
222- pixel_x = - 64
223-
224- / obj / effect/ abstract/ maptext_holder/ init/ check_preferences( client / seer)
225- return .. () && seer. prefs. read_preference(/ datum / preference/ toggle/ show_init_stats)
226-
227- / obj / effect/ abstract/ maptext_holder/ music
228- icon = ' maplestation_modules/icons/hud/lobby_spinner.dmi'
229- icon_state = " spinner"
230- maptext_height = 64
231- maptext_width = 200
232- maptext_x = 36
233- maptext_y = 6
234- pixel_y = 6
235- pixel_x = 420
236-
237- / obj / effect/ abstract/ maptext_holder/ music/ check_preferences( client / seer)
238- return .. () && seer. prefs. read_preference(/ datum / preference/ toggle/ sound_lobby)
172+ for (var /mob /dead/new_player/lobbyguy as anything in GLOB . new_player_list)
173+ for (var /atom/movable /screen/lobby_init_text/text in lobbyguy. hud_used?. static_inventory)
174+ animate (text, alpha = 0 , time = 8 SECONDS )
175+ stats_faded = TRUE
0 commit comments