Пример #1
0
 def _populate(self):
     battle_selector_items.create()
     super(LobbyHeader, self)._populate()
     self.app.containerManager.onViewAddedToContainer += self.__onViewAddedToContainer
     game_control.g_instance.wallet.onWalletStatusChanged += self.__onWalletChanged
     game_control.g_instance.gameSession.onPremiumNotify += self.__onPremiumTimeChanged
     g_currentVehicle.onChanged += self.__onVehicleChanged
     g_eventsCache.onSyncCompleted += self.__onEventsCacheResync
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE, self.__handleFightButtonUpdated, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.CoolDownEvent.PREBATTLE, self.__handleSetPrebattleCoolDown, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.BubbleTooltipEvent.SHOW, self.__showBubbleTooltip, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.CloseWindowEvent.GOLD_FISH_CLOSED, self.__onGoldFishWindowClosed, scope=EVENT_BUS_SCOPE.LOBBY)
     g_clientUpdateManager.addCallbacks({'stats.credits': self.__setCredits,
      'stats.gold': self.__setGold,
      'stats.freeXP': self.__setFreeXP,
      'stats.clanInfo': self.__setClanInfo,
      'goodies': self.__updateGoodies,
      'account.premiumExpiryTime': self.__onPremiumExpireTimeChanged,
      'cache.SPA': self.__onSPAUpdated})
     self.as_setFightButtonS(i18n.makeString('#menu:headerButtons/battle'))
     self.as_setWalletStatusS(game_control.g_instance.wallet.componentsStatuses)
     self.updateAccountInfo()
     self.startGlobalListening()
     self.__updateServerName()
     if not isTimeToShowGoldFishPromo():
         enabledVal = isGoldFishActionActive()
         tooltip = TOOLTIPS.HEADER_REFILL_ACTION if enabledVal else TOOLTIPS.HEADER_REFILL
         self.as_setGoldFishEnabledS(enabledVal, False, tooltip, TOOLTIP_TYPES.COMPLEX)
     Waiting.hide('enter')
Пример #2
0
 def _populate(self):
     battle_selector_items.create()
     super(LobbyHeader, self)._populate()
     self.app.containerManager.onViewAddedToContainer += self.__onViewAddedToContainer
     game_control.g_instance.wallet.onWalletStatusChanged += self.__onWalletChanged
     game_control.g_instance.gameSession.onPremiumNotify += self.__onPremiumTimeChanged
     g_currentVehicle.onChanged += self.__onVehicleChanged
     g_eventsCache.onSyncCompleted += self.__onEventsCacheResync
     g_itemsCache.onSyncCompleted += self.__onItemsChanged
     self.__falloutCtrl = getFalloutCtrl()
     self.__falloutCtrl.onVehiclesChanged += self.__updateFalloutSettings
     self.__falloutCtrl.onSettingsChanged += self.__updateFalloutSettings
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE, self.__handleFightButtonUpdated, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.CoolDownEvent.PREBATTLE, self.__handleSetPrebattleCoolDown, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.BubbleTooltipEvent.SHOW, self.__showBubbleTooltip, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.CloseWindowEvent.GOLD_FISH_CLOSED, self.__onGoldFishWindowClosed, scope=EVENT_BUS_SCOPE.LOBBY)
     g_clientUpdateManager.addCallbacks({'stats.credits': self.__setCredits,
      'stats.gold': self.__setGold,
      'stats.freeXP': self.__setFreeXP,
      'stats.clanInfo': self.__setClanInfo,
      'goodies': self.__updateGoodies,
      'account.premiumExpiryTime': self.__onPremiumExpireTimeChanged,
      'cache.SPA': self.__onSPAUpdated})
     self.as_setFightButtonS(i18n.makeString('#menu:headerButtons/battle'))
     self.as_setWalletStatusS(game_control.g_instance.wallet.componentsStatuses)
     self.updateAccountInfo()
     self.startGlobalListening()
     self.__updateServerName()
     if not isTimeToShowGoldFishPromo():
         enabledVal = isGoldFishActionActive()
         tooltip = TOOLTIPS.HEADER_REFILL_ACTION if enabledVal else TOOLTIPS.HEADER_REFILL
         self.as_setGoldFishEnabledS(enabledVal, False, tooltip, TOOLTIP_TYPES.COMPLEX)
     Waiting.hide('enter')
