Beispiel #1
0
 protected override void OnClickCard(GameObject o)
 {
     EditorContext.Reset();
     EditorContext.trackPath = Path.Combine(cardToTrack[o].folder, Paths.kTrackFilename);
     EditorContext.track     = cardToTrack[o].track;
     PanelTransitioner.TransitionTo(trackSetupPanel,
                                    TransitionToPanel.Direction.Right);
 }
Beispiel #2
0
    private void OnCreateButtonClick(string title, string artist)
    {
        // Attempt to create track directory. Contains timestamp
        // so collisions are very unlikely.
        string filteredTitle  = Paths.FilterString(title);
        string filteredArtist = Paths.FilterString(artist);
        string timestamp      = DateTime.Now.ToString("yyyyMMddHHmmss");

        string newDir = Path.Combine(Paths.GetTrackFolder(), $"{filteredArtist} - {filteredTitle} - {timestamp}");

        try
        {
            Directory.CreateDirectory(newDir);
        }
        catch (Exception e)
        {
            messageDialog.Show($"An error occurred when " +
                               $"creating {newDir}:\n\n{e.Message}");
            return;
        }

        // Create empty track.
        Track  track    = new Track(title, artist);
        string filename = Path.Combine(newDir, Paths.kTrackFilename);

        try
        {
            track.SaveToFile(filename);
        }
        catch (Exception e)
        {
            messageDialog.Show($"An error occurred when " +
                               $"writing to {filename}:\n\n{e.Message}");
            return;
        }

        EditorContext.Reset();
        EditorContext.trackPath = filename;
        EditorContext.track     = track;
        PanelTransitioner.TransitionTo(trackSetupPanel,
                                       TransitionToPanel.Direction.Right);
    }
Beispiel #3
0
 public virtual void Invoke()
 {
     PanelTransitioner.TransitionTo(target, targetAppearsFrom);
 }
 public void ForceTransition()
 {
     PanelTransitioner.TransitionTo(target, targetAppearsFrom);
 }