diff --git a/scripts/zm/replaced/_zm_buildables.gsc b/scripts/zm/replaced/_zm_buildables.gsc index c168cd84..befc8129 100644 --- a/scripts/zm/replaced/_zm_buildables.gsc +++ b/scripts/zm/replaced/_zm_buildables.gsc @@ -505,6 +505,38 @@ player_build( buildable, pieces ) return ""; } +player_progress_bar( start_time, build_time, building_prompt ) +{ + self.usebar = self createprimaryprogressbar(); + self.usebartext = self createprimaryprogressbartext(); + + if ( isdefined( building_prompt ) ) + self.usebartext settext( building_prompt ); + else + self.usebartext settext( &"ZOMBIE_BUILDING" ); + + if ( isdefined( self ) && isdefined( start_time ) && isdefined( build_time ) ) + self player_progress_bar_update( start_time, build_time ); + + self.usebartext destroyelem(); + self.usebar destroyelem(); +} + +player_progress_bar_update( start_time, build_time ) +{ + self endon( "entering_last_stand" ); + self endon( "death" ); + self endon( "disconnect" ); + self endon( "buildable_progress_end" ); + + self.usebar updatebar( 0.01, 1000 / build_time ); + + while ( isdefined( self ) && gettime() - start_time < build_time ) + { + wait 0.05; + } +} + model_go_away(weaponname) { self hide(); diff --git a/scripts/zm/replaced/_zm_craftables.gsc b/scripts/zm/replaced/_zm_craftables.gsc index 87f7ebc4..5fa1e7d6 100644 --- a/scripts/zm/replaced/_zm_craftables.gsc +++ b/scripts/zm/replaced/_zm_craftables.gsc @@ -88,4 +88,19 @@ choose_open_craftable( player ) self.b_open_craftable_checking_input = 0; self.opencraftablehudelem[n_playernum] destroy(); self.opencraftablehudelem[n_playernum] = undefined; +} + +player_progress_bar_update( start_time, craft_time ) +{ + self endon( "entering_last_stand" ); + self endon( "death" ); + self endon( "disconnect" ); + self endon( "craftable_progress_end" ); + + self.usebar updatebar( 0.01, 1000 / craft_time ); + + while ( isdefined( self ) && gettime() - start_time < craft_time ) + { + wait 0.05; + } } \ No newline at end of file diff --git a/scripts/zm/zm_prison/zm_prison_reimagined.gsc b/scripts/zm/zm_prison/zm_prison_reimagined.gsc index 9f60550e..f8574bfd 100644 --- a/scripts/zm/zm_prison/zm_prison_reimagined.gsc +++ b/scripts/zm/zm_prison/zm_prison_reimagined.gsc @@ -59,6 +59,7 @@ main() replaceFunc(maps\mp\zombies\_zm_ai_brutus::brutus_health_increases, scripts\zm\replaced\_zm_ai_brutus::brutus_health_increases); replaceFunc(maps\mp\zombies\_zm_ai_brutus::brutus_cleanup_at_end_of_grief_round, scripts\zm\replaced\_zm_ai_brutus::brutus_cleanup_at_end_of_grief_round); replaceFunc(maps\mp\zombies\_zm_craftables::choose_open_craftable, scripts\zm\replaced\_zm_craftables::choose_open_craftable); + replaceFunc(maps\mp\zombies\_zm_craftables::player_progress_bar_update, scripts\zm\replaced\_zm_craftables::player_progress_bar_update); replaceFunc(maps\mp\zombies\_zm_riotshield_prison::doriotshielddeploy, scripts\zm\replaced\_zm_riotshield_prison::doriotshielddeploy); replaceFunc(maps\mp\zombies\_zm_riotshield_prison::trackriotshield, scripts\zm\replaced\_zm_riotshield_prison::trackriotshield); replaceFunc(maps\mp\zombies\_zm_weap_riotshield_prison::init, scripts\zm\replaced\_zm_weap_riotshield_prison::init); diff --git a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc index cb316e2d..ab4fd61f 100644 --- a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc +++ b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc @@ -70,6 +70,7 @@ main() replaceFunc(maps\mp\zombies\_zm_ai_mechz::mechz_set_starting_health, scripts\zm\replaced\_zm_ai_mechz::mechz_set_starting_health); replaceFunc(maps\mp\zombies\_zm_ai_mechz::mechz_round_tracker, scripts\zm\replaced\_zm_ai_mechz::mechz_round_tracker); replaceFunc(maps\mp\zombies\_zm_craftables::choose_open_craftable, scripts\zm\replaced\_zm_craftables::choose_open_craftable); + replaceFunc(maps\mp\zombies\_zm_craftables::player_progress_bar_update, scripts\zm\replaced\_zm_craftables::player_progress_bar_update); replaceFunc(maps\mp\zombies\_zm_powerup_zombie_blood::zombie_blood_powerup, scripts\zm\replaced\_zm_powerup_zombie_blood::zombie_blood_powerup); replaceFunc(maps\mp\zombies\_zm_riotshield_tomb::doriotshielddeploy, scripts\zm\replaced\_zm_riotshield_tomb::doriotshielddeploy); replaceFunc(maps\mp\zombies\_zm_riotshield_tomb::trackriotshield, scripts\zm\replaced\_zm_riotshield_tomb::trackriotshield);