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); }
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); }
public virtual void Invoke() { PanelTransitioner.TransitionTo(target, targetAppearsFrom); }
public void ForceTransition() { PanelTransitioner.TransitionTo(target, targetAppearsFrom); }