Beispiel #1
0
        private static void DrawDefaultSettingButton(IEntityFilter filter, ref Rect baseRect)
        {
            Text.Font = GameFont.Tiny;
            float btHeight    = 24f;
            Rect  buttonRect1 = new Rect(baseRect.x, baseRect.y - btHeight - 2f, 140f, 24f);

            if (Widgets.ButtonText(buttonRect1, "DefaultEntityListSettingsButton".Translate(), true, false, true))
            {
                RestrictedEntityManager.DefaultCopyFrom(filter);
            }
        }
Beispiel #2
0
        public override void PostSpawnSetup(bool respawningAfterLoad)
        {
            this.propDef = this.props as EntityListCompDef;
            if (this.propDef == null)
            {
                Log.Error(DebugLog.GetMethodName() + "EntityListCompDef is NULL");
            }

            this.filter.slotGroupParent = this.parent as ISlotGroupParent;

            parent.Map.GetComponent <RestrictedEntityManager>().Register(this.filter);

            if (propDef.listType != null)
            {
                this.label       = propDef.listType.label;
                this.description = propDef.listType.description;
            }
            if (!filter.IsLoaded)
            {
                RestrictedEntityManager.DefaultPasteTo(filter);
            }
            base.PostSpawnSetup(respawningAfterLoad);
        }