Exemple #1
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Defs.Look(ref repeatMode, "repeatMode");
     Scribe_Values.Look(ref repeatCount, "repeatCount", 0);
     Scribe_Defs.Look(ref storeMode, "storeMode");
     Scribe_References.Look(ref storeZone, "storeZone");
     Scribe_Values.Look(ref targetCount, "targetCount", 0);
     Scribe_Values.Look(ref pauseWhenSatisfied, "pauseWhenSatisfied", defaultValue: false);
     Scribe_Values.Look(ref unpauseWhenYouHave, "unpauseWhenYouHave", 0);
     Scribe_Values.Look(ref includeEquipped, "includeEquipped", defaultValue: false);
     Scribe_Values.Look(ref includeTainted, "includeTainted", defaultValue: false);
     Scribe_References.Look(ref includeFromZone, "includeFromZone");
     Scribe_Values.Look(ref hpRange, "hpRange", FloatRange.ZeroToOne);
     Scribe_Values.Look(ref qualityRange, "qualityRange", QualityRange.All);
     Scribe_Values.Look(ref limitToAllowedStuff, "limitToAllowedStuff", defaultValue: false);
     Scribe_Values.Look(ref paused, "paused", defaultValue: false);
     if (repeatMode == null)
     {
         repeatMode = BillRepeatModeDefOf.RepeatCount;
     }
     if (storeMode == null)
     {
         storeMode = BillStoreModeDefOf.BestStockpile;
     }
 }
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Defs.Look <BillRepeatModeDef>(ref this.repeatMode, "repeatMode");
     Scribe_Values.Look <int>(ref this.repeatCount, "repeatCount", 0, false);
     Scribe_Defs.Look <BillStoreModeDef>(ref this.storeMode, "storeMode");
     Scribe_References.Look <Zone_Stockpile>(ref this.storeZone, "storeZone", false);
     Scribe_Values.Look <int>(ref this.targetCount, "targetCount", 0, false);
     Scribe_Values.Look <bool>(ref this.pauseWhenSatisfied, "pauseWhenSatisfied", false, false);
     Scribe_Values.Look <int>(ref this.unpauseWhenYouHave, "unpauseWhenYouHave", 0, false);
     Scribe_Values.Look <bool>(ref this.includeEquipped, "includeEquipped", false, false);
     Scribe_Values.Look <bool>(ref this.includeTainted, "includeTainted", false, false);
     Scribe_References.Look <Zone_Stockpile>(ref this.includeFromZone, "includeFromZone", false);
     Scribe_Values.Look <FloatRange>(ref this.hpRange, "hpRange", FloatRange.ZeroToOne, false);
     Scribe_Values.Look <QualityRange>(ref this.qualityRange, "qualityRange", QualityRange.All, false);
     Scribe_Values.Look <bool>(ref this.limitToAllowedStuff, "limitToAllowedStuff", false, false);
     Scribe_Values.Look <bool>(ref this.paused, "paused", false, false);
     if (this.repeatMode == null)
     {
         this.repeatMode = BillRepeatModeDefOf.RepeatCount;
     }
     if (this.storeMode == null)
     {
         this.storeMode = BillStoreModeDefOf.BestStockpile;
     }
 }
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.Look <int>(ref this.repeatCount, "repeatCount", 0, false);
     Scribe_Values.Look <int>(ref this.targetCount, "targetCount", 0, false);
     Scribe_Defs.Look <BillRepeatModeDef>(ref this.repeatMode, "repeatMode");
     Scribe_Defs.Look <BillStoreModeDef>(ref this.storeMode, "storeMode");
     Scribe_Values.Look <bool>(ref this.pauseWhenSatisfied, "pauseWhenSatisfied", false, false);
     Scribe_Values.Look <int>(ref this.unpauseWhenYouHave, "unpauseWhenYouHave", 0, false);
     Scribe_Values.Look <bool>(ref this.paused, "paused", false, false);
     if (this.repeatMode == null)
     {
         this.repeatMode = BillRepeatModeDefOf.RepeatCount;
     }
     if (this.storeMode == null)
     {
         this.storeMode = BillStoreModeDefOf.BestStockpile;
     }
 }
Exemple #4
0
        protected override void DoConfigInterface(Rect baseRect, Color baseColor)
        {
            Rect rect = new Rect(28f, 32f, 100f, 30f);

            GUI.color = new Color(1f, 1f, 1f, 0.65f);
            Widgets.Label(rect, RepeatInfoText);
            GUI.color = baseColor;
            WidgetRow widgetRow = new WidgetRow(baseRect.xMax, baseRect.y + 29f, UIDirection.LeftThenUp);

            if (widgetRow.ButtonText("Details".Translate() + "..."))
            {
                Find.WindowStack.Add(new Dialog_BillConfig(this, ((Thing)billStack.billGiver).Position));
            }
            if (widgetRow.ButtonText(repeatMode.LabelCap.PadRight(20)))
            {
                BillRepeatModeUtility.MakeConfigFloatMenu(this);
            }
            if (widgetRow.ButtonIcon(TexButton.Plus))
            {
                if (repeatMode == BillRepeatModeDefOf.Forever)
                {
                    repeatMode  = BillRepeatModeDefOf.RepeatCount;
                    repeatCount = 1;
                }
                else if (repeatMode == BillRepeatModeDefOf.TargetCount)
                {
                    int num = recipe.targetCountAdjustment * GenUI.CurrentAdjustmentMultiplier();
                    targetCount        += num;
                    unpauseWhenYouHave += num;
                }
                else if (repeatMode == BillRepeatModeDefOf.RepeatCount)
                {
                    repeatCount += GenUI.CurrentAdjustmentMultiplier();
                }
                SoundDefOf.AmountIncrement.PlayOneShotOnCamera();
                if (TutorSystem.TutorialMode && repeatMode == BillRepeatModeDefOf.RepeatCount)
                {
                    TutorSystem.Notify_Event(recipe.defName + "-RepeatCountSetTo-" + repeatCount);
                }
            }
            if (widgetRow.ButtonIcon(TexButton.Minus))
            {
                if (repeatMode == BillRepeatModeDefOf.Forever)
                {
                    repeatMode  = BillRepeatModeDefOf.RepeatCount;
                    repeatCount = 1;
                }
                else if (repeatMode == BillRepeatModeDefOf.TargetCount)
                {
                    int num2 = recipe.targetCountAdjustment * GenUI.CurrentAdjustmentMultiplier();
                    targetCount        = Mathf.Max(0, targetCount - num2);
                    unpauseWhenYouHave = Mathf.Max(0, unpauseWhenYouHave - num2);
                }
                else if (repeatMode == BillRepeatModeDefOf.RepeatCount)
                {
                    repeatCount = Mathf.Max(0, repeatCount - GenUI.CurrentAdjustmentMultiplier());
                }
                SoundDefOf.AmountDecrement.PlayOneShotOnCamera();
                if (TutorSystem.TutorialMode && repeatMode == BillRepeatModeDefOf.RepeatCount)
                {
                    TutorSystem.Notify_Event(recipe.defName + "-RepeatCountSetTo-" + repeatCount);
                }
            }
        }