def __init__(self, windows, settlement):
		StatsWidget.__init__(self, settlement.session, center_widget=True)
		Window.__init__(self, windows)

		self.settlement = settlement
		self.db = self.settlement.session.db
		Scheduler().add_new_object(Callback(self._refresh_tick), self, run_in=GAME_SPEED.TICKS_PER_SECOND, loops=-1)
	def __init__(self, windows, settlement):
		StatsWidget.__init__(self, settlement.session, center_widget=True)
		Window.__init__(self, windows)

		self.settlement = settlement
		self.db = self.settlement.session.db
		Scheduler().add_new_object(Callback(self._refresh_tick), self, run_in=GAME_SPEED.TICKS_PER_SECOND, loops=-1)
Esempio n. 3
0
	def __init__(self, windows):
		Window.__init__(self, windows)
		PickBeltWidget.__init__(self)

		self._settings = horizons.globals.fife._setting

		self.widget.mapEvents({
			'okButton': self.apply_settings,
			'defaultButton': self.set_defaults,
			'cancelButton': self._windows.close,
		})

		languages = find_available_languages().keys()
		language_names = [LANGUAGENAMES[x] for x in sorted(languages)]

		fps = {0: _lazy("Disabled"), 30: 30, 45: 45, 60: 60, 90: 90, 120: 120}

		FIFE = SETTINGS.FIFE_MODULE
		UH = SETTINGS.UH_MODULE

		def get_resolutions():
			return get_screen_resolutions(self._settings.get(FIFE, 'ScreenResolution'))

		self._options = [
			# Graphics/Sound/Input
			Setting(FIFE, 'ScreenResolution', 'screen_resolution', get_resolutions, restart=True),
			Setting(FIFE, 'FullScreen', 'enable_fullscreen', restart=True),
			Setting(FIFE, 'FrameLimit', 'fps_rate', fps, restart=True, callback=self._on_FrameLimit_changed),

			Setting(UH, 'VolumeMusic', 'volume_music', callback=self._on_VolumeMusic_changed),
			Setting(UH, 'VolumeEffects', 'volume_effects', callback=self._on_VolumeEffects_changed),
			Setting(FIFE, 'PlaySounds', 'enable_sound', callback=self._on_PlaySounds_changed),
			Setting(UH, 'EdgeScrolling', 'edgescrolling'),
			Setting(UH, 'CursorCenteredZoom', 'cursor_centered_zoom'),
			Setting(UH, 'MiddleMousePan', 'middle_mouse_pan'),
			Setting(FIFE, 'MouseSensitivity', 'mousesensitivity', restart=True),

			# Game
			Setting(UH, 'AutosaveInterval', 'autosaveinterval'),
			Setting(UH, 'AutosaveMaxCount', 'autosavemaxcount'),
			Setting(UH, 'QuicksaveMaxCount', 'quicksavemaxcount'),
			Setting(UH, 'Language', 'uni_language', language_names, callback=self._on_Language_changed),

			Setting(UH, 'MinimapRotation', 'minimaprotation'),
			Setting(UH, 'UninterruptedBuilding', 'uninterrupted_building'),
			Setting(UH, 'AutoUnload', 'auto_unload'),
			Setting(UH, 'DebugLog', 'debug_log', callback=self._on_DebugLog_changed),
			Setting(UH, 'ShowResourceIcons', 'show_resource_icons'),
			Setting(UH, 'ScrollSpeed', 'scrollspeed'),
			Setting(UH, 'QuotesType', 'quotestype', QUOTES_SETTINGS),
			Setting(UH, 'NetworkPort', 'network_port', callback=self._on_NetworkPort_changed),
		]

		self._fill_widgets()

		# key configuration
		hk = HotkeyConfiguration()
		number = self.sections.index(('hotkeys_settings', _('Hotkeys')))
		self.page_widgets[number].addChild(hk.widget)
		self.hotkey_interface = hk
