public void DrawTab(Rect pane) { Text.Font = GameFont.Small; GUI.color = Color.white; new RectStacker(pane) .ThenForEach(metrics, (u, v, w) => { return(statTabList.DrawItem(u, selectedMetric, v, w, (drawRect, curItem, ind) => { Widgets.Label(drawRect, curItem.Name); }, clickedObj => { selectedMetric = clickedObj; //onListItemClick.OnNext(clickedObj); } )); }) .IfThen(() => metrics.Count > 0, u => { Rect addMetricButtonRect = new Rect(u); addMetricButtonRect.height = 35f; addMetricButtonRect.width = 80f; if (Widgets.ButtonText(addMetricButtonRect, "Add metric")) { onAddMetricClicked.OnNext(tracker); } return(addMetricButtonRect); }); }
public Dialog_AddDerivedMetric(CompStatTracker tracker, List <SourceMetric> allSourceMetrics, List <Type> allOperatorTypes) : base(tracker) { SourceMetric initAnchor = tracker.Data.SourceMetrics.First(); optionsManager = new AddOperatorOptionsManager(allSourceMetrics, allOperatorTypes, initAnchor.Domain); addOperatorListComponent = new AddOperatorListComponent(optionsManager, form.OperatorList); AnchorMetricChosen(initAnchor); }
public bool SourceMetricIsOfCurrentDomain(SourceMetric sourceMetric) { if (sourceMetric != null) { return(sourceMetric.Domain.Resolution == domain.Resolution); } return(false); }
public void AddSourceMetric(SourceMetric metric) { CreateVolume(metric); metric.ValuePushed.Subscribe(dataPoint => { History.Save(metric.Key, dataPoint); }); this.SourceMetrics.Add(metric); }
private RectConnector DrawTextButton(Rect inRect, string label, List <SourceMetric> metricList, SourceMetric selectedMetric, Action <SourceMetric> metricCb) { return(StatWidgets.DrawTextButtonSideLabel(inRect, label, metricList, u => u.Name, selectedMetric, metricCb)); }
private void AnchorMetricChosen(SourceMetric anchorMetric) { form.AnchorMetric = anchorMetric; optionsManager.ChangeDomain(anchorMetric.Domain); }
private void SourceMetricChosen(SourceMetric chosenSourceMetric) { Model.ChosenSourceMetric = chosenSourceMetric; sourceMetricChosen.OnNext(chosenSourceMetric); }
public void SetSource(CompStatTracker tracker) { this.tracker = tracker; metrics = tracker.Data.SourceMetrics; selectedMetric = metrics.FirstOrDefault(); }
public void AddSourceMetric(SourceMetric metric) { Data.AddSourceMetric(metric); }