示例#1
0
 public Pattern()
 {
     patternMetadata       = new PatternMetadata();
     legacyRulesetOverride = new LegacyRulesetOverride();
     bpmEvents             = new List <BpmEvent>();
     timeStops             = new List <TimeStop>();
     notes = new SortedSet <Note>(new NoteComparer());
 }
示例#2
0
    public void OnPatternMetadataChanged()
    {
        PatternMetadata m          = selectedPattern.patternMetadata;
        bool            madeChange = false;

        UIUtils.UpdatePropertyInMemory(ref m.patternName,
                                       patternName.text, ref madeChange);
        UIUtils.UpdatePropertyInMemory(ref m.author,
                                       patternAuthor.text, ref madeChange);
        UIUtils.ClampInputField(patternLevel,
                                Pattern.minLevel, Pattern.maxLevel);
        UIUtils.UpdatePropertyInMemory(ref m.level,
                                       patternLevel.text, ref madeChange);

        // Special handling for control scheme
        if ((int)m.controlScheme != controlScheme.value)
        {
            if (!madeChange)
            {
                EditorContext.PrepareForChange();
                madeChange = true;
            }
            m.controlScheme = (ControlScheme)controlScheme.value;
        }

        UIUtils.UpdatePropertyInMemory(ref m.backingTrack,
                                       patternBackingTrack, ref madeChange);
        UIUtils.UpdatePropertyInMemory(
            ref m.backImage, backgroundImage, ref madeChange);
        UIUtils.UpdatePropertyInMemory(
            ref m.bga, backgroundVideo, ref madeChange);
        UIUtils.UpdatePropertyInMemory(
            ref m.bgaOffset, bgaOffset.text, ref madeChange);

        UIUtils.UpdatePropertyInMemory(
            ref m.firstBeatOffset, firstBeatOffset.text,
            ref madeChange);
        UIUtils.ClampInputField(initialBpm,
                                Pattern.minBpm, Pattern.maxBpm);
        UIUtils.UpdatePropertyInMemory(
            ref m.initBpm, initialBpm.text, ref madeChange);
        UIUtils.ClampInputField(bps, Pattern.minBps, Pattern.maxBps);
        UIUtils.UpdatePropertyInMemory(
            ref m.bps, bps.text, ref madeChange);

        if (madeChange)
        {
            EditorContext.track.SortPatterns();
            EditorContext.DoneWithChange();
            RefreshPatternList();
        }
    }
示例#3
0
    public void Initialize(PatternMetadata p)
    {
        switch (p.controlScheme)
        {
        case ControlScheme.Touch:
            controlIcon.sprite = touchIcon;
            break;

        case ControlScheme.Keys:
            controlIcon.sprite = keysIcon;
            break;

        case ControlScheme.KM:
            controlIcon.sprite = kmIcon;
            break;
        }
        levelText.text = p.level.ToString();
        nameText.text  = p.patternName;
    }
示例#4
0
    private void RefreshPatternMetadata()
    {
        patternMetadata.SetActive(selectedPattern != null);
        patternButtons.SetActive(selectedPattern != null);
        noPatternSelectedNotice.SetActive(selectedPattern == null);
        if (selectedPattern == null)
        {
            return;
        }

        PatternMetadata m = selectedPattern.patternMetadata;

        patternName.SetTextWithoutNotify(m.patternName);
        patternAuthor.SetTextWithoutNotify(m.author);
        controlScheme.SetValueWithoutNotify((int)m.controlScheme);
        patternLevel.SetTextWithoutNotify(m.level.ToString());

        UIUtils.MemoryToDropdown(patternBackingTrack,
                                 m.backingTrack, audioFilesCache);
        UIUtils.MemoryToDropdown(backgroundImage,
                                 m.backImage, imageFilesCache);
        UIUtils.MemoryToDropdown(backgroundVideo,
                                 m.bga, videoFilesCache);
        bgaOffset.SetTextWithoutNotify(m.bgaOffset.ToString());

        firstBeatOffset.SetTextWithoutNotify(m.firstBeatOffset.ToString());
        initialBpm.SetTextWithoutNotify(m.initBpm.ToString());
        bps.SetTextWithoutNotify(m.bps.ToString());

        foreach (TMP_InputField field in new List <TMP_InputField>()
        {
            patternName,
            patternAuthor,
            patternLevel,
            bgaOffset,
            firstBeatOffset,
            initialBpm,
            bps
        })
        {
            field.GetComponent <MaterialTextField>().RefreshMiniLabel();
        }
    }
示例#5
0
    // Start is called before the first frame update
    void Start()
    {
        title.text = Game.score.stageFailed ? "Stage Failed" : "Stage Clear";

        // Track and Pattern
        TrackMetadata track = GameSetup.track.trackMetadata;

        eyecatch.LoadImage(GameSetup.trackFolder, track);
        trackTitle.text  = track.title;
        trackArtist.text = track.artist;

        PatternMetadata pattern = GameSetup.pattern.patternMetadata;

        patternBanner.Initialize(pattern);

        // Tallies
        rainbowMax.text = Game.score.notesPerJudgement
                          [Judgement.RainbowMax].ToString();
        max.text = Game.score.notesPerJudgement
                   [Judgement.Max].ToString();
        cool.text = Game.score.notesPerJudgement
                    [Judgement.Cool].ToString();
        good.text = Game.score.notesPerJudgement
                    [Judgement.Good].ToString();
        miss.text = Game.score.notesPerJudgement
                    [Judgement.Miss].ToString();
        breakText.text = Game.score.notesPerJudgement
                         [Judgement.Break].ToString();
        maxCombo.text   = Game.maxCombo.ToString();
        feverBonus.text = Game.score.totalFeverBonus.ToString();

        int score = Game.score.CurrentScore();

        totalScore.text = score.ToString();

        // Rank
        // The choice of rank is quite arbitrary.
        string rank = "F";

        if (score > 150000)
        {
            rank = "C";
        }
        if (score > 200000)
        {
            rank = "B";
        }
        if (score > 250000)
        {
            rank = "A";
        }
        if (score > 290000)
        {
            rank = "S";
        }
        if (Game.score.stageFailed)
        {
            rank = "F";
        }
        rankText.text = rank;

        // Medals
        newRecordMedal.SetActive(false);
        if (Game.score.notesPerJudgement[Judgement.Miss] == 0 &&
            Game.score.notesPerJudgement[Judgement.Break] == 0)
        {
            // Qualified for performance medal.
            performanceMedal.SetActive(true);
            TextMeshProUGUI medalText = performanceMedal
                                        .GetComponentInChildren <TextMeshProUGUI>();
            if (Game.score.notesPerJudgement[Judgement.Cool] == 0 &&
                Game.score.notesPerJudgement[Judgement.Good] == 0)
            {
                if (score == 300000)
                {
                    medalText.text = "ABSOLUTE PERFECT";
                }
                else
                {
                    medalText.text = "PERFECT PLAY";
                }
            }
            else
            {
                medalText.text = "FULL COMBO";
            }
        }
        else
        {
            performanceMedal.SetActive(false);
        }
    }
示例#6
0
 public Pattern()
 {
     patternMetadata = new PatternMetadata();
     bpmEvents       = new List <BpmEvent>();
     notes           = new SortedSet <Note>(new NoteComparer());
 }