Exemplo n.º 1
0
        private static void ValidateExpandedEvents()
        {
            var wereChanges = false;

            // TODO: Check to see if this fixes the issue described below.
            Store_IncidentEditor.LoadCopies();

            // We're not going to update this to use EventExtension
            // since it appears to wipe previous settings.
            foreach (StoreIncident incident in DefDatabase <StoreIncident> .AllDefs.Where(
                         i => i.defName == "BuyPawn" || i.defName == "AddTrait" || i.defName == "RemoveTrait"
                         ))
            {
                if (incident.cost <= 1)
                {
                    continue;
                }

                incident.cost = 1;
                wereChanges   = true;
            }

            if (wereChanges)
            {
                Store_IncidentEditor.UpdatePriceSheet();
            }
        }
Exemplo n.º 2
0
        /// <inheritdoc cref="Window.PreClose"/>
        public override void PreClose()
        {
            base.PreClose();

            Store_ItemEditor.UpdateStoreItemList();
            Store_IncidentEditor.UpdatePriceSheet();
            Toolkit.Mod.WriteSettings();

            Task.Run(
                async() =>
            {
                switch (TkSettings.DumpStyle)
                {
                case "SingleFile":
                    await Data.SaveLegacyShopAsync(Paths.LegacyShopDumpFilePath);

                    return;

                case "MultiFile":
                    await Data.SaveTraitsAsync(Paths.TraitFilePath);
                    await Data.SavePawnKindsAsync(Paths.PawnKindFilePath);

                    return;
                }

                await Data.SaveItemDataAsync(Paths.ItemDataFilePath);
                await Data.SaveEventDataAsync(Paths.EventDataFilePath);
            }
                )
            .ConfigureAwait(false);
        }
 public override void PostClose()
 {
     MakeSureSaveExists(true);
     Store_IncidentEditor.UpdatePriceSheet();
 }
Exemplo n.º 4
0
 public override void PostClose()
 {
     MakeSureSaveExists(true);
     Store_IncidentEditor.UpdatePriceSheet();
     Toolkit.Mod.WriteSettings();
 }
Exemplo n.º 5
0
        public override void Close(bool doCloseSound = true)
        {
            Store_IncidentEditor.UpdatePriceSheet();

            base.Close(doCloseSound);
        }
Exemplo n.º 6
0
 public StoreIncidentsWindow()
 {
     Store_IncidentEditor.UpdatePriceSheet();
 }