Skip to content

Commit 0048240

Browse files
authored
Merge pull request #34 from baolibaobao/main2
补充高亮提示
2 parents 6b42d94 + f186712 commit 0048240

4 files changed

Lines changed: 63 additions & 21 deletions

File tree

SourceCode/JinChanChanTool/DataClass/StaticData/JccCoordinateTemplates.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,29 +58,29 @@ public static class JccCoordinateTemplates
5858
// --- 备用区域 ---
5959

6060
/// <summary>
61-
/// 第一个卡槽的可点击区域
61+
/// 第一个卡槽的高亮/点击区域
6262
/// </summary>
63-
public static readonly AnchorProfile CardSlot1_Click = new(-301.5, -47.5, 155, 125);
63+
public static readonly AnchorProfile CardSlot1_Click = new(-262.8, -81.9, 166, 136);
6464

6565
/// <summary>
66-
/// 第二个卡槽的可点击区域
66+
/// 第二个卡槽的高亮/点击区域
6767
/// </summary>
68-
public static readonly AnchorProfile CardSlot2_Click = new(-124, -47.5, 150, 125);
68+
public static readonly AnchorProfile CardSlot2_Click = new(-88.4, -81.9, 166, 136);
6969

7070
/// <summary>
71-
/// 第三个卡槽的可点击区域
71+
/// 第三个卡槽的高亮/点击区域
7272
/// </summary>
73-
public static readonly AnchorProfile CardSlot3_Click = new(53.5, -47.5, 155, 125);
73+
public static readonly AnchorProfile CardSlot3_Click = new(86.4, -81.9, 166, 136);
7474

7575
/// <summary>
76-
/// 第四个卡槽的可点击区域
76+
/// 第四个卡槽的高亮/点击区域
7777
/// </summary>
78-
public static readonly AnchorProfile CardSlot4_Click = new(229, -47.5, 150, 125);
78+
public static readonly AnchorProfile CardSlot4_Click = new(261.3, -81.9, 166, 136);
7979

8080
/// <summary>
81-
/// 第五个卡槽的可点击区域
81+
/// 第五个卡槽的高亮/点击区域
8282
/// </summary>
83-
public static readonly AnchorProfile CardSlot5_Click = new(404, -47.5, 150, 125);
83+
public static readonly AnchorProfile CardSlot5_Click = new(436.1, -81.9, 166, 136);
8484

8585
/// <summary>
8686
/// 金币数量识别区域

SourceCode/JinChanChanTool/DataClass/StaticData/TftCoordinateTemplates.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,29 +53,29 @@ public static class TftCoordinateTemplates
5353
// --- 备用区域 ---
5454

5555
/// <summary>
56-
/// 第一个卡槽的可点击区域
56+
/// 第一个卡槽的高亮/点击区域
5757
/// </summary>
58-
public static readonly AnchorProfile CardSlot1_Click = new(-392.5, -82.5, 165, 125);
58+
public static readonly AnchorProfile CardSlot1_Click = new(-384, -80.5, 191, 141);
5959

6060
/// <summary>
61-
/// 第二个卡槽的可点击区域
61+
/// 第二个卡槽的高亮/点击区域
6262
/// </summary>
63-
public static readonly AnchorProfile CardSlot2_Click = new(-190, -82.5, 160, 125);
63+
public static readonly AnchorProfile CardSlot2_Click = new(-183, -80.5, 191, 141);
6464

6565
/// <summary>
66-
/// 第三个卡槽的可点击区域
66+
/// 第三个卡槽的高亮/点击区域
6767
/// </summary>
68-
public static readonly AnchorProfile CardSlot3_Click = new(-5, -82.5, 130, 125);
68+
public static readonly AnchorProfile CardSlot3_Click = new(18, -80.5, 191, 141);
6969

7070
/// <summary>
71-
/// 第四个卡槽的可点击区域
71+
/// 第四个卡槽的高亮/点击区域
7272
/// </summary>
73-
public static readonly AnchorProfile CardSlot4_Click = new(210, -82.5, 160, 125);
73+
public static readonly AnchorProfile CardSlot4_Click = new(220, -80.5, 191, 141);
7474

7575
/// <summary>
76-
/// 第五个卡槽的可点击区域
76+
/// 第五个卡槽的高亮/点击区域
7777
/// </summary>
78-
public static readonly AnchorProfile CardSlot5_Click = new(415, -82.5, 170, 125);
78+
public static readonly AnchorProfile CardSlot5_Click = new(422, -80.5, 191, 141);
7979

8080
/// <summary>
8181
/// 金币数量识别区域

