Ejemplo n.º 1
0
        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);
            });
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 4
0
        public void AddSourceMetric(SourceMetric metric)
        {
            CreateVolume(metric);

            metric.ValuePushed.Subscribe(dataPoint =>
            {
                History.Save(metric.Key, dataPoint);
            });

            this.SourceMetrics.Add(metric);
        }
Ejemplo n.º 5
0
 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));
 }
Ejemplo n.º 6
0
 private void AnchorMetricChosen(SourceMetric anchorMetric)
 {
     form.AnchorMetric = anchorMetric;
     optionsManager.ChangeDomain(anchorMetric.Domain);
 }
Ejemplo n.º 7
0
 private void SourceMetricChosen(SourceMetric chosenSourceMetric)
 {
     Model.ChosenSourceMetric = chosenSourceMetric;
     sourceMetricChosen.OnNext(chosenSourceMetric);
 }
Ejemplo n.º 8
0
 public void SetSource(CompStatTracker tracker)
 {
     this.tracker   = tracker;
     metrics        = tracker.Data.SourceMetrics;
     selectedMetric = metrics.FirstOrDefault();
 }
Ejemplo n.º 9
0
 public void AddSourceMetric(SourceMetric metric)
 {
     Data.AddSourceMetric(metric);
 }