1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-11 15:48:05 -05:00

Buildables: use localized hint string for cost

This commit is contained in:
Jbleezy
2023-02-28 00:01:31 -08:00
parent 1afb98632d
commit 3b82ca3705
4 changed files with 55 additions and 25 deletions

View File

@ -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;
}
}
}

View File

@ -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 ) )

View File

@ -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;
}

View File

@ -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" )