def _doFadeAndQuit(self):
		# FIXME: using protected apis
		bsInternal._fadeScreen(False, time=200, endCall=bs.Call(bs.quit, soft=True))
		bsInternal._lockAllInput()
		# unlock and fade back in shortly.. just in case something goes wrong
		# (or on android where quit just backs out of our activity and we may come back)
		bs.realTimer(300, bsInternal._unlockAllInput)
Пример #2
0
 def _add(self):
     bsInternal._lockAllInput()  # make sure no more commands happen
     bs.realTimer(100, bsInternal._unlockAllInput)
     gameconfig = {}
     if config["selected"] == self._selectedGameType.__name__:
         if config["config"]:
             gameconfig = config["config"]
     if "map" in gameconfig:
         gameconfig["settings"]["map"] = gameconfig.pop("map")
     self._selectedGameType.createConfigUI(self._editSession._sessionType, gameconfig, self.onEditGameDone)
	def _add(self):
		bsInternal._lockAllInput() # make sure no more commands happen
		bs.realTimer(100, bsInternal._unlockAllInput)
		gameconfig = {}
		if config["selected"] == self._selectedGameType.__name__:
			if config["config"]:
				gameconfig = config["config"]
		if "map" in gameconfig:
			gameconfig["settings"]["map"] = gameconfig.pop("map")
		self._selectedGameType.createConfigUI(self._editSession._sessionType, gameconfig, self.onEditGameDone)
Пример #4
0
 def __init__(self):
     bs.Session.__init__(self)
     self._locked = False
     # we have a splash screen only on ali currently..
     env = bs.getEnvironment()
     global gFirstRun
     if env['platform'] == 'android' \
        and env['subplatform'] == 'alibaba' \
        and gFirstRun:
         bsInternal._lockAllInput()
         self._locked = True
         self.setActivity(bs.newActivity(SplashScreenActivity))
         gFirstRun = False
     else:
         self.setActivity(bs.newActivity(MainMenuActivity))
Пример #5
0
def startGame(session, fadeout=True):
    def callback():
        if fadeout:
            bsInternal._unlockAllInput()
        try:
            bsInternal._newHostSession(session)
        except Exception:
            import bsMainMenu
            bs.printException("exception running session", session)
            # drop back into a main menu session..
            bsInternal._newHostSession(bsMainMenu.MainMenuSession)

    if fadeout:
        bsInternal._fadeScreen(False, time=250, endCall=callback)
        bsInternal._lockAllInput()
    else:
        callback()
def startGame(session, fadeout=True):
	def callback():
		if fadeout:
			bsInternal._unlockAllInput()
		try:
			bsInternal._newHostSession(session)
		except Exception:
			import bsMainMenu
			bs.printException("exception running session", session)
			# drop back into a main menu session..
			bsInternal._newHostSession(bsMainMenu.MainMenuSession)

	if fadeout:
		bsInternal._fadeScreen(False, time=250, endCall=callback)
		bsInternal._lockAllInput()
	else:
		callback()