Пример #3
0
 def _populate(self):
     self.__updateHangarMenuData()
     battle_selector_items.create()
     super(LobbyHeader, self)._populate()
     self.startGlobalListening()
     self.app.containerManager.onViewAddedToContainer += self.__onViewAddedToContainer
     game_control.g_instance.wallet.onWalletStatusChanged += self.__onWalletChanged
     game_control.g_instance.gameSession.onPremiumNotify += self.__onPremiumTimeChanged
     game_control.g_instance.igr.onIgrTypeChanged += self.__onIGRChanged
     g_lobbyContext.getServerSettings().onServerSettingsChange += self.__onServerSettingChanged
     g_currentVehicle.onChanged += self.__onVehicleChanged
     g_currentPreviewVehicle.onChanged += self.__onVehicleChanged
     g_eventsCache.onSyncCompleted += self.__onEventsCacheResync
     g_itemsCache.onSyncCompleted += self.__onItemsChanged
     game_control.g_instance.boosters.onBoosterChangeNotify += self.__onUpdateGoodies
     self.__falloutCtrl = getFalloutCtrl()
     self.__falloutCtrl.onVehiclesChanged += self.__updateFalloutSettings
     self.__falloutCtrl.onSettingsChanged += self.__updateFalloutSettings
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE, self.__handleFightButtonUpdated, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.CoolDownEvent.PREBATTLE, self.__handleSetPrebattleCoolDown, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.BubbleTooltipEvent.SHOW, self.__showBubbleTooltip, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.CloseWindowEvent.GOLD_FISH_CLOSED, self.__onGoldFishWindowClosed, scope=EVENT_BUS_SCOPE.LOBBY)
     g_clientUpdateManager.addCallbacks({'stats.credits': self.__setCredits,
      'stats.gold': self.__setGold,
      'stats.freeXP': self.__setFreeXP,
      'stats.clanInfo': self.__setClanInfo,
      'goodies': self.__updateGoodies,
      'account.premiumExpiryTime': self.__onPremiumExpireTimeChanged,
      'cache.SPA': self.__onSPAUpdated})
     self.as_setFightButtonS(i18n.makeString('#menu:headerButtons/battle'))
     self.as_setWalletStatusS(game_control.g_instance.wallet.componentsStatuses)
     self.as_setPremShopDataS(RES_ICONS.MAPS_ICONS_LOBBY_ICON_PREMSHOP, MENU.HEADERBUTTONS_BTNLABEL_PREMSHOP, TOOLTIPS.HEADER_PREMSHOP, TOOLTIP_TYPES.COMPLEX)
     self.as_initOnlineCounterS(constants.IS_SHOW_SERVER_STATS)
     if constants.IS_SHOW_SERVER_STATS:
         game_control.g_instance.serverStats.onStatsReceived += self.__onStatsReceived
         self.__onStatsReceived()
     self.updateAccountInfo()
     self.__updateServerData()
     if not isTimeToShowGoldFishPromo():
         enabledVal = isGoldFishActionActive()
         tooltip = TOOLTIPS.HEADER_REFILL_ACTION if enabledVal else TOOLTIPS.HEADER_REFILL
         self.as_setGoldFishEnabledS(enabledVal, False, tooltip, TOOLTIP_TYPES.COMPLEX)
     g_preDefinedHosts.onPingPerformed += self.__onPingPerformed
     g_preDefinedHosts.requestPing()
     g_settingsCore.onSettingsChanged += self.__onSettingsChanged
     encyclopediaController = game_control.getEncyclopediaController()
     encyclopediaController.onNewRecommendationReceived += self.__onNewEncyclopediaRecommendation
     encyclopediaController.onStateChanged += self.__updateHangarMenuData
     Waiting.hide('enter')
Пример #4
0
 def _showAward(self, ctx):
     if isGoldFishActionActive() and isTimeToShowGoldFishPromo():
         g_eventBus.handleEvent(events.LoadViewEvent(VIEW_ALIAS.GOLD_FISH_WINDOW))
