예제 #1
0
        public void IntAdjuster(ref int val, int countChange, int min = 0)
        {
            Rect rect = base.GetRect(24f);

            rect.width = 42f;
            if (Widgets.ButtonText(rect, "-" + countChange, true, false, true))
            {
                SoundDefOf.AmountDecrement.PlayOneShotOnCamera(null);
                val -= countChange * GenUI.CurrentAdjustmentMultiplier();
                if (val < min)
                {
                    val = min;
                }
            }
            rect.x += rect.width + 2f;
            if (Widgets.ButtonText(rect, "+" + countChange, true, false, true))
            {
                SoundDefOf.AmountIncrement.PlayOneShotOnCamera(null);
                val += countChange * GenUI.CurrentAdjustmentMultiplier();
                if (val < min)
                {
                    val = min;
                }
            }
            base.Gap(this.verticalSpacing);
        }
예제 #2
0
        public void IntAdjuster(ref int val, int countChange, int min = 0)
        {
            Rect rect = GetRect(24f);

            rect.width = 42f;
            if (Widgets.ButtonText(rect, "-" + countChange))
            {
                SoundDefOf.DragSlider.PlayOneShotOnCamera();
                val -= countChange * GenUI.CurrentAdjustmentMultiplier();
                if (val < min)
                {
                    val = min;
                }
            }
            rect.x += rect.width + 2f;
            if (Widgets.ButtonText(rect, "+" + countChange))
            {
                SoundDefOf.DragSlider.PlayOneShotOnCamera();
                val += countChange * GenUI.CurrentAdjustmentMultiplier();
                if (val < min)
                {
                    val = min;
                }
            }
            Gap(verticalSpacing);
        }