svnno****@sourc*****
svnno****@sourc*****
2014年 9月 13日 (土) 22:03:07 JST
Revision: 57 http://sourceforge.jp/projects/shoginextmove/scm/svn/commits/57 Author: bellyoshi Date: 2014-09-13 22:03:06 +0900 (Sat, 13 Sep 2014) Log Message: ----------- 次の一手の編集で漢字で場所をメッセージに表示するように Modified Paths: -------------- ShogiNextMove/Board/Kifu/KifKifuUtil.vb ShogiNextMove/frmMain.vb Modified: ShogiNextMove/Board/Kifu/KifKifuUtil.vb =================================================================== --- ShogiNextMove/Board/Kifu/KifKifuUtil.vb 2014-09-13 12:31:15 UTC (rev 56) +++ ShogiNextMove/Board/Kifu/KifKifuUtil.vb 2014-09-13 13:03:06 UTC (rev 57) @@ -45,7 +45,45 @@ "反則勝ち"} Return array End Get + End Property + + Private sujiStrArray() As String = {"", "1", "2", "3", "4", "5", "6", "7", "8", "9"} + Private kanjiNumberStrArray() As String = { + "", "一", "二", "三", "四", "五", "六", "七", "八", "九", + "十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八"} + + Public Function MoveToString(te As Te, prevTe As Te) As String + + Dim text As New System.Text.StringBuilder + + If te.IsNullMove Then + Return NullMoveToString(te.NullMoveType) + End If + + If prevTe IsNot Nothing AndAlso prevTe.ToLocation.Equals(te.ToLocation) Then + text.Append("同 ") + Else + text.Append(sujiStrArray(te.ToLocation.Col)) + text.Append(kanjiNumberStrArray(te.ToLocation.Row)) + End If + + text.Append(KomaToName(te.Piece.Value)) + + If te.Promote Then + text.Append("成") + End If + + If te.FromLocation.IsMochigoma Then + text.Append("打") + Else + text.AppendFormat("({0}{1})", te.FromLocation.Col, te.FromLocation.Row) + End If + + Return text.ToString + + End Function + End Class End Namespace Modified: ShogiNextMove/frmMain.vb =================================================================== --- ShogiNextMove/frmMain.vb 2014-09-13 12:31:15 UTC (rev 56) +++ ShogiNextMove/frmMain.vb 2014-09-13 13:03:06 UTC (rev 57) @@ -162,7 +162,9 @@ If rbEdit.Checked AndAlso rbNextMove.Checked Then - Dim ret As DialogResult = MessageBox.Show("次の一手はこれでよいですか?", "確認", MessageBoxButtons.OKCancel) + Dim msg As String = String.Format("次の一手は""{0}""でよいですか?", + Board.Kifu.KifKifuUtil.GetInstance.MoveToString(e.MovingValue, Nothing)) + Dim ret As DialogResult = MessageBox.Show(msg, "確認", MessageBoxButtons.OKCancel) If ret = Windows.Forms.DialogResult.Cancel Then Viewer.kyokumen = _editKifu.KyokumenList(0) Viewer.DrawCurrentBitmap()