// Token: 0x06000007 RID: 7 RVA: 0x0000219C File Offset: 0x0000039C
        public override IEnumerable <Gizmo> GetGizmos()
        {
            IEnumerable <Gizmo> gizmos = base.GetGizmos();

            return(SaveStorageSettingsGizmoUtil.AddSaveLoadGizmos(gizmos, "DisplayCases", this.settings.filter, 987767552));
        }
        public override IEnumerable <Gizmo> GetGizmos()
        {
            List <Gizmo> l = new List <Gizmo>(base.GetGizmos());

            return(SaveStorageSettingsGizmoUtil.AddSaveLoadGizmos(l, "fridge", this.settings.filter));
        }
        public override IEnumerable <Gizmo> GetGizmos()
        {
            List <Gizmo> gizmos = new List <Gizmo>(base.GetGizmos());

            gizmos.Add(new Command_Action
            {
                icon          = ContentFinder <Texture2D> .Get("UI/Icons/Rename", true),
                defaultDesc   = "RimFridge.RenameTheRefrigerator".Translate(),
                defaultLabel  = "Rename".Translate(),
                activateSound = SoundDef.Named("Click"),
                action        = delegate { Find.WindowStack.Add(new Dialog_Rename(this)); },
                groupKey      = 887767542
            });

            float offsetN10 = this.RoundedToCurrentTempModeOffset(-10f);

            gizmos.Add(new Command_Action
            {
                action = delegate
                {
                    this.InterfaceChangeTargetTemperature(offsetN10);
                },
                defaultLabel = offsetN10.ToStringTemperatureOffset("F0"),
                defaultDesc  = "CommandLowerTempDesc".Translate(),
                hotKey       = KeyBindingDefOf.Misc5,
                icon         = ContentFinder <Texture2D> .Get("UI/Commands/TempLower", true)
            });

            float offsetN1 = this.RoundedToCurrentTempModeOffset(-1f);

            gizmos.Add(new Command_Action
            {
                action = delegate
                {
                    this.InterfaceChangeTargetTemperature(offsetN1);
                },
                defaultLabel = offsetN1.ToStringTemperatureOffset("F0"),
                defaultDesc  = "CommandLowerTempDesc".Translate(),
                hotKey       = KeyBindingDefOf.Misc4,
                icon         = ContentFinder <Texture2D> .Get("UI/Commands/TempLower", true)
            });

            gizmos.Add(new Command_Action
            {
                action = delegate
                {
                    this.DesiredTemp = DEFAULT_DESIRED_TEMP;
                    this.ThrowCurrentTemperatureText();
                },
                defaultLabel = "CommandResetTemp".Translate(),
                defaultDesc  = "CommandResetTempDesc".Translate(),
                hotKey       = KeyBindingDefOf.Misc1,
                icon         = ContentFinder <Texture2D> .Get("UI/Commands/TempReset", true)
            });

            float offset1 = this.RoundedToCurrentTempModeOffset(1f);

            gizmos.Add(new Command_Action
            {
                action = delegate
                {
                    this.InterfaceChangeTargetTemperature(offset1);
                },
                defaultLabel = "+" + offset1.ToStringTemperatureOffset("F0"),
                defaultDesc  = "CommandRaiseTempDesc".Translate(),
                hotKey       = KeyBindingDefOf.Misc2,
                icon         = ContentFinder <Texture2D> .Get("UI/Commands/TempRaise", true)
            });

            float offset10 = this.RoundedToCurrentTempModeOffset(10f);

            gizmos.Add(new Command_Action
            {
                action = delegate
                {
                    this.InterfaceChangeTargetTemperature(offset10);
                },
                defaultLabel = "+" + offset10.ToStringTemperatureOffset("F0"),
                defaultDesc  = "CommandRaiseTempDesc".Translate(),
                hotKey       = KeyBindingDefOf.Misc3,
                icon         = ContentFinder <Texture2D> .Get("UI/Commands/TempRaise", true)
            });

            return(SaveStorageSettingsGizmoUtil.AddSaveLoadGizmos(
                       gizmos, SaveTypeEnum.Zone_Stockpile, this.settings.filter));
        }
