@@ -78,6 +78,7 @@ static const widget_id widget_test_int_num( "test_int_num" );
78
78
static const widget_id widget_test_mana_num ( " test_mana_num" );
79
79
static const widget_id widget_test_morale_num ( " test_morale_num" );
80
80
static const widget_id widget_test_move_cost_num ( " test_move_cost_num" );
81
+ static const widget_id widget_test_move_count_mode_text ( " test_move_count_mode_text" );
81
82
static const widget_id widget_test_move_mode_letter ( " test_move_mode_letter" );
82
83
static const widget_id widget_test_move_mode_text ( " test_move_mode_text" );
83
84
static const widget_id widget_test_move_num ( " test_move_num" );
@@ -411,15 +412,6 @@ TEST_CASE( "widgets showing avatar attributes", "[widget][avatar]" )
411
412
CHECK ( morale_w.layout ( ava ) == " MORALE: -100" );
412
413
}
413
414
414
- SECTION ( " move counter" ) {
415
- widget move_w = widget_test_move_num.obj ();
416
-
417
- ava.movecounter = 80 ;
418
- CHECK ( move_w.layout ( ava ) == " MOVE: 80" );
419
- ava.movecounter = 150 ;
420
- CHECK ( move_w.layout ( ava ) == " MOVE: 150" );
421
- }
422
-
423
415
SECTION ( " hit points" ) {
424
416
bodypart_id head ( " head" );
425
417
widget head_num_w = widget_test_hp_head_num.obj ();
@@ -461,26 +453,51 @@ TEST_CASE( "widgets showing avatar attributes", "[widget][avatar]" )
461
453
}
462
454
}
463
455
464
- TEST_CASE ( " widgets showing movement mode" , " [widget][move_mode]" )
456
+ TEST_CASE ( " widgets showing move counter and mode" , " [widget][move_mode]" )
465
457
{
466
- widget mode_letter_w = widget_test_move_mode_letter.obj ();
467
- widget mode_text_w = widget_test_move_mode_text.obj ();
468
-
469
458
avatar &ava = get_avatar ();
470
459
clear_avatar ();
471
460
472
- ava.set_movement_mode ( move_mode_walk );
473
- CHECK ( mode_letter_w.layout ( ava ) == " MODE: <color_c_white>W</color>" );
474
- CHECK ( mode_text_w.layout ( ava ) == " MODE: <color_c_white>walking</color>" );
475
- ava.set_movement_mode ( move_mode_run );
476
- CHECK ( mode_letter_w.layout ( ava ) == " MODE: <color_c_red>R</color>" );
477
- CHECK ( mode_text_w.layout ( ava ) == " MODE: <color_c_red>running</color>" );
478
- ava.set_movement_mode ( move_mode_crouch );
479
- CHECK ( mode_letter_w.layout ( ava ) == " MODE: <color_c_light_blue>C</color>" );
480
- CHECK ( mode_text_w.layout ( ava ) == " MODE: <color_c_light_blue>crouching</color>" );
481
- ava.set_movement_mode ( move_mode_prone );
482
- CHECK ( mode_letter_w.layout ( ava ) == " MODE: <color_c_green>P</color>" );
483
- CHECK ( mode_text_w.layout ( ava ) == " MODE: <color_c_green>prone</color>" );
461
+ SECTION ( " move counter" ) {
462
+ widget move_w = widget_test_move_num.obj ();
463
+
464
+ ava.movecounter = 80 ;
465
+ CHECK ( move_w.layout ( ava ) == " MOVE: 80" );
466
+ ava.movecounter = 150 ;
467
+ CHECK ( move_w.layout ( ava ) == " MOVE: 150" );
468
+ }
469
+
470
+ SECTION ( " move counter and mode letter" ) {
471
+ widget move_count_mode_w = widget_test_move_count_mode_text.obj ();
472
+
473
+ ava.movecounter = 90 ;
474
+ ava.set_movement_mode ( move_mode_walk );
475
+ CHECK ( move_count_mode_w.layout ( ava ) == " MOVE/MODE: <color_c_white>90(W)</color>" );
476
+ ava.set_movement_mode ( move_mode_run );
477
+ CHECK ( move_count_mode_w.layout ( ava ) == " MOVE/MODE: <color_c_red>90(R)</color>" );
478
+ ava.set_movement_mode ( move_mode_crouch );
479
+ CHECK ( move_count_mode_w.layout ( ava ) == " MOVE/MODE: <color_c_light_blue>90(C)</color>" );
480
+ ava.set_movement_mode ( move_mode_prone );
481
+ CHECK ( move_count_mode_w.layout ( ava ) == " MOVE/MODE: <color_c_green>90(P)</color>" );
482
+ }
483
+
484
+ SECTION ( " movement mode text and letter" ) {
485
+ widget mode_letter_w = widget_test_move_mode_letter.obj ();
486
+ widget mode_text_w = widget_test_move_mode_text.obj ();
487
+
488
+ ava.set_movement_mode ( move_mode_walk );
489
+ CHECK ( mode_letter_w.layout ( ava ) == " MODE: <color_c_white>W</color>" );
490
+ CHECK ( mode_text_w.layout ( ava ) == " MODE: <color_c_white>walking</color>" );
491
+ ava.set_movement_mode ( move_mode_run );
492
+ CHECK ( mode_letter_w.layout ( ava ) == " MODE: <color_c_red>R</color>" );
493
+ CHECK ( mode_text_w.layout ( ava ) == " MODE: <color_c_red>running</color>" );
494
+ ava.set_movement_mode ( move_mode_crouch );
495
+ CHECK ( mode_letter_w.layout ( ava ) == " MODE: <color_c_light_blue>C</color>" );
496
+ CHECK ( mode_text_w.layout ( ava ) == " MODE: <color_c_light_blue>crouching</color>" );
497
+ ava.set_movement_mode ( move_mode_prone );
498
+ CHECK ( mode_letter_w.layout ( ava ) == " MODE: <color_c_green>P</color>" );
499
+ CHECK ( mode_text_w.layout ( ava ) == " MODE: <color_c_green>prone</color>" );
500
+ }
484
501
}
485
502
486
503
TEST_CASE ( " widgets showing movement cost" , " [widget][move_cost]" )
0 commit comments