{"record":{"id":"255815ef2be88bbb","repo":"babalae/better-genshin-impact","slug":"error-255815","errorCode":null,"errorMessage":"当前不在地图界面","messagePattern":"当前不在地图界面","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs","lineNumber":2150,"sourceCode":"    private Point2f GetBigMapCenterPoint(string mapName, Point2f? expectedCenterPoint)\n    {\n        // 判断是否在地图界面\n        using var ra = CaptureToRectArea();\n        using var mapScaleButtonRa = ra.Find(GetQuickTeleportRecognitionObject(\"MapScaleButton\", ra));\n        if (mapScaleButtonRa.IsExist())\n        {\n            var p = RecognizeBigMapCenterPoint(mapName, ra.CacheGreyMat, expectedCenterPoint);\n\n            if (p.IsEmpty())\n            {\n                throw new MapPositionNotRecognizedException(\"大地图特征点匹配识别位置失败\");\n            }\n\n            return p;\n        }\n        else\n        {\n            throw new InvalidOperationException(\"当前不在地图界面\");\n        }\n    }\n\n    private Point2f RecognizeBigMapCenterPoint(string mapName, Mat greyMat, Point2f? expectedCenterPoint = null)\n    {\n        Point2f p;\n        try\n        {\n            var map = MapManager.GetMap(mapName, _mapMatchingMethod);\n            p = expectedCenterPoint is Point2f expectedCenter\n                ? map.GetBigMapPosition(greyMat, map.ConvertGenshinMapCoordinatesToImageCoordinates(expectedCenter))\n                : map.GetBigMapPosition(greyMat);\n        }\n        catch (Exception ex)\n        {\n            throw new MapPositionNotRecognizedException(\"大地图特征点匹配引发异常：\" + ex.Message, ex);\n        }\n","sourceCodeStart":2132,"sourceCodeEnd":2168,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs#L2132-L2168","documentation":"Thrown by GetBigMapCenterPoint when the MapScaleButton recognition object is not found in the captured screen region. This is the precondition check confirming the game is displaying the big map UI. If the button template isn't matched, the code assumes the map screen is not open.","triggerScenarios":"Called from GetBigMapCenterPoint(mapName, expectedCenterPoint). ra.Find(GetQuickTeleportRecognitionObject(\"MapScaleButton\", ra)).IsExist() returns false.","commonSituations":"Game is on the main game screen or a different UI panel, not the big map; the map was closed or a dialog is overlaying it; map UI rendering not complete; the MapScaleButton template doesn't match due to resolution/scaling differences.","solutions":["Open the big map in-game (press M or the configured map key) before calling this method.","Wait for the map UI to fully render before invoking.","Verify the capture resolution and display scaling match the MapScaleButton template expectations.","Update the MapScaleButton recognition asset if the map UI changed in a game update."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify the map is open before calling GetBigMapCenterPoint\nusing var ra = task.CaptureToRectArea();\nusing var btn = ra.Find(task.GetQuickTeleportRecognitionObject(\"MapScaleButton\", ra));\nif (!btn.IsExist())\n{\n    throw new InvalidOperationException(\"Big map is not open. Press M first.\");\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    var center = task.GetBigMapCenterPoint(mapName);\n}\ncatch (InvalidOperationException ex) when (ex.Message == \"当前不在地图界面\")\n{\n    // Open the map and retry\n}","preventionTips":["Always open the big map (press M) and wait for full render before calling.","Verify the MapScaleButton template matches the current game UI.","Check capture resolution and display scaling settings."],"tags":["map-navigation","precondition","game-ui","template-matching"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}