Exemple #4
0
        public override IEnumerable <Gizmo> GetGizmos()
        {
            IEnumerable <Gizmo> enumerables = base.GetGizmos();

            List <Gizmo> l;

            if (enumerables != null)
            {
                l = new List <Gizmo>(enumerables);
            }
            else
            {
                l = new List <Gizmo>(1);
            }

            int groupKey = this.GetType().Name.GetHashCode();

            Command_Action a = new Command_Action();

            a.icon          = WidgetUtil.manageapparelTexture;
            a.defaultDesc   = "ChangeDresser.ManageApparelDesc".Translate();
            a.defaultLabel  = "ChangeDresser.ManageApparel".Translate();
            a.activateSound = SoundDef.Named("Click");
            a.action        = delegate { Find.WindowStack.Add(new UI.StorageUI(this, null)); };
            a.groupKey      = groupKey;
            ++groupKey;
            l.Add(a);

            a               = new Command_Action();
            a.icon          = WidgetUtil.assignweaponsTexture;
            a.defaultDesc   = "ChangeDresser.AssignOutfitsDesc".Translate();
            a.defaultLabel  = "ChangeDresser.AssignOutfits".Translate();
            a.activateSound = SoundDef.Named("Click");
            a.action        = delegate { Find.WindowStack.Add(new UI.AssignOutfitUI(this)); };
            a.groupKey      = groupKey;
            ++groupKey;
            l.Add(a);

            a               = new Command_Action();
            a.icon          = WidgetUtil.customapparelTexture;
            a.defaultDesc   = "ChangeDresser.CustomOutfitsDesc".Translate();
            a.defaultLabel  = "ChangeDresser.CustomOutfits".Translate();
            a.activateSound = SoundDef.Named("Click");
            a.action        = delegate { Find.WindowStack.Add(new UI.CustomOutfitUI(this)); };
            a.groupKey      = groupKey;
            ++groupKey;
            l.Add(a);

            a               = new Command_Action();
            a.icon          = WidgetUtil.emptyTexture;
            a.defaultDesc   = "ChangeDresser.EmptyDesc".Translate();
            a.defaultLabel  = "ChangeDresser.Empty".Translate();
            a.activateSound = SoundDef.Named("Click");
            a.action        =
                delegate
            {
                this.Empty <Apparel>();
            };
            a.groupKey = groupKey;
            ++groupKey;
            l.Add(a);

            a               = new Command_Action();
            a.icon          = WidgetUtil.collectTexture;
            a.defaultDesc   = "ChangeDresser.CollectDesc".Translate();
            a.defaultLabel  = "ChangeDresser.Collect".Translate();
            a.activateSound = SoundDef.Named("Click");
            a.action        =
                delegate
            {
                this.ReclaimApparel();
            };
            a.groupKey = groupKey;
            ++groupKey;
            l.Add(a);

            a = new Command_Action();
            if (this.includeInTradeDeals)
            {
                a.icon = WidgetUtil.yesSellTexture;
            }
            else
            {
                a.icon = WidgetUtil.noSellTexture;
            }
            a.defaultDesc   = "ChangeDresser.IncludeInTradeDealsDesc".Translate();
            a.defaultLabel  = "ChangeDresser.IncludeInTradeDeals".Translate();
            a.activateSound = SoundDef.Named("Click");
            a.action        =
                delegate
            {
                this.includeInTradeDeals = !this.includeInTradeDeals;
            };
            a.groupKey = groupKey;
            ++groupKey;
            l.Add(a);

            a = new Command_Action();
            if (this.UseDresserToDressFrom)
            {
                a.icon = WidgetUtil.yesDressFromTexture;
            }
            else
            {
                a.icon = WidgetUtil.noDressFromTexture;
            }
            a.defaultDesc   = "ChangeDresser.UseDresserToDressFromDesc".Translate();
            a.defaultLabel  = "ChangeDresser.UseDresserToDressFrom".Translate();
            a.activateSound = SoundDef.Named("Click");
            a.action        =
                delegate
            {
                this.UseDresserToDressFrom = !this.UseDresserToDressFrom;
                if (this.UseDresserToDressFrom)
                {
                    WorldComp.AddDresser(this);
                }
                else
                {
                    WorldComp.RemoveDesser(this);
                }
            };
            a.groupKey = groupKey;
            ++groupKey;
            l.Add(a);

            return(SaveStorageSettingsGizmoUtil.AddSaveLoadGizmos(l, SaveTypeEnum.Apparel_Management, this.settings.filter));
        }
