diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index b2dd72a3..bedf5ce8 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -2714,10 +2714,9 @@ buildbuildable( buildable, craft ) { if ( isDefined( buildable ) || stub.persistent != 3 ) { - hint_string = stub get_equipment_hint_string(); stub.cost = stub get_equipment_cost(); - stub.trigger_hintstring = hint_string + " [Cost: " + stub.cost + "]"; stub.trigger_func = ::buildable_place_think; + stub.prompt_and_visibility_func = ::buildabletrigger_update_prompt; if (craft) { @@ -2729,7 +2728,6 @@ buildbuildable( buildable, craft ) else { level.zombie_buildables[stub.equipname].hint = "Hold ^3[{+activate}]^7 to craft " + stub get_equipment_display_name(); - stub.prompt_and_visibility_func = ::buildabletrigger_update_prompt; } i = 0; @@ -2749,20 +2747,6 @@ buildbuildable( buildable, craft ) } } -get_equipment_hint_string() -{ - if (self.equipname == "packasplat") - { - return "Hold ^3[{+activate}]^7 to convert Blundergat into Acidgat"; - } - else if (self.equipname == "equip_dieseldrone_zm") - { - return "Hold ^3[{+activate}]^7 to take the Maxis Drone"; - } - - return "Hold ^3[{+activate}]^7 for " + get_equipment_display_name(); -} - get_equipment_display_name() { if (self.equipname == "turbine") @@ -3075,7 +3059,15 @@ buildabletrigger_update_prompt( player ) can_use = self.stub buildablestub_update_prompt( player, self ); } - self sethintstring( self.stub.hint_string ); + if (can_use && is_true(self.stub.built)) + { + self sethintstring( self.stub.hint_string, " [Cost: " + self.stub.cost + "]" ); + } + else + { + self sethintstring( self.stub.hint_string ); + } + if ( isDefined( self.stub.cursor_hint ) ) { if ( self.stub.cursor_hint == "HINT_WEAPON" && isDefined( self.stub.cursor_hint_weapon ) ) @@ -3473,10 +3465,9 @@ updatebuildables() { if(IsDefined(stub.equipname)) { - hint_string = stub get_equipment_hint_string(); stub.cost = stub get_equipment_cost(); - stub.trigger_hintstring = hint_string + " [Cost: " + stub.cost + "]"; stub.trigger_func = ::buildable_place_think; + stub.prompt_and_visibility_func = ::buildabletrigger_update_prompt; } } } diff --git a/scripts/zm/replaced/_zm_buildables_pooled.gsc b/scripts/zm/replaced/_zm_buildables_pooled.gsc index c85fe3c1..d16926cc 100644 --- a/scripts/zm/replaced/_zm_buildables_pooled.gsc +++ b/scripts/zm/replaced/_zm_buildables_pooled.gsc @@ -29,7 +29,16 @@ add_buildable_to_pool( stub, poolname ) pooledbuildabletrigger_update_prompt( player ) { can_use = self.stub pooledbuildablestub_update_prompt( player, self ); - self sethintstring( self.stub.hint_string ); + + if (can_use && is_true(self.stub.built)) + { + self sethintstring( self.stub.hint_string, " [Cost: " + self.stub.cost + "]" ); + } + else + { + self sethintstring( self.stub.hint_string ); + } + if ( isDefined( self.stub.cursor_hint ) ) { if ( self.stub.cursor_hint == "HINT_WEAPON" && isDefined( self.stub.cursor_hint_weapon ) ) diff --git a/scripts/zm/zm_prison/zm_prison_reimagined.gsc b/scripts/zm/zm_prison/zm_prison_reimagined.gsc index ead3d80f..665f2f6b 100644 --- a/scripts/zm/zm_prison/zm_prison_reimagined.gsc +++ b/scripts/zm/zm_prison/zm_prison_reimagined.gsc @@ -334,10 +334,9 @@ updatecraftables() { if(IsDefined(stub.equipname)) { - hint_string = stub scripts\zm\_zm_reimagined::get_equipment_hint_string(); stub.cost = stub scripts\zm\_zm_reimagined::get_equipment_cost(); - stub.trigger_hintstring = hint_string + " [Cost: " + stub.cost + "]"; stub.trigger_func = ::craftable_place_think; + stub.prompt_and_visibility_func = ::craftabletrigger_update_prompt; } } } @@ -595,4 +594,20 @@ craftable_place_think() } } } +} + +craftabletrigger_update_prompt( player ) +{ + can_use = self.stub craftablestub_update_prompt( player ); + + if (can_use && is_true(self.stub.crafted)) + { + self sethintstring( self.stub.hint_string, " [Cost: " + self.stub.cost + "]" ); + } + else + { + self sethintstring( self.stub.hint_string ); + } + + return can_use; } \ No newline at end of file diff --git a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc index be5ac93f..5a9c4fd9 100644 --- a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc +++ b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc @@ -313,10 +313,9 @@ updatecraftables() { if(IsDefined(stub.equipname)) { - hint_string = stub scripts\zm\_zm_reimagined::get_equipment_hint_string(); stub.cost = stub scripts\zm\_zm_reimagined::get_equipment_cost(); - stub.trigger_hintstring = hint_string + " [Cost: " + stub.cost + "]"; stub.trigger_func = ::craftable_place_think; + stub.prompt_and_visibility_func = ::craftabletrigger_update_prompt; } } } @@ -576,6 +575,22 @@ craftable_place_think() } } +craftabletrigger_update_prompt( player ) +{ + can_use = self.stub craftablestub_update_prompt( player ); + + if (can_use && is_true(self.stub.crafted)) + { + self sethintstring( self.stub.hint_string, " [Cost: " + self.stub.cost + "]" ); + } + else + { + self sethintstring( self.stub.hint_string ); + } + + return can_use; +} + setup_quadrotor_purchase( player ) { if ( self.stub.weaponname == "equip_dieseldrone_zm" )