SourceCode/JinChanChanTool/Forms/NecessaryForm/MainForm.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,6 +2018,12 @@ private void timer_UpdateCoordinates_Tick(object sender, EventArgs e)
20182018
var rectSlot4 = _automationService.GetTargetRectangle(UiElement.CardSlot4_Name);
20192019
var rectSlot5 = _automationService.GetTargetRectangle(UiElement.CardSlot5_Name);
20202020
var rectRefresh = _automationService.GetTargetRectangle(UiElement.RefreshButton);
2021+
// 获取高亮区域矩形
2022+
var rectHighLight1 = _automationService.GetTargetRectangle(UiElement.CardSlot1_Highlight);
2023+
var rectHighLight2 = _automationService.GetTargetRectangle(UiElement.CardSlot2_Highlight);
2024+
var rectHighLight3 = _automationService.GetTargetRectangle(UiElement.CardSlot3_Highlight);
2025+
var rectHighLight4 = _automationService.GetTargetRectangle(UiElement.CardSlot4_Highlight);
2026+
var rectHighLight5 = _automationService.GetTargetRectangle(UiElement.CardSlot5_Highlight);
20212027

20222028
if (rectSlot1.HasValue && rectSlot1.Value.Width > 0 && rectSlot1.Value.Height > 0)
20232029
{
@@ -2044,6 +2050,27 @@ private void timer_UpdateCoordinates_Tick(object sender, EventArgs e)
20442050
{
20452051
_iAutomaticSettingsService.CurrentConfig.RefreshStoreButtonRectangle = (Rectangle)rectRefresh;
20462052
}
2053+
// 更新高亮区域矩形
2054+
if (rectHighLight1.HasValue && rectHighLight1.Value.Width > 0)
2055+
{
2056+
_iAutomaticSettingsService.CurrentConfig.HighLightRectangle_1 = (Rectangle)rectHighLight1;
2057+
}
2058+
if (rectHighLight2.HasValue && rectHighLight2.Value.Width > 0)
2059+
{
2060+
_iAutomaticSettingsService.CurrentConfig.HighLightRectangle_2 = (Rectangle)rectHighLight2;
2061+
}
2062+
if (rectHighLight3.HasValue && rectHighLight3.Value.Width > 0)
2063+
{
2064+
_iAutomaticSettingsService.CurrentConfig.HighLightRectangle_3 = (Rectangle)rectHighLight3;
2065+
}
2066+
if (rectHighLight4.HasValue && rectHighLight4.Value.Width > 0)
2067+
{
2068+
_iAutomaticSettingsService.CurrentConfig.HighLightRectangle_4 = (Rectangle)rectHighLight4;
2069+
}
2070+
if (rectHighLight5.HasValue && rectHighLight5.Value.Width > 0)
2071+
{
2072+
_iAutomaticSettingsService.CurrentConfig.HighLightRectangle_5 = (Rectangle)rectHighLight5;
2073+
}
20472074
}
20482075
}
20492076

SourceCode/JinChanChanTool/Services/AutomaticSetCoordinates/AutomationService.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ public enum UiElement
4040
CardSlot3_Click,
4141
CardSlot4_Click,
4242
CardSlot5_Click,
43-
GoldAmount
43+
GoldAmount,
44+
CardSlot1_Highlight,
45+
CardSlot2_Highlight,
46+
CardSlot3_Highlight,
47+
CardSlot4_Highlight,
48+
CardSlot5_Highlight
4449
}
4550

4651
/// <summary>
@@ -160,6 +165,11 @@ private AnchorProfile GetTftProfile(UiElement element)
160165
case UiElement.CardSlot4_Click: return TftCoordinateTemplates.CardSlot4_Click;
161166
case UiElement.CardSlot5_Click: return TftCoordinateTemplates.CardSlot5_Click;
162167
case UiElement.GoldAmount: return TftCoordinateTemplates.GoldAmount;
168+
case UiElement.CardSlot1_Highlight: return TftCoordinateTemplates.CardSlot1_Click;
169+
case UiElement.CardSlot2_Highlight: return TftCoordinateTemplates.CardSlot2_Click;
170+
case UiElement.CardSlot3_Highlight: return TftCoordinateTemplates.CardSlot3_Click;
171+
case UiElement.CardSlot4_Highlight: return TftCoordinateTemplates.CardSlot4_Click;
172+
case UiElement.CardSlot5_Highlight: return TftCoordinateTemplates.CardSlot5_Click;
163173
default: throw new ArgumentOutOfRangeException(nameof(element), "未知的UI元素。");
164174
}
165175
}
@@ -187,6 +197,11 @@ private AnchorProfile GetJccProfile(UiElement element)
187197
case UiElement.CardSlot4_Click: return JccCoordinateTemplates.CardSlot4_Click;
188198
case UiElement.CardSlot5_Click: return JccCoordinateTemplates.CardSlot5_Click;
189199
case UiElement.GoldAmount: return JccCoordinateTemplates.GoldAmount;
200+
case UiElement.CardSlot1_Highlight: return JccCoordinateTemplates.CardSlot1_Click;
201+
case UiElement.CardSlot2_Highlight: return JccCoordinateTemplates.CardSlot2_Click;
202+
case UiElement.CardSlot3_Highlight: return JccCoordinateTemplates.CardSlot3_Click;
203+
case UiElement.CardSlot4_Highlight: return JccCoordinateTemplates.CardSlot4_Click;
204+
case UiElement.CardSlot5_Highlight: return JccCoordinateTemplates.CardSlot5_Click;
190205
default: throw new ArgumentOutOfRangeException(nameof(element), "未知的UI元素。");
191206
}
192207
}

0 commit comments

Comments
 (0)