private void Start() { Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "06", "welcome"); PenguinName.text = Service.Get <SessionManager>().LocalUser.RegistrationProfile.DisplayName; CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); if (!(SceneManager.GetActiveScene().name == "Boot")) { avatarRenderer = GetComponentInChildren <AvatarRenderTextureComponent>(); DataEntityHandle localPlayerHandle = cPDataEntityCollection.LocalPlayerHandle; AvatarAnimationFrame avatarFrame = new AvatarAnimationFrame("Base Layer.Interactions.PassPortPoses_CelebrateAnimation", 0f); if (cPDataEntityCollection.TryGetComponent(localPlayerHandle, out AvatarDetailsData component)) { avatarRenderer.RenderAvatar(component, avatarFrame); } else { avatarRenderer.RenderAvatar(new DCustomEquipment[0], avatarFrame); } } AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData(); accountFlowData.SkipWelcome = true; StartCoroutine(AutoTransition()); }
private void Start() { Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().MembershipFunnelName, "05", "membership_thanks"); membershipController = GetComponentInParent <MembershipController>(); if (MonoSingleton <NativeAccessibilityManager> .Instance.AccessibilityLevel == NativeAccessibilityLevel.VOICE) { string tokenTranslation = Service.Get <Localizer>().GetTokenTranslation("Accessibility.Popup.Title.MembershipThanks"); MonoSingleton <NativeAccessibilityManager> .Instance.Native.Speak(tokenTranslation); } CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); DataEntityHandle localPlayerHandle = cPDataEntityCollection.LocalPlayerHandle; if (!(SceneManager.GetActiveScene().name == "Boot")) { avatarRenderer = GetComponentInChildren <AvatarRenderTextureComponent>(); if (cPDataEntityCollection.TryGetComponent <AvatarDetailsData>(localPlayerHandle, out var component)) { avatarRenderer.RenderAvatar(component); } else { avatarRenderer.RenderAvatar(new DCustomEquipment[0]); } } }
private void Awake() { defaultHeaderText = HeaderText.text; eventBus = new EventChannel(CatalogContext.EventBus); eventBus.AddListener <CatalogUIEvents.ShowItemsForThemeEvent>(onCatalogChallengeSelected); eventBus.AddListener <CatalogUIEvents.InvokeBackButtonClick>(onInvokeBackButtonClick); avatarRenderTextureComponent = StatsButton.GetComponent <AvatarRenderTextureComponent>(); getLocalPlayerData(); }
private void Start() { membershipController = GetComponentInParent <MembershipController>(); membershipController.OnPurchaseRetried += onPurchaseRetried; backgroundButtons = GetComponentInParent <BackgroundButtonsController>(); showCarrierBilling = membershipController.IsCarrierBillingAvailable(); string message = showCarrierBilling ? "with_carrier_billing_info" : "regular"; Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().MembershipFunnelName, "03", "membership_terms", message); PenguinName.text = Service.Get <SessionManager>().LocalUser.RegistrationProfile.DisplayName; CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); DataEntityHandle localPlayerHandle = cPDataEntityCollection.LocalPlayerHandle; if (!(SceneManager.GetActiveScene().name == "Boot")) { avatarRenderer = GetComponentInChildren <AvatarRenderTextureComponent>(); AvatarAnimationFrame avatarFrame = new AvatarAnimationFrame("Base Layer.Interactions.PassPortPoses_CelebrateAnimation", 0f); if (cPDataEntityCollection.TryGetComponent(localPlayerHandle, out AvatarDetailsData component)) { avatarRenderer.RenderAvatar(component, avatarFrame); } else { avatarRenderer.RenderAvatar(new DCustomEquipment[0], avatarFrame); } } bool hasTrialAvailable = true; MembershipData component3 = default(MembershipData); if (cPDataEntityCollection.TryGetComponent(localPlayerHandle, out ProfileData component2) && cPDataEntityCollection.TryGetComponent(localPlayerHandle, out component3)) { if (component2.IsFirstTimePlayer || SceneManager.GetActiveScene().name != Service.Get <GameStateController>().SceneConfig.HomeSceneName) { ChangePenguinContainer.SetActive(value: false); } else { ChangePenguinContainer.SetActive(value: true); } hasTrialAvailable = component3.MembershipTrialAvailable; } membershipController.OnProductsReady += onProductsReady; membershipController.GetProduct(hasTrialAvailable); if (MonoSingleton <NativeAccessibilityManager> .Instance.AccessibilityLevel == NativeAccessibilityLevel.VOICE) { string tokenTranslation = Service.Get <Localizer>().GetTokenTranslation("Accessibility.Popup.Title.MembershipTerms"); MonoSingleton <NativeAccessibilityManager> .Instance.Native.Speak(tokenTranslation); } }
private void Start() { Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "05", "display_name"); createController = GetComponentInParent <AbstractCreateController>(); createController.OnUpdateDisplayNameError += OnUpdateDisplayNameError; referAFriendEnabled = true; if (Service.Get <SessionManager>().LocalUser != null && (Service.Get <SessionManager>().LocalUser.RegistrationProfile.DisplayNameProposedStatus == DisplayNameProposedStatus.Rejected || (Service.Get <SessionManager>().LocalUser.RegistrationProfile.DisplayNameProposedStatus == DisplayNameProposedStatus.Pending && Service.Get <SessionManager>().LocalUser.RegistrationProfile.ProposedDisplayName.StartsWith("DNAME-REJ-")))) { Instructions.text = Service.Get <Localizer>().GetTokenTranslation("Account.DisplayName.DisplayNameRejected"); referAFriendEnabled = false; } if (ReferAFriendSection != null) { ReferAFriendSection.SetActive(referAFriendEnabled); } else { referAFriendEnabled = false; } setDisplayNameValid = false; AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData(); SessionManager sessionManager = Service.Get <SessionManager>(); if (!string.IsNullOrEmpty(sessionManager.LocalUser.RegistrationProfile.Username) && accountFlowData.PreValidatedDisplayNames.Contains(sessionManager.LocalUser.RegistrationProfile.Username)) { DisplayNameInputField.TextInput.text = sessionManager.LocalUser.RegistrationProfile.Username; DisplayNameInputField.HasError = false; DisplayNameInputField.IsValidationComplete = true; setDisplayNameValid = true; } AvatarRenderTextureComponent componentInChildren = GetComponentInChildren <AvatarRenderTextureComponent>(); CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); DataEntityHandle localPlayerHandle = cPDataEntityCollection.LocalPlayerHandle; AvatarDetailsData component = default(AvatarDetailsData); if (!localPlayerHandle.IsNull && cPDataEntityCollection.TryGetComponent(localPlayerHandle, out component)) { componentInChildren.RenderAvatar(component); } else { componentInChildren.RenderAvatar(new DCustomEquipment[0]); } }
private void Start() { avatarRenderTextureComponent = GetComponent <AvatarRenderTextureComponent>(); CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); DataEntityHandle localPlayerHandle = cPDataEntityCollection.LocalPlayerHandle; if (!localPlayerHandle.IsNull) { if (cPDataEntityCollection.TryGetComponent(localPlayerHandle, out AvatarDetailsData component)) { avatarRenderTextureComponent.RenderAvatar(component); return; } avatarRenderTextureComponent.RenderAvatar(new DCustomEquipment[0]); Log.LogError(this, "Local player handle did not have avatar details data"); } else { Log.LogError(this, "Local player handle was null"); } }
private void Start() { Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().AccountFunnelName, "16", "restore_membership_success"); ModalBackground component = GetComponent <ModalBackground>(); component.enabled = true; PenguinName.text = string.Format(PenguinName.text, Service.Get <SessionManager>().LocalUser.RegistrationProfile.DisplayName); if (!(SceneManager.GetActiveScene().name == "Boot")) { avatarRenderer = GetComponentInChildren <AvatarRenderTextureComponent>(); CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); DataEntityHandle localPlayerHandle = cPDataEntityCollection.LocalPlayerHandle; AvatarAnimationFrame avatarFrame = new AvatarAnimationFrame("Base Layer.Interactions.PassPortPoses_CelebrateAnimation", 0f); if (cPDataEntityCollection.TryGetComponent <AvatarDetailsData>(localPlayerHandle, out var component2)) { avatarRenderer.RenderAvatar(component2, avatarFrame); } else { avatarRenderer.RenderAvatar(new DCustomEquipment[0], avatarFrame); } } }
public override void Start() { RememberMeService rememberMeService = Service.Get <RememberMeService>(); rememberedData = rememberMeService.GetRememberMeData(); if (rememberedData.AccountData == null) { string text = rememberMeService.CurrentUsername; if (string.IsNullOrEmpty(text)) { text = rememberMeService.Usernames[0]; } rememberedData.AccountData = rememberMeService.LoadAccountData(text); } string username = rememberedData.AccountData.Username; SoftLoginSelector.IsOn = (username == rememberMeService.CurrentUsername && PlatformUtils.GetPlatformType() != PlatformType.Mobile); showGeneralError(rememberedData.GeneralErrorMessage); rememberedData.GeneralErrorMessage = string.Empty; setPasswordValid = false; PasswordField.TextInput.text = rememberedData.AccountData.Password; RememberPassword.isOn = !string.IsNullOrEmpty(PasswordField.TextInput.text); if (!string.IsNullOrEmpty(PasswordField.TextInput.text)) { PasswordField.HasError = false; PasswordField.IsValidationComplete = true; setPasswordValid = true; } AvatarRenderTextureComponent componentInChildren = GetComponentInChildren <AvatarRenderTextureComponent>(); if (componentInChildren != null) { componentInChildren.RenderAvatar(rememberedData.AccountData.Outfit, rememberedData.AccountData.BodyColor); } if (DisplayName != null) { DisplayName.text = rememberedData.AccountData.DisplayName; } if (MembershipSelector != null) { int index = 0; switch (rememberedData.AccountData.MembershipType) { case MembershipType.Member: index = 1; break; case MembershipType.None: case MembershipType.AllAccessEventMember: { AllAccessService allAccessService = Service.Get <AllAccessService>(); if (allAccessService.IsAllAccessActive() && AllAccessHelper.HasSeenAllAccessFlow(allAccessService.GetAllAccessEventKey(), rememberedData.AccountData.DisplayName)) { index = 2; } break; } } MembershipSelector.SelectSprite(index); } bool isBanned = false; if (rememberedData.AccountData.Banned.HasValue) { DateTime?expirationDate = rememberedData.AccountData.Banned.Value.ExpirationDate; if (!expirationDate.HasValue) { isBanned = true; } else if ((rememberedData.AccountData.Banned.Value.ExpirationDate - DateTime.Now).Value.TotalHours >= 0.0) { isBanned = true; } } updateBannedState(isBanned); base.Start(); }
private void Awake() { renderTextureComponent = GetComponent <AvatarRenderTextureComponent>(); }