Beispiel #1
0
        private void GameButton_DownloadClick(object sender, EventArgs e)
        {
            GameButton gb = (GameButton)sender;

            gb.DownloadButtonEnabled = false;
            Application.DoEvents();
            GameInfo gi = Program.Games[gb.Tag.ToString()];

            if (gi == null || !gi.HasSave)
            {
                return;
            }
            string userSavesPath = Path.Combine(Path.Combine(Program.Config["SavesPath"], gi.ID), _LoginedUserID);

            if (!Directory.Exists(userSavesPath))
            {
                MessageBox.Show("您沒有備份此遊戲進度資料!!", _CaptionText, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                CopyForm cf = new CopyForm(_LoginedUserID, true);
                cf.GameInfo = gi;
                if (cf.ShowDialog(this) == DialogResult.OK)
                {
                    MessageBox.Show("遊戲進度資料檔已下載完畢!!", _CaptionText, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("遊戲進度資料檔尚未下載完畢,請重新下載!!", _CaptionText, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            gb.DownloadButtonEnabled = true;
        }
Beispiel #2
0
        private void GameButton_UploadClick(object sender, EventArgs e)
        {
            GameButton gb = (GameButton)sender;

            gb.UploadButtonEnabled = false;
            Application.DoEvents();
            GameInfo gi = Program.Games[gb.Tag.ToString()];

            if (gi == null || !gi.HasSave)
            {
                return;
            }
            using (CopyForm cf = new CopyForm(_LoginedUserID, false))
            {
                cf.GameInfo = gi;
                DialogResult dr = cf.ShowDialog(this);
                switch (dr)
                {
                case DialogResult.OK:
                    MessageBox.Show("遊戲進度資料檔已上傳完畢!!", _CaptionText, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    break;

                case DialogResult.Abort:
                    MessageBox.Show("找不到遊戲進度儲存目錄,無法備份進度檔!!", _CaptionText, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    break;

                default:
                    MessageBox.Show("遊戲進度資料檔尚未備份完畢,請重新上傳!!", _CaptionText, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    break;
                }
                gb.UploadButtonEnabled = true;
            }
        }