Ejemplo n.º 1
0
        public bool CheckboxLabeled(string label, ref bool checkOn, bool dev, ref float modifier, string tooltip = null, bool disabled = false, bool highlight = false, Texture2D texChecked = null, Texture2D texUnchecked = null, bool placeCheckboxNearText = false, bool extend = false)
        {
            float lineHeight = Text.LineHeight;
            Rect  rect       = this.GetRect(lineHeight, null, extend);

            if (dev)
            {
                Rect r = rect.RightPart(0.25f);
                rect = rect.LeftPart(0.75f);
                if (Widgets.ButtonText(r.LeftHalf(), "-"))
                {
                    modifier--;
                }
                if (Widgets.ButtonText(r.RightHalf(), "+"))
                {
                    modifier++;
                }
            }
            if (!tooltip.NullOrEmpty() || highlight)
            {
                if (Mouse.IsOver(rect))
                {
                    Widgets.DrawHighlight(rect);
                }
                if (!tooltip.NullOrEmpty())
                {
                    TooltipHandler.TipRegion(rect, tooltip);
                }
            }
            AdeptusWidgets.CheckboxLabeled(rect, label, ref checkOn, disabled, texChecked, texUnchecked, placeCheckboxNearText);
            this.Gap(this.verticalSpacing);
            return(checkOn);
        }
Ejemplo n.º 2
0
        /*
         * public void CheckboxLabeled(string label, ref bool checkOn, string tooltip = null, bool disabled = false, bool highlight = false, Texture2D texChecked = null, Texture2D texUnchecked = null, bool placeCheckboxNearText = false)
         * {
         *      float lineHeight = Text.LineHeight;
         *      Rect rect = this.GetRect(lineHeight);
         *      if (!tooltip.NullOrEmpty() || highlight)
         *      {
         *              if (Mouse.IsOver(rect))
         *              {
         *                      Widgets.DrawHighlight(rect);
         *              }
         *              if (!tooltip.NullOrEmpty()) TooltipHandler.TipRegion(rect, tooltip);
         *      }
         *      AdeptusWidgets.CheckboxLabeled(rect, label, ref checkOn, disabled, texChecked, texUnchecked, placeCheckboxNearText);
         *      this.Gap(this.verticalSpacing);
         * }
         */
        public bool CheckboxLabeled(string label, ref bool checkOn, string tooltip = null, bool disabled = false, bool highlight = false, Texture2D texChecked = null, Texture2D texUnchecked = null, bool placeCheckboxNearText = false, bool extend = false)
        {
            float lineHeight = Text.LineHeight;
            Rect  rect       = this.GetRect(lineHeight, null, extend);

            if (!tooltip.NullOrEmpty() || highlight)
            {
                if (Mouse.IsOver(rect))
                {
                    Widgets.DrawHighlight(rect);
                }
                if (!tooltip.NullOrEmpty())
                {
                    TooltipHandler.TipRegion(rect, tooltip);
                }
            }
            AdeptusWidgets.CheckboxLabeled(rect, label, ref checkOn, disabled, texChecked, texUnchecked, placeCheckboxNearText);
            this.Gap(this.verticalSpacing);
            return(checkOn);
        }