コード例 #1
0
def showBuyOptionalDeviceOverlay(itemId,
                                 source=None,
                                 origin=None,
                                 alias=VIEW_ALIAS.OVERLAY_WEB_STORE,
                                 itemsCache=None):
    item = itemsCache.items.getItemByCD(itemId)
    if item.getBuyPrice().price.isCurrencyDefined(Currency.CRYSTAL):
        showBuyItemWebView(helpers.getBonsDevicesUrl(), itemId, source, origin,
                           alias)
    else:
        showBuyItemWebView(helpers.getBuyOptionalDevicesUrl(), itemId, source,
                           origin, alias)
コード例 #2
0
from gui.impl.gen.view_models.views.lobby.crystals_promo.condition_model import ConditionModel
from gui.impl.gen.view_models.views.lobby.crystals_promo.crystals_promo_view_model import CrystalsPromoViewModel
from gui.impl.pub import ViewImpl
from gui.Scaleform.daapi.settings.views import VIEW_ALIAS
from gui.Scaleform.framework.entities.View import ViewKey
from gui.shared import g_eventBus, events, EVENT_BUS_SCOPE
from gui.impl.gen import R
from account_helpers.AccountSettings import AccountSettings, CRYSTALS_INFO_SHOWN
from helpers import dependency
from skeletons.gui.app_loader import IAppLoader
from skeletons.gui.lobby_context import ILobbyContext
from gui.impl.backport.backport_system_locale import getIntegralFormat
from gui.Scaleform.daapi.view.lobby.store.browser.shop_helpers import getBonsDevicesUrl, getBonsVehiclesUrl, getBonsInstructionsUrl
from gui.shared.event_dispatcher import showShop
shopUrlsMap = {CrystalsPromoViewModel.TANKS_TAB: getBonsVehiclesUrl(),
 CrystalsPromoViewModel.EQUIPMENT_TAB: getBonsDevicesUrl(),
 CrystalsPromoViewModel.INSTRUCTIONS_TAB: getBonsInstructionsUrl()}

class CrystalsPromoView(ViewImpl):
    __slots__ = ('__visibility', '__isMarkerDisabled')
    _lobbyContext = dependency.descriptor(ILobbyContext)
    _appLoader = dependency.descriptor(IAppLoader)

    def __init__(self, layoutID, visibility=HeaderMenuVisibilityState.ALL):
        settings = ViewSettings(layoutID)
        settings.flags = ViewFlags.LOBBY_TOP_SUB_VIEW
        settings.model = CrystalsPromoViewModel()
        super(CrystalsPromoView, self).__init__(settings)
        self.__visibility = visibility
        self.__isMarkerDisabled = False
        app = self._appLoader.getApp(APP_NAME_SPACE.SF_LOBBY)