private bool shouldPreventPhoneFromOpening() { CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); DataEntityHandle entityByType = cPDataEntityCollection.GetEntityByType <AllAccessCelebrationData>(); if (!entityByType.IsNull) { AllAccessCelebrationData component = cPDataEntityCollection.GetComponent <AllAccessCelebrationData>(entityByType); if (component.ShowAllAccessCelebration) { return(true); } } return(false); }
private void Start() { gameStateController = Service.Get <GameStateController>(); CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); DataEntityHandle entityByType = cPDataEntityCollection.GetEntityByType <AllAccessCelebrationData>(); if (!entityByType.IsNull) { allAccessCelebrationData = cPDataEntityCollection.GetComponent <AllAccessCelebrationData>(entityByType); if (allAccessCelebrationData.ShowAllAccessCelebration) { showAllAccessCelebration(); } } if (cPDataEntityCollection.TryGetComponent(cPDataEntityCollection.LocalPlayerHandle, out membershipData)) { membershipData.MembershipDataUpdated += onMembershipDataUpdated; } }
private bool showAllAccess() { AllAccessService allAccessService = Service.Get <AllAccessService>(); if (allAccessService.IsAllAccessActive()) { CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); if (cPDataEntityCollection.TryGetComponent(cPDataEntityCollection.LocalPlayerHandle, out DisplayNameData component)) { string allAccessEventKey = allAccessService.GetAllAccessEventKey(); if (!AllAccessHelper.HasSeenAllAccessFlow(allAccessEventKey, component.DisplayName)) { AllAccessHelper.SetHasSeenAllAccessFlow(allAccessEventKey, component.DisplayName); DataEntityHandle handle = cPDataEntityCollection.AddEntity("AllAccessCelebrationData"); AllAccessCelebrationData allAccessCelebrationData = cPDataEntityCollection.AddComponent <AllAccessCelebrationData>(handle); allAccessCelebrationData.ShowAllAccessCelebration = true; return(true); } } } return(false); }