def __init__(self, parent): super().__init__(parent, gettext("V-Sync")) self.set_tooltip( gettext( "When checked, enable video synchronization whenever possible") ) SettingsBehavior(self, ["video_sync"])
def __init__(self, parent, new_button=True): super().__init__(parent) self.layout = fsui.VerticalLayout() hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) if new_button: label_stand_in = fsui.Panel(self) _, th = label_stand_in.measure_text(gettext("Configuration")) label_stand_in.set_min_height(th) hori_layout.add(label_stand_in, margin_top=10, margin_bottom=10) hori_layout.add(NewConfigButton(self), margin_left=10, margin_right=10) self.config_name_field = fsui.TextField(self) hori_layout.add( self.config_name_field, expand=True, margin=10, margin_top=0, margin_bottom=0, ) hori_layout.add(SaveButton(self), margin_left=10, margin_right=10) self.config_name_field.on_changed = self.on_config_name_changed SettingsBehavior(self, ["config_name"])
def __init__(self, parent): self.window_icon = fsui.Image("launcher:res/16/fullscreen_window.png") self.fullscreen_icon = fsui.Image( "launcher:res/16/fullscreen_fullscreen.png") self.desktop_icon = fsui.Image( "launcher:res/16/fullscreen_desktop.png") super().__init__(parent, self.desktop_icon) self.set_tooltip(gettext( "Change fullscreen mode (desktop, fullscreen, window)")) self.set_min_width(40) self.fullscreen_mode = "desktop" SettingsBehavior(self, ["fullscreen", "fullscreen_mode"])
def __init__(self, parent): super().__init__(parent, "") try: from fsui.qt import init_qt qapplication = init_qt() except AttributeError: pass else: for screen in qapplication.screens(): screen.geometryChanged.connect(self.on_screen_change) screen.refreshRateChanged.connect(self.on_screen_change) qapplication.screenAdded.connect(self.on_screen_added) SettingsBehavior(self, ["fullscreen", "monitor", "assume_refresh_rate"])
def __init__(self, parent): self.left_icon = fsui.Image("launcher:res/16/monitor_left.png") self.middle_left_icon = fsui.Image( "launcher:res/16/monitor_middle_left.png") self.middle_right_icon = fsui.Image( "launcher:res/16/monitor_middle_right.png") self.right_icon = fsui.Image("launcher:res/16/monitor_right.png") super().__init__(parent, self.middle_left_icon) self.set_tooltip( gettext("Monitor to display FS-UAE on (left, " "middle-left, middle-right, right)")) self.set_min_width(40) self.monitor = "" SettingsBehavior(self, ["fullscreen", "monitor"])
def __init__(self, parent): self.active_icon = 1 super().__init__(parent, [], cursor_keys=False) with self.changed.inhibit: self.add_item(gettext("Rate Variant"), Image("launcher:res/16x16/bullet.png")) self.add_item(gettext("Best Variant"), Image("launcher:res/16x16/rating_fav_2.png")) self.add_item(gettext("Good Variant"), Image("launcher:res/16x16/thumb_up_2.png")) self.add_item(gettext("Bad Variant"), Image("launcher:res/16x16/thumb_down_2.png")) ConfigBehavior(self, ["variant_uuid"]) SettingsBehavior(self, ["__variant_rating"])
def __init__(self, parent, fsgc): self.fsgc = fsgc super().__init__(parent) self.layout = fsui.VerticalLayout() hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) heading_label = fsui.HeadingLabel(self, gettext("Settings")) hori_layout.add(heading_label, margin=10) hori_layout.add_spacer(0, expand=True) settings_button = IconButton(self, "16x16/more.png") settings_button.activated.connect(self.on_settings_button) hori_layout.add(settings_button, margin_right=10) self.layout.add_spacer(0) # button = fsui.Button(self, "Platform Settings") # button.activated.connect(self.on_platform_settings_button) # self.layout.add(button, margin=10, fill=True) # self.add_option(Option.KEEP_ASPECT, text=gettext("Keep Aspect"), # platforms=AMIGA_PLATFORMS) self.add_option(Option.SCALE, text=None, enable=SCALING) self.add_option(Option.STRETCH, text=None, enable=STRETCHING) self.add_option(Option.BEZEL, text=None, enable=BEZEL) self.add_option(Option.EFFECT, text=None, enable=EFFECTS) self.add_option(Option.ZOOM, text=None, platforms=AMIGA_PLATFORMS) self.add_option(Option.BORDER, text=None, platforms=BORDER) # self.add_option(Option.SMOOTHING, text=None, platforms=SMOOTHING) # self.add_option(Option.CROP, text=None, platforms=CROPPING) # if fsgc.settings[Option.DEVELOPER_MODE] == "1": # pass # # self.add_option(Option.ZXS_DRIVER, [Platform.ZXS]) # # self.add_option(Option.DOS_EMULATOR, [Platform.DOS]) # self.add_option(Option.NES_EMULATOR, [Platform.NES]) self.add_option(Option.AUTO_LOAD, [Platform.DOS, Platform.ZXS]) self.add_option(Option.AUTO_QUIT, [Platform.DOS]) self.add_option(Option.TURBO_LOAD, [Platform.ZXS]) # self.add_option(Option.FRAME, text=None, platforms=BEZEL) # self.add_option(Option.BEZEL, text=None, platforms=BEZEL) # self.add_option(Option.CHEATS, platforms=CHEATS) quick_settings = fsgc.settings[Option.QUICK_SETTINGS_OPTIONS] for option in quick_settings.split(","): option = option.strip().lower() if "[" in option: # For future use of e.g.: # option1[platform1,platform2],option2[platform,...] option, platforms = option.split("[", 1) else: platforms = [] if option in options: try: self.add_option(option) except Exception: print("Error adding quick setting") traceback.print_exc() self.layout.add_spacer(expand=True) hori_layout = fsui.HorizontalLayout() hori_layout.add_spacer(expand=True) self.platform_settings_button = fsui.Button(self, "Platform Settings") self.platform_settings_button.activated.connect( self.on_platform_settings_button) hori_layout.add(self.platform_settings_button, margin=10) self.layout.add(hori_layout, fill=True) hori_layout = fsui.HorizontalLayout() hori_layout.add_spacer(expand=True) self.video_sync_checkbox = VideoSyncCheckBox(self) hori_layout.add(self.video_sync_checkbox, margin_right=10) self.layout.add(hori_layout, fill=True) self.monitor_button = MonitorButton(self) hori_layout.add(self.monitor_button, fill=True, margin_right=10) self.fullscreen_mode_button = FullscreenModeButton(self) hori_layout.add(self.fullscreen_mode_button, fill=True, margin_right=10) self.layout.add_spacer(10) ConfigBehavior(self, [Option.PLATFORM]) SettingsBehavior(self, [Option.G_SYNC])
def __init__(self, parent): fsui.Choice.__init__(self, parent) self.game_lists = [] self.populate_list() self.changed.connect(self.__on_changed_signal) SettingsBehavior(self, [Option.CONFIG_REFRESH, Option.GAME_LIST_UUID])
def __init__(self, parent): fsui.Choice.__init__(self, parent) self.game_lists = [] self.populate_list() SettingsBehavior(self, ["config_refresh", "game_list_uuid"])
def __init__(self, parent): StatusElement.__init__(self, parent) self.error_icon = Image("launcher:res/16x16/error.png") self.warning_icon = Image("launcher:res/16x16/warning_3.png") self.notice_icon = Image("launcher:res/16x16/information.png") self.icons = [self.error_icon, self.warning_icon, self.notice_icon] self.coordinates = [] self.warnings = [] self.game_notice = "" self.variant_notice = "" self.variant_warning = "" self.variant_error = "" self.joy_emu_conflict = "" self.using_joy_emu = False self.kickstart_file = "" self.x_kickstart_file_sha1 = "" self.update_available = "" self.__error = "" self.x_missing_files = "" self.download_page = "" self.download_file = "" self.platform = "" self.amiga_model = "" self.amiga_model_calculated = "" self.chip_memory = "" self.chip_memory_calculated = 0 self.outdated_plugins = [] self.custom_config = set() self.custom_uae_config = set() self.settings_config_keys = set() plugin_manager = PluginManager.instance() for plugin in plugin_manager.plugins(): if plugin.outdated: self.outdated_plugins.append(plugin.name) ConfigBehavior( self, [ "x_game_notice", "x_variant_notice", "x_variant_warning", "x_variant_error", "x_joy_emu_conflict", "amiga_model", "x_kickstart_file_sha1", "kickstart_file", "download_page", "download_file", "x_missing_files", "__error", "chip_memory", "jit_compiler", "platform", ], ) SettingsBehavior(self, ["__update_available"]) LauncherConfig.add_listener(self) for key in JOYSTICK_KEYS: self.on_config(key, LauncherConfig.get(key)) for key in LauncherConfig.keys(): if LauncherConfig.is_custom_uae_option(key): self.on_config(key, LauncherConfig.get(key)) elif LauncherConfig.is_custom_option(key): self.on_config(key, LauncherConfig.get(key)) LauncherSettings.add_listener(self) for key in LauncherSettings.keys(): if LauncherConfig.is_config_only_option(key): self.on_setting(key, LauncherSettings.get(key))