Esempio n. 4
0
	def __init__(self, windows):
		Window.__init__(self, windows)
		PickBeltWidget.__init__(self)

		self._settings = horizons.globals.fife._setting

		self.widget.mapEvents({
			'okButton': self.apply_settings,
			'defaultButton': self.set_defaults,
			'cancelButton': self._windows.close,
		})

		languages = find_available_languages().keys()
		language_names = [LANGUAGENAMES[x] for x in sorted(languages)]

		fps = {0: _lazy("Disabled"), 30: 30, 45: 45, 60: 60, 90: 90, 120: 120}

		FIFE = SETTINGS.FIFE_MODULE
		UH = SETTINGS.UH_MODULE

		def get_resolutions():
			return get_screen_resolutions(self._settings.get(FIFE, 'ScreenResolution'))

		self._options = [
			# Graphics/Sound/Input
			Setting(FIFE, 'ScreenResolution', 'screen_resolution', get_resolutions, restart=True),
			Setting(FIFE, 'FullScreen', 'enable_fullscreen', restart=True),
			Setting(FIFE, 'FrameLimit', 'fps_rate', fps, restart=True, callback=self._on_FrameLimit_changed),

			Setting(UH, 'VolumeMusic', 'volume_music', callback=self._on_VolumeMusic_changed),
			Setting(UH, 'VolumeEffects', 'volume_effects', callback=self._on_VolumeEffects_changed),
			Setting(FIFE, 'PlaySounds', 'enable_sound', callback=self._on_PlaySounds_changed),
			Setting(UH, 'EdgeScrolling', 'edgescrolling'),
			Setting(UH, 'CursorCenteredZoom', 'cursor_centered_zoom'),
			Setting(UH, 'MiddleMousePan', 'middle_mouse_pan'),
			Setting(FIFE, 'MouseSensitivity', 'mousesensitivity', restart=True),

			# Game
			Setting(UH, 'AutosaveInterval', 'autosaveinterval'),
			Setting(UH, 'AutosaveMaxCount', 'autosavemaxcount'),
			Setting(UH, 'QuicksaveMaxCount', 'quicksavemaxcount'),
			Setting(UH, 'Language', 'uni_language', language_names, callback=self._on_Language_changed),

			Setting(UH, 'MinimapRotation', 'minimaprotation'),
			Setting(UH, 'UninterruptedBuilding', 'uninterrupted_building'),
			Setting(UH, 'AutoUnload', 'auto_unload'),
			Setting(UH, 'DebugLog', 'debug_log', callback=self._on_DebugLog_changed),
			Setting(UH, 'ShowResourceIcons', 'show_resource_icons'),
			Setting(UH, 'ScrollSpeed', 'scrollspeed'),
			Setting(UH, 'QuotesType', 'quotestype', QUOTES_SETTINGS),
			Setting(UH, 'NetworkPort', 'network_port', callback=self._on_NetworkPort_changed),
		]

		self._fill_widgets()

		# key configuration
		hk = HotkeyConfiguration()
		number = self.sections.index(('hotkeys_settings', _('Hotkeys')))
		self.page_widgets[number].addChild(hk.widget)
		self.hotkey_interface = hk
