public void Draw(float x, ref float y, float width)
        {
            WindowUtil.DrawLabel(x, y, width, this.DisplayLabel, true);
            y += 30;

            x += 20;
            foreach (var v in this.inputWidgets)
            {
                v.Draw(x, ref y, width);
            }

            WindowUtil.PlusMinusLabel(x, ref y, width, "Skill Gains", this.skillGainsArgs);
            foreach (var v in this.skillGains)
            {
                v.Draw(x + 20, ref y, width);
            }

            WindowUtil.PlusMinusLabel(x, ref y, width, "Stat Offsets", this.statOffsetsArgs);
            foreach (var v in this.statOffsets)
            {
                v.Draw(x + 20, ref y, width);
            }

            WindowUtil.PlusMinusLabel(x, ref y, width, "Stat Factors", this.statFactorsArgs);
            foreach (var v in this.statFactors)
            {
                v.Draw(x + 20, ref y, width);
            }
        }
        public override void DrawLeft(float x, ref float y, float width)
        {
            foreach (var v in this.inputWidgets)
            {
                v.Draw(x, ref y, width);
            }

            WindowUtil.PlusMinusLabel(x, ref y, width, "Required Work Tags", this.requiredWorkTags);
            foreach (var v in this.workTags)
            {
                if ((base.Def.requiredWorkTags & v) == v)
                {
                    WindowUtil.DrawLabel(x + 20, ref y, width, "- " + v.ToString(), 30);
                }
            }

            WindowUtil.PlusMinusLabel(x, ref y, width, "Disabled Work Tags", this.disabledWorkTags);
            foreach (var v in this.workTags)
            {
                if ((base.Def.disabledWorkTags & v) == v)
                {
                    WindowUtil.DrawLabel(x + 20, ref y, width, "- " + v.ToString(), 30);
                }
            }
        }
Пример #3
0
 protected override void DrawInput(float x, ref float y, float width)
 {
     WindowUtil.DrawLabel(x, ref y, width, base.label);
     x += 20;
     this.r.Draw(x, ref y, width);
     this.g.Draw(x, ref y, width);
     this.b.Draw(x, ref y, width);
 }
Пример #4
0
        public void Draw(float x, ref float y, float width)
        {
            WindowUtil.DrawLabel(x, y, 300, this.DisplayLabel, true);
            y += 40;

            x += 10;
            this.positionRadius.Draw(x, ref y, width);
            this.offsetTowardsTarget?.Draw(x, ref y, width);
        }
        public void Draw(float x, ref float y, float width)
        {
            WindowUtil.DrawLabel(x, y, 300, this.DisplayLabel, true);
            y += 40;

            x += 10;
            foreach (var i in this.inputWidgets)
            {
                i.Draw(x, ref y, width - 10);
            }
        }
        public void Draw(float x, ref float y, float width)
        {
            WindowUtil.PlusMinusLabel(x, ref y, width, label, this.args);
            IEnumerable <string> beingUsed = this.args.beingUsed.Invoke();

            x += 10;
            foreach (var s in beingUsed)
            {
                WindowUtil.DrawLabel(x, y, width, $"- {s}");
                y += 30;
            }
        }
Пример #7
0
        public void Draw(float x, ref float y, float width)
        {
            WindowUtil.DrawLabel(x, y, 300, this.DisplayLabel, true);
            y += 40;

            foreach (IInputWidget w in this.inputWidgets)
            {
                w.Draw(x, ref y, width);
            }

            x += 20;
            WindowUtil.PlusMinusLabel(
                x, ref y, width, "Capabilities",
                new WindowUtil.FloatOptionsArgs <ToolCapacityDef>()
            {
                // Add
                getDisplayName = delegate(ToolCapacityDef d) { return(d.defName); },
                updateItems    = delegate()
                {
                    HashSet <ToolCapacityDef> lookup = new HashSet <ToolCapacityDef>();
                    if (this.Tool.capacities != null)
                    {
                        this.Tool.capacities.ForEach((ToolCapacityDef d) => lookup.Add(d));
                    }

                    IEnumerable <ToolCapacityDef> defs = DefDatabase <ToolCapacityDef> .AllDefs;
                    List <ToolCapacityDef> list        = new List <ToolCapacityDef>(defs.Count());
                    foreach (var tool in defs)
                    {
                        if (!lookup.Contains(tool))
                        {
                            list.Add(tool);
                        }
                    }
                    return(list);
                },
                onSelect = delegate(ToolCapacityDef d) { this.Tool.capacities.Add(d); }
            },
                new WindowUtil.FloatOptionsArgs <ToolCapacityDef>()
            {
                // Remove
                items          = this.Tool.capacities,
                getDisplayName = delegate(ToolCapacityDef d) { return(d.defName); },
                onSelect       = delegate(ToolCapacityDef d) { this.Tool.capacities.Remove(d); }
            });

            x += 10;
            foreach (ToolCapacityDef d in this.Tool.capacities)
            {
                Widgets.Label(new Rect(x, y, 150, 32), "- " + d.defName);
                y += 40;
            }
        }