Exemple #5
0
        //public float y=0f;
        public override IEnumerable <Gizmo> CompGetGizmosExtra()
        {
            List <Gizmo> gizmos = new List <Gizmo>(base.CompGetGizmosExtra())
            {
                new Command_Action
                {
                    icon         = ContentFinder <Texture2D> .Get("UI/Commands/RenameZone", true),
                    defaultLabel = "CommandRenameZoneLabel".Translate(),
                    action       = delegate()
                    {
                        Find.WindowStack.Add(new Dialog_RenameDSU(this));
                    },
                    hotKey = KeyBindingDefOf.Misc1
                }
            };

            if (base.parent is Building_Storage s)
            {
                SaveStorageSettingsGizmoUtil.AddSaveLoadGizmos(gizmos, SaveTypeEnum.Zone_Stockpile, s.settings.filter);
            }

#if DEBUG
            gizmos.Add(new Command_Toggle {
                defaultLabel = "Use RClick Logic",
                defaultDesc  = "Toggle use of custom Right Click logic",
                isActive     = (() => Settings.useDeepStorageRightClickLogic),
                toggleAction = delegate() {
                    Settings.useDeepStorageRightClickLogic = !Settings.useDeepStorageRightClickLogic;
                }
            });
            gizmos.Add(new Command_Action {
                defaultLabel = "Items in Region",
                action       = delegate() {
                    Log.Warning("ListerThings for " + parent + " (at region at position " + parent.Position + ")");
                    foreach (var t in parent.Position.GetRegion(parent.Map).ListerThings
                             .ThingsMatching(ThingRequest.ForGroup(ThingRequestGroup.HaulableEver)))
                    {
                        Log.Message("  " + t);
                    }
                }
            });
#endif

#if false
            gizmos.Add(new Command_Action {
                defaultLabel = "Y-=.1",
                action       = delegate() {
                    y -= 0.1f;
                    Messages.Message("Offset: " + y, MessageTypeDefOf.NeutralEvent);
                }
            });
            gizmos.Add(new Command_Action {
                defaultLabel = "Y+=.1",
                action       = delegate() {
                    y += 0.1f;
                    Messages.Message("Offset: " + y, MessageTypeDefOf.NeutralEvent);
                }
            });
#endif

            // I left this lovely testing code in - oops.
            //gizmos.Add(new Command_Action
            //{
            //    defaultLabel = "Minus One",
            //    action=delegate ()
            //    {
            //        foreach (var cl in parent.GetSlotGroup().CellsList)
            //        {
            //            foreach (Thing t in parent.Map.thingGrid.ThingsAt(cl))
            //            {
            //                if (t.def.category == ThingCategory.Item)
            //                {
            //                    if (t.stackCount > 1)
            //                    {
            //                        Log.Warning("Lowering " + t.ToString());
            //                        t.stackCount--;
            //                    }
            //                }// item
            //            }// each thing
            //        }// each cell
            //    },// end action
            //});

            return(gizmos);
        }