Example #1
0
        private void OkButton_Click(object sender, EventArgs e)
        {
            if (!GTAFolder.ValidateGTAFolder(SelectedFolder, out string failReason))
            {
                MessageBox.Show("The selected folder could not be used:\n\n" + failReason, "Invalid GTA Folder", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            Result = DialogResult.OK;
            Close();
        }
Example #2
0
        private void Init()
        {
            //called from VehicleForm_Load

            if (!initedOk)
            {
                Close();
                return;
            }


            MouseWheel += VehicleForm_MouseWheel;

            if (!GTAFolder.UpdateGTAFolder(true))
            {
                Close();
                return;
            }



            ShaderParamNames[] texsamplers = RenderableGeometry.GetTextureSamplerList();
            foreach (var texsampler in texsamplers)
            {
                TextureSamplerComboBox.Items.Add(texsampler);
            }
            //TextureSamplerComboBox.SelectedIndex = 0;//LoadSettings will do this..


            UpdateGridVerts();
            GridSizeComboBox.SelectedIndex  = 1;
            GridCountComboBox.SelectedIndex = 1;



            Input.Init();


            Renderer.Start();
        }
Example #3
0
        static void Main(string[] args)
        {
            bool menumode     = false;
            bool explorermode = false;
            bool projectmode  = false;

            if ((args != null) && (args.Length > 0))
            {
                foreach (string arg in args)
                {
                    string argl = arg.ToLowerInvariant();
                    if (argl == "menu")
                    {
                        menumode = true;
                    }
                    if (argl == "explorer")
                    {
                        explorermode = true;
                    }
                    if (argl == "project")
                    {
                        projectmode = true;
                    }
                }
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            // Always check the GTA folder first thing
            if (!GTAFolder.UpdateGTAFolder(Properties.Settings.Default.RememberGTAFolder))
            {
                MessageBox.Show("Could not load CodeWalker because no valid GTA 5 folder was selected. CodeWalker will now exit.", "GTA 5 Folder Not Found", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
#if !DEBUG
            try
            {
#endif
            if (menumode)
            {
                Application.Run(new MenuForm());
            }
            else if (explorermode)
            {
                Application.Run(new ExploreForm());
            }
            else if (projectmode)
            {
                Application.Run(new Project.ProjectForm());
            }
            else
            {
                Application.Run(new WorldForm());
            }
#if !DEBUG
        }

        catch (Exception ex)
        {
            MessageBox.Show("An unexpected error was encountered!\n" + ex.ToString());
            //this can happen if folder wasn't chosen, or in some other catastrophic error. meh.
        }
#endif
        }
Example #4
0
 private void FolderBrowseButton_Click(object sender, EventArgs e)
 {
     GTAFolder.UpdateGTAFolder(false);
     FolderTextBox.Text = GTAFolder.CurrentGTAFolder;
 }