static void Main() { #if GENERATECLASSES GenerateClasses(); #else ConsoleRedirect = new ConsoleStringWriter(); Console.SetOut(ConsoleRedirect); //Set up the crash handler AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Prompt the user to specify the Dota 2 path if it has not been set InitialSetup initial = new InitialSetup(true); if (!initial.IsDotaDirSet()) { Application.Exit(); return; } // Ensure that the AddOnPath user setting was set if (!initial.IsAddOnPathSet()) { Application.Exit(); return; } Application.ApplicationExit += Application_ApplicationExit; System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.CreateSpecificCulture(Properties.Settings.Default.Language); // Extract the Dota 2 pack01_dir VPK file and load all of the data AssetLoadingDialog assets = new AssetLoadingDialog(); assets.ShowDialog(AssetLoadingDialog.InitialLoad); //Construct the main form and load the default project (if any). MainForm mainForm = new MainForm(); if (IsLoaddedAddonDirectoryValid()) { mainForm.LoadProject(Properties.Settings.Default.LoadedAddonDirectory); } CheckForUpdate.Check(true); Application.Run(mainForm); Properties.Settings.Default.Save(); #endif }
static void Main() { // DataSchema.DataClassGenerator.FindPossibleValuesForKey(@"E:\Dota2SDK\root\scripts\npc\items.txt", "ItemDeclarations"); #if GENERATECLASSES string outputDir = "../../DataClasses/"; string unitDir = outputDir + "ScriptTypes/"; string inputDir = "../../DataSchema/"; DataSchema.DataClassGenerator.GenerateClassForSchema(inputDir + "BaseUnitSchema.txt", unitDir); DataSchema.DataClassGenerator.GenerateClassForSchema(inputDir + "HeroSchema.txt", unitDir); DataSchema.DataClassGenerator.GenerateClassForSchema(inputDir + "UnitSchema.txt", unitDir); DataSchema.DataClassGenerator.GenerateClassForSchema(inputDir + "AbilitySchema.txt", unitDir); DataSchema.DataClassGenerator.GenerateClassForSchema(inputDir + "ItemSchema.txt", unitDir); #else Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!Properties.Settings.Default.ranonce) { InitialSetup initial = new InitialSetup(true); if (initial.ShowDialog() == DialogResult.OK) { Properties.Settings.Default.ranonce = true; Properties.Settings.Default.Save(); } else { Application.Exit(); return; } } AssetLoadingDialog assets = new AssetLoadingDialog(); assets.ShowDialog(AssetLoadingDialog.InitialLoad); if (Properties.Settings.Default.AddonPath != "") { assets = new AssetLoadingDialog(); assets.ShowDialog(AssetLoadingDialog.AddonLoadTasks); } Application.ApplicationExit += Application_ApplicationExit; Application.Run(mainForm = new MainForm()); Properties.Settings.Default.Save(); #endif }
static void Main() { #if GENERATECLASSES GenerateClasses(); #else Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!Properties.Settings.Default.ranonce) { InitialSetup initial = new InitialSetup(true); if (initial.ShowDialog() == DialogResult.OK) { Properties.Settings.Default.ranonce = true; Properties.Settings.Default.Save(); } else { Application.Exit(); return; } } AssetLoadingDialog assets = new AssetLoadingDialog(); assets.ShowDialog(AssetLoadingDialog.InitialLoad); if (Properties.Settings.Default.AddonPath != "") { assets = new AssetLoadingDialog(); assets.ShowDialog(AssetLoadingDialog.AddonLoadTasks); } Application.ApplicationExit += Application_ApplicationExit; System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.CreateSpecificCulture(Properties.Settings.Default.language); Application.Run(mainForm = new MainForm()); Properties.Settings.Default.Save(); #endif }