コード例 #1
0
ファイル: __init__.py プロジェクト: kusaku/wot_scripts
def writeIntroVideoSetting():
    userPrefs = Settings.g_instance.userPrefs
    if userPrefs is not None:
        import account_shared
        userPrefs.writeString(Settings.INTRO_VIDEO_VERSION,
                              account_shared.getClientMainVersion())
    return
コード例 #2
0
ファイル: PromoController.py プロジェクト: kusaku/wot_scripts
    def _processPromo(self, promo):
        yield lambda callback: callback(True)
        if self.isPatchPromoAvailable() and self.isPatchChanged(
        ) and self.isPromoAutoViewsEnabled() and not self._isPromoShown:
            LOG_DEBUG('Showing patchnote promo:',
                      self.__currentVersionPromoUrl)
            AccountSettings.setSettings(LAST_PROMO_PATCH_VERSION,
                                        getClientMainVersion())
            self.__currentVersionBrowserShown = True
            self._isPromoShown = True
            self._showCurrentVersionPatchPromo(isAsync=True)
            return
        elif not self._isPromoShown and self.__pendingPromo is not None:
            self.__registerAndShowPromoBrowser(*self.__pendingPromo)
            self.__pendingPromo = None
            return
        else:
            actionsPromo = [
                item for item in promo if item.eventType.startswith(
                    gc_constants.PROMO.TEMPLATE.ACTION)
            ]
            for actionPromo in actionsPromo:
                promoUrl = yield self.__urlMacros.parse(actionPromo.data)
                promoTitle = actionPromo.text
                if promoUrl not in self.__promoShown and not self._isPromoShown and promoUrl != self.__currentVersionPromoUrl:
                    LOG_DEBUG('Showing action promo:', promoUrl)
                    self.__promoShown.add(promoUrl)
                    self.__savePromoShown()
                    self._isPromoShown = True
                    yield self.__showPromoBrowser(promoUrl, promoTitle)
                    return

            return
コード例 #3
0
ファイル: helpers__init__.py プロジェクト: aevitas/wotsdk
def isIntroVideoSettingChanged(userPrefs=None):
    userPrefs = userPrefs or Settings.g_instance.userPrefs
    import account_shared

    mainVersion = account_shared.getClientMainVersion()
    lastVideoVersion = userPrefs.readString(Settings.INTRO_VIDEO_VERSION, "")
    return lastVideoVersion != mainVersion
コード例 #4
0
 def _processPromo(self, promo):
     yield lambda callback: callback(True)
     if self.isPatchPromoAvailable() and self.isPatchChanged() and self.isPromoAutoViewsEnabled() and not self._isPromoShown:
         LOG_DEBUG('Showing patchnote promo:', self.__currentVersionPromoUrl)
         AccountSettings.setSettings(LAST_PROMO_PATCH_VERSION, getClientMainVersion())
         self.__currentVersionBrowserShown = True
         self._isPromoShown = True
         self.showCurrentVersionPatchPromo(isAsync=True)
         return
     actionsPromo = [ item for item in promo if item.eventType.startswith(gc_constants.PROMO.TEMPLATE.ACTION) ]
     for actionPromo in actionsPromo:
         promoUrl = yield self.__urlMacros.parse(actionPromo.data)
         promoTitle = actionPromo.text
         if promoUrl not in self.__promoShown and not self._isPromoShown and promoUrl != self.__currentVersionPromoUrl:
             LOG_DEBUG('Showing action promo:', promoUrl)
             self.__promoShown.add(promoUrl)
             self.__savePromoShown()
             self._isPromoShown = True
             yield self.__showPromoBrowser(promoUrl, promoTitle)
             return
コード例 #5
0
ファイル: __init__.py プロジェクト: webiumsk/WOT-0.9.15-CT
def isShowStartupVideo():
    if not BigWorld.wg_isSSE2Supported():
        return False
    else:
        from gui import GUI_SETTINGS
        if not GUI_SETTINGS.guiEnabled:
            return False
        p = Settings.g_instance.userPrefs
        if p is not None:
            if p.readInt(Settings.KEY_SHOW_STARTUP_MOVIE, 1) == 1:
                import account_shared
                mainVersion = account_shared.getClientMainVersion()
                lastVideoVersion = p.readString(Settings.INTRO_VIDEO_VERSION, '')
                if lastVideoVersion != mainVersion:
                    p.writeString(Settings.INTRO_VIDEO_VERSION, mainVersion)
                    return True
                else:
                    return False
            else:
                return False
        else:
            return True
        return
コード例 #6
0
ファイル: PromoController.py プロジェクト: kusaku/wot_scripts
 def isPatchChanged(self):
     mainVersion = getClientMainVersion()
     return mainVersion is not None and AccountSettings.getSettings(
         LAST_PROMO_PATCH_VERSION) != mainVersion
コード例 #7
0
def isIntroVideoSettingChanged(userPrefs=None):
    userPrefs = userPrefs or Settings.g_instance.userPrefs
    import account_shared
    mainVersion = account_shared.getClientMainVersion()
    lastVideoVersion = userPrefs.readString(Settings.INTRO_VIDEO_VERSION, '')
    return lastVideoVersion != mainVersion
コード例 #8
0
ファイル: helpers__init__.py プロジェクト: aevitas/wotsdk
def writeIntroVideoSetting():
    userPrefs = Settings.g_instance.userPrefs
    if userPrefs:
        import account_shared

        userPrefs.writeString(Settings.INTRO_VIDEO_VERSION, account_shared.getClientMainVersion())
コード例 #9
0
 def isPatchChanged(self):
     mainVersion = getClientMainVersion()
     return mainVersion is not None and AccountSettings.getSettings(LAST_PROMO_PATCH_VERSION) != mainVersion