diff --git a/GUI.cpp b/GUI.cpp index b7b5ad1..1accc4e 100644 --- a/GUI.cpp +++ b/GUI.cpp @@ -1292,7 +1292,7 @@ bool __fastcall XgSaveSettings(void) ////////////////////////////////////////////////////////////////////////////// // クロスワードをチェックする。 -bool __fastcall XgCheckCrossWord(HWND hwnd, bool check_words = true) +bool __fastcall XgCheckCrossWord(HWND hwnd, bool check_words, bool loose) { // 四隅黒禁。 if ((xg_nRules & RULE_DONTCORNERBLACK) && xg_xword.CornerBlack()) { @@ -1332,20 +1332,22 @@ bool __fastcall XgCheckCrossWord(HWND hwnd, bool check_words = true) } } - // 黒マス点対称。 - if ((xg_nRules & RULE_POINTSYMMETRY) && !xg_xword.IsPointSymmetry()) { - XgCenterMessageBoxW(hwnd, XgLoadStringDx1(IDS_NOTPOINTSYMMETRY), nullptr, MB_ICONERROR); - return false; - } + if (!loose) { + // 黒マス点対称。 + if ((xg_nRules & RULE_POINTSYMMETRY) && !xg_xword.IsPointSymmetry()) { + XgCenterMessageBoxW(hwnd, XgLoadStringDx1(IDS_NOTPOINTSYMMETRY), nullptr, MB_ICONERROR); + return false; + } - // 黒マス線対称。 - if ((xg_nRules & RULE_LINESYMMETRYV) && !xg_xword.IsLineSymmetryV()) { - XgCenterMessageBoxW(hwnd, XgLoadStringDx1(IDS_NOTLINESYMMETRYV), nullptr, MB_ICONERROR); - return false; - } - if ((xg_nRules & RULE_LINESYMMETRYH) && !xg_xword.IsLineSymmetryH()) { - XgCenterMessageBoxW(hwnd, XgLoadStringDx1(IDS_NOTLINESYMMETRYH), nullptr, MB_ICONERROR); - return false; + // 黒マス線対称。 + if ((xg_nRules & RULE_LINESYMMETRYV) && !xg_xword.IsLineSymmetryV()) { + XgCenterMessageBoxW(hwnd, XgLoadStringDx1(IDS_NOTLINESYMMETRYV), nullptr, MB_ICONERROR); + return false; + } + if ((xg_nRules & RULE_LINESYMMETRYH) && !xg_xword.IsLineSymmetryH()) { + XgCenterMessageBoxW(hwnd, XgLoadStringDx1(IDS_NOTLINESYMMETRYH), nullptr, MB_ICONERROR); + return false; + } } // 偶数行数で黒マス線対称(タテ)の場合は連黒禁は不可。 diff --git a/GUI.hpp b/GUI.hpp index 123f686..f6001f5 100644 --- a/GUI.hpp +++ b/GUI.hpp @@ -20,6 +20,9 @@ bool XgOpenHintsByNotepad(HWND /*hwnd*/, bool bShowAnswer); // ヒントを表示するかどうか。 extern BOOL xg_bShowClues; +// クロスワードをチェックする。 +bool __fastcall XgCheckCrossWord(HWND hwnd, bool check_words = true, bool loose = false); + ////////////////////////////////////////////////////////////////////////////// // UIフォントの論理オブジェクトを取得する。 diff --git a/XG_CandsWnd.hpp b/XG_CandsWnd.hpp index 243216b..be980bb 100644 --- a/XG_CandsWnd.hpp +++ b/XG_CandsWnd.hpp @@ -8,9 +8,6 @@ struct XG_CandsButtonData WNDPROC m_fnOldWndProc; }; -// クロスワードをチェックする。 -bool __fastcall XgCheckCrossWord(HWND hwnd, bool check_words); - // 候補ウィンドウ。 class XG_CandsWnd : public XG_Window { @@ -143,7 +140,7 @@ class XG_CandsWnd : public XG_Window XG_CandsWnd::xg_vecCandidates.resize(xg_nMaxCandidates); if (XG_CandsWnd::xg_vecCandidates.empty()) { - if (XgCheckCrossWord(hwnd, false)) { + if (XgCheckCrossWord(hwnd, false, true)) { ::MessageBeep(0xFFFFFFFF); } else { return false;