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); }
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); }