Пример #1
0
    def set_action(self, mode, action):
        if self.handles(mode, action):
            if isinstance(action, ModeModifier):
                self._recursing = True
                self.builder.get_object("cbInvertGyro").set_active(
                    bool(action.default))
                self._recursing = False
                b = action.order[0]
                action = action.mods[b] or action.default
                self.select_gyro_button(b)
            else:
                self.select_gyro_button(None)

            actions = [action]
            if isinstance(action, MultiAction):
                actions = action.actions

            self._recursing = True
            for a in actions:
                if isinstance(a, GyroAction):
                    pars = ensure_size(3, a.parameters)
                    for i in xrange(0, 3):
                        if pars[i]:
                            self.axes[i] = pars[i]
                            self.cbs[i].set_active(isinstance(
                                a, GyroAbsAction))
            self.update()
            self._recursing = False
Пример #2
0
	def set_action(self, mode, action):
		if self.handles(mode, action):
			if isinstance(action, ModeModifier):
				self._recursing = True
				self.builder.get_object("cbInvertGyro").set_active(bool(action.default))
				self._recursing = False
				b = action.mods.keys()[0]
				action = action.mods[b] or action.default
				self.select_gyro_button(b)
			else:
				self.select_gyro_button(None)
			
			actions = [ action ]
			if isinstance(action, MultiAction):
				actions = action.actions
			
			self._recursing = True
			for a in actions:
				if isinstance(a, GyroAction):
					pars = ensure_size(3, a.parameters)
					for i in xrange(0, 3):
						if pars[i] is not None:
							self.axes[i] = pars[i]
							self.cbs[i].set_active(isinstance(a, GyroAbsAction))
			self.update()
			self._recursing = False
Пример #3
0
	def set_action(self, mode, action):
		if self.handles(mode, action):
			if isinstance(action, ModeModifier):
				b = action.order[0]
				action = action.mods[b]
				self.select_gyro_button(b)
			else:
				self.select_gyro_button(None)
			
			actions = [ action ]
			if isinstance(action, MultiAction):
				actions = action.actions
			
			self._recursing = True
			for a in actions:
				if isinstance(a, GyroAction):
					pars = ensure_size(3, a.parameters)
					for i in xrange(0, 3):
						if pars[i]:
							self.axes[i] = pars[i]
							self.cbs[i].set_active(isinstance(a, GyroAbsAction))
			self.update()
			self._recursing = False
Пример #4
0
	def __init__(self, *actions):
		DPadAction.__init__(self, *actions)
		self.actions = ensure_size(8, actions)
		self.eight = True
Пример #5
0
	def __init__(self, *actions):
		Action.__init__(self, *actions)
		self.actions = ensure_size(4, actions)
		self.eight = False
		self.dpad_state = [ None, None, None ]	# X, Y, 8-Way pad
Пример #6
0
	def __init__(self, *actions):
		DPadAction.__init__(self, *actions)
		self.actions = ensure_size(8, actions)
		self.eight = True
Пример #7
0
	def __init__(self, *actions):
		Action.__init__(self, *actions)
		self.actions = ensure_size(4, actions)
		self.eight = False
		self.dpad_state = [ None, None, None ]	# X, Y, 8-Way pad