@@ -22,7 +22,7 @@ ctf_core.testing = {
22
22
end
23
23
}
24
24
25
- local hud = mhud .init ()
25
+ local mapload_huds = mhud .init ()
26
26
local LOADING_SCREEN_TARGET_TIME = 7
27
27
local loading_screen_time
28
28
@@ -121,25 +121,27 @@ local old_announce = ctf_modebase.map_chosen
121
121
function ctf_modebase .map_chosen (map , ...)
122
122
set_playertags_state (PLAYERTAGS_OFF )
123
123
124
+ mapload_huds :clear_all ()
125
+
124
126
for _ , p in pairs (minetest .get_connected_players ()) do
125
127
if ctf_teams .get (p ) then
126
- hud :add (p , " loading_screen" , {
128
+ mapload_huds :add (p , " loading_screen" , {
127
129
hud_elem_type = " image" ,
128
130
position = {x = 0.5 , y = 0.5 },
129
131
image_scale = - 100 ,
130
132
z_index = 1000 ,
131
133
texture = " [combine:1x1^[invert:rgba^[opacity:1^[colorize:#141523:255"
132
134
})
133
135
134
- hud :add (p , " map_image" , {
136
+ mapload_huds :add (p , " map_image" , {
135
137
hud_elem_type = " image" ,
136
138
position = {x = 0.5 , y = 0.5 },
137
139
image_scale = - 100 ,
138
140
z_index = 1001 ,
139
141
texture = map .dirname .. " _screenshot.png^[opacity:30" ,
140
142
})
141
143
142
- hud :add (p , " loading_text" , {
144
+ mapload_huds :add (p , " loading_text" , {
143
145
hud_elem_type = " text" ,
144
146
position = {x = 0.5 , y = 0.5 },
145
147
alignment = {x = " center" , y = " up" },
@@ -148,7 +150,7 @@ function ctf_modebase.map_chosen(map, ...)
148
150
color = 0x7ec5ff ,
149
151
z_index = 1002 ,
150
152
})
151
- hud :add (p , {
153
+ mapload_huds :add (p , {
152
154
hud_elem_type = " text" ,
153
155
position = {x = 0.5 , y = 0.75 },
154
156
alignment = {x = " center" , y = " center" },
@@ -477,7 +479,7 @@ return {
477
479
local total_time = (minetest .get_us_time () - loading_screen_time ) / 1e6
478
480
479
481
minetest .after (math.max (0 , LOADING_SCREEN_TARGET_TIME - total_time ), function ()
480
- hud :clear_all ()
482
+ mapload_huds :clear_all ()
481
483
set_playertags_state (PLAYERTAGS_ON )
482
484
483
485
ctf_modebase .build_timer .start ()
0 commit comments