示例#1
0
 def __init__(self, dataSection, avatarInputHandler):
     self.__aih = weakref.proxy(avatarInputHandler)
     self.__cam = ArcadeCamera(dataSection['camera'], dataSection.readVector2('defaultOffset'))
     self.__isEnabled = False
     self.__curVehicleID = None
     self._aimingMode = 0
     return
class FalloutDeathMode(IControlMode):
    curVehicleID = property(lambda self: self.__curVehicleID)
    aimingMode = property(lambda self: self._aimingMode)

    def __init__(self, dataSection, avatarInputHandler):
        self.__aih = weakref.proxy(avatarInputHandler)
        self.__aim = aims.createAim('postmortem')
        self.__cam = ArcadeCamera(dataSection['camera'], self.__aim)
        self.__isEnabled = False
        self.__curVehicleID = None
        self._aimingMode = 0
        return

    def create(self):
        self.__aim.create()
        self.__cam.create(_ARCADE_CAM_PIVOT_POS, None, True)
        return

    def destroy(self):
        self.disable()
        self.__aim.destroy()
        self.__cam.destroy()
        self.__cam = None
        return

    def dumpState(self):
        return dumpStateEmpty()

    def getAim(self):
        return self.__aim

    def enable(self, **args):
        SoundGroups.g_instance.changePlayMode(0)
        self.__cam.enable(None, False, args.get('postmortemParams'))
        self.__aim.enable()
        player = BigWorld.player()
        self.__curVehicleID = player.playerVehicleID
        self.__isEnabled = True
        return

    def disable(self):
        self.__isEnabled = False
        self.__aim.disable()
        self.__cam.disable()

    def handleMouseEvent(self, dx, dy, dz):
        raise self.__isEnabled or AssertionError
        GUI.mcursor().position = self.__aim.offset()
        self.__cam.update(dx, dy, clamp(-1.0, 1.0, dz))
        return True
示例#3
0
 def __init__(self, dataSection, avatarInputHandler):
     self.__aih = weakref.proxy(avatarInputHandler)
     self.__aim = aims.createAim('postmortem')
     self.__cam = ArcadeCamera(dataSection['camera'], self.__aim)
     self.__isEnabled = False
     self.__curVehicleID = None
     return
 def __init__(self, dataSection, avatarInputHandler):
     self.__aih = weakref.proxy(avatarInputHandler)
     self.__cam = ArcadeCamera(dataSection['camera'], dataSection.readVector2('defaultOffset'))
     self.__isEnabled = False
     self.__curVehicleID = None
     self._aimingMode = 0
     return
class FalloutDeathMode(IControlMode):
    curVehicleID = property(lambda self: self.__curVehicleID)
    aimingMode = property(lambda self: self._aimingMode)
    __aimOffset = aim_global_binding.bind(
        aim_global_binding.BINDING_ID.AIM_OFFSET)

    def __init__(self, dataSection, avatarInputHandler):
        self.__aih = weakref.proxy(avatarInputHandler)
        self.__cam = ArcadeCamera(dataSection['camera'],
                                  dataSection.readVector2('defaultOffset'))
        self.__isEnabled = False
        self.__curVehicleID = None
        self._aimingMode = 0
        return

    def create(self):
        self.__cam.create(_ARCADE_CAM_PIVOT_POS, None, True)
        return

    def destroy(self):
        self.disable()
        self.__cam.destroy()
        self.__cam = None
        return

    def dumpState(self):
        return dumpStateEmpty()

    def enable(self, **args):
        SoundGroups.g_instance.changePlayMode(0)
        self.__cam.enable(None, False, args.get('postmortemParams'))
        player = BigWorld.player()
        self.__curVehicleID = player.playerVehicleID
        self.__isEnabled = True
        return

    def disable(self):
        self.__isEnabled = False
        self.__cam.disable()

    def handleMouseEvent(self, dx, dy, dz):
        raise self.__isEnabled or AssertionError
        GUI.mcursor().position = self.__aimOffset
        self.__cam.update(dx, dy, clamp(-1.0, 1.0, dz))
        return True
