private bool onEndGameResults(TubeRaceEvents.EndGameResultsReceived evt)
 {
     if (evt.PlayerIdToPlacement.Count > 1 && base.transform.GetSiblingIndex() <= (int)MaxPlacementForTrophy)
     {
         TrophySelector.Select(base.transform.GetSiblingIndex() + 1);
         TrophyGameObject.SetActive(value: true);
     }
     return(false);
 }
        private void onSpinDataAdded(DailySpinEntityData spinData)
        {
            for (int i = 0; i < widgetData.ChestDefinitions.Count; i++)
            {
                if (widgetData.ChestDefinitions[i].ChestId == spinData.CurrentChestId)
                {
                    currentChestDefinition = widgetData.ChestDefinitions[i];
                    break;
                }
            }
            ChestSpriteSelector.Select(currentChestDefinition.ChestId);
            ChestLevelNameText.text = localizer.GetTokenTranslation(currentChestDefinition.ChestNameToken);
            if (currentChestDefinition.NumChestsToNextLevel == -1)
            {
                ChestLevelValueText.gameObject.SetActive(value: false);
            }
            else
            {
                ChestLevelValueText.text = $" {spinData.NumChestsReceivedOfCurrentChestId + 1}/{currentChestDefinition.NumChestsToNextLevel}";
            }
            TitleText.text = string.Format(localizer.GetTokenTranslation("Cellphone.DailySpin.Unlock"), localizer.GetTokenTranslation(currentChestDefinition.ChestTypeToken));
            int numPunchesPerChest = currentChestDefinition.NumPunchesPerChest;

            SetChestTicks(numPunchesPerChest, spinData.NumPunchesOnCurrentChest);
            DailySpinWheel dailySpinWheel = DailySpinWheel;

            dailySpinWheel.OnSpinComplete = (System.Action)Delegate.Combine(dailySpinWheel.OnSpinComplete, new System.Action(onSpinComplete));
            if (!CheckLastSpinTime(spinData.TimeOfLastSpinInMilliseconds))
            {
                if (showingSpinData != null)
                {
                    SetChestTicks(currentChestDefinition.NumPunchesPerChest, showingSpinData.NumPunchesOnCurrentChest);
                }
                DailySpinWheel.SetOverlayState(DailySpinWheel.WheelOverlayState.Full);
            }
            this.spinData   = spinData;
            showingSpinData = new DailySpinEntityData();
            showingSpinData.CurrentChestId = spinData.CurrentChestId;
            showingSpinData.NumChestsReceivedOfCurrentChestId = spinData.NumChestsReceivedOfCurrentChestId;
            showingSpinData.NumPunchesOnCurrentChest          = spinData.NumPunchesOnCurrentChest;
            showingSpinData.TimeOfLastSpinInMilliseconds      = spinData.TimeOfLastSpinInMilliseconds;
            DailySpinWheel.SetWidgetData(widgetData, currentChestDefinition.ChestId);
        }
        public static bool SetButtonState(DataEntityHandle handle, GameObject buttonGameObject)
        {
            bool           flag  = Service.Get <ZoneTransitionService>().IsInIgloo&& Service.Get <SceneLayoutDataManager>().IsInOwnIgloo();
            ButtonState    index = (flag ? ButtonState.Disabled : ButtonState.Enabled);
            SpriteSelector componentInChildren = buttonGameObject.GetComponentInChildren <SpriteSelector>();

            if (componentInChildren != null)
            {
                componentInChildren.Select((int)index);
            }
            return(flag);
        }
Exemple #4
0
        public void SetReward(CellPhoneDailySpinActivityDefinition.SpinReward spinReward, CellPhoneDailySpinActivityDefinition widgetData, int currentChestId)
        {
            CoinXPContainer.SetActive(value: false);
            ChestContainer.SetActive(value: false);
            RespinContainer.SetActive(value: false);
            ItemRewardId = spinReward.SpinOutcomeId;
            ChestSpriteSelector.Select(currentChestId);
            CoinReward rewardable;

            if (spinReward.Reward != null)
            {
                Reward         reward = spinReward.Reward.ToReward();
                MascotXPReward rewardable2;
                if (reward.TryGetValue <CoinReward>(out rewardable) && rewardable.Coins > 0)
                {
                    ValueText.text = rewardable.Coins.ToString();
                    CoinsXpSpriteSelector.SelectSprite(4);
                }
                else if (reward.TryGetValue <MascotXPReward>(out rewardable2))
                {
                    using (Dictionary <string, int> .Enumerator enumerator = rewardable2.XP.GetEnumerator())
                    {
                        if (enumerator.MoveNext())
                        {
                            KeyValuePair <string, int> current = enumerator.Current;
                            ValueText.text = current.Value.ToString();
                            int index = 0;
                            if (Service.Get <ProgressionService>().IsMascotMaxLevel(current.Key))
                            {
                                index          = 5;
                                ValueText.text = "1";
                            }
                            else
                            {
                                if (current.Key == "AuntArctic")
                                {
                                    index = 0;
                                }
                                if (current.Key == "Rockhopper")
                                {
                                    index = 1;
                                }
                                if (current.Key == "Rookie")
                                {
                                    index = 2;
                                }
                                if (current.Key == "DJCadence")
                                {
                                    index = 3;
                                }
                            }
                            CoinsXpSpriteSelector.SelectSprite(index);
                        }
                    }
                }
                CoinXPContainer.SetActive(value: true);
            }
            else if (spinReward.SpinOutcomeId == widgetData.ChestSpinOutcomeId)
            {
                ChestContainer.SetActive(value: true);
            }
            else if (spinReward.SpinOutcomeId == widgetData.RespinSpinOutcomeId)
            {
                if (widgetData.RespinReward.ToReward().TryGetValue <CoinReward>(out rewardable))
                {
                    RespinValueText.text = rewardable.Coins.ToString();
                }
                RespinContainer.SetActive(value: true);
            }
        }