public override void Draw(Rect inRect, AutocastFilter filter)
        {
            Widgets.DrawBoxSolid(inRect, new Color(21f / 256f, 25f / 256f, 29f / 256f));

            var drawBox = inRect.ContractedBy(5f);

            var yAnchor = drawBox.y;
            var xAnchor = drawBox.x;

            // Draw top matter
            DrawTopMatter(xAnchor, ref yAnchor, drawBox.width);

            // Draw invert option
            DrawInvertOption(ref xAnchor, yAnchor);

            //Draw threshold option
            Widgets.Label(
                new Rect(drawBox.xMax - (ThresholdLabelWidth + ThresholdFillableWidth + XSeparation), yAnchor,
                         ThresholdLabelWidth, OptionHeight), ThresholdKey.Translate());
            Widgets.TextFieldPercent(
                new Rect(drawBox.xMax - ThresholdFillableWidth, yAnchor, ThresholdFillableWidth, OptionHeight),
                ref Threshold, ref thresholdBuffer, 0f, MaxValue);

            yAnchor += OptionHeight + YSeparation;

            // Draw bottom matter
            Text.Anchor = TextAnchor.MiddleCenter;
            DrawBottomMatter(drawBox.x, yAnchor, drawBox.width, filter);

            Text.Anchor = TextAnchor.UpperLeft;
        }
Exemplo n.º 2
0
        protected void DrawBottomMatter(float xAnchor, float yAnchor, float width, AutocastFilter filter)
        {
            // Draw info button
            Widgets.InfoCardButton(xAnchor, yAnchor, Def);

            // Draw remove button
            var buttonRect = new Rect(xAnchor + width - RemoveButtonWidth, yAnchor, RemoveButtonWidth, RemoveButtonHeight);

            if (Widgets.ButtonText(buttonRect, RemoveKey.Translate()))
            {
                filter.MarkAdditionalFilterForRemoval(this);
            }
        }
        public override void Draw(Rect inRect, AutocastFilter filter)
        {
            Widgets.DrawBoxSolid(inRect, new Color(21f / 256f, 25f / 256f, 29f / 256f));

            var drawBox = inRect.ContractedBy(5f);

            var xAnchor = drawBox.x;
            var yAnchor = drawBox.y;

            // Draw top matter
            DrawTopMatter(drawBox.x, ref yAnchor, drawBox.width);

            // Draw invert option
            DrawInvertOption(ref xAnchor, yAnchor);

            yAnchor += OptionHeight + YSeparation;

            // Draw bottom matter
            Text.Anchor = TextAnchor.MiddleCenter;
            DrawBottomMatter(drawBox.x, yAnchor, drawBox.width, filter);

            Text.Anchor = TextAnchor.UpperLeft;
        }
Exemplo n.º 4
0
 public abstract void Draw(Rect inRec, AutocastFilter filter);