Esempio n. 1
0
    private void change_view_mode(SplitsManager.ViewMode mode)
    {
        System.TimeSpan t;
        switch (mode)
        {
        case SplitsManager.ViewMode.PB:
            _time.text = System.TimeSpan.FromMilliseconds(_model.pb).ToString(@"m\:ss");
            break;

        case SplitsManager.ViewMode.GLOD:
            //_time.text = System.TimeSpan.FromMilliseconds(_model.gold).ToString(@"m\:ss\.ff");
            t          = System.TimeSpan.FromMilliseconds(_model.gold);
            _time.text = string.Format("{0}:{1}.<size=16>{2}", t.Minutes, t.Seconds, t.Milliseconds);
            break;

        case SplitsManager.ViewMode.DURATION:
        case SplitsManager.ViewMode.POSSIBLE_SAVE:
            speedrun.Split i = null;
            foreach (var pb in _model.history)
            {
                if (pb.attempt_index == _model.pb_index)
                {
                    i = pb;
                    break;
                }
            }

            if (mode == SplitsManager.ViewMode.DURATION)
            {
                t          = System.TimeSpan.FromMilliseconds(i.split_duration);
                _time.text = string.Format("{0}:{1}.<size=16>{2}", t.Minutes, t.Seconds, t.Milliseconds);
                //_time.text = System.TimeSpan.FromMilliseconds(i.split_duration).ToString(@"m\:ss");
            }
            else if (mode == SplitsManager.ViewMode.POSSIBLE_SAVE)
            {
                t          = System.TimeSpan.FromMilliseconds(i.split_duration - _model.gold);
                _time.text = string.Format("{0}:{1}.<size=16>{2}", t.Minutes, t.Seconds, t.Milliseconds);
                //_time.text = System.TimeSpan.FromMilliseconds(i.split_duration - _model.gold).ToString(@"m\:ss");
            }
            break;
        }
    }
Esempio n. 2
0
    private void change_view_mode(SplitsManager.ViewMode mode)
    {
        switch (mode)
        {
        case SplitsManager.ViewMode.PB:
            _text.text = "PB";
            break;

        case SplitsManager.ViewMode.GLOD:
            _text.text = "GLOD";
            break;

        case SplitsManager.ViewMode.DURATION:
            _text.text = "PBD";
            break;

        case SplitsManager.ViewMode.POSSIBLE_SAVE:
            _text.text = "SAVE";
            break;
        }
    }