Add map record HUD announcements for T5 and T6
This commit is contained in:
+24
-1
@@ -1,4 +1,4 @@
|
||||
/* tws_t6_common.gsc — shared config, HUD helpers, help and spawn-handler registries. */
|
||||
/* tws_t6_common.gsc — shared config, HUD helpers, connect/spawn/help registries. */
|
||||
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
@@ -76,6 +76,15 @@ register_spawn_handler(fn)
|
||||
level.tws_spawn_handlers[level.tws_spawn_handlers.size] = fn;
|
||||
}
|
||||
|
||||
// Connection handlers also serve newcomers still waiting in spectator mode.
|
||||
register_connect_handler(fn)
|
||||
{
|
||||
if (!isDefined(level.tws_connect_handlers))
|
||||
level.tws_connect_handlers = [];
|
||||
|
||||
level.tws_connect_handlers[level.tws_connect_handlers.size] = fn;
|
||||
}
|
||||
|
||||
// Modules register their own commands, regardless of init order.
|
||||
register_help_command(command, description)
|
||||
{
|
||||
@@ -160,9 +169,23 @@ on_player_connect_dispatch()
|
||||
{
|
||||
level waittill("connected", player);
|
||||
player thread on_player_spawned_dispatch();
|
||||
player thread on_player_connected_dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
on_player_connected_dispatch()
|
||||
{
|
||||
self endon("disconnect");
|
||||
// Leave the connection handshake before invoking optional modules.
|
||||
wait 0.05;
|
||||
|
||||
if (!isDefined(level.tws_connect_handlers))
|
||||
return;
|
||||
|
||||
for (i = 0; i < level.tws_connect_handlers.size; i++)
|
||||
self thread [[ level.tws_connect_handlers[i] ]]();
|
||||
}
|
||||
|
||||
// handlers own their own self endon("disconnect")
|
||||
on_player_spawned_dispatch()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user