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
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
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
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
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
def isPatchChanged(self): mainVersion = getClientMainVersion() return mainVersion is not None and AccountSettings.getSettings( LAST_PROMO_PATCH_VERSION) != mainVersion
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
def writeIntroVideoSetting(): userPrefs = Settings.g_instance.userPrefs if userPrefs: import account_shared userPrefs.writeString(Settings.INTRO_VIDEO_VERSION, account_shared.getClientMainVersion())
def isPatchChanged(self): mainVersion = getClientMainVersion() return mainVersion is not None and AccountSettings.getSettings(LAST_PROMO_PATCH_VERSION) != mainVersion