Exemplo n.º 1
0
        public void AddToUI(Step s)
        {
            currentStep_ = s;

            if (currentStep_ == null)
            {
                return;
            }

            header_.Text        = currentStep_.Name;
            enabled_.Parameter  = currentStep_.EnabledParameter;
            paused_.Value       = currentStep_.Paused;
            halfMove_.Parameter = currentStep_.HalfMoveParameter;
            durationWidgets_.SetValue(currentStep_?.Duration);
            repeatWidgets_.SetValue(currentStep_.Repeat, new FloatRange(0, 10));
            delayWidgets_.SetValue(currentStep_?.Delay);

            durationCollapsible_.Clear();
            durationCollapsible_.Add(durationWidgets_.GetWidgets());

            delayCollapsible_.Clear();
            delayCollapsible_.Add(delayWidgets_.GetWidgets());

            widgets_.AddToUI(header_);
            widgets_.AddToUI(delete_);
            widgets_.AddToUI(enabled_);
            widgets_.AddToUI(disableOthers_);
            widgets_.AddToUI(enableAll_);
            widgets_.AddToUI(new SmallSpacer());

            widgets_.AddToUI(paused_);
            widgets_.AddToUI(halfMove_);

            durationCollapsible_.AddToUI();
            repeatCollapsible_.AddToUI();
            delayCollapsible_.AddToUI();

            widgets_.AddToUI(new LargeSpacer());
            widgets_.AddToUI(new LargeSpacer());
            widgets_.AddToUI(new LargeSpacer());
            widgets_.AddToUI(new LargeSpacer());

            UpdateDelayCheckboxes();
        }
Exemplo n.º 2
0
        public StepUI()
        {
            header_ = new Header("");

            delete_ = new ConfirmableButton("Delete step", DeleteStep);

            enabled_ = new Checkbox(
                "Step enabled", true, StepEnabledChanged);

            disableOthers_ = new Button(
                "Disable other steps", DisableOthers);

            enableAll_ = new Button(
                "Enable all steps", EnableAll);

            paused_ = new Checkbox(
                "Step paused", false, StepPausedChanged);

            halfMove_ = new Checkbox(
                "Half move", false, StepHalfMoveChanged);

            durationCollapsible_ = new Collapsible("Duration");
            durationWidgets_     = new DurationWidgets(
                "", DurationTypeChanged);

            repeatWidgets_     = new RandomizableTimeWidgets("Repeat");
            repeatCollapsible_ = new Collapsible("Repeat");

            foreach (var w in repeatWidgets_.GetWidgets())
            {
                repeatCollapsible_.Add(w);
            }

            delayCollapsible_ = new Collapsible("Delay");
            delayWidgets_     = new DelayWidgets();
        }