Ejemplo n.º 1
0
        public static SongSelectItem SearchSong(string query)
        {
            songSelect = GameObject.FindObjectOfType <SongSelect>();
            SongSelectItem song = null;

            if (songSelect == null)
            {
                return(song);
            }

            songs = songSelect.songSelectItems.mItems;

            for (int i = 0; i < songs.Count; i++)
            {
                SongSelectItem currentSong = songs[i];

                if (currentSong.mSongData.artist.ToLower().Contains(query.ToLower()) ||
                    currentSong.mSongData.title.ToLower().Contains(query.ToLower()) ||
                    currentSong.mSongData.songID.ToLower().Contains(query.ToLower()) ||
                    currentSong.mSongData.artist.ToLower().Replace(" ", "").Contains(query.ToLower()) ||
                    currentSong.mSongData.title.ToLower().Replace(" ", "").Contains(query.ToLower()))
                {
                    song = currentSong;
                    break;
                }
            }

            return(song);
        }
Ejemplo n.º 2
0
            private static void Postfix(SongSelectItem __instance)
            {
                string songID = __instance.mSongData.songID;

                AudicaMod.selectedSong = songID;
                AudicaMod.ResetState();
            }
Ejemplo n.º 3
0
        //Tracking selected song
        public static void OnSelect(SongSelectItem ssi)
        {
            SongSelectItem button = ssi;
            string         songID = button.mSongData.songID;

            selectedSong = songID;
            MelonLogger.Log(songID);
        }
Ejemplo n.º 4
0
        public static void ProcessQueue()
        {
            //MelonLogger.Log(requestQueue.Count.ToString() + " in queue.");

            if (requestQueue.Count != 0)
            {
                for (int i = 0; i < requestQueue.Count; i++)
                {
                    SongSelectItem result = SearchSong(requestQueue[i]);

                    if (result != null)
                    {
                        MelonLogger.Log("Result: " + result.mSongData.songID);
                        MelonLogger.Log(result.mSongData.title);
                        if (!requestList.Contains(result.mSongData.songID))
                        {
                            requestList.Add(result.mSongData.songID);
                        }
                    }
                    else
                    {
                        MelonLogger.Log("Song not found");
                    }
                }
                requestQueue.Clear();
            }

            TextMeshPro buttonText = filterSongRequestsButton.GetComponentInChildren <TextMeshPro>();

            if (requestList.Count == 0)
            {
                if (buttonText.text.Contains("=green>"))
                {
                    buttonText.text = buttonText.text.Replace("=green>", "=red>");
                }
                else
                {
                    buttonText.text = "<color=red>" + buttonText.text + "</color>";
                }
                MelonLogger.Log("Red");
            }
            else
            {
                if (buttonText.text.Contains("=red>"))
                {
                    buttonText.text = buttonText.text.Replace("=red>", "=green>");
                }
                else
                {
                    buttonText.text = "<color=green>" + buttonText.text + "</color>";
                }
                MelonLogger.Log("Green");
            }
        }
Ejemplo n.º 5
0
 private static void Postfix(SongSelectItem __instance)
 {
     SongList.SongData currentSong = SongDataHolder.I.songData;
     AudicaRPC.Presence.state          = currentSong.artist;
     AudicaRPC.Presence.details        = currentSong.title;
     AudicaRPC.Presence.startTimestamp = default(long);
     AudicaRPC.Presence.largeImageKey  = "audica_main";
     AudicaRPC.Presence.largeImageText = "Audica";
     AudicaRPC.Presence.smallImageKey  = "expert";
     AudicaRPC.Presence.smallImageText = "Expert difficulty";
     DiscordRpc.UpdatePresence(AudicaRPC.Presence);
 }
