次の一手の編集で漢字で場所をメッセージに表示するように
| @@ -45,7 +45,45 @@ | ||
| 45 | 45 | "反則勝ち"} |
| 46 | 46 | Return array |
| 47 | 47 | End Get |
| 48 | + | |
| 48 | 49 | End Property |
| 50 | + | |
| 51 | + Private sujiStrArray() As String = {"", "1", "2", "3", "4", "5", "6", "7", "8", "9"} | |
| 52 | + Private kanjiNumberStrArray() As String = { | |
| 53 | + "", "一", "二", "三", "四", "五", "六", "七", "八", "九", | |
| 54 | + "十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八"} | |
| 55 | + | |
| 56 | + Public Function MoveToString(te As Te, prevTe As Te) As String | |
| 57 | + | |
| 58 | + Dim text As New System.Text.StringBuilder | |
| 59 | + | |
| 60 | + If te.IsNullMove Then | |
| 61 | + Return NullMoveToString(te.NullMoveType) | |
| 62 | + End If | |
| 63 | + | |
| 64 | + If prevTe IsNot Nothing AndAlso prevTe.ToLocation.Equals(te.ToLocation) Then | |
| 65 | + text.Append("同 ") | |
| 66 | + Else | |
| 67 | + text.Append(sujiStrArray(te.ToLocation.Col)) | |
| 68 | + text.Append(kanjiNumberStrArray(te.ToLocation.Row)) | |
| 69 | + End If | |
| 70 | + | |
| 71 | + text.Append(KomaToName(te.Piece.Value)) | |
| 72 | + | |
| 73 | + If te.Promote Then | |
| 74 | + text.Append("成") | |
| 75 | + End If | |
| 76 | + | |
| 77 | + If te.FromLocation.IsMochigoma Then | |
| 78 | + text.Append("打") | |
| 79 | + Else | |
| 80 | + text.AppendFormat("({0}{1})", te.FromLocation.Col, te.FromLocation.Row) | |
| 81 | + End If | |
| 82 | + | |
| 83 | + Return text.ToString | |
| 84 | + | |
| 85 | + End Function | |
| 86 | + | |
| 49 | 87 | End Class |
| 50 | 88 | |
| 51 | 89 | End Namespace |
| @@ -162,7 +162,9 @@ | ||
| 162 | 162 | |
| 163 | 163 | If rbEdit.Checked AndAlso rbNextMove.Checked Then |
| 164 | 164 | |
| 165 | - Dim ret As DialogResult = MessageBox.Show("次の一手はこれでよいですか?", "確認", MessageBoxButtons.OKCancel) | |
| 165 | + Dim msg As String = String.Format("次の一手は""{0}""でよいですか?", | |
| 166 | + Board.Kifu.KifKifuUtil.GetInstance.MoveToString(e.MovingValue, Nothing)) | |
| 167 | + Dim ret As DialogResult = MessageBox.Show(msg, "確認", MessageBoxButtons.OKCancel) | |
| 166 | 168 | If ret = Windows.Forms.DialogResult.Cancel Then |
| 167 | 169 | Viewer.kyokumen = _editKifu.KyokumenList(0) |
| 168 | 170 | Viewer.DrawCurrentBitmap() |