Exemplo n.º 1
0
 private void setToNormalState()
 {
     currentState = ButtonState.Normal;
     SelectedHighlight.SetActive(value: false);
     PreviewButton.interactable = true;
     PreviewButton.gameObject.SetActive(value: true);
     previewButtonTintSelector.SelectColor(0);
     ApplyButton.gameObject.SetActive(value: true);
     PauseButton.gameObject.SetActive(value: false);
     StopButton.gameObject.SetActive(value: false);
 }
 public void SetHighlighted(bool highlighted)
 {
     ActiveOutline.SetActive(highlighted);
     if (isLocalPlayer)
     {
         if (highlighted)
         {
             PlayerNameText.GetComponent <TintSelector>().SelectColor(1);
             BgTintSelector.SelectColor(1);
         }
         else
         {
             PlayerNameText.GetComponent <TintSelector>().SelectColor(0);
             BgTintSelector.SelectColor(0);
         }
     }
 }
 public void UpdatePopulationScale(RoomPopulationScale populationScale)
 {
     this.populationScale = populationScale;
     if (PopulationDisplay != null)
     {
         PopulationDisplay.UpdatePopulationDisplay(populationScale);
     }
     if (nameTint != null)
     {
         if (isWorldFull)
         {
             nameTint.SelectColor(1);
         }
         else
         {
             nameTint.SelectColor(0);
         }
     }
 }
Exemplo n.º 4
0
    public void SetState(MoveIconState state)
    {
        getComponents();
        spriteSelector.SelectSprite((int)state);
        switch (state)
        {
        case MoveIconState.BlankRed:
            tintSelector.SelectColor(0);
            break;

        case MoveIconState.BlankBlue:
            tintSelector.SelectColor(1);
            break;

        default:
            image.color = Color.white;
            break;
        }
    }
    private void Update()
    {
        if (loadingController == null && Service.IsSet <LoadingController>())
        {
            loadingController = Service.Get <LoadingController>();
        }
        float num  = 0f;
        float num2 = 0f;

        num = ((loadingController == null) ? 1f : (loadingController.DownloadProgress.HasValue ? loadingController.DownloadProgress.Value : 1f));
        if (bundleManager == null && Service.IsSet <BundlePrecacheManager>())
        {
            bundleManager = Service.Get <BundlePrecacheManager>();
        }
        num2 = ((bundleManager == null) ? 1f : ((!bundleManager.IsCaching) ? 1f : bundleManager.CompleteRatio));
        num2 = num2 / 2f + num / 2f;
        num2 = Mathf.Lerp(0f, num2, currentTime);
        Vector2 anchoredPosition = fillStripes.anchoredPosition;

        currentTime += Time.deltaTime;
        currentTime %= fillStripesRepeatSeconds;
        float num3 = currentTime / fillStripesRepeatSeconds;
        float num4 = (anchoredPosition.x = num3 * fillStripesParent.rect.width);

        fillStripes.anchoredPosition = anchoredPosition;
        if (num2 >= 1f - Mathf.Epsilon)
        {
            FullProgressCompleted = true;
        }
        else if (FullProgressCompleted)
        {
            setSpecificEmoji();
            FullProgressCompleted = false;
            isPlayingSpinner      = false;
        }
        if (!FullProgressCompleted || !isPlayingSpinner)
        {
            progressBarFillRectTransform.anchorMax = new Vector2(num2, progressBarFillRectTransform.anchorMax.y);
            float x = num2 * progressbarWidth;
            emojiRectTransform.anchoredPosition = new Vector2(x, emojiRectTransform.anchoredPosition.y);
            int  a    = (int)Mathf.Max(0f, (float)tintSelector.Colors.Length * num2);
            uint num5 = (uint)Mathf.Min(a, tintSelector.Colors.Length - 1);
            tintSelector.SelectColor((int)num5);
            if (isGenericProgressBar && SetEmoji == null)
            {
                setEmojiIndex(num5 + 1);
            }
            if (FullProgressCompleted)
            {
                setEmojiIndex(0u);
                isPlayingSpinner = true;
            }
        }
    }
Exemplo n.º 6
0
		private void setSprites(int buttonStateInt)
		{
			if (IsBackgroundVisible && BackgroundSprite != null)
			{
				BackgroundSprite.SelectSprite(buttonStateInt);
			}
			if (IconSprite != null && IconSprite.Sprites != null && IconSprite.Sprites.Length > buttonStateInt)
			{
				IconSprite.SelectSprite(buttonStateInt);
			}
			if (IconTint != null && IconTint.Colors != null && IconTint.Colors.Length > buttonStateInt)
			{
				IconTint.SelectColor(buttonStateInt);
			}
		}
Exemplo n.º 7
0
 public void Setup(Transform popupParent, SavedIgloosMetaData savedIgloosMetaData, bool enableButton)
 {
     this.popupParent = popupParent;
     if (this.savedIgloosMetaData != null)
     {
         this.savedIgloosMetaData.PublishedStatusUpdated -= onPublishedStatusUpdated;
     }
     this.savedIgloosMetaData = savedIgloosMetaData;
     savedIgloosMetaData.PublishedStatusUpdated += onPublishedStatusUpdated;
     onPublishedStatusUpdated(savedIgloosMetaData.IglooVisibility);
     isLoading           = false;
     button.interactable = enableButton;
     if (buttonTintSelector != null)
     {
         int index = (!enableButton) ? 1 : 0;
         buttonTintSelector.SelectColor(index);
     }
 }
		private void setTemplateChosenData()
		{
			string text = string.Format(translatedTitleString, Service.Get<Localizer>().GetTokenTranslation(itemModel.TemplateDefinition.Name));
			templateDescription.text = Service.Get<Localizer>().GetTokenTranslation(itemModel.TemplateDefinition.Description);
			templateImage.sprite = itemModel.TemplateSprite;
			templateTitle.text = text;
			templateCost.text = itemModel.TemplateDefinition.Cost.ToString();
			bool flag = getMyCoinCount() >= itemModel.TemplateDefinition.Cost;
			if (Service.Get<CatalogServiceProxy>().IsCatalogThemeActive())
			{
				templateCost.transform.parent.gameObject.SetActive(value: false);
				flag = true;
			}
			int index = ((!flag) ? 1 : 0);
			tintSelector.SelectColor(index);
			selectButton.SetActive(flag);
			notEnoughCoins.SetActive(!flag);
		}
    private void setMemberViews(bool canEquip)
    {
        int index = (!canEquip) ? 1 : 0;

        memberLockImage.SetActive(!canEquip);
        if (materialSelectors == null)
        {
            materialSelectors = GetComponentsInChildren <MaterialSelector>(includeInactive: true);
        }
        for (int i = 0; i < materialSelectors.Length; i++)
        {
            if (materialSelectors[i] != null)
            {
                materialSelectors[i].SelectMaterial(index);
            }
        }
        glossTintSelector.SelectColor(index);
        IsEquippable = canEquip;
    }
Exemplo n.º 10
0
 public void SetTeamData(PartyGameTeamEndGamePopupData.PartyGameTeamEndGamePopupTeamData teamData)
 {
     TeamNameText.text = Service.Get <Localizer>().GetTokenTranslation(teamData.TeamNameToken);
     if (teamData.IsShowingScore)
     {
         TeamScorePanel.SetActive(value: true);
         TeamScoreText.text = teamData.Score.ToString();
     }
     else if (TeamScorePanel != null)
     {
         TeamScorePanel.SetActive(value: false);
     }
     WinPanel.SetActive(teamData.IsWinningTeam);
     if (teamData.IsLocalPlayersTeam)
     {
         BackgroundTintSelector.SelectColor(teamData.TeamThemeId);
     }
     else
     {
         BackgroundTintSelector.GetComponent <Image>().enabled = false;
     }
     TeamIconSpriteSelector.SelectSprite(teamData.TeamThemeId);
 }
        private void setState(DanceBattleVisualsState newState)
        {
            Screens[(int)currentState].SetActive(value: false);
            if (newState == DanceBattleVisualsState.Off || newState == DanceBattleVisualsState.Lobby || localPlayerIsInGame)
            {
                Screens[(int)newState].SetActive(value: true);
                RemotePenguinScreen.SetActive(value: false);
            }
            else
            {
                RemotePenguinScreen.SetActive(value: true);
            }
            switch (newState)
            {
            case DanceBattleVisualsState.Off:
                startTimerForNextLobbyStart();
                break;

            case DanceBattleVisualsState.Game:
                RedScoreBar.StopBounceAnim();
                BlueScoreBar.StopBounceAnim();
                MoveIconContainer.SetActive(value: true);
                setChatVisible(visible: false);
                if (isFirstTurn)
                {
                    CoroutineRunner.Start(playDanceMusicAfterDelay(DanceMusicStartDelay), this, "");
                    isFirstTurn = false;
                }
                CoroutineRunner.Start(switchStateAfterDelay(currentSequenceSet.SequenceDisplayTimeInSeconds, DanceBattleVisualsState.TurnTimer), this, "DanceBattleTimerWait");
                break;

            case DanceBattleVisualsState.TurnTimer:
            {
                destroyMoveIcons();
                MoveIconInputContainer.SetActive(value: true);
                for (int i = 0; i < currentSequenceSet.SequenceLength; i++)
                {
                    DanceBattleMoveIcon component = UnityEngine.Object.Instantiate(moveIconPrefab, MoveIconInputContainer.transform, worldPositionStays: false).GetComponent <DanceBattleMoveIcon>();
                    component.SetState((localPlayerTeamId != 1) ? DanceBattleMoveIcon.MoveIconState.BlankBlue : DanceBattleMoveIcon.MoveIconState.BlankRed);
                    moveIconList.Add(component);
                }
                dispatcher.DispatchEvent(new DanceBattleEvents.SequenceDisplayEnd(this));
                TurnTimer.StartCountdown(currentSequenceSet.TurnTimeInSeconds);
                CoroutineRunner.Start(switchStateAfterDelay(currentSequenceSet.TurnTimeInSeconds, DanceBattleVisualsState.PerformingMoves), this, "DanceBattleResultsWait");
                break;
            }

            case DanceBattleVisualsState.PerformingMoves:
            {
                destroyMoveIcons();
                setChatVisible(visible: true);
                StageAnimator.SetTrigger("StrobesHigh");
                string parameter = $"High{currentTurnData.RoundNum}";
                EventManager.Instance.PostEvent("MUS/Town/DJCadence/DanceGame", EventAction.SetSwitch, parameter, musicTargetObject);
                dispatcher.DispatchEvent(default(DanceBattleEvents.TurnTimerComplete));
                break;
            }

            case DanceBattleVisualsState.RoundResults:
            {
                StageAnimator.SetTrigger("StrobesLow");
                string trigger = "ResultLow";
                if (lastScoreBlueDelta > lastScoreRedDelta)
                {
                    trigger = "ResultPerfectBlue";
                }
                else if (lastScoreBlueDelta < lastScoreRedDelta)
                {
                    trigger = "ResultPerfectRed";
                }
                else if (lastScoreRedDelta > 0.5f)
                {
                    trigger = "ResultMed";
                }
                StageAnimator.SetTrigger(trigger);
                if (currentTurnData.RoundNum == danceBattleDefinition.NumberOfRounds - 1)
                {
                    CoroutineRunner.Start(switchStateAfterDelay(danceBattleDefinition.TurnStartDelayInSeconds, DanceBattleVisualsState.FinalResults), this, "DanceBattleResultsWait");
                }
                EventManager.Instance.PostEvent("MUS/Town/DJCadence/DanceGame", EventAction.SetSwitch, "Low", musicTargetObject);
                break;
            }

            case DanceBattleVisualsState.FinalResults:
                if (currentScoreData != null)
                {
                    int  num  = ((!(currentScoreData.Team1Score > currentScoreData.Team2Score)) ? 1 : 0);
                    bool flag = currentScoreData.Team1Score == currentScoreData.Team2Score;
                    if (flag)
                    {
                        StageAnimator.SetTrigger("WinTie");
                        WinnerText.text = localizer.GetTokenTranslation("PartyGames.FindFour.Draw");
                        WinnerBG.SelectColor(2);
                        FloorController.SetFloorHighlight(redHighlightOn: true, blueHighlightOn: true);
                        FloorController.SetFloorAnim(redAnimOn: true, blueAnimOn: true);
                    }
                    else if (num == 0)
                    {
                        StageAnimator.SetTrigger("WinBlue");
                        WinnerText.text = localizer.GetTokenTranslation("Activity.DanceBattle.TeamBlueWin");
                        WinnerBG.SelectColor(0);
                        FloorController.SetFloorHighlight(redHighlightOn: false, blueHighlightOn: true);
                        FloorController.SetFloorAnim(redAnimOn: false, blueAnimOn: true);
                    }
                    else
                    {
                        StageAnimator.SetTrigger("WinRed");
                        WinnerText.text = localizer.GetTokenTranslation("Activity.DanceBattle.TeamRedWin");
                        WinnerBG.SelectColor(1);
                        FloorController.SetFloorHighlight(redHighlightOn: true, blueHighlightOn: false);
                        FloorController.SetFloorAnim(redAnimOn: true, blueAnimOn: false);
                    }
                    if (flag || localPlayerTeamId == num)
                    {
                        EventManager.Instance.PostEvent("MUS/Town/DJCadence/DanceGame", EventAction.SetSwitch, "Win", musicTargetObject);
                    }
                    else
                    {
                        EventManager.Instance.PostEvent("MUS/Town/DJCadence/DanceGame", EventAction.SetSwitch, "Lose", musicTargetObject);
                    }
                    dispatcher.DispatchEvent(new DanceBattleEvents.FinalResultsShown(flag, num));
                    if (EndGameParticleSelector != null)
                    {
                        EndGameParticleSelector.SelectGameObject(num);
                    }
                }
                break;
            }
            currentState = newState;
        }
Exemplo n.º 12
0
 private void setTheme(int themeId)
 {
     HeaderTintSelector.SelectColor(themeId);
     BackgroundSpriteSelector.SelectSprite(themeId);
     ParticleSelector.SelectGameObject(themeId);
 }