Ejemplo n.º 6
0
    void Start()
    {
        WalletAnim      = WalletWindow.GetComponent <Animator>();
        TransactionAnim = TransactionWindow.GetComponent <Animator>();
        ConfirmAnim     = ConfirmWindow.GetComponent <Animator>();

        BGVideos    = new VideoClip[10];
        BGVideos[0] = Resources.Load <VideoClip>("181208/clock");
        BGVideos[1] = Resources.Load <VideoClip>("181208/fake");
        BGVideos[2] = Resources.Load <VideoClip>("181208/floating");
        BGVideos[3] = Resources.Load <VideoClip>("181208/madeon");
        BGVideos[4] = Resources.Load <VideoClip>("181208/sakura");
        BGVideos[5] = Resources.Load <VideoClip>("181208/taeyeon");
        BGVideos[6] = Resources.Load <VideoClip>("181208/tether");
        BGVideos[7] = Resources.Load <VideoClip>("181208/twice");

        m_txtSongAmount.text = "1/" + DataManager.Instance.m_dicBMS.Count.ToString();

        for (int i = 0; i < 5; i++)
        {
            GameObject newObj = GameObject.Instantiate(Resources.Load("UI/Select/SongPanel"), Vector3.zero, Quaternion.identity) as GameObject;
            newObj.transform.parent        = m_objSongList.transform;
            newObj.transform.localScale    = new Vector3(1, 1, 1);
            newObj.transform.localRotation = Quaternion.identity;

            m_uiSongPanel[i] = newObj.GetComponent <SongSelectItem>();
            m_uiSongPanel[i].m_nCurrentPositionIndex = i;
            m_uiSongPanel[i].m_nCurrentBMSIndex      = i - 2;
            m_uiSongPanel[i].SetTargetPosition(m_vecDestPos[m_uiSongPanel[i].m_nCurrentPositionIndex]);

            m_uiSongPanel[i].UpdateInform();

            if (i == 2)
            {
                m_uiCurrentSongPanel = m_uiSongPanel[i];

                m_uiSongPanel[i].m_animator.SetTrigger("MoveFront");
                //m_uiSelectedPanel.SetSelectedInform(m_uiCurrentSongPanel.cCurrentBMS);
            }
        }

        UpdateInform();

        if (ParticleManager.Instance.SelectState == 1)
        {
            ParticleManager.Instance.SelectState = 0;
            CurrentSceneState = 2;
            StartCoroutine(Coroutine_FadeMain());
        }
    }
Ejemplo n.º 7
0
    public void ScrollNext()
    {
        if (DataManager.Instance.m_dicBMS.Count - 1 <= m_nSelectedIndex)
        {
            return;
        }

        m_uiCurrentSongPanel.m_nCurrentDifficultyIndex = 0;

        foreach (SongSelectItem item in m_uiSongPanel)
        {
            if (item.m_nCurrentPositionIndex == 2)
            {
                item.m_animator.SetTrigger("MoveBack");
            }

            item.m_nCurrentPositionIndex--;

            if (item.m_nCurrentPositionIndex == 2)
            {
                m_uiCurrentSongPanel = item;

                //m_uiSelectedPanel.SetSelectedInform(m_uiCurrentSongPanel.cCurrentBMS);

                item.m_animator.SetTrigger("MoveFront");
            }

            if (item.m_nCurrentPositionIndex < 0)
            {
                item.m_nCurrentPositionIndex = 4;
                item.SetCurrentPosition(m_vecDestPos[item.m_nCurrentPositionIndex]);

                // set bms
                item.m_nCurrentBMSIndex = m_nSelectedIndex + 3;
                item.UpdateInform();
            }

            item.SetTargetPosition(m_vecDestPos[item.m_nCurrentPositionIndex]);
        }

        m_nSelectedIndex += 1;

        m_txtSongAmount.text = (m_nSelectedIndex + 1) + "/" + DataManager.Instance.m_dicBMS.Count.ToString();

        UpdateInform();
    }
Ejemplo n.º 8
0
        //Tracking the song's buttons score display update function
        public static void UpdateScoreDisplays(SongSelectItem item, int score)
        {
            //If the score is zero we don't do anything
            if (score != 0)
            {
                SongSelectItem button = item;

                //Get percentage
                float percentage = GetHighScorePercentage(button.GetSongData().songID);

                //Make pretty-ish strings
                string scoreString      = "<size=" + songListHighScoreSize + ">" + String.Format("{0:n0}", score).Replace(",", " ") + "</size>";
                string percentageString = "<size=" + songListPercentSize + "> (" + String.Format("{0:0.00}", percentage) + "%)</size>";

                //Update button
                button.highScoreLabel.text = scoreString + percentageString;
            }
        }
Ejemplo n.º 9
0
 private static void Postfix(SongSelectItem __instance)
 {
     AudicaMod.selectedSong = __instance.mSongData;
 }
Ejemplo n.º 10
0
 private static void Postfix(SongSelectItem __instance)
 {
     SongRequests.selectedSong = __instance.mSongData;
 }
Ejemplo n.º 11
0
 public static void Postfix(SongSelectItem __instance)
 {
     AudicaHTTPStatus.selectedSongData = __instance.mSongData;
 }
Ejemplo n.º 12
0
 private static void Postfix(SongSelectItem __instance, int score, KataConfig.Difficulty difficulty, float percent, bool fullCombo)
 {
     AudicaMod.UpdateScoreDisplays(__instance, score);
 }
Ejemplo n.º 13
0
 private static void Postfix(SongSelectItem __instance)
 {
     AudicaMod.OnSelect(__instance);
 }
Ejemplo n.º 14
0
 private static void Prefix(SongSelectItem __instance)
 {
     AudicaMod.selectedSong = __instance.mSongData.songID;
 }