Esempio n. 1
0
        public MainForm()
        {
            InitializeComponent();
            InitTabs();


            // Create a dummy context menu
            _contextMenu = new ContextMenuStrip();
            ToolStripMenuItem menuItem1 = new ToolStripMenuItem("Option &1");
            ToolStripMenuItem menuItem2 = new ToolStripMenuItem("Option &2");
            ToolStripMenuItem menuItem3 = new ToolStripMenuItem("Option &3");

            _contextMenu.Items.Add(menuItem1);
            _contextMenu.Items.Add(menuItem2);
            _contextMenu.Items.Add(menuItem3);

            //Create the console and lock it
            ConsoleForm = new ConsoleForm();
            ConsoleForm.Show(dockPanel, DockState.DockBottom);
            _consoleWriter = new ConsoleStringWriter(ConsoleForm);
            Console.SetOut(_consoleWriter);

            //Create the start page
            ShowStartPage();

            PrimaryDockingPanel = dockPanel; //Set a static accessor to our docking panel for all default controls to go to.
        }
Esempio n. 2
0
        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

        }
Esempio n. 3
0
        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
        }
Esempio n. 4
0
        public static string DoScratchpadString(string text, ConsoleStringWriter sw)
        {
            StringWriter = sw;
            try
            {
                var ret = ScratchpadState.DoString(text);

                if (ret == null)
                {
                    return(null);
                }
                return(String.Join(",", ret));
            }
            catch (LuaException e)
            {
                return(e.ToString());
            }
        }
Esempio n. 5
0
        public static string DoScratchpadString(string text, ConsoleStringWriter sw)
        {
            StringWriter = sw;
            try
            {
                var ret = ScratchpadState.DoString(text);

                if (ret == null) return null;
                return String.Join(",", ret);
            }
            catch (LuaException e)
            {
                return e.ToString();
            }
        }