public ISmartMenu CreateMenu() { _nextMenu = this; if (_grid == null) { _grid = new Grid(5, 5, 150, 155); _grid.Add(new[] { new GridColumn(new List<IGridRenderable> { new GridLabel(() => "Movement log file:"), new GridTextField((x) => _replayFolder = x, "0123-0123-0123-0123-0123"), new GridColumn(new List<IGridRenderable> { new GridButton("Exit to Main Menu", () => { Global.ReplayManager.StopReplay(); _nextMenu = new MainMenuView(); }), new GridButton("Instant Render", () => { _nextMenu = LaunchReplay(false); }), new GridButton("Real-time Render", () => { _nextMenu = LaunchReplay(true); }), }, new Padding(0, 2)), }, new Padding(2, 5)) }); } _grid.Render(); return _nextMenu; }
public ISmartMenu CreateMenu() { _nextMenu = this; GUI.skin.button.fontSize = 10; GUI.skin.label.fontSize = 10; GUI.skin.textArea.fontSize = 11; GUI.skin.textField.fontSize = 11; if (_grid == null) { _grid = new Grid(5, 5, 135, 140); _grid.Add(new[] { new GridColumn(new List<IGridRenderable> { new GridButton("Start New Run...", () => _nextMenu = new NewRunMenu()), new GridButton("Configuration...", () => _nextMenu = new ConfigurationMenu()), new GridButton("Replay...", () => _nextMenu = new ReplayMenu()), new GridButton("Exit", Application.Quit), }, new Padding(5, 5)), }); } _grid.Render(); //GUI.BeginGroup(new Rect(5, 5, 135, 140)); //GUI.Box(new Rect(0, 0, 110, 125), ""); //GUI.skin.button.fontSize = 10; //GUI.skin.label.fontSize = 10; //GUI.skin.textArea.fontSize = 11; //GUI.skin.textField.fontSize = 11; //if (GUI.Button(new Rect(5, 5, 100, 25), "Start New Run...")) //{ // return new NewRunMenu(); //} //if (GUI.Button(new Rect(5, 35, 100, 25), "Configuration...")) //{ // return new ConfigurationMenu(); //} //if (GUI.Button(new Rect(5, 65, 100, 25), "Replay...")) //{ // return new ReplayMenu(); //} //if (GUI.Button(new Rect(5, 95, 100, 25), "Exit")) //{ // Application.Quit(); //} //GUI.EndGroup(); return _nextMenu; }
private void BuildStatsView() { if (_statsView != null) return; var statsEngine = Global.ReplayManager.GetStatsEngine(); _statsView = new Grid(130, 5, 400, 120); _statsView.Add(new[] { new GridColumn(new List<IGridRenderable> { new GridRow(new List<IGridRenderable> { new GridLabel(() => string.Format("% Complete: {0:f2}", 100*statsEngine.Elapsed.TotalMilliseconds/ statsEngine.TotalTime.TotalMilliseconds)), }), new GridRow(new List<IGridRenderable> { new GridColumn(new List<IGridRenderable> { new GridRow(new List<IGridRenderable> { new GridLabel(() => "Elapsed:", "0123-0123-01"), new GridLabel(() => string.Format("{0:f2}", statsEngine.Elapsed)), }), new GridRow(new List<IGridRenderable> { new GridLabel(() => "Start time:", "0123-0123-01"), new GridLabel(() => string.Format("{0}", statsEngine.StartTime)), }), new GridRow(new List<IGridRenderable> { new GridLabel(() => "End time:", "0123-0123-01"), new GridLabel(() => string.Format("{0}", statsEngine.EndTime)), }), new GridRow(new List<IGridRenderable> { new GridLabel(() => "Total Time:", "0123-0123-01"), new GridLabel(() => string.Format("{0:f2}", statsEngine.TotalTime)), }), }), new GridColumn(new List<IGridRenderable> { new GridRow(new List<IGridRenderable> { new GridLabel(() => "Current velocity (u/s):", "0123-0123-0123-0123-0"), new GridLabel(() => string.Format("{0:f2}", statsEngine.CurrentVelocity)), }), new GridRow(new List<IGridRenderable> { new GridLabel(() => "Average velocity (u/s):", "0123-0123-0123-0123-0"), new GridLabel(() => string.Format("{0:f2}", statsEngine.AverageVelocity)), }), new GridRow(new List<IGridRenderable> { new GridLabel(() => "Maximum velocity (u/s):", "0123-0123-0123-0123-0"), new GridLabel(() => string.Format("{0:f2}", statsEngine.MaxVelocity)), }), new GridRow(new List<IGridRenderable> { new GridLabel(() => "Total Distance (u):", "0123-0123-0123-0123-0"), new GridLabel(() => string.Format("{0:f2}", statsEngine.TotalDistance)), }), new GridRow(new List<IGridRenderable> { new GridLabel(() => "Total Laser Time (ms):", "0123-0123-0123-0123-0"), new GridLabel(() => string.Format("{0:f2}", Global.Launcher.SaveState.RuntimeResults.TotalLaserTime)), }), }, new Padding(100, 0)), }), }, new Padding(5, 5)), }); }
public ISmartMenu CreateMenu() { _nextMenu = this; var statsEngine = Global.ReplayManager.GetStatsEngine(); BuildStatsView(); if (_grid == null) { _lastSliderValue = statsEngine.CurrentSegment; _grid = new Grid(5, 5, 120, 100); _grid.Add(new[] { new GridColumn(new List<IGridRenderable> { new GridColumn(new List<IGridRenderable> { new GridRow(new List<IGridRenderable> { new GridButton("<<", () => { }), new GridButton("< ", () => { }), new GridButton("PP", () => Global.ReplayManager.PlayPause()), new GridButton(" >", () => { }), new GridButton(">>", () => { }), }), new GridRow(new List<IGridRenderable> { new GridItem(rect => { var currentValue = GUI.HorizontalSlider(rect, _lastSliderValue, 0, statsEngine.TotalSegments); if ((int) currentValue != (int) _lastSliderValue) { Global.ReplayManager.SetPosition((int)currentValue); _lastSliderValue = currentValue; } else { _lastSliderValue = statsEngine.CurrentSegment; } }, 100, 15), }) }), new GridColumn(new List<IGridRenderable> { new GridButton("Exit Replay", () => { Global.ReplayManager.StopReplay(); _nextMenu = new ReplayMenu(); }), }, new Padding(0, 15)), }, new Padding(5, 5)) }); } _grid.Render(); _statsView.Render(); return _nextMenu; }