Skip to content

Commit a3e24d7

Browse files
committed
Merge remote-tracking branch 'origin/main' into i18n-v2
# Conflicts: # BetterGenshinImpact/App.xaml # BetterGenshinImpact/BetterGenshinImpact.csproj
2 parents aaea439 + c24329e commit a3e24d7

File tree

669 files changed

+35972
-75
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

669 files changed

+35972
-75
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
steps:
7575
- uses: actions/checkout@v4
7676
with:
77-
repository: A-Little-AnQi/bettergi-script-web
77+
repository: zaodonganqi/bettergi-script-web
7878
- uses: actions/setup-node@v4
7979
with:
8080
node-version: 20

BetterGenshinImpact/App.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Application x:Class="BetterGenshinImpact.App"
1+
<Application x:Class="BetterGenshinImpact.App"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:behavior="clr-namespace:BetterGenshinImpact.View.Behavior"
@@ -24,6 +24,7 @@
2424
<bgivc:NotNullConverter x:Key="NotNullConverter" />
2525
<bgivc:EnumToKVPConverter x:Key="EnumToKVPConverter" />
2626
<bgivc:CultureInfoNameToKVPConverter x:Key="CultureInfoNameToKVPConverter" />
27+
<bgivc:StringToColorConverter x:Key="StringToColorConverter" />
2728
<bgivc:TrConverter x:Key="TrConverter" />
2829
<Style BasedOn="{StaticResource DefaultTextBoxStyle}" TargetType="{x:Type TextBox}">
2930
<Setter Property="behavior:ClipboardInterceptor.EnableSafeClipboard" Value="True" />

BetterGenshinImpact/BetterGenshinImpact.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<AssemblyName>BetterGI</AssemblyName>
5-
<Version>0.56.3-alpha.1</Version>
5+
<Version>0.56.3-alpha.2</Version>
66
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
77
<OutputType>WinExe</OutputType>
88
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
@@ -129,6 +129,9 @@
129129
<None Update="GameTask\AutoFishing\Assets\1920x1080\**">
130130
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
131131
</None>
132+
<None Update="GameTask\AutoLeyLineOutcrop\Assets\**">
133+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
134+
</None>
132135
<None Update="GameTask\LogParse\Assets\**">
133136
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
134137
</None>
@@ -195,6 +198,9 @@
195198
<None Update="GameTask\Common\Element\Assets\1920x1080\in_domain.png">
196199
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
197200
</None>
201+
<None Update="GameTask\AutoDomain\Assets\1920x1080\**">
202+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
203+
</None>
198204
<None Update="User\I18n\en.json">
199205
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
200206
</None>

BetterGenshinImpact/Core/Config/AllConfig.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
using BetterGenshinImpact.GameTask.AutoStygianOnslaught;
2323
using BetterGenshinImpact.GameTask.GetGridIcons;
2424
using BetterGenshinImpact.GameTask.AutoEat;
25+
using BetterGenshinImpact.GameTask.AutoLeyLineOutcrop;
2526
using BetterGenshinImpact.GameTask.MapMask;
27+
using BetterGenshinImpact.GameTask.SkillCd;
2628
using BetterGenshinImpact.GameTask.UseRedeemCode;
2729

2830
namespace BetterGenshinImpact.Core.Config;
@@ -172,12 +174,22 @@ public partial class AllConfig : ObservableObject
172174
/// 自动吃药配置
173175
/// </summary>
174176
public AutoEatConfig AutoEatConfig { get; set; } = new();
177+
178+
/// <summary>
179+
/// 自动地脉花配置
180+
/// </summary>
181+
public AutoLeyLineOutcropConfig AutoLeyLineOutcropConfig { get; set; } = new();
175182

