Ejemplo n.º 1
0
            public void DoWindowContents(Rect canvas)
            {
                Rect rect = canvas.AtZero();

                rect.y    += 45f;
                rect.yMax -= 90f;

                var outRect    = new Rect(canvas.x, canvas.y, canvas.width, canvas.height);
                var scrollRect = new Rect(0f, 0f, canvas.width - 16f, canvas.height * 3f);

                Widgets.BeginScrollView(outRect, ref scrollPosition, scrollRect, true);

                Listing_Standard listing_Standard = new Listing_Standard
                {
                    ColumnWidth = (rect.width - 34f) / 3f
                };

                listing_Standard.Begin(scrollRect);

                /*** Первая колонка ***/
                Text.Font = GameFont.Medium;
                listing_Standard.Label("Настройка мода", -1f);
                listing_Standard.Gap(12f);

                Text.Font = GameFont.Small;
                listing_Standard.CheckboxLabeledSelectable("Активен ", ref modEnabled, ref modEnabled);
                listing_Standard.Gap(12f);
                listing_Standard.GapLine(6f);
                listing_Standard.Gap(12f);

                listing_Standard.Label("Путь к логу чата ");
                logPath = listing_Standard.TextEntry(logPath, 1);

                /*** Вторая колонка ***/
                listing_Standard.NewColumn();
                Text.Font = GameFont.Medium;
                listing_Standard.Label("События".Translate(), -1f);
                listing_Standard.Gap(12f);

                Text.Font = GameFont.Small;

                listing_Standard.CheckboxLabeledSelectable(rimEvent.IncidentName, ref tempRef, ref tempRef);

                /*** Третья колонка ***/
                listing_Standard.NewColumn();
                Text.Font = GameFont.Medium;
                listing_Standard.Label("Цена".Translate(), -1f);
                listing_Standard.Gap(12f);

                Text.Font = GameFont.Small;
                listing_Standard.Label("Путь к логу чата asdfdfasdgggggggggggggggggggggggasddddddddddd");
                listing_Standard.Gap(12f);
                listing_Standard.Gap(12f);
                listing_Standard.Label("Путь к логу чата asdf");
                listing_Standard.Label("Путь к логу чата fasdfsdf");
                listing_Standard.Label("Путь к логу чата asdjfhgsajfhgaksjdfgaksjfgakjsdfa");

                listing_Standard.End();
                Widgets.EndScrollView();
            }
Ejemplo n.º 2
0
        public void DoWindowContents(Rect inRect)
        {
            {
                var   list         = new Listing_Standard();
                Color defaultColor = GUI.color;
                list.Begin(inRect);

                list.Label("CraftingQualityRebalanced.SliderWarning".Translate());

                list.Label("CraftingQualityRebalanced.MinimumSkillPoor".Translate() + minSkillPoor);
                minSkillPoor = (int)list.Slider(minSkillPoor, 0, minSkillNormal - 1);

                list.Label("CraftingQualityRebalanced.MinimumSkillNormal".Translate() + minSkillNormal);
                minSkillNormal = (int)list.Slider(minSkillNormal, minSkillPoor + 1, minSkillGood - 1);

                list.Label("CraftingQualityRebalanced.MinimumSkillGood".Translate() + minSkillGood);
                minSkillGood = (int)list.Slider(minSkillGood, minSkillNormal + 1, minSkillExcellent - 1);

                list.Label("CraftingQualityRebalanced.MinimumSkillExcellent".Translate() + minSkillExcellent);
                minSkillExcellent = (int)list.Slider(minSkillExcellent, minSkillGood + 1, minSkillMasterwork - 1);

                list.Label("CraftingQualityRebalanced.MinimumSkillMasterwork".Translate() + minSkillMasterwork);
                minSkillMasterwork = (int)list.Slider(minSkillMasterwork, 7, 22);

                list.Label("CraftingQualityRebalanced.MinimumSkillLegendary".Translate() + minSkillLegendary);
                minSkillLegendary = (int)list.Slider(minSkillLegendary, 0, 21);

                list.Label("CraftingQualityRebalanced.LegendaryChance".Translate() + legendaryChance + "%");
                legendaryChance = (int)list.Slider(legendaryChance, 0, 100);

                list.Label("CraftingQualityRebalanced.LegendaryChanceExplanation".Translate());

                list.CheckboxLabeledSelectable("CraftingQualityRebalanced.SupressMasterworkMessages".Translate(), ref supressMasterworkMessages, ref supressMasterworkMessages);

                list.CheckboxLabeledSelectable("CraftingQualityRebalanced.SupressLegendaryMessages".Translate(), ref supressLegendaryMessages, ref supressLegendaryMessages);

                if (minSkillExcellent >= minSkillMasterwork)
                {
                    minSkillExcellent = minSkillMasterwork - 1;
                }
                if (minSkillGood >= minSkillExcellent)
                {
                    minSkillGood = minSkillExcellent - 1;
                }
                if (minSkillNormal >= minSkillGood)
                {
                    minSkillNormal = minSkillGood - 1;
                }
                if (minSkillPoor >= minSkillNormal)
                {
                    minSkillPoor = minSkillNormal - 1;
                }

                list.End();
            }
        }
