Beispiel #1
0
    def options_as_dict(self, options_type):
        """Convert the option list to a dict with option name as keys"""
        options = {}
        if options_type == 'system':
            options = (sysoptions.with_runner_overrides(self.runner_slug)
                       if self.runner_slug
                       else sysoptions.system_options)
        else:
            if not self.runner_slug:
                return
            attribute_name = options_type + '_options'

            runner = import_runner(self.runner_slug)
            if not getattr(runner, attribute_name):
                runner = runner()

            options = getattr(runner, attribute_name)
        return dict((opt['option'], opt) for opt in options)
Beispiel #2
0
    def options_as_dict(self, options_type):
        """Convert the option list to a dict with option name as keys"""
        if options_type == "system":
            options = (
                sysoptions.with_runner_overrides(self.runner_slug)
                if self.runner_slug
                else sysoptions.system_options
            )
        else:
            if not self.runner_slug:
                return None
            attribute_name = options_type + "_options"

            try:
                runner = import_runner(self.runner_slug)
            except InvalidRunner:
                options = {}
            else:
                if not getattr(runner, attribute_name):
                    runner = runner()

                options = getattr(runner, attribute_name)
        return dict((opt["option"], opt) for opt in options)
Beispiel #3
0
    def __init__(self, lutris_config):
        ConfigBox.__init__(self)
        self.lutris_config = lutris_config
        runner_slug = self.lutris_config.runner_slug

        if runner_slug:
            self.options = sysoptions.with_runner_overrides(runner_slug)
        else:
            self.options = sysoptions.system_options

        if lutris_config.game_config_id and runner_slug:
            self.generate_top_info_box(
                "If modified, these options supersede the same options from "
                "the base runner configuration, which themselves supersede "
                "the global preferences."
            )
        elif runner_slug:
            self.generate_top_info_box(
                "If modified, these options supersede the same options from "
                "the global preferences."
            )

        self.generate_widgets('system')
Beispiel #4
0
    def __init__(self, lutris_config):
        ConfigBox.__init__(self)
        self.lutris_config = lutris_config
        runner_slug = self.lutris_config.runner_slug

        if runner_slug:
            self.options = sysoptions.with_runner_overrides(runner_slug)
        else:
            self.options = sysoptions.system_options

        if lutris_config.game_config_id and runner_slug:
            self.generate_top_info_box(
                "If modified, these options supersede the same options from "
                "the base runner configuration, which themselves supersede "
                "the global preferences."
            )
        elif runner_slug:
            self.generate_top_info_box(
                "If modified, these options supersede the same options from "
                "the global preferences."
            )

        self.generate_widgets("system")