Example #1
0
        private async void BTN_LaunchWC3_Click(object sender, EventArgs e)
        {
            string LastInstallPath = Settings.InstallPath;

            if (!File.Exists(Path.Combine(LastInstallPath, "JNLoader.exe")))
            {
                OpenFileDialog FDialog = new OpenFileDialog
                {
                    Title  = "실행 파일을 선택하세요.",
                    Filter = "워크래프트 EXE파일|JNLoader.exe;Warcraft III.exe;war3.exe"
                };
                if (FDialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                Settings.InstallPath = LastInstallPath = Path.GetDirectoryName(FDialog.FileName);
                string MixPath = $"{LastInstallPath}\\Cirnix";
                if (!File.Exists(MixPath + ".mix"))
                {
                    File.WriteAllBytes(MixPath + ".mix", Global.Properties.Resources.Cirnix);
                    NativeMethods.WritePrivateProfileString("Cirnix", "Mana Bar", "0", MixPath + ".ini");
                    NativeMethods.WritePrivateProfileString("Cirnix", "Show AS & MS in Number", "1", MixPath + ".ini");
                }
            }
            if (Memory.Component.Warcraft3Info.Process != null)
            {
                if (MetroDialog.YesNo("기존 프로세스 감지 됨", "Warcraft III 프로세스가 아직 실행 중입니다.\n종료하고 실행하시겠습니까?"))
                {
                    if (!Memory.Component.Warcraft3Info.Close())
                    {
                        MetroDialog.OK("액세스 오류", "Warcraft III 프로세스를 종료할 수 없었습니다.\n작업 관리자에서 수동으로 프로세스를 종료하세요.");
                        return;
                    }
                }
                else
                {
                    return;
                }
            }
            GameModule.StartWarcraft3(LastInstallPath, MetroDialog.Select("화면 표기 설정", "창 모드", "전체 창", "전체화면"));
        }
Example #2
0
        internal static async void Rework(string[] args)
        {
            string LastInstallPath = Path.GetDirectoryName(Warcraft3Info.Process.MainModule.FileName);

            Settings.InstallPath = LastInstallPath;
            string[] procArgs = GetArguments(Warcraft3Info.ID);
            Warcraft3Info.Close();

            await Task.Delay(2000);

            int windowState = 1;

            if (procArgs.Length != 0)
            {
                switch (procArgs[0].ToLower())
                {
                case "-windows": windowState = 0; break;

                case "-nativefullscr": windowState = 2; break;
                }
            }
            await GameModule.StartWarcraft3(LastInstallPath, windowState);
        }