protected override void DrawInput(float x, ref float y, float width)
 {
     if (ColorOverride != null)
     {
         GUI.color = ColorOverride.Value;
     }
     this.value = WindowUtil.DrawInput(x, ref y, width, base.label, this.value, delegate(bool b) { base.setValue(this.Parent, b); });
     GUI.color  = Color.white;
 }
 protected override void DrawInput(float x, ref float y, float width)
 {
     this.buffer = WindowUtil.DrawInput(x, ref y, width, this.label, this.value, delegate(int i)
     {
         if (IsValid == null || IsValid(i))
         {
             base.setValue(this.Parent, i);
         }
     }, this.buffer);
 }
예제 #3
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 override void DrawLeft(float x, ref float y, float width)
        {
            foreach (var w in this.inputWidgets)
            {
                w.Draw(x, ref y, width);
            }

            WindowUtil.DrawInput(x, ref y, width, "Foraged Food", 100, (this.Def.foragedFood != null) ? this.Def.foragedFood.defName : "None",
                                 new WindowUtil.FloatOptionsArgs <ThingDef>()
            {
                items             = DefLookupUtil.GetSortedDefs(DefDatabase <ThingDef> .AllDefs),
                getDisplayName    = delegate(ThingDef d) { return(d.defName); },
                onSelect          = delegate(ThingDef d) { this.Def.foragedFood = d; },
                includeNullOption = true
            });

            this.DrawTerrainPatchMakers(x, ref y, width);
        }
 protected override void DrawInput(float x, ref float y, float width)
 {
     WindowUtil.DrawInput(x, ref y, width, base.label, this.labelWidth, Util.GetLabel(base.getValue(base.Parent)), this.args);
 }
 protected override void DrawInput(float x, ref float y, float width)
 {
     this.buffer = WindowUtil.DrawInput(x, ref y, width, this.label, this.value, delegate(float f) { base.setValue(this.Parent, f); }, this.buffer);
 }