tresinformal / drakkar

The tresinformal video game called 'Drakkar'
GNU General Public License v3.0
11 stars 4 forks source link

The music on/off button changes color dynamically #710

Closed TheoPannetier closed 1 year ago

TheoPannetier commented 1 year ago

Context

As we're not sure whether the turning music on/off feature works, it would be great to have a visual cue. When is on, button should be green. When it is off, button should be red.

Instead of green/red, let's use the following proxies so that color blind people are not impeded: Red: (219 67 37) Green: (87 196 173)

Test

#define FIX_ISSUE_710
{
  // Colorblind-friendly green and red
    const color color_on{87, 196, 173};
    const color color_off{219, 67, 37};

    // Music is first off, then turned on
    const game_options go_music_off(0, false);
    options_view ov(go_music_off);
    color mb_color = ov.get_music_button().get_color();
    assert(mb_color == color_off);
    ov.click_play_music_button();
    mb_color = ov.get_music_button().get_color();
    assert(mb_color == color_on);
}
#endif // FIX_ISSUE_710
TheoPannetier commented 1 year ago

Done, the music button changes color as it is turned on or off!