def callback(self, action):
        if hasattr(action, 'letter'):
            setattr(CONFIG.keyboard, action.get_id(), action.get_value())

        if action.text == _('Back'):
            return {'goto': 'back'}

        CONFIG.write()
    def callback(self, action):
        if action.text == 'Music Volume':
            CONFIG.audio.MUSIC_VOLUME = action.get_value()
        if action.text == 'Sound Volume':
            CONFIG.audio.SOUND_VOLUME = action.get_value()
        if action.text == 'Music':
            if CONFIG.audio.MUSIC:
                CONFIG.audio.MUSIC = False
            else:
                CONFIG.audio.MUSIC = True
        if action.text == 'Sound':
            if CONFIG.audio.SOUND:
                CONFIG.audio.SOUND = False
            else:
                CONFIG.audio.SOUND = True
        if action.text == _('Back'):
            return {'goto': 'back'}

        CONFIG.write()
    def callback(self, action):
        if action == self.resolution:
            value = action.get_value()
            CONFIG.general.WIDTH = int(value.split('x')[0])
            CONFIG.general.HEIGHT = int(value.split('x')[1])
        if action == self.fullscreen:
            pygame.display.toggle_fullscreen()
            if CONFIG.display.FULLSCREEN:
                CONFIG.display.FULLSCREEN = False
            else:
                CONFIG.display.FULLSCREEN = True
        if action == self.fps:
            if CONFIG.display.SHOW_FPS:
                CONFIG.display.SHOW_FPS = False
            else:
                CONFIG.display.SHOW_FPS = True
        if action.text == 'zoom_sharpness':
            CONFIG.general.ZOOM_SHARPNESS = (action.get_value()+1)*5
        if action.text == _('Back'):
            return {'goto': 'back'}

        CONFIG.write()
Beispiel #4
0
    def callback(self, action):
        if action == self.resolution:
            value = action.get_value()
            CONFIG.general.WIDTH = int(value.split('x')[0])
            CONFIG.general.HEIGHT = int(value.split('x')[1])
        if action == self.fullscreen:
            pygame.display.toggle_fullscreen()
            if CONFIG.display.FULLSCREEN:
                CONFIG.display.FULLSCREEN = False
            else:
                CONFIG.display.FULLSCREEN = True
        if action == self.fps:
            if CONFIG.display.SHOW_FPS:
                CONFIG.display.SHOW_FPS = False
            else:
                CONFIG.display.SHOW_FPS = True
        if action.text == 'zoom_sharpness':
            CONFIG.general.ZOOM_SHARPNESS = (action.get_value() + 1) * 5
        if action.text == _('Back'):
            return {'goto': 'back'}

        CONFIG.write()