Esempio n. 1
0
    def __init__(self, data_dir: Path, user_dir: Optional[Path] = None):
        self._data_dir = data_dir
        self._user_dir = user_dir or data_dir
        self._last_changelog_displayed = str(update_checker.strict_current_version())

        for game in RandovaniaGame.all_games():
            self._set_field(f"game_{game.value}", None)
Esempio n. 2
0
def add_per_game_serializer():
    def make_decoder(g):
        return lambda it: g.options.from_json(it)

    for game in RandovaniaGame.all_games():
        _SERIALIZER_FOR_FIELD[f"game_{game.value}"] = Serializer(
            lambda it: it.as_json,
            make_decoder(game),
        )
Esempio n. 3
0
def test_on_first_show_after_set_experimental(skip_qtbot, is_dev_version):
    # Setup

    widget = GamesHelpWidget()
    widget.set_experimental_visible(True)

    # Run
    widget._on_first_show()

    # Assert
    visibility = {
        game: widget.isTabVisible(index)
        for game, index in widget._index_for_game.items()
    }
    assert visibility == {
        game: game.data.development_state.can_view(True)
        for game in RandovaniaGame.all_games()
        if game.gui.help_widget is not None
    }