Exemple #1
0
        public void DeleteAndClose()
        {
            var options = new List <FloatMenuOption>();

            options.Add(new FloatMenuOption("Fluffy.WorkTab.UnloadFavourite".Translate(),
                                            () => { FavouriteManager.Remove(favourite); Close(); }));
            options.Add(new FloatMenuOption("Fluffy.WorkTab.DeleteFavourite".Translate(),
                                            () => { FavouriteManager.Delete(favourite, true); Close(); }));
            Find.WindowStack.Add(new FloatMenu(options));
        }
Exemple #2
0
        public void ApplyAndClose()
        {
            var valid = FavouriteManager.IsValidLabel(label, favourite.Label);

            if (!valid)
            {
                Messages.Message(valid.Reason, MessageTypeDefOf.RejectInput, false);
                return;
            }

            if (label != favourite.Label)
            {
                FavouriteManager.Delete(favourite);
            }

            favourite.Icon  = textureChooser.Choice;
            favourite.Label = label;
            FavouriteManager.Save(favourite);
            Close();
        }