示例#1
0
        private void LaunchGame()
        {
            var username = IsMF ? _ConfigManager.MFUsername : Environment.UserName;
            var originalAppScreensPath = PathHelper.GetOriginalAppScreensPathByUsername(username);

            if (GameStateHelper.HasUnknownRunningGame(new List <string> {
                _ConfigManager.MFPath,
                _ConfigManager.GFPath,
            }))
            {
                UtilHelper.ShowAlertDialog(new AlertDialogInterfaceModel {
                    Content = "有未知激战2客户端正在运行"
                });
                return;
            }

            if (!IOHelper.IsDirectoryLnk(originalAppScreensPath))
            {
                if (!IOHelper.IsDirectoryEmpty(originalAppScreensPath))
                {
                    var content = "创建截图文件夹快捷方式时遇到问题。\r\n\r\n截图文件夹:\r\n";
                    content += originalAppScreensPath;
                    content += "\r\n已有截图,需要对其进行迁移。\r\n\r\n请确认其截图属于美服还是国服,然后从下面选择。";

                    UtilHelper.ShowConfirmDialog(new ConfirmDialogInterfaceModel
                    {
                        Title             = "正在启动" + (IsMF ? "美服" : "国服"),
                        Content           = content,
                        ConfirmButtonText = "国服",
                        CancelButtonText  = "美服",
                        ShowClose         = true,
                        ConfirmCallback   = () =>
                        {
                            MoveScreensAndLaunch(originalAppScreensPath, _ConfigManager.GFPath);
                        },
                        CancelCallback = () =>
                        {
                            MoveScreensAndLaunch(originalAppScreensPath, _ConfigManager.MFPath);
                        },
                    });

                    return;
                }
            }

            DoLaunchGame();
        }