Example #1
0
 def _initialize(self, ctx=None):
     ctx = ctx or {}
     tabId = ctx.get('tabId')
     component = ctx.get('component')
     itemCD = ctx.get('itemCD')
     self.__showBackButton = ctx.get('showBackButton', False)
     if tabId is not None:
         self.__currentTabIdx = _getTabIndex(tabId)
     elif self.__currentTabIdx is None:
         if self.__checkForActiveActions():
             self.__currentTabIdx = _getTabIndex(
                 STORE_CONSTANTS.STORE_ACTIONS)
         else:
             self.__currentTabIdx = _getTabIndex(STORE_CONSTANTS.SHOP)
     if component is not None:
         nation, _, actionsSelected = AccountSettings.getFilter(
             'shop_current')
         AccountSettings.setFilter('shop_current',
                                   (nation, component, actionsSelected))
     if all((itemCD, component, tabId)):
         AccountSettings.setFilter('scroll_to_item', itemCD)
         section = '{}_{}'.format(tabId, component)
         _, component, _ = AccountSettings.getFilter('shop_current')
         defaults = AccountSettings.getFilterDefault(section)
         AccountSettings.setFilter('shop_current', (-1, component, False))
         AccountSettings.setFilter(section, defaults)
     return
Example #2
0
 def _populateAfter(self):
     blueprints = {}
     defaults = AccountSettings.getFilterDefault(GUI_START_BEHAVIOR)
     settings = self.__settingsCore.serverSettings.getSection(GUI_START_BEHAVIOR, defaults)
     if self.__needShowTechTreeIntro(settings):
         if settings[GuiSettingsBehavior.TECHTREE_INTRO_BLUEPRINTS_RECEIVED]:
             blueprints = AccountSettings.getSettings(TECHTREE_INTRO_BLUEPRINTS)
         shared_events.showTechTreeIntro(parent=self.getParentWindow(), blueprints=blueprints)
Example #3
0
 def _onLoaded(self, *args, **kwargs):
     super(TechTreeIntroView, self)._onLoaded(*args, **kwargs)
     Waiting.hide('loadPage')
     defaults = AccountSettings.getFilterDefault(GUI_START_BEHAVIOR)
     settings = self.__settingsCore.serverSettings.getSection(
         GUI_START_BEHAVIOR, defaults)
     settings[GuiSettingsBehavior.TECHTREE_INTRO_SHOWED] = True
     self.__settingsCore.serverSettings.setSectionSettings(
         GUI_START_BEHAVIOR, settings)
Example #4
0
 def atCall(self, cd):
     defaults = AccountSettings.getFilterDefault(GUI_START_BEHAVIOR)
     filters = self.settingsCore.serverSettings.getSection(GUI_START_BEHAVIOR, defaults)
     filters['isFreeXPInfoDialogShowed'] = True
     self.settingsCore.serverSettings.setSectionSettings(GUI_START_BEHAVIOR, filters)
     cd.avoid()
     yield DialogsInterface.showDialog(FreeXPInfoMeta())
     cd.function(*cd._packArgs(), **cd._kwargs)
     self.callback((ExchangeFreeXPToTankmanPointcut, UnlockItemPointcut))
Example #5
0
 def __checkFreeXPConditions(self):
     defaults = AccountSettings.getFilterDefault(GUI_START_BEHAVIOR)
     filters = self.settingsCore.serverSettings.getSection(GUI_START_BEHAVIOR, defaults)
     if filters['isFreeXPInfoDialogShowed']:
         return
     self.__weaver = Weaver()
     if self.__weaver.findPointcut(UnlockItemPointcut) == -1:
         self.__weaver.weave(pointcut=UnlockItemPointcut, aspects=[ShowXPInfoDialogAspect(self.cleanWeave)])
     if self.__weaver.findPointcut(ExchangeFreeXPToTankmanPointcut) == -1:
         self.__weaver.weave(pointcut=ExchangeFreeXPToTankmanPointcut, aspects=[ShowXPInfoDialogAspect(self.cleanWeave)])
Example #6
0
 def __tryShowWelcomeUnlockMsg(self):
     if not self.isEnabled():
         return
     else:
         defaults = AccountSettings.getFilterDefault(GUI_START_BEHAVIOR)
         settings = self.__settingsCore.serverSettings.getSection(
             GUI_START_BEHAVIOR, defaults)
         if not settings[GuiSettingsBehavior.
                         VEH_POST_PROGRESSION_UNLOCK_MSG_NEED_SHOW]:
             return
         criteria = REQ_CRITERIA.INVENTORY | REQ_CRITERIA.VEHICLE.ELITE
         suitVehs = self.__itemsCache.items.getVehicles(criteria=criteria)
         progressionSettings = self.__postProgressionSettings
         if findFirst(
                 lambda v: self.isExistsFor(v.typeDescr,
                                            progressionSettings),
                 suitVehs.itervalues()) is not None:
             showWelcomeUnlockMsg()
         settings[GuiSettingsBehavior.
                  VEH_POST_PROGRESSION_UNLOCK_MSG_NEED_SHOW] = False
         self.__settingsCore.serverSettings.setSectionSettings(
             GUI_START_BEHAVIOR, settings)
         return
def setIntroShown():
    settingsCore = dependency.instance(ISettingsCore)
    defaults = AccountSettings.getFilterDefault(GUI_START_BEHAVIOR)
    settings = settingsCore.serverSettings.getSection(GUI_START_BEHAVIOR, defaults)
    settings[GuiSettingsBehavior.RESOURCE_WELL_INTRO_SHOWN] = True
    settingsCore.serverSettings.setSectionSettings(GUI_START_BEHAVIOR, settings)
def isIntroShown():
    settingsCore = dependency.instance(ISettingsCore)
    defaults = AccountSettings.getFilterDefault(GUI_START_BEHAVIOR)
    settings = settingsCore.serverSettings.getSection(GUI_START_BEHAVIOR, defaults)
    return settings.get(GuiSettingsBehavior.RESOURCE_WELL_INTRO_SHOWN, False)
Example #9
0
 def __getFilters(self):
     defaults = AccountSettings.getFilterDefault(GUI_START_BEHAVIOR)
     return self.settingsCore.serverSettings.getSection(
         GUI_START_BEHAVIOR, defaults)