176183
/// <summary>
177184
/// 地图遮罩
178185
/// </summary>
179186
public MapMaskConfig MapMaskConfig { get; set; } = new();
180-
187+
188+
/// <summary>
189+
/// 技能 CD 提示
190+
/// </summary>
191+
public SkillCdConfig SkillCdConfig { get; set; } = new();
192+
181193
/// <summary>
182194
/// 自动使用
183195
/// </summary>
@@ -267,13 +279,15 @@ public void InitEvent()
267279
AutoArtifactSalvageConfig.PropertyChanged += OnAnyPropertyChanged;
268280
AutoRedeemCodeConfig.PropertyChanged += OnAnyPropertyChanged;
269281
AutoEatConfig.PropertyChanged += OnAnyPropertyChanged;
282+
AutoLeyLineOutcropConfig.PropertyChanged += OnAnyPropertyChanged;
270283
MapMaskConfig.PropertyChanged += OnAnyPropertyChanged;
271284
AutoMusicGameConfig.PropertyChanged += OnAnyPropertyChanged;
272285
TpConfig.PropertyChanged += OnAnyPropertyChanged;
273286
ScriptConfig.PropertyChanged += OnAnyPropertyChanged;
274287
PathingConditionConfig.PropertyChanged += OnAnyPropertyChanged;
275288
DevConfig.PropertyChanged += OnAnyPropertyChanged;
276289
HardwareAccelerationConfig.PropertyChanged += OnAnyPropertyChanged;
290+
SkillCdConfig.PropertyChanged += OnAnyPropertyChanged;
277291
}
278292

279293
public void OnAnyPropertyChanged(object? sender, EventArgs args)
@@ -286,4 +300,4 @@ public void OnNotificationPropertyChanged(object? sender, PropertyChangedEventAr
286300
{
287301
NotificationService.Instance().RefreshNotifiers();
288302
}
289-
}
303+
}

BetterGenshinImpact/Core/Config/HotKeyConfig.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using BetterGenshinImpact.Model;
1+
using BetterGenshinImpact.Model;
22
using CommunityToolkit.Mvvm.ComponentModel;
33
using System;
44

@@ -100,6 +100,13 @@ public partial class HotKeyConfig : ObservableObject
100100

101101
[ObservableProperty]
102102
private string _quickTeleportTickHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
103+
104+
// 技能CD提示开关
105+
[ObservableProperty]
106+
private string _skillCdEnabledHotkey = "";
107+
108+
[ObservableProperty]
109+
private string _skillCdEnabledHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
103110

104111
// 截图
105112
[ObservableProperty]
@@ -237,4 +244,11 @@ public partial class HotKeyConfig : ObservableObject
237244

238245
[ObservableProperty]
239246
private string _onedragonHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
247+
248+
// 地图遮罩开关
249+
[ObservableProperty]
250+
private string _mapMaskEnabledHotkey = "";
251+
252+
[ObservableProperty]
253+
private string _mapMaskEnabledHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
240254
}

BetterGenshinImpact/Core/Config/OneDragonFlowConfig.cs

Lines changed: 140 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using BetterGenshinImpact.GameTask;
4+
using BetterGenshinImpact.GameTask.AutoLeyLineOutcrop;
45
using BetterGenshinImpact.Helpers;
56
using CommunityToolkit.Mvvm.ComponentModel;
67

@@ -61,6 +62,87 @@ public partial class OneDragonFlowConfig : ObservableObject
6162
[ObservableProperty]
6263
private List<string> _secretTreasureObjects = new();
6364

