Ejemplo n.º 1
0
 def showStartGameVideo(self):
     if isShowStartupVideo():
         self.window.fireEvent(
             ShowViewEvent(
                 ShowViewEvent.SHOW_INTRO_VIDEO,
                 {'resultCallback': lambda *args: self.showLogin()}))
         return True
     return False
Ejemplo n.º 2
0
 def configure(self):
     loading = State(stateID=GameplayStateID.GAME_LOADING,
                     flags=StateFlags.INITIAL | StateFlags.SINGULAR)
     intro = State(stateID=GameplayStateID.INTRO_VIDEO)
     login = State(stateID=GameplayStateID.LOGIN)
     loading.addTransition(ConditionTransition(
         lambda e: helpers.isShowStartupVideo(), invert=False),
                           target=intro)
     loading.addTransition(ConditionTransition(
         lambda e: helpers.isShowStartupVideo(), invert=True),
                           target=login)
     intro.addTransition(StringEventTransition(
         GUIEventID.INTRO_VIDEO_FINISHED),
                         target=login)
     self.addChildState(loading)
     self.addChildState(intro)
     self.addChildState(login)
 def goNext(self, ctx):
     spaceID = ctx.guiSpaceID
     if spaceID == _SPACE_ID.UNDEFINED:
         if _isBattleReplayAutoStart():
             return None
         if isShowStartupVideo():
             ctx.guiSpaceID = _SPACE_ID.INTRO_VIDEO
             return IntroVideoState()
         ctx.guiSpaceID = _SPACE_ID.LOGIN
         return LoginState()
     elif spaceID == _SPACE_ID.LOGIN:
         return LoginState()
     elif spaceID == _SPACE_ID.BATTLE_LOADING:
         return BattleLoadingState(ctx.arenaGuiType)
     else:
         LOG_ERROR('State can not be switched', self, ctx)
         return None
Ejemplo n.º 4
0
 def goNext(self, ctx):
     spaceID = ctx.guiSpace
     if spaceID == _SPACE_ID.UNDEFINED:
         if _isBattleReplayAutoStart():
             return None
         elif isShowStartupVideo():
             ctx.guiSpace = _SPACE_ID.INTRO_VIDEO
             return IntroVideoState()
         else:
             ctx.guiSpace = _SPACE_ID.LOGIN
             return LoginState()
     else:
         if spaceID == _SPACE_ID.LOGIN:
             return LoginState()
         if spaceID in _SPACE_ID.BATTLE_LOADING_IDS:
             return _createBattleLoadingState(spaceID)
         LOG_ERROR('State can not be switched', self, ctx)
Ejemplo n.º 5
0
 def showStartGameVideo(self):
     if isShowStartupVideo():
         self.window.fireEvent(LoadViewEvent(VIEW_ALIAS.INTRO_VIDEO, ctx={'resultCallback': lambda *args: self.showLogin()}))
         return True
     return False
Ejemplo n.º 6
0
 def showStartGameVideo(self):
     if isShowStartupVideo():
         self.window.fireEvent(ShowViewEvent(ShowViewEvent.SHOW_INTRO_VIDEO, {'resultCallback': lambda *args: self.showLogin()}))
         return True
     return False