tresinformal / drakkar

The tresinformal video game called 'Drakkar'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A `game_view`'s options can be updated

TheoPannetier opened this issue · comments

Context

We can change (some) Options from the Options screen (options_view), great!
But this currently has no effect on the options of the game run in game_view, because both are independent.
To solve this, we need to update the options in game_view with those in options_view every time we switch to this screen.

Test

  • Test is ready and on develop
// (664) A game_view's options can be updated from options_view's
  {
    game_options options(0, true);
    view_manager vm(view_mode::options, options);
    assert(vm.get_game_view().get_options().is_playing_music());

    vm.get_options_view().click_play_music_button();
    vm.set_next_view(view_mode::game);
    assert(!vm.get_game_view().get_options().is_playing_music());
  }

Done, game_view's options are now updated every time the view is switched to it