65+
// 地脉花一条龙模式(跳过部分准备流程)
66+
[ObservableProperty]
67+
private bool _leyLineOneDragonMode = false;
68+
69+
// 地脉花运行日期设置
70+
[ObservableProperty]
71+
private bool _leyLineRunMonday = true;
72+
73+
[ObservableProperty]
74+
private bool _leyLineRunTuesday = true;
75+
76+
[ObservableProperty]
77+
private bool _leyLineRunWednesday = true;
78+
79+
[ObservableProperty]
80+
private bool _leyLineRunThursday = true;
81+
82+
[ObservableProperty]
83+
private bool _leyLineRunFriday = true;
84+
85+
[ObservableProperty]
86+
private bool _leyLineRunSaturday = true;
87+
88+
[ObservableProperty]
89+
private bool _leyLineRunSunday = true;
90+
91+
// 地脉花每日类型与国家配置(为空则使用独立任务配置)
92+
[ObservableProperty]
93+
private string _leyLineMondayType = string.Empty;
94+
95+
[ObservableProperty]
96+
private string _leyLineMondayCountry = string.Empty;
97+
98+
[ObservableProperty]
99+
private string _leyLineTuesdayType = string.Empty;
100+
101+
[ObservableProperty]
102+
private string _leyLineTuesdayCountry = string.Empty;
103+
104+
[ObservableProperty]
105+
private string _leyLineWednesdayType = string.Empty;
106+
107+
[ObservableProperty]
108+
private string _leyLineWednesdayCountry = string.Empty;
109+
110+
[ObservableProperty]
111+
private string _leyLineThursdayType = string.Empty;
112+
113+
[ObservableProperty]
114+
private string _leyLineThursdayCountry = string.Empty;
115+
116+
[ObservableProperty]
117+
private string _leyLineFridayType = string.Empty;
118+
119+
[ObservableProperty]
120+
private string _leyLineFridayCountry = string.Empty;
121+
122+
[ObservableProperty]
123+
private string _leyLineSaturdayType = string.Empty;
124+
125+
[ObservableProperty]
126+
private string _leyLineSaturdayCountry = string.Empty;
127+
128+
[ObservableProperty]
129+
private string _leyLineSundayType = string.Empty;
130+
131+
[ObservableProperty]
132+
private string _leyLineSundayCountry = string.Empty;
133+
134+
// 地脉花刷取次数(0 表示使用独立任务配置)
135+
[ObservableProperty]
136+
private int _leyLineRunCount = 0;
137+
138+
// 地脉花树脂耗尽模式
139+
[ObservableProperty]
140+
private bool _leyLineResinExhaustionMode = false;
141+
142+
// 地脉花刷取次数取小值(仅耗尽模式生效)
143+
[ObservableProperty]
144+
private bool _leyLineOpenModeCountMin = false;
145+
64146
#region 每周秘境配置
65147

66148
//周一
@@ -142,5 +224,62 @@ public partial class OneDragonFlowConfig : ObservableObject
142224
}
143225
}
144226

