Exemplo n.º 1
0
 internal static void CreateLocalCopy(ModMetaData mod, bool batch = false)
 {
     LongEventHandler.QueueLongEvent(() =>
     {
         ModMetaData copy;
         LongEventHandler.SetCurrentEventText(I18n.CreatingLocal(mod.Name));
         if (TryCreateLocalCopy(mod, out copy))
         {
             var button = ModButton_Installed.For(copy);
             if (batch)
             {
                 _batchCreatedCopies.Add(new Pair <ModButton_Installed, ModMetaData>(button, copy));
             }
             else
             {
                 Messages.Message(I18n.CreateLocalSucceeded(mod.Name), MessageTypeDefOf.NeutralEvent, false);
                 LongEventHandler.QueueLongEvent(() => button.Notify_VersionAdded(copy, true), "", true, null);
             }
         }
         else
         {
             Messages.Message(I18n.CreateLocalFailed(mod.Name), MessageTypeDefOf.RejectInput, false);
         }
     }, null, true, null);
 }