public static void Load(bool displaySuccessMessage = false) { MyMwcLog.WriteLine("MySmallShipTemplates.Load() - START"); MyMwcLog.IncreaseIndent(); for (int i = 0; i < m_templates.Length; i++) { m_templates[i] = new List <MySmallShipTemplate>(); } try { MyMwcObjectBuilder_SmallShipTemplates templatesBuilder; templatesBuilder = MyLocalCache.LoadGlobalData().Templates; foreach (var templateBuilder in templatesBuilder.SmallShipTemplates) { m_templates[(int)templateBuilder.Builder.ShipType].Add(new MySmallShipTemplate(templateBuilder)); } LoadTemplateTiers(); MyMwcLog.WriteLine("Load state - OK"); if (displaySuccessMessage) { MyGuiManager.AddScreen(new MyGuiScreenMessageBox(MyMessageBoxType.MESSAGE, Localization.MyTextsWrapperEnum.TemplatesLoadSuccess, Localization.MyTextsWrapperEnum.Success, Localization.MyTextsWrapperEnum.Ok, null)); } } catch (Exception ex) { MyMwcLog.WriteLine("Load state - ERROR"); MyMwcLog.WriteLine(ex.Message); MyGuiManager.AddScreen(new MyGuiScreenMessageBox(MyMessageBoxType.ERROR, Localization.MyTextsWrapperEnum.TemplatesLoadError, Localization.MyTextsWrapperEnum.Error, Localization.MyTextsWrapperEnum.Ok, onMessageBox)); } MyMwcLog.DecreaseIndent(); MyMwcLog.WriteLine("MySmallShipTemplates.Load() - END"); }