227+
public bool ShouldRunLeyLineToday()
228+
{
229+
if (!LeyLineRunMonday
230+
&& !LeyLineRunTuesday
231+
&& !LeyLineRunWednesday
232+
&& !LeyLineRunThursday
233+
&& !LeyLineRunFriday
234+
&& !LeyLineRunSaturday
235+
&& !LeyLineRunSunday)
236+
{
237+
return true;
238+
}
239+
240+
var serverTime = ServerTimeHelper.GetServerTimeNow();
241+
var dayOfWeek = (serverTime.Hour >= 4 ? serverTime : serverTime.AddDays(-1)).DayOfWeek;
242+
return dayOfWeek switch
243+
{
244+
DayOfWeek.Monday => LeyLineRunMonday,
245+
DayOfWeek.Tuesday => LeyLineRunTuesday,
246+
DayOfWeek.Wednesday => LeyLineRunWednesday,
247+
DayOfWeek.Thursday => LeyLineRunThursday,
248+
DayOfWeek.Friday => LeyLineRunFriday,
249+
DayOfWeek.Saturday => LeyLineRunSaturday,
250+
DayOfWeek.Sunday => LeyLineRunSunday,
251+
_ => true
252+
};
253+
}
254+
255+
public (string type, string country) GetLeyLineConfigForToday(AutoLeyLineOutcropConfig fallback)
256+
{
257+
var serverTime = ServerTimeHelper.GetServerTimeNow();
258+
var dayOfWeek = (serverTime.Hour >= 4 ? serverTime : serverTime.AddDays(-1)).DayOfWeek;
259+
var (type, country) = dayOfWeek switch
260+
{
261+
DayOfWeek.Monday => (LeyLineMondayType, LeyLineMondayCountry),
262+
DayOfWeek.Tuesday => (LeyLineTuesdayType, LeyLineTuesdayCountry),
263+
DayOfWeek.Wednesday => (LeyLineWednesdayType, LeyLineWednesdayCountry),
264+
DayOfWeek.Thursday => (LeyLineThursdayType, LeyLineThursdayCountry),
265+
DayOfWeek.Friday => (LeyLineFridayType, LeyLineFridayCountry),
266+
DayOfWeek.Saturday => (LeyLineSaturdayType, LeyLineSaturdayCountry),
267+
DayOfWeek.Sunday => (LeyLineSundayType, LeyLineSundayCountry),
268+
_ => (string.Empty, string.Empty)
269+
};
270+
271+
if (string.IsNullOrWhiteSpace(type))
272+
{
273+
type = fallback.LeyLineOutcropType;
274+
}
275+
276+
if (string.IsNullOrWhiteSpace(country))
277+
{
278+
country = fallback.Country;
279+
}
280+
281+
return (type, country);
282+
}
283+
145284
#endregion
146-
}
285+
}
3.77 KB
Loading
2.7 KB
Loading
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using BetterGenshinImpact.Core.Recognition;
2+
using BetterGenshinImpact.GameTask.Model;
3+
using OpenCvSharp;
4+
5+
namespace BetterGenshinImpact.GameTask.AutoDomain.Assets;
6+
7+
public class AutoDomainAssets : BaseAssets<AutoDomainAssets>
8+
{
9+
public RecognitionObject ResinSwitchBtnRo;
10+
public RecognitionObject ResinSwitchBtnNoActiveRo;
11+
12+
13+
private AutoDomainAssets() : base()
14+
{
15+
Initialization(this.systemInfo);
16+
}
17+
18+
protected AutoDomainAssets(ISystemInfo systemInfo) : base(systemInfo)
19+
{
20+
Initialization(systemInfo);
21+
}
22+
23+
24+
25+
private void Initialization(ISystemInfo systemInfo)
26+
{
27+
// 可点击状态的树脂切换按钮
28+
ResinSwitchBtnRo = new RecognitionObject
29+
{
30+
Name = "ResinSwitchBtn",
31+
RecognitionType = RecognitionTypes.TemplateMatch,
32+
TemplateImageMat = GameTaskManager.LoadAssetImage("AutoDomain", "resin_switch_btn.png", this.systemInfo),
33+
RegionOfInterest = new Rect((int)(960 * AssetScale), (int)(430 * AssetScale), (int)(400 * AssetScale), (int)(130 * AssetScale)),
34+
Threshold = 0.8,
35+
DrawOnWindow = false
36+
}.InitTemplate();
37+
38+
// 不可点击状态的树脂切换按钮
39+
ResinSwitchBtnNoActiveRo = new RecognitionObject
40+
{
41+
Name = "ResinSwitchBtnNoActive",
42+
RecognitionType = RecognitionTypes.TemplateMatch,
43+
TemplateImageMat = GameTaskManager.LoadAssetImage("AutoDomain", "resin_switch_btn_no_active.png", this.systemInfo),
44+
RegionOfInterest = new Rect((int)(960 * AssetScale), (int)(430 * AssetScale), (int)(400 * AssetScale), (int)(130 * AssetScale)),
45+
Threshold = 0.8,
46+
DrawOnWindow = false
47+
}.InitTemplate();
48+
}
49+
}

BetterGenshinImpact/GameTask/AutoDomain/AutoDomainConfig.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ public partial class AutoDomainConfig : ObservableObject
6868
// 使用原粹树脂刷取副本次数
6969
[ObservableProperty]
7070
private int _originalResinUseCount = 0;
71+
// 使用原粹树脂(20)刷取副本次数
72+
[ObservableProperty]
73+
private int _originalResin20UseCount = 0;
74+
75+
// 使用原粹树脂(40)刷取副本次数
76+
[ObservableProperty]
77+
private int _originalResin40UseCount = 0;
7178

7279
//使用浓缩树脂刷取副本次数
7380
[ObservableProperty]

0 commit comments

Comments
 (0)