@@ -637,6 +637,7 @@ static input_context make_crafting_context( bool highlight_unread_recipes )
637
637
ctxt.register_action ( " HELP_RECIPE" );
638
638
ctxt.register_action ( " HELP_KEYBINDINGS" );
639
639
ctxt.register_action ( " CYCLE_BATCH" );
640
+ ctxt.register_action ( " TOGGLE_BATCH_MULTIPLIER" );
640
641
ctxt.register_action ( " CHOOSE_CRAFTER" );
641
642
ctxt.register_action ( " RELATED_RECIPES" );
642
643
ctxt.register_action ( " HIDE_SHOW_RECIPE" );
@@ -1304,6 +1305,7 @@ std::pair<Character *, const recipe *> select_crafter_and_crafting_recipe( int &
1304
1305
add_action_desc ( " RELATED_RECIPES" , pgettext ( " crafting gui" , " Related" ) );
1305
1306
add_action_desc ( " TOGGLE_FAVORITE" , pgettext ( " crafting gui" , " Favorite" ) );
1306
1307
add_action_desc ( " CYCLE_BATCH" , pgettext ( " crafting gui" , " Batch" ) );
1308
+ add_action_desc ( " TOGGLE_BATCH_MULTIPLIER" , pgettext ( " crafting gui" , " Toggle Batch Multiplier" ) );
1307
1309
add_action_desc ( " CHOOSE_CRAFTER" , pgettext ( " crafting gui" , " Choose crafter" ) );
1308
1310
add_action_desc ( " HELP_KEYBINDINGS" , pgettext ( " crafting gui" , " Keybindings" ) );
1309
1311
keybinding_x = isWide ? 5 : 2 ;
@@ -1367,6 +1369,7 @@ std::pair<Character *, const recipe *> select_crafter_and_crafting_recipe( int &
1367
1369
bool keepline = false ;
1368
1370
bool done = false ;
1369
1371
bool batch = false ;
1372
+ int batch_multiplier = 1 ;
1370
1373
bool show_hidden = false ;
1371
1374
size_t num_hidden = 0 ;
1372
1375
int num_recipe = 0 ;
@@ -1497,7 +1500,7 @@ std::pair<Character *, const recipe *> select_crafter_and_crafting_recipe( int &
1497
1500
std::string tmp_name = std::string ( indent[i],
1498
1501
' ' ) + current[i]->result_name ( /* decorated=*/ true );
1499
1502
if ( batch ) {
1500
- tmp_name = string_format ( _ ( " %2dx %s" ), i + 1 , tmp_name );
1503
+ tmp_name = string_format ( _ ( " %3dx %s" ), ( i + 1 ) * batch_multiplier , tmp_name );
1501
1504
}
1502
1505
const bool rcp_read = !highlight_unread_recipes ||
1503
1506
uistate.read_recipes .count ( current[i]->ident () );
@@ -1518,7 +1521,7 @@ std::pair<Character *, const recipe *> select_crafter_and_crafting_recipe( int &
1518
1521
i - istart ) ) );
1519
1522
}
1520
1523
1521
- const int batch_size = batch ? line + 1 : 1 ;
1524
+ const int batch_size = batch ? ( line + 1 ) * batch_multiplier : 1 ;
1522
1525
if ( !current.empty () ) {
1523
1526
const recipe &recp = *current[line];
1524
1527
@@ -1616,7 +1619,7 @@ std::pair<Character *, const recipe *> select_crafter_and_crafting_recipe( int &
1616
1619
current.clear ();
1617
1620
for ( int i = 1 ; i <= 50 ; i++ ) {
1618
1621
current.push_back ( chosen );
1619
- available.emplace_back ( *crafter, chosen, i, camp_crafting, inventory_override );
1622
+ available.emplace_back ( *crafter, chosen, i * batch_multiplier , camp_crafting, inventory_override );
1620
1623
}
1621
1624
indent.assign ( current.size (), 0 );
1622
1625
} else {
@@ -1888,13 +1891,14 @@ std::pair<Character *, const recipe *> select_crafter_and_crafting_recipe( int &
1888
1891
!available[line].crafter_has_primary_skill ) {
1889
1892
popup ( _ ( " Crafter can't craft that!" ) );
1890
1893
} else if ( available[line].inv_override == nullptr &&
1891
- !crafter->check_eligible_containers_for_crafting ( *current[line], batch ? line + 1 : 1 ) ) {
1894
+ !crafter->check_eligible_containers_for_crafting ( *current[line],
1895
+ batch ? ( line + 1 ) * batch_multiplier : 1 ) ) {
1892
1896
// popup is already inside check
1893
1897
} else if ( crafter->lighting_craft_speed_multiplier ( *current[line] ) <= 0 .0f ) {
1894
1898
popup ( _ ( " Crafter can't see!" ) );
1895
1899
} else {
1896
1900
chosen = current[line];
1897
- batch_size_out = batch ? line + 1 : 1 ;
1901
+ batch_size_out = batch ? ( line + 1 ) * batch_multiplier : 1 ;
1898
1902
done = true ;
1899
1903
uistate.read_recipes .insert ( chosen->ident () );
1900
1904
}
@@ -1984,6 +1988,12 @@ std::pair<Character *, const recipe *> select_crafter_and_crafting_recipe( int &
1984
1988
keepline = true ;
1985
1989
}
1986
1990
recalc = true ;
1991
+ } else if ( action == " TOGGLE_BATCH_MULTIPLIER" ) {
1992
+ if ( batch_multiplier == 1 ) {
1993
+ batch_multiplier = 10 ;
1994
+ } else {
1995
+ batch_multiplier = 1 ;
1996
+ }
1987
1997
} else if ( action == " CHOOSE_CRAFTER" ) {
1988
1998
// allow for switching crafter when no recipes are shown (e.g. filter)
1989
1999
bool rec_valid = !current.empty ();
0 commit comments