Beispiel #1
0
 public void CreateHoldNote()
 {
     if (LimSystem.ChartContainer == null)
     {
         return;
     }
     Lanotalium.Chart.LanotaHoldNote New = new Lanotalium.Chart.LanotaHoldNote();
     New.Type     = 5;
     New.Time     = TunerManager.ChartTime;
     New.Duration = 1;
     OperationManager.AddHoldNote(New);
     OperationManager.InspectorManager.ArrangeComponentsUi();
 }
Beispiel #2
0
    private void CreateNoteAtCurser(float Time, float Degree)
    {
        if (!Enable)
        {
            return;
        }
        int Type = ConvertValueToType(TypeDropdown.value);
        int Size = SizeDropdown.value;

        if (Type == 5)
        {
            Lanotalium.Chart.LanotaHoldNote New = new Lanotalium.Chart.LanotaHoldNote();
            New.Type     = 5;
            New.Duration = 1;
            New.Degree   = Degree;
            New.Time     = Time;
            New.Size     = Size;
            OperationManager.AddHoldNote(New);
        }
        else
        {
            Lanotalium.Chart.LanotaTapNote New = new Lanotalium.Chart.LanotaTapNote();
            New.Type   = Type;
            New.Time   = Time;
            New.Degree = Degree;
            New.Size   = Size;
            OperationManager.AddTapNote(New);
        }
    }
    public void CopySelectedNotes()
    {
        if (!OperationManager.TunerManager.isInitialized)
        {
            return;
        }
        if (!ValidateCopyInstruction())
        {
            return;
        }

        bool  HasTap = false, HasHold = false;
        float FirstNoteTime = 0;

        if (OperationManager.SelectedTapNote.Count != 0)
        {
            OperationManager.SelectedTapNote.Sort((Lanotalium.Chart.LanotaTapNote a, Lanotalium.Chart.LanotaTapNote b) => { return(a.Time.CompareTo(b.Time)); });
            FirstNoteTime = OperationManager.SelectedTapNote[0].Time;
            HasTap        = true;
        }
        if (OperationManager.SelectedHoldNote.Count != 0)
        {
            OperationManager.SelectedHoldNote.Sort((Lanotalium.Chart.LanotaHoldNote a, Lanotalium.Chart.LanotaHoldNote b) => { return(a.Time.CompareTo(b.Time)); });
            FirstNoteTime = OperationManager.SelectedHoldNote[0].Time;
            HasHold       = true;
        }
        if (HasTap && HasHold)
        {
            FirstNoteTime = Mathf.Min(OperationManager.SelectedTapNote[0].Time, OperationManager.SelectedHoldNote[0].Time);
        }
        if (!HasTap && !HasHold)
        {
            return;
        }
        if (HasTap)
        {
            foreach (float Target in CopyTargets)
            {
                float Delta = Target - FirstNoteTime;
                foreach (Lanotalium.Chart.LanotaTapNote Tap in OperationManager.SelectedTapNote)
                {
                    Lanotalium.Chart.LanotaTapNote New = Tap.DeepCopy();
                    New.Time += Delta;
                    OperationManager.AddTapNote(New, true, false, false);
                }
            }
        }
        if (HasHold)
        {
            foreach (float Target in CopyTargets)
            {
                float Delta = Target - FirstNoteTime;
                foreach (Lanotalium.Chart.LanotaHoldNote Hold in OperationManager.SelectedHoldNote)
                {
                    Lanotalium.Chart.LanotaHoldNote New = Hold.DeepCopy();
                    New.Time += Delta;
                    OperationManager.AddHoldNote(New, true, false, false);
                }
            }
        }
        OperationManager.SelectNothing();
        LimNotifyIcon.ShowMessage(LimLanguageManager.TextDict["Copier_Msg_Success"]);
    }