Esempio n. 1
0
        private static IEnumerator CallBack(SkirmishMechBayPanel panel)
        {
            yield return(new WaitForEndOfFrame());

            try
            {
                if (mechDefsIterator == null)
                {
                    mechDefsIterator = panel.allMechs.GetEnumerator();
                }
                while (mechDefsIterator.MoveNext())
                {
                    var mechDef        = mechDefsIterator.Current;
                    var screenshotPath = DebugScreenshotMechsFeature.Shared.ScreenshotPath(mechDef);
                    if (File.Exists(screenshotPath))
                    {
                        continue;
                    }
                    if (DebugScreenshotMechsFeature.Shared.Settings.OnlyInvalidMechs &&
                        MechValidationRules.ValidateMechDef(MechValidationLevel.Full, panel.dataManager, mechDef, null).All(x => !x.Value.Any()))
                    {
                        continue;
                    }
                    panel.SelectMech(mechDef);
                    panel.OnEditMechClicked();
                    break;
                }
            }
            catch (Exception e)
            {
                Control.mod.Logger.LogError(e);
            }
        }
        private static IEnumerator CallBack(SkirmishMechBayPanel panel)
        {
            yield return(new WaitForEndOfFrame());

            try
            {
                if (mechDefsIterator == null)
                {
                    mechDefsIterator = panel.allMechs.GetEnumerator();
                }
                if (mechDefsIterator.MoveNext())
                {
                    panel.SelectMech(mechDefsIterator.Current);
                    panel.OnEditMechClicked();
                }
            }
            catch (Exception e)
            {
                Control.mod.Logger.LogError(e);
            }
        }