示例#6
0
class FalloutDeathMode(IControlMode):
    curVehicleID = property(lambda self: self.__curVehicleID)

    def __init__(self, dataSection, avatarInputHandler):
        self.__aih = weakref.proxy(avatarInputHandler)
        self.__aim = aims.createAim('postmortem')
        self.__cam = ArcadeCamera(dataSection['camera'], self.__aim)
        self.__isEnabled = False
        self.__curVehicleID = None

    def create(self):
        self.__aim.create()
        self.__cam.create(_ARCADE_CAM_PIVOT_POS, None, True)

    def destroy(self):
        self.disable()
        self.__aim.destroy()
        self.__cam = None

    def dumpState(self):
        return dumpStateEmpty()

    def getAim(self):
        return self.__aim

    def enable(self, **args):
        SoundGroups.g_instance.changePlayMode(0)
        self.__cam.enable(None, False, args.get('postmortemParams'))
        self.__aim.enable()
        player = BigWorld.player()
        self.__curVehicleID = player.playerVehicleID
        self.__cam.vehicleMProv = player.getOwnVehicleMatrix()
        self.__isEnabled = True

    def disable(self):
        self.__isEnabled = False
        self.__aim.disable()
        self.__cam.disable()

    def handleMouseEvent(self, dx, dy, dz):
        assert self.__isEnabled
        GUI.mcursor().position = self.__aim.offset()
        self.__cam.update(dx, dy, clamp(-1.0, 1.0, dz))
        return True
示例#7
0
class RespawnDeathMode(IControlMode):
    curVehicleID = property(lambda self: self.__curVehicleID)
    aimingMode = property(lambda self: self._aimingMode)
    guiSessionProvider = dependency.descriptor(IBattleSessionProvider)
    __aimOffset = aih_global_binding.bindRO(
        aih_global_binding.BINDING_ID.AIM_OFFSET)

    def __init__(self, dataSection, avatarInputHandler):
        self.__aih = weakref.proxy(avatarInputHandler)
        self.__cam = ArcadeCamera(dataSection['camera'],
                                  dataSection.readVector2('defaultOffset'))
        self.__isEnabled = False
        self.__curVehicleID = None
        self._aimingMode = 0
        return

    def create(self):
        self.__cam.create(_ARCADE_CAM_PIVOT_POS, None, True)
        return

    def destroy(self):
        self.disable()
        self.__cam.destroy()
        self.__cam = None
        return

    def enable(self, **args):
        SoundGroups.g_instance.changePlayMode(0)
        self.__cam.enable(None, False, args.get('postmortemParams'))
        self.__cam.reinitMatrix()
        player = BigWorld.player()
        self.__curVehicleID = player.playerVehicleID
        ctrl = self.guiSessionProvider.dynamic.respawn
        if hasattr(ctrl, 'showUiAllowed'):
            ctrl.showUiAllowed = True
        self.__isEnabled = True
        return

    def disable(self):
        self.__isEnabled = False
        self.__cam.disable()
        ctrl = self.guiSessionProvider.dynamic.respawn
        if hasattr(ctrl, 'showUiAllowed'):
            ctrl.showUiAllowed = False

    def handleMouseEvent(self, dx, dy, dz):
        raise self.__isEnabled or AssertionError
        GUI.mcursor().position = self.__aimOffset
        self.__cam.update(dx, dy, clamp(-1.0, 1.0, dz))
        return True
示例#8
0
 def __init__(self, dataSection, avatarInputHandler):
     self.__aih = weakref.proxy(avatarInputHandler)
     self.__aim = aims.createAim('postmortem')
     self.__cam = ArcadeCamera(dataSection['camera'], self.__aim)
     self.__isEnabled = False
     self.__curVehicleID = None