コード例 #1
0
ファイル: MainForm.cs プロジェクト: b2zeldafreak/WorldSmith
        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.
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Oplkill/WorldSmith
        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

        }
コード例 #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
        }
コード例 #4
0
ファイル: LuaHelper.cs プロジェクト: xfw5/WorldSmith
        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());
            }
        }
コード例 #5
0
ファイル: LuaHelper.cs プロジェクト: Oplkill/WorldSmith
        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();
            }
        }