Ejemplo n.º 1
0
    def _populate(self):
        self._startBattleSession()
        super(SharedPage, self)._populate()
        for component in self._external:
            component.setOwner(self.app)

        self.addListener(events.GameEvent.RADIAL_MENU_CMD,
                         self._handleRadialMenuCmd,
                         scope=EVENT_BUS_SCOPE.BATTLE)
        self.addListener(events.GameEvent.FULL_STATS,
                         self._handleToggleFullStats,
                         scope=EVENT_BUS_SCOPE.BATTLE)
        self.addListener(events.GameEvent.TOGGLE_GUI,
                         self._handleGUIToggled,
                         scope=EVENT_BUS_SCOPE.BATTLE)
        self.addListener(events.GameEvent.SHOW_CURSOR,
                         self.__handleShowCursor,
                         scope=EVENT_BUS_SCOPE.GLOBAL)
        self.addListener(events.GameEvent.HIDE_CURSOR,
                         self.__handleHideCursor,
                         scope=EVENT_BUS_SCOPE.GLOBAL)
        self.addListener(events.GameEvent.BATTLE_LOADING,
                         self.__handleBattleLoading, EVENT_BUS_SCOPE.BATTLE)
        self.fireEvent(events.GlobalSpaceEvent(
            events.GlobalSpaceEvent.GO_NEXT))
 def __sendResult(self, isSuccess, msg=''):
     if not isSuccess:
         LOG_ERROR(msg)
     if self.__writeSetting:
         writeIntroVideoSetting()
     self.fireEvent(events.GlobalSpaceEvent(
         events.GlobalSpaceEvent.GO_NEXT))
Ejemplo n.º 3
0
 def __sendResult(self, isSuccess, msg=''):
     """
     Call callback and send result of work
     @param isSuccess: is result of current component working has no errors
     @param msg: described reason of error
     """
     if not isSuccess:
         LOG_ERROR(msg)
     self.fireEvent(events.GlobalSpaceEvent(
         events.GlobalSpaceEvent.GO_NEXT))