Пример #5
0
 def _populate(self):
     self.__updateHangarMenuData()
     battle_selector_items.create()
     super(LobbyHeader, self)._populate()
     self.startGlobalListening()
     self.app.containerManager.onViewAddedToContainer += self.__onViewAddedToContainer
     self.wallet.onWalletStatusChanged += self.__onWalletChanged
     self.gameSession.onPremiumNotify += self.__onPremiumTimeChanged
     self.igrCtrl.onIgrTypeChanged += self.__onIGRChanged
     g_lobbyContext.getServerSettings(
     ).onServerSettingsChange += self.__onServerSettingChanged
     g_currentVehicle.onChanged += self.__onVehicleChanged
     g_currentPreviewVehicle.onChanged += self.__onVehicleChanged
     self.eventsCache.onSyncCompleted += self.__onEventsCacheResync
     g_itemsCache.onSyncCompleted += self.__onItemsChanged
     self.boosters.onBoosterChangeNotify += self.__onUpdateGoodies
     self.falloutCtrl.onVehiclesChanged += self.__updateFalloutSettings
     self.falloutCtrl.onSettingsChanged += self.__updateFalloutSettings
     self.addListener(events.FightButtonEvent.FIGHT_BUTTON_UPDATE,
                      self.__handleFightButtonUpdated,
                      scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.CoolDownEvent.PREBATTLE,
                      self.__handleSetPrebattleCoolDown,
                      scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.BubbleTooltipEvent.SHOW,
                      self.__showBubbleTooltip,
                      scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.CloseWindowEvent.GOLD_FISH_CLOSED,
                      self.__onGoldFishWindowClosed,
                      scope=EVENT_BUS_SCOPE.LOBBY)
     g_clientUpdateManager.addCallbacks({
         'stats.credits': self.__setCredits,
         'stats.gold': self.__setGold,
         'stats.freeXP': self.__setFreeXP,
         'stats.clanInfo': self.__setClanInfo,
         'goodies': self.__updateGoodies,
         'account.premiumExpiryTime': self.__onPremiumExpireTimeChanged,
         'cache.SPA': self.__onSPAUpdated
     })
     self.as_setFightButtonS(i18n.makeString('#menu:headerButtons/battle'))
     self.as_setWalletStatusS(self.wallet.componentsStatuses)
     self.as_setPremShopDataS(RES_ICONS.MAPS_ICONS_LOBBY_ICON_PREMSHOP,
                              MENU.HEADERBUTTONS_BTNLABEL_PREMSHOP,
                              TOOLTIPS.HEADER_PREMSHOP,
                              TOOLTIP_TYPES.COMPLEX)
     self.as_initOnlineCounterS(constants.IS_SHOW_SERVER_STATS)
     if constants.IS_SHOW_SERVER_STATS:
         self.serverStats.onStatsReceived += self.__onStatsReceived
         self.__onStatsReceived()
     self.updateAccountInfo()
     self.__updateServerData()
     if not isTimeToShowGoldFishPromo():
         enabledVal = isGoldFishActionActive()
         tooltip = TOOLTIPS.HEADER_REFILL_ACTION if enabledVal else TOOLTIPS.HEADER_REFILL
         self.as_setGoldFishEnabledS(enabledVal, False, tooltip,
                                     TOOLTIP_TYPES.COMPLEX)
     g_preDefinedHosts.onPingPerformed += self.__onPingPerformed
     g_preDefinedHosts.requestPing()
     self.settingsCore.onSettingsChanged += self.__onSettingsChanged
     self.encyclopedia.onNewRecommendationReceived += self.__onNewEncyclopediaRecommendation
     self.encyclopedia.onStateChanged += self.__updateHangarMenuData
     Waiting.hide('enter')
Пример #6
0
 def _showAward(self, ctx):
     if isGoldFishActionActive() and isTimeToShowGoldFishPromo():
         g_eventBus.handleEvent(events.LoadViewEvent(
             VIEW_ALIAS.GOLD_FISH_WINDOW),
                                scope=EVENT_BUS_SCOPE.LOBBY)