Ejemplo n.º 1
0
    def _delayedPythonCallUtil(_self, argsList):
        iArg1, iArg2 = argsList
        #print("delayedPythonCall triggerd with %i %i" % (iArg1, iArg2))

        if iArg1 == 1 and iArg2 == 0:

            # To avoid nested redrawing of two threads (leads to CtD)
            # try to win the battle by periodical requests if getMousePos()
            # returns a valid value.
            #(If yes, drawing will not causes an 'unidentifiable C++ exception'
            # in fullscreen mode.)

            iRepeat = 1000  # Milliseconds till next check
            pt = CyInterface().getMousePos()
            #print("Mouse position (%i, %i)" % (int(pt.x), int(pt.y)))

            if pt.x == 0 and pt.y == 0:
                print("(ModUpdaterScreen) Hey, window not ready for drawing."
                      "Wait %s milliseconds..." % (iRepeat, ))
                return iRepeat
            else:
                if not CvScreensInterface.modUpdaterScreen.FIRST_DRAWN:
                    CvScreensInterface.showModUpdaterScreen()

                return 0

        # Unhandled argument combination... Should not be reached.
        return 0
Ejemplo n.º 2
0
    def _delayedPythonCallUtil(_self, argsList):
        iArg1, iArg2 = argsList
        #print("delayedPythonCall triggerd with %i %i" % (iArg1, iArg2))

        if iArg1 == 1 and iArg2 == 0:

            # To avoid nested redrawing of two threads (leads to CtD)
            # try to win the battle by periodical requests if getMousePos()
            # returns a valid value.
            #(If yes, drawing will not causes an 'unidentifiable C++ exception'
            # in fullscreen mode.)

            iRepeat = 1000  # Milliseconds till next check
            pt = CyInterface().getMousePos()
            #print("Mouse position (%i, %i)" % (int(pt.x), int(pt.y)))

            if pt.x == 0 and pt.y == 0:
                print("(ModUpdaterScreen) Hey, window not ready for drawing."
                      "Wait %s milliseconds..." % (iRepeat,))
                return iRepeat
            else:
                if not CvScreensInterface.modUpdaterScreen.FIRST_DRAWN:
                    CvScreensInterface.showModUpdaterScreen()

                return 0

        # Unhandled argument combination... Should not be reached.
        return 0
Ejemplo n.º 3
0
    def _onWindowActivation(self, eventType, argsList):
        'Called when the game window activates or deactivates'
        bActive = argsList[0]

        if not hasattr(CvScreensInterface, "showModUpdaterScreen"):
            CvModUpdaterScreen.integrate()

        # Show ModUpdater screen after Window switch
        if (bActive and
            -1 == CyGame().getActivePlayer() and not CyGame().isPitbossHost()):
            CvScreensInterface.showModUpdaterScreen()
Ejemplo n.º 4
0
	def onWindowActivation(self, argsList):
		'Called when the game window activates or deactivates'
		bActive = argsList[0]

		# Updater Mod
		if not hasattr(CvScreensInterface, "showModUpdaterScreen"):
			CvModUpdaterScreen.integrate()

		# Show ModUpdater screen after Window switch
		if( bActive and
			-1 == CyGame().getActivePlayer() and not CyGame().isPitbossHost()):
			CvScreensInterface.showModUpdaterScreen()