mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-29 10:22:53 +08:00
82 lines
2.4 KiB
C#
82 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace CodeWalker
|
|
{
|
|
static class Program
|
|
{
|
|
/// <summary>
|
|
/// The main entry point for the application.
|
|
/// </summary>
|
|
[STAThread]
|
|
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
|
|
}
|
|
}
|
|
}
|