public EffecterDefWidget(EffecterDef def) { this.EffecterDef = def; this.positionRadius = new FloatInputWidget <EffecterDef>( this.EffecterDef, "Position Radius", (d) => d.positionRadius, (d, f) => d.positionRadius = f); this.offsetTowardsTarget = new MinMaxInputWidget <EffecterDef, float>("Offset Towards Target", new FloatInputWidget <EffecterDef>(this.EffecterDef, "Min", (d) => d.offsetTowardsTarget.min, (d, f) => d.offsetTowardsTarget.min = f), new FloatInputWidget <EffecterDef>(this.EffecterDef, "Max", (d) => d.offsetTowardsTarget.max, (d, f) => d.offsetTowardsTarget.max = f)); }
public IngredientCountWidget(IngredientCount ingredientCount) { this.uniqueId = uniqueCount; ++uniqueCount; this.IngredientCount = ingredientCount; this.filter = new ThingFilterWidget("Ingredient Filter", this.IngredientCount.filter); this.count = new FloatInputWidget <IngredientCount>( this.IngredientCount, "Ingredient Count", (ic) => IngredientCountStats.GetIngredientCount(ic), (ic, f) => IngredientCountStats.SetIngredientCount(ic, f)); }
public ColorWidget(P parent, string label, GetValue getValue, SetValue setValue) : base(parent, label, getValue, setValue) { this.r = new FloatInputWidget <P>(parent, "Red", p => getValue(p).r, (p, v) => { if (v > 0 && v < 1) { Color c = getValue(p); c.r = v; setValue(p, c); } }); this.g = new FloatInputWidget <P>(parent, "Green", p => getValue(p).g, (p, v) => { if (v > 0 && v < 1) { Color c = getValue(p); c.g = v; setValue(p, c); } }); this.b = new FloatInputWidget <P>(parent, "Blue", p => getValue(p).b, (p, v) => { if (v > 0 && v < 1) { Color c = getValue(p); c.b = v; setValue(p, c); } }); }