Пример #8
0
        protected override void DrawInputs(float x, ref float y, float width)
        {
            foreach (var v in this.inputWidgets)
            {
                v.Draw(x, ref y, width);
            }

            if (this.Props is StorytellerCompProperties_RandomMain rm &&
                this.categoryWeightArgs != null)
            {
                WindowUtil.PlusMinusLabel(x, ref y, width, "Category Weights", this.categoryWeightArgs);
                if (rm.categoryWeights != null)
                {
                    foreach (var v in rm.categoryWeights)
                    {
                        WindowUtil.DrawLabel(x + 20, ref y, width, "- " + Util.GetLabel(v.category), 30);
                    }
                }
            }

            if (this.allowedTargetTags != null)
            {
                WindowUtil.PlusMinusLabel(x, ref y, width, "Allowed Target Tags", this.allowedTargetTags);
                if (this.Props.allowedTargetTags != null)
                {
                    foreach (var v in this.Props.allowedTargetTags)
                    {
                        WindowUtil.DrawLabel(x + 20, ref y, width, "- " + Util.GetLabel(v), 30);
                    }
                }
            }

            if (this.disallowedTargetTags != null)
            {
                WindowUtil.PlusMinusLabel(x, ref y, width, "Disallowed Target Tags", this.disallowedTargetTags);
                if (this.Props.disallowedTargetTags != null)
                {
                    foreach (var v in this.Props.disallowedTargetTags)
                    {
                        WindowUtil.DrawLabel(x + 20, ref y, width, "- " + Util.GetLabel(v), 30);
                    }
                }
            }

            foreach (var v in this.simpleCurveWidgets)
            {
                v.Draw(x, ref y, width);
            }
        }
        public void Draw(float x, ref float y, float width)
        {
            WindowUtil.PlusMinusLabel(x, ref y, width, label, this.args);
            IEnumerable <D> beingUsed = this.args.beingUsed.Invoke();

            x += 10;
            if (beingUsed != null)
            {
                foreach (var def in beingUsed)
                {
                    WindowUtil.DrawLabel(x, y, width, "- " + Util.GetLabel(def));
                    y += 30;
                }
            }
        }
 public void Draw(float x, ref float y, float width)
 {
     WindowUtil.DrawLabel(x, ref y, width, this.stage.label, 32, true);
     x     += 20;
     width -= 20;
     if (this.stage.description != null)
     {
         Widgets.Label(new Rect(x, y, width, 42), this.stage.description);
         y += 45;
     }
     foreach (var v in this.inputWidgets)
     {
         v.Draw(x, ref y, width);
     }
 }
 public void Draw(float x, ref float y, float width)
 {
     if (this.CanCollapse)
     {
         if (Widgets.ButtonText(new Rect(x, y, 30, 30), ((this.isCollapsed) ? "+" : "-")))
         {
             this.isCollapsed = !this.isCollapsed;
         }
         WindowUtil.DrawLabel(x + 34, ref y, width - 34, this.DisplayLabel, 30, true);
     }
     if (!this.isCollapsed)
     {
         this.DrawInputs(x + 10f, ref y, width - 10f);
     }
 }
Пример #12
0
        public void Draw(float x, ref float y, float width)
        {
            WindowUtil.DrawLabel(x, y, 300, this.DisplayLabel, true);
            y += 40;

            x += 10;
            foreach (var w in this.inputWidgets)
            {
                w.Draw(x, ref y, width);
            }

            WindowUtil.DrawInput(x, ref y, width, "InGameDefEditor.SoundCast".Translate(), 100, (VerbProperties.soundCast != null) ? VerbProperties.soundCast.defName : "None",
                                 new WindowUtil.FloatOptionsArgs <SoundDef>()
            {
                items             = DefLookupUtil.GetSortedDefs(DefDatabase <SoundDef> .AllDefs),
                getDisplayName    = delegate(SoundDef d) { return(d.defName); },
                onSelect          = delegate(SoundDef d) { VerbProperties.soundCast = d; },
                includeNullOption = true
            });
            WindowUtil.DrawInput(x, ref y, width, "InGameDefEditor.SoundCastTail".Translate(), 100, (VerbProperties.soundCastTail != null) ? VerbProperties.soundCastTail.defName : "None",
                                 new WindowUtil.FloatOptionsArgs <SoundDef>()
            {
                items             = DefLookupUtil.GetSortedDefs(DefDatabase <SoundDef> .AllDefs),
                getDisplayName    = delegate(SoundDef d) { return(d.defName); },
                onSelect          = delegate(SoundDef d) { VerbProperties.soundCastTail = d; },
                includeNullOption = true
            });

            y += 10;

            if (VerbProperties.defaultProjectile != null)
            {
                WindowUtil.DrawInput(x, ref y, width, "InGameDefEditor.Projectiles".Translate(), 100, this.VerbProperties.defaultProjectile.label,
                                     new WindowUtil.FloatOptionsArgs <ThingDef>()
                {
                    items          = Defs.ProjectileDefs.Values,
                    getDisplayName = delegate(ThingDef d) { return(d.label); },
                    onSelect       = delegate(ThingDef d)
                    {
                        this.VerbProperties.defaultProjectile = d;
                        this.projectileWidget = new ProjectileDefWidget(d, DefType.Projectile);
                    }
                }, true);

                x += 20;
                this.projectileWidget.Draw(x, ref y, width - x);
            }
        }
        public void Draw(float x, ref float y, float width)
        {
            WindowUtil.DrawLabel(x, y, width, "Perlin Frequency " + this.Parent.perlinFrequency, true);
            y += 40;

            x += 10;
            foreach (var v in this.inputWidgets)
            {
                v.Draw(x, ref y, width);
            }

            WindowUtil.PlusMinusLabel(x, ref y, width, "Thresholds", this.thresholdsArgs);

            x += 10;
            foreach (var v in this.thresholds)
            {
                v.Draw(x, ref y, width);
            }
        }
        public void Draw(float x, ref float y, float width)
        {
            WindowUtil.DrawLabel(x, y, width, this.DisplayLabel, true);
            y += 40;

            x += 10;
            WindowUtil.DrawLabel(x, y, 100, "Min");
            if (Widgets.ButtonText(new Rect(110f, y, 100, 30), this.QualityRange.min.GetLabel()))
            {
                WindowUtil.DrawFloatingOptions(this.MinQualityRange);
            }
            y += 40;

            WindowUtil.DrawLabel(x, y, 100, "Max");
            if (Widgets.ButtonText(new Rect(110f, y, 100, 30), this.QualityRange.max.GetLabel()))
            {
                WindowUtil.DrawFloatingOptions(this.MaxQualityRange);
            }
            y += 40;
        }
Пример #15
0
 public override void DrawMiddle(float x, ref float y, float width)
 {
     WindowUtil.PlusMinusLabel(x, ref y, width, "Nullifying Own Tales", this.nullifyingOwnTales);
     foreach (var v in this.Def.nullifyingOwnTales)
     {
         WindowUtil.DrawLabel(x + 20, y, width, "- " + Util.GetLabel(v));
         y += 30;
     }
     WindowUtil.PlusMinusLabel(x, ref y, width, "Required Traits", this.requiredTraits);
     foreach (var v in this.Def.requiredTraits)
     {
         WindowUtil.DrawLabel(x + 20, y, width, "- " + Util.GetLabel(v));
         y += 30;
     }
     WindowUtil.PlusMinusLabel(x, ref y, width, "Nullifying Traits", this.nullifyingTraits);
     foreach (var v in this.Def.nullifyingTraits)
     {
         WindowUtil.DrawLabel(x + 20, y, width, "- " + Util.GetLabel(v));
         y += 30;
     }
 }
Пример #16
0
 public override void DrawRight(float x, ref float y, float width)
 {
     WindowUtil.PlusMinusLabel(x, ref y, width, "Required Work Types", this.requiredWorkTypes);
     foreach (var v in this.Def.requiredWorkTypes)
     {
         WindowUtil.DrawLabel(x + 20, y, width, "- " + Util.GetLabel(v));
         y += 30;
     }
     WindowUtil.PlusMinusLabel(x, ref y, width, "Disabled Work Types", this.disabledWorkTypes);
     foreach (var v in this.Def.disabledWorkTypes)
     {
         WindowUtil.DrawLabel(x + 20, y, width, "- " + Util.GetLabel(v));
         y += 30;
     }
     WindowUtil.PlusMinusLabel(x, ref y, width, "Confliting Traits", this.conflictingTraits);
     foreach (var v in this.Def.conflictingTraits)
     {
         WindowUtil.DrawLabel(x + 20, y, width, "- " + Util.GetLabel(v));
         y += 30;
     }
 }
        public override void DrawMiddle(float x, ref float y, float width)
        {
            if (this.ingredients.Count > 0)
            {
                WindowUtil.DrawLabel(x, ref y, width, "Ingredients", 30, true);
                foreach (var v in this.ingredients)
                {
                    v.Draw(x + 10, ref y, width);
                }
            }
            y += 8;

            if (this.products.Count > 0)
            {
                WindowUtil.DrawLabel(x, ref y, 150, "Products", 30, true);
                foreach (var v in this.products)
                {
                    v.Draw(x + 10, ref y, width);
                }
            }
            y += 8;

            WindowUtil.PlusMinusLabel(x, ref y, width, "Skill Requirements", this.skillRequirementsPlusMinusArgs);
            foreach (var v in this.skillRequirements)
            {
                v.Draw(x + 10, ref y, width);
            }
            y += 8;

            WindowUtil.PlusMinusLabel(x, ref y, width, "Force Hidden Special Filters", this.forceHiddenSpecialFilters);
            if (base.Def.forceHiddenSpecialFilters != null)
            {
                foreach (var v in base.Def.forceHiddenSpecialFilters)
                {
                    WindowUtil.DrawLabel(x + 10, y, width - 10, "- " + v);
                    y += 32;
                }
            }
            y += 8;

            WindowUtil.PlusMinusLabel(x, ref y, width, "Applied On Fixed Body Parts", this.appliedOnFixedBodyParts);
            if (base.Def.appliedOnFixedBodyParts != null)
            {
                foreach (var v in base.Def.appliedOnFixedBodyParts)
                {
                    WindowUtil.DrawLabel(x + 10, y, width - 10, "- " + v);
                    y += 32;
                }
            }
            y += 8;

            //foreach(var v in this.)

            /*WindowUtil.PlusMinusLabel(x, ref y, 150, "Ingredients",
             *      delegate ()
             *      {
             *              IngredientCount c = new IngredientCount() { filter = new ThingFilter() };
             *              IngredientCountStats.SetIngredientCount(c, 0);
             *              base.Def.ingredients.Add(c);
             *              this.ingredients.Add(new IngredientCountWidget(c));
             *      },
             *      delegate ()
             *      {
             *              List<string> items = new List<string>(this.ingredients.Count);
             *              foreach (var v in this.ingredients)
             *                      items.Add(v.DisplayLabel);
             *              WindowUtil.DrawFloatingOptions(new FloatOptionsArgs<string>()
             *              {
             *                      items = items,
             *                      getDisplayName = (s) => s,
             *                      onSelect = (s) => this.ingredients.RemoveAll((i) => i.DisplayLabel.Equals(s)),
             *              });
             *      });
             * foreach (var v in this.ingredients)
             * {
             *      WindowUtil.DrawLabel(x + 10, y, width - 10, "- " + v.DisplayLabel, true);
             *      y += 32;
             *      v.Draw(x + 20, ref y, width - 20);
             * }
             * y += 8;*/

            /*WindowUtil.PlusMinusLabel(x, ref y, 150, "Special Products", this.specialProducts);
             * if (base.Def.specialProducts != null)
             * {
             * foreach (var v in base.Def.specialProducts)
             * {
             * WindowUtil.DrawLabel(x + 10, y, width - 10, "- " + v);
             * y += 32;
             * }
             * y += 8;
             * }*/

            /*WindowUtil.PlusMinusLabel(x, ref y, 150, "Recipe Users", this.recipeUsers);
             * foreach (var v in base.Def.recipeUsers)
             * {
             *      WindowUtil.DrawLabel(x + 10, y, width - 10, "- " + v);
             *      y += 40;
             * }*/
        }