Ejemplo n.º 3
0
        public void DoWindowContents(Rect inRect)
        {
            {
                var list = new Listing_Standard();
                list.Begin(inRect);

                list.Label("CraftingQualityRebalanced.SliderWarning".Translate());

                list.Label("CraftingQualityRebalanced.MinimumSkillPoor".Translate() + GetSkillValue(QualityCategory.Poor));
                SetSkillValue(QualityCategory.Poor, (int)list.Slider(GetSkillValue(QualityCategory.Poor), 0, 20));

                list.Label("CraftingQualityRebalanced.MinimumSkillNormal".Translate() + GetSkillValue(QualityCategory.Normal));
                SetSkillValue(QualityCategory.Normal, (int)list.Slider(GetSkillValue(QualityCategory.Normal), 1, 20));

                list.Label("CraftingQualityRebalanced.MinimumSkillGood".Translate() + GetSkillValue(QualityCategory.Good));
                SetSkillValue(QualityCategory.Good, (int)list.Slider(GetSkillValue(QualityCategory.Good), 4, 20));

                list.Label("CraftingQualityRebalanced.MinimumSkillExcellent".Translate() + GetSkillValue(QualityCategory.Excellent));
                SetSkillValue(QualityCategory.Excellent, (int)list.Slider(GetSkillValue(QualityCategory.Excellent), 8, 21));

                list.Label("CraftingQualityRebalanced.MinimumSkillMasterwork".Translate() + GetSkillValue(QualityCategory.Masterwork));
                SetSkillValue(QualityCategory.Masterwork, (int)list.Slider(GetSkillValue(QualityCategory.Masterwork), 16, 22));

                list.Label("CraftingQualityRebalanced.MinimumSkillLegendary".Translate() + GetSkillValue(QualityCategory.Legendary));
                SetSkillValue(QualityCategory.Legendary, (int)list.Slider(GetSkillValue(QualityCategory.Legendary), 0, 21));

                list.Label("CraftingQualityRebalanced.LegendaryChance".Translate() + legendaryChance + "%");
                legendaryChance = (int)list.Slider(legendaryChance, 0, 100);

                list.Label("CraftingQualityRebalanced.LegendaryChanceExplanation".Translate());

                list.Gap();

                list.CheckboxLabeledSelectable("CraftingQualityRebalanced.SupressMasterworkMessages".Translate(), ref supressMasterworkMessages, ref supressMasterworkMessages);

                list.CheckboxLabeledSelectable("CraftingQualityRebalanced.SupressLegendaryMessages".Translate(), ref supressLegendaryMessages, ref supressLegendaryMessages);

                list.CheckboxLabeledSelectable("CraftingQualityRebalanced.SetQualityInsteadOfRerolling".Translate(), ref setQualityInsteadOfReroll, ref setQualityInsteadOfReroll);

                list.End();
            }
        }
Ejemplo n.º 4
0
        public override void DoWindowContents(Rect inRect)
        {
            Text.Font = GameFont.Medium;
            Rect titleRect = new Rect(0f, 0f, 400f, 50f);

            Widgets.Label(titleRect, "Graph Settings"); // TODO: add renaming button
            Text.Font = GameFont.Small;
            Rect             listerRect       = new Rect(0f, titleRect.yMax, 180f, inRect.height - titleRect.height);
            Listing_Standard listing_Standard = new Listing_Standard(listerRect);

            if (listing_Standard.ButtonText("Default", null))
            {
                this.setting.SetDefault();
            }

            AddBinarySelector(ref listing_Standard, "Deficiency", "No Deficiency", ref this.setting.ShowDeficiency);
            AddBinarySelector(ref listing_Standard, "Draw Points", "No Points", ref this.setting.DrawPoints);
            AddBinarySelector(ref listing_Standard, "Anti-Alias", "No Anti-Alias", ref this.setting.UseAntiAliasedLines);
            AddBinarySelector(ref listing_Standard, "Outdoor Animal", "No Outdoor Animal", ref this.setting.EnableOutdoorAnimalDetection);
            AddBinarySelector(ref listing_Standard, "Growing Season", "No Growing Season", ref this.setting.EnableOutdoorNoGrowWinter);

            // TODO: add floating menu here
            if (this.setting.predictorModel == Predictor.ModelType.learning)
            {
                if (this.setting.EnableLearning)
                {
                    if (listing_Standard.ButtonText("Enable Learning", null))
                    {
                        this.setting.EnableLearning = false;
                    }
                }
                else if (listing_Standard.ButtonText("No Learning", null))
                {
                    this.setting.EnableLearning = true;
                }
            }

            /*
             * if (listing_Standard.ButtonText(this.bill.repeatMode.GetLabel(), null))
             * {
             *  BillRepeatModeUtility.MakeConfigFloatMenu(this.bill);
             * }
             * string label = ("BillStoreMode_" + this.bill.storeMode).Translate();
             * if (listing_Standard.ButtonText(label, null))
             * {
             *  List<FloatMenuOption> list = new List<FloatMenuOption>();
             *  using (IEnumerator enumerator = Enum.GetValues(typeof(BillStoreMode)).GetEnumerator())
             *  {
             *      while (enumerator.MoveNext())
             *      {
             *          BillStoreMode billStoreMode = (BillStoreMode)((byte)enumerator.Current);
             *          BillStoreMode smLocal = billStoreMode;
             *          list.Add(new FloatMenuOption(("BillStoreMode_" + billStoreMode).Translate(), delegate
             *          {
             *              this.bill.storeMode = smLocal;
             *          }, MenuOptionPriority.Medium, null, null, 0f, null));
             *      }
             *  }
             *  Find.WindowStack.Add(new FloatMenu(list));
             * }
             * listing_Standard.Gap(12f);
             * if (this.bill.repeatMode == BillRepeatMode.RepeatCount)
             * {
             *  listing_Standard.Label("RepeatCount".Translate(new object[]
             *  {
             *  this.bill.RepeatInfoText
             *  }));
             *  listing_Standard.IntSetter(ref this.bill.repeatCount, 1, "1", 42f);
             *  listing_Standard.IntAdjuster(ref this.bill.repeatCount, 1, 0);
             *  listing_Standard.IntAdjuster(ref this.bill.repeatCount, 25, 0);
             * }
             * else if (this.bill.repeatMode == BillRepeatMode.TargetCount)
             * {
             *  string text = "CurrentlyHave".Translate() + ": ";
             *  text += this.bill.recipe.WorkerCounter.CountProducts(this.bill);
             *  text += " / ";
             *  text += ((this.bill.targetCount >= 999999) ? "Infinite".Translate().ToLower() : this.bill.targetCount.ToString());
             *  string text2 = this.bill.recipe.WorkerCounter.ProductsDescription(this.bill);
             *  if (!text2.NullOrEmpty())
             *  {
             *      string text3 = text;
             *      text = string.Concat(new string[]
             *      {
             *      text3,
             *      "\n",
             *      "CountingProducts".Translate(),
             *      ": ",
             *      text2
             *      });
             *  }
             *  listing_Standard.Label(text);
             *  listing_Standard.IntSetter(ref this.bill.targetCount, 1, "1", 42f);
             *  listing_Standard.IntAdjuster(ref this.bill.targetCount, 1, 1);
             *  listing_Standard.IntAdjuster(ref this.bill.targetCount, 25, 1);
             *  listing_Standard.IntAdjuster(ref this.bill.targetCount, 250, 1);
             * }
             * listing_Standard.Gap(12f);
             * listing_Standard.Label("IngredientSearchRadius".Translate() + ": " + this.bill.ingredientSearchRadius.ToString("F0"));
             * this.bill.ingredientSearchRadius = listing_Standard.Slider(this.bill.ingredientSearchRadius, 3f, 100f);
             * if (this.bill.ingredientSearchRadius >= 100f)
             * {
             *  this.bill.ingredientSearchRadius = 999f;
             * }
             * if (this.bill.recipe.workSkill != null)
             * {
             *  listing_Standard.Label("AllowedSkillRange".Translate(new object[]
             *  {
             *  this.bill.recipe.workSkill.label.ToLower()
             *  }));
             *  listing_Standard.IntRange(ref this.bill.allowedSkillRange, 0, 20);
             * }
             */

            //*
            listing_Standard.End();


            Rect centerRect = new Rect(listerRect.xMax + 6f, titleRect.yMax, 280f, -1f);

            centerRect.yMax = inRect.height - this.CloseButSize.y - 6f;

            Widgets.DrawMenuSection(centerRect, true);
            Text.Font = GameFont.Tiny;
            float num   = centerRect.width - 2f;
            Rect  rect2 = new Rect(centerRect.x + 1f, centerRect.y + 1f, num / 2f, 24f);

            if (Widgets.ButtonText(rect2, "ClearAll".Translate(), true, false, true))
            {
                foreach (String s in setting.graphEnable.Keys.ToList())
                {
                    setting.graphEnable[s] = false;

                    MainTabWindow_Estimator.predictor.allPredType[s].enabled = false;
                }
            }
            Rect rect3 = new Rect(rect2.xMax + 1f, rect2.y, num / 2f, 24f);

            if (Widgets.ButtonText(rect3, "AllowAll".Translate(), true, false, true))
            {
                foreach (String s in setting.graphEnable.Keys.ToList())
                {
                    setting.graphEnable[s] = true;
                    MainTabWindow_Estimator.predictor.allPredType[s].enabled = true;
                    MainTabWindow_Estimator.predictor.MakePrediction(0); // TODO: if paused prevent calling 2nd time
                }
            }
            Text.Font       = GameFont.Small;
            centerRect.yMin = rect2.yMax;
            Rect viewRect = new Rect(0, 0f, centerRect.width - 16f, setting.graphEnable.Count() * (Text.LineHeight + listing_Standard.verticalSpacing));

            Widgets.BeginScrollView(centerRect, ref scrollPosition, viewRect);
            listing_Standard = new Listing_Standard(new Rect(6, 0, viewRect.width - 6, viewRect.height));
            foreach (String s in setting.graphEnable.Keys.ToList())
            {
                bool checkFlag  = setting.graphEnable[s];
                bool selectFlag = false;
                listing_Standard.CheckboxLabeledSelectable(s, ref selectFlag, ref checkFlag); // TODO: use select flag to show a rect on the right to allow selecting yield, consumption, stock, population
                if (checkFlag != setting.graphEnable[s])
                {
                    setting.graphEnable[s] = checkFlag;
                    MainTabWindow_Estimator.predictor.allPredType[s].enabled = checkFlag;

                    MainTabWindow_Estimator.predictor.MakePrediction(0);
                }
            }
            listing_Standard.End();
            Widgets.EndScrollView();

            //*/

            /*StringBuilder stringBuilder = new StringBuilder();
             *
             *
             * if (this.bill.recipe.description != null)
             * {
             * stringBuilder.AppendLine(this.bill.recipe.description);
             * stringBuilder.AppendLine();
             * }
             * stringBuilder.AppendLine("WorkAmount".Translate() + ": " + this.bill.recipe.WorkAmountTotal(null).ToStringWorkAmount());
             * stringBuilder.AppendLine();
             * for (int i = 0; i < this.bill.recipe.ingredients.Count; i++)
             * {
             * IngredientCount ingredientCount = this.bill.recipe.ingredients[i];
             * if (!ingredientCount.filter.Summary.NullOrEmpty())
             * {
             *     stringBuilder.AppendLine(this.bill.recipe.IngredientValueGetter.BillRequirementsDescription(ingredientCount));
             * }
             * }
             * stringBuilder.AppendLine();
             * string text4 = this.bill.recipe.IngredientValueGetter.ExtraDescriptionLine(this.bill.recipe);
             * if (text4 != null)
             * {
             * stringBuilder.AppendLine(text4);
             * stringBuilder.AppendLine();
             * }
             * stringBuilder.AppendLine("MinimumSkills".Translate());
             * stringBuilder.AppendLine(this.bill.recipe.MinSkillString);
             * Text.Font = GameFont.Small;
             * string text5 = stringBuilder.ToString();
             * if (Text.CalcHeight(text5, rect4.width) > rect4.height)
             * {
             * Text.Font = GameFont.Tiny;
             * }
             * Widgets.Label(rect4, text5);
             * Text.Font = GameFont.Small;
             * if (this.bill.recipe.products.Count == 1)
             * {
             * Widgets.InfoCardButton(rect4.x, rect3.y, this.bill.recipe.products[0].thingDef);
             * }
             */
        }