Esempio n. 5
0
    def __init__(self, windows):
        Window.__init__(self, windows)
        PickBeltWidget.__init__(self)

        self._settings = horizons.globals.fife._setting

        self.widget.mapEvents(
            {"okButton": self.apply_settings, "defaultButton": self.set_defaults, "cancelButton": self._windows.close}
        )

        languages = find_available_languages().keys()
        language_names = [LANGUAGENAMES[x] for x in sorted(languages)]

        fps = {0: _lazy("Disabled"), 30: 30, 45: 45, 60: 60, 90: 90, 120: 120}

        FIFE = SETTINGS.FIFE_MODULE
        UH = SETTINGS.UH_MODULE

        def get_resolutions():
            return get_screen_resolutions(self._settings.get(FIFE, "ScreenResolution"))

        self._options = [
            # Graphics/Sound/Input
            Setting(FIFE, "ScreenResolution", "screen_resolution", get_resolutions, restart=True),
            Setting(FIFE, "FullScreen", "enable_fullscreen", restart=True),
            Setting(FIFE, "FrameLimit", "fps_rate", fps, restart=True, callback=self._on_FrameLimit_changed),
            Setting(UH, "VolumeMusic", "volume_music", callback=self._on_VolumeMusic_changed),
            Setting(UH, "VolumeEffects", "volume_effects", callback=self._on_VolumeEffects_changed),
            Setting(FIFE, "PlaySounds", "enable_sound", callback=self._on_PlaySounds_changed),
            Setting(UH, "EdgeScrolling", "edgescrolling"),
            Setting(UH, "CursorCenteredZoom", "cursor_centered_zoom"),
            Setting(UH, "MiddleMousePan", "middle_mouse_pan"),
            Setting(FIFE, "MouseSensitivity", "mousesensitivity", restart=True),
            # Game
            Setting(UH, "AutosaveInterval", "autosaveinterval"),
            Setting(UH, "AutosaveMaxCount", "autosavemaxcount"),
            Setting(UH, "QuicksaveMaxCount", "quicksavemaxcount"),
            Setting(UH, "Language", "uni_language", language_names, callback=self._on_Language_changed),
            Setting(UH, "MinimapRotation", "minimaprotation"),
            Setting(UH, "UninterruptedBuilding", "uninterrupted_building"),
            Setting(UH, "AutoUnload", "auto_unload"),
            Setting(UH, "DebugLog", "debug_log", callback=self._on_DebugLog_changed),
            Setting(UH, "ShowResourceIcons", "show_resource_icons"),
            Setting(UH, "ScrollSpeed", "scrollspeed"),
            Setting(UH, "QuotesType", "quotestype", QUOTES_SETTINGS),
            Setting(UH, "NetworkPort", "network_port", callback=self._on_NetworkPort_changed),
        ]

        self._fill_widgets()

        # key configuration
        hk = HotkeyConfiguration()
        number = self.sections.index(("hotkeys_settings", _("Hotkeys")))
        self.page_widgets[number].addChild(hk.widget)
        self.hotkey_interface = hk
Esempio n. 6
0
    def __init__(self, windows):
        Window.__init__(self, windows)
        PickBeltWidget.__init__(self)

        self._settings = horizons.globals.fife._setting

        self.widget.mapEvents({
            'okButton': self.apply_settings,
            'defaultButton': self.set_defaults,
            'cancelButton': self._windows.close,
        })
Esempio n. 7
0
	def __init__(self, windows):
		Window.__init__(self, windows)
		PickBeltWidget.__init__(self)

		self._settings = horizons.globals.fife._setting

		self.widget.mapEvents({
			'okButton': self.apply_settings,
			'defaultButton': self.set_defaults,
			'cancelButton': self._windows.close,
		})
	def __init__(self, windows):
		Window.__init__(self, windows)
		PickBeltWidget.__init__(self)

		# Overwrite a few style pieces
		for box in self.widget.findChildren(name='box'):
			box.margins = (30, 0) # to get some indentation
			box.padding = 3
		for listbox in self.widget.findChildren(name='translators'):
			listbox.background_color = NOTHING

		self.widget.findChild(name=OkButton.DEFAULT_NAME).capture(self._windows.close)
Esempio n. 9
0
	def __init__(self, windows):
		Window.__init__(self, windows)
		PickBeltWidget.__init__(self)

		# Overwrite a few style pieces
		for box in self.widget.findChildren(name='box'):
			box.margins = (30, 0) # to get some indentation
			box.padding = 3
		for listbox in self.widget.findChildren(name='translators'):
			listbox.background_color = NOTHING

		self.widget.findChild(name=OkButton.DEFAULT_NAME).capture(self._windows.close)
Esempio n. 10
0
	def __init__(self, windows):
		Window.__init__(self, windows)
		self.visible = False
	def __init__(self, windows):
		Window.__init__(self, windows)
		self.visible = False