Exemple #1
0
        public void Initialize(GameID game)
        {
            this.game = game;

            var rivals = game.AssociatedRivals.ToArray();

            UnityEngine.ColorUtility.TryParseHtmlString(enumHexes[rivals[0]], out var rivalOneColor);
            rivalOneImage.color = rivalOneColor;

            UnityEngine.ColorUtility.TryParseHtmlString(enumHexes[rivals[1]], out var rivalTwoColor);
            rivalTwoImage.color = rivalTwoColor;

            UnityEngine.ColorUtility.TryParseHtmlString(enumHexes[game.Theme], out var themeColor);
            themeImage.color = themeColor;

            var inputs = game.Inputs.Split().ToArray();

            for (var i = 0; i < inputs.Length; i++)
            {
                inputImages[i].gameObject.SetActive(true);
                UnityEngine.ColorUtility.TryParseHtmlString(enumHexes[inputs[i]], out var inputColor);
                inputImages[i].color = inputColor;
            }
            for (var i = inputs.Length; i < inputImages.Length; i++)
            {
                inputImages[i].gameObject.SetActive(false);
            }

            textMesh.text = game.GetLanguageSpecificInfo(Language.English)[0].Remove(0, 4);
        }
Exemple #2
0
        public void Refresh(GameID game)
        {
            currentGame = game;

            canvasGroup.alpha          = 1f;
            canvasGroup.blocksRaycasts = true;

            var gameInfo = game.GetLanguageSpecificInfo(Language.English);

            gameName.text     = gameInfo[0].Remove(0, 4);
            thumbnail.texture = game.Thumbnail.texture;
            thumbnail.SetNativeSize();
            gameDescription.text = gameInfo[1];

            var difficulties = Enum.GetValues(typeof(Difficulty)) as Difficulty[];

            for (var i = 0; i < difficulties.Length; i++)
            {
                stars[i].color = game.GetWinCount(difficulties[i]) > 0 ? enabledColor : disabledColor;
            }
            var playCount = difficulties.Sum(t => game.GetPlayCount(t) > 0 ? 1 : 0);

            bpmSlider.maxValue        = Mathf.Clamp(playCount, 1, 3);
            difficultySlider.maxValue = Mathf.Clamp(playCount, 1, 3);
        }
        public void ShowMenu(GameID nextGame)
        {
            if (currentgame != nextGame)
            {
                difficulty.Value = difficulty.InitialValue;
                speed.Value      = speed.InitialValue;

                if (currentgame != null)
                {
                    toggle.Do();
                }

                currentgame = nextGame;

                icone.sprite  = nextGame.Thumbnail;
                nomDuJeu.text = nextGame.GetLanguageSpecificInfo(Language.English)[0];

                if (nextGame.GetWinCount(Difficulty.Easy) > 0)
                {
                    etoiles[0].gameObject.SetActive(true);
                    difficultyChoice[0].interactable = true;
                }
                else
                {
                    etoiles[0].gameObject.SetActive(false);
                    difficultyChoice[0].interactable = false;
                }

                if (nextGame.GetWinCount(Difficulty.Easy) > 0)
                {
                    etoiles[1].gameObject.SetActive(true);
                    difficultyChoice[1].interactable = true;
                }
                else
                {
                    etoiles[1].gameObject.SetActive(false);
                    difficultyChoice[1].interactable = false;
                }

                if (nextGame.GetWinCount(Difficulty.Hard) > 0)
                {
                    etoiles[2].gameObject.SetActive(true);
                    difficultyChoice[2].interactable = true;
                }
                else
                {
                    etoiles[2].gameObject.SetActive(false);
                    difficultyChoice[2].interactable = false;
                }
            }
        }
Exemple #4
0
        bool ISearchable <TapeSearchArguments> .IsMatch(TapeSearchArguments arguments)
        {
            var info = game.GetLanguageSpecificInfo(Language.English);

            var lowercaseName   = info[0].ToLower().Replace(" ", "");
            var lowercaseSearch = arguments.SearchedContent.ToLower().Replace(" ", "");

            var isContentMatch = lowercaseName.Contains(lowercaseSearch);
            var isRivalMatch   = game.AssociatedRivals.Any(rival => arguments.Rivals.HasFlag(rival)) || arguments.Rivals == Rivals.None;
            var isInputMatch   = game.Inputs.Split().Any(input => arguments.Inputs.HasFlag(input)) || arguments.Inputs == Inputs.None;
            var isThemeMatch   = arguments.Themes.Contains(game.Theme) || arguments.Themes.Length == 0;

            return(isContentMatch && isRivalMatch && isInputMatch && isThemeMatch);
        }
Exemple #5
0
 public void SetGameID(GameID id)
 {
     nameGame.text = id.GetLanguageSpecificInfo(Language.English)[0];
 }