Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5787aa9d3 | ||
|
|
f38e3e05ae | ||
|
|
db67429350 | ||
|
|
5484aea335 | ||
|
|
a948c70baf | ||
|
|
688bdcd8ae | ||
|
|
3f2f45e3b1 | ||
|
|
ff3e89aa1c | ||
|
|
ddf1c72ba3 | ||
|
|
a651bbfbe5 | ||
|
|
a9cf0dcfb3 | ||
|
|
e3caf32b94 | ||
|
|
0761652e31 | ||
|
|
abc2b5dd19 | ||
|
|
200f904a64 | ||
|
|
ab498fa731 | ||
|
|
42ef97b1cd | ||
|
|
3beb762223 | ||
|
|
fc942bd8cd | ||
|
|
da80dd02c4 |
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyName>BetterGI</AssemblyName>
|
||||
<Version>0.55.2-alpha.1</Version>
|
||||
<Version>0.56.2</Version>
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
|
||||
@@ -45,7 +45,7 @@
|
||||
<PackageReference Include="BetterGI.VCRuntime" Version="14.44.35208" />
|
||||
<PackageReference Include="BetterGI.Assets.Map" Version="1.0.17" />
|
||||
<PackageReference Include="BetterGI.Assets.Model" Version="1.0.18" />
|
||||
<PackageReference Include="BetterGI.Assets.Other" Version="1.0.10" />
|
||||
<PackageReference Include="BetterGI.Assets.Other" Version="1.0.12" />
|
||||
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
<PackageReference Include="DeviceId" Version="6.9.0" />
|
||||
|
||||
@@ -83,10 +83,10 @@ public partial class MaskWindowConfig : ObservableObject
|
||||
private double _logTextBoxLeftRatio = 20.0 / 1920;
|
||||
|
||||
[ObservableProperty]
|
||||
private double _logTextBoxTopRatio = 832.0 / 1080;
|
||||
private double _logTextBoxTopRatio = 822.0 / 1080;
|
||||
|
||||
[ObservableProperty]
|
||||
private double _logTextBoxWidthRatio = 477.0 / 1920;
|
||||
private double _logTextBoxWidthRatio = 480.0 / 1920;
|
||||
|
||||
[ObservableProperty]
|
||||
private double _logTextBoxHeightRatio = 188.0 / 1080;
|
||||
@@ -95,10 +95,10 @@ public partial class MaskWindowConfig : ObservableObject
|
||||
private double _statusListLeftRatio = 20.0 / 1920;
|
||||
|
||||
[ObservableProperty]
|
||||
private double _statusListTopRatio = 807.0 / 1080;
|
||||
private double _statusListTopRatio = 790.0 / 1080;
|
||||
|
||||
[ObservableProperty]
|
||||
private double _statusListWidthRatio = 477.0 / 1920;
|
||||
private double _statusListWidthRatio = 480.0 / 1920;
|
||||
|
||||
[ObservableProperty]
|
||||
private double _statusListHeightRatio = 24.0 / 1080;
|
||||
|
||||
@@ -320,7 +320,8 @@ namespace BetterGenshinImpact.GameTask.AutoFight
|
||||
if (retryCount == 0)
|
||||
{
|
||||
await Delay(delayTime,ct);
|
||||
Logger.LogInformation("打开编队界面检查战斗是否结束,延时{detectDelayTime}毫秒检查", detectDelayTime);
|
||||
// Logger.LogInformation("打开编队界面检查战斗是否结束,延时{detectDelayTime}毫秒检查", detectDelayTime);
|
||||
Logger.LogInformation("打开编队界面检查战斗是否结束");
|
||||
Simulation.SendInput.SimulateAction(GIActions.OpenPartySetupScreen);
|
||||
await Delay(detectDelayTime, ct);
|
||||
var ra3 = CaptureToRectArea();
|
||||
|
||||
@@ -444,7 +444,7 @@ public class AutoFightTask : ISoloTask
|
||||
if (_finishDetectConfig.DelayTimes.TryGetValue(command.Name, out var time))
|
||||
{
|
||||
delayTime = time;
|
||||
Logger.LogInformation($"{command.Name}结束后,延时检查为{delayTime}毫秒");
|
||||
// Logger.LogInformation($"{command.Name}结束后,延时检查为{delayTime}毫秒");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -498,13 +498,13 @@ public class AutoFightTask : ISoloTask
|
||||
{
|
||||
oldPartyName = RunnerContext.Instance.PartyName;
|
||||
}
|
||||
else if (picker is null)
|
||||
else if(picker is null && !string.IsNullOrEmpty(_taskParam.KazuhaPartyName))
|
||||
{
|
||||
Logger.LogWarning("换队拾取:当前队伍名称为空,尝试读取!");
|
||||
await Delay(1000, ct);
|
||||
await _returnMainUiTask.Start(ct);
|
||||
|
||||
for (int attempt = 0; attempt < 3; attempt++)
|
||||
for (int attempt = 0; attempt < 6; attempt++)
|
||||
{
|
||||
Simulation.SendInput.SimulateAction(GIActions.OpenPartySetupScreen);
|
||||
var enterGameAppear = await NewRetry.WaitForElementAppear(
|
||||
@@ -514,13 +514,15 @@ public class AutoFightTask : ISoloTask
|
||||
15,
|
||||
500
|
||||
);
|
||||
if (attempt == 2)
|
||||
if(attempt == 5 && !enterGameAppear)
|
||||
{
|
||||
Logger.LogWarning("换队拾取:读取队伍名称失败!");
|
||||
Logger.LogWarning("换队拾取:读取队伍名称失败,跳过换队拾取步骤");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await Delay(1000, ct);
|
||||
|
||||
//等待寻找2秒队伍按钮出现
|
||||
var timeWaitStart = 0;
|
||||
while(timeWaitStart < 6000)
|
||||
@@ -530,14 +532,43 @@ public class AutoFightTask : ISoloTask
|
||||
if (partyViewBtn.IsExist())
|
||||
{
|
||||
// OCR 当前队伍名称(无法单字,中间禁止空格)
|
||||
oldPartyName = ra.Find(new RecognitionObject
|
||||
{
|
||||
RecognitionType = RecognitionTypes.Ocr,
|
||||
RegionOfInterest = new Rect(partyViewBtn.Right, partyViewBtn.Top, (int)(350 * _assetScale),
|
||||
partyViewBtn.Height)
|
||||
}).Text;
|
||||
Logger.LogInformation("换队拾取:当前队伍名称读取为:{oldPartyName}",oldPartyName);
|
||||
RunnerContext.Instance.PartyName = oldPartyName;
|
||||
// 读取OCR原始识别文本
|
||||
var rawPartyName = ra.Find(new RecognitionObject
|
||||
{
|
||||
RecognitionType = RecognitionTypes.Ocr,
|
||||
RegionOfInterest = new Rect(partyViewBtn.Right, partyViewBtn.Top, (int)(350 * _assetScale),
|
||||
partyViewBtn.Height)
|
||||
}).Text;
|
||||
|
||||
// 核心处理逻辑:1.空值兜底 2.去首尾空白 3.移除末尾的“口”字(仅最后一个是口才删)
|
||||
if (string.IsNullOrWhiteSpace(rawPartyName))
|
||||
{
|
||||
oldPartyName = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
//有概率把编辑图标识别为字符,并且含有空格或换行符,需要过滤
|
||||
var tempName = rawPartyName
|
||||
.Replace("\"", "") // 移除所有双引号(核心新增,解决日志里的""问题)
|
||||
.Replace("\r\n", "") // 清理Windows换行符
|
||||
.Replace("\r", ""); // 先清理所有双引号,避免引号干扰后续处理
|
||||
|
||||
// 核心逻辑:找到第一个换行符(\n)的位置,截断并删除换行+后面所有字符
|
||||
int firstNewLineIndex = tempName.IndexOf('\n');
|
||||
if (firstNewLineIndex != -1) // 存在换行符,截取到换行符前
|
||||
{
|
||||
tempName = tempName.Substring(0, firstNewLineIndex);
|
||||
}
|
||||
|
||||
// 最后统一去首尾所有空白(空格、制表符、回车符\r等),得到纯净队伍名
|
||||
oldPartyName = tempName.Trim();
|
||||
}
|
||||
|
||||
// 后续原有逻辑不变
|
||||
Logger.LogInformation("换队拾取:当前队伍名称读取为:{oldPartyName}", oldPartyName);
|
||||
// 加在rawPartyName赋值后,打印原始文本的“原始形态”(转义符会显示)
|
||||
Logger.LogDebug("OCR原始识别文本(含转义):{rawPartyName}", rawPartyName);
|
||||
RunnerContext.Instance.PartyName = oldPartyName;
|
||||
// await _returnMainUiTask.Start(ct);
|
||||
break;
|
||||
}
|
||||
@@ -735,7 +766,8 @@ public class AutoFightTask : ISoloTask
|
||||
|
||||
if (!_finishDetectConfig.RotateFindEnemyEnabled)await Delay(delayTime, _ct);
|
||||
|
||||
Logger.LogInformation("打开编队界面检查战斗是否结束,延时{detectDelayTime}毫秒检查", detectDelayTime);
|
||||
// Logger.LogInformation("打开编队界面检查战斗是否结束,延时{detectDelayTime}毫秒检查", detectDelayTime);
|
||||
Logger.LogInformation("打开编队界面检查战斗是否结束");
|
||||
// 最终方案确认战斗结束
|
||||
Simulation.SendInput.SimulateAction(GIActions.OpenPartySetupScreen);
|
||||
await Delay(detectDelayTime, _ct);
|
||||
@@ -758,8 +790,9 @@ public class AutoFightTask : ISoloTask
|
||||
return true;
|
||||
}
|
||||
|
||||
Logger.LogInformation($"未识别到战斗结束yellow{b3.Item0},{b3.Item1},{b3.Item2}");
|
||||
Logger.LogInformation($"未识别到战斗结束white{whiteTile.Item0},{whiteTile.Item1},{whiteTile.Item2}");
|
||||
// Logger.LogInformation($"未识别到战斗结束yellow{b3.Item0},{b3.Item1},{b3.Item2}");
|
||||
// Logger.LogInformation($"未识别到战斗结束white{whiteTile.Item0},{whiteTile.Item1},{whiteTile.Item2}");
|
||||
Logger.LogInformation($"未识别到战斗结束: yellow{b3.Item0},{b3.Item1},{b3.Item2};white{whiteTile.Item0},{whiteTile.Item1},{whiteTile.Item2}");
|
||||
|
||||
if (_finishDetectConfig.RotateFindEnemyEnabled)
|
||||
{
|
||||
|
||||
@@ -254,10 +254,10 @@ public class Avatar
|
||||
// 切换成功
|
||||
if (CombatScenes.GetActiveAvatarIndex(region, context) == Index)
|
||||
{
|
||||
if (needLog && i > 0)
|
||||
{
|
||||
Logger.LogInformation("成功切换角色:{Name}", Name);
|
||||
}
|
||||
// if (needLog && i > 0)
|
||||
// {
|
||||
// Logger.LogInformation("成功切换角色:{Name}", Name);
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -267,6 +267,8 @@ public class Avatar
|
||||
|
||||
Sleep(250, Ct);
|
||||
}
|
||||
|
||||
Logger.LogWarning("切换角色失败:{Name}", Name);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -472,8 +474,8 @@ public class Avatar
|
||||
var cd = AfterUseSkill(region);
|
||||
if (cd > 0)
|
||||
{
|
||||
Logger.LogInformation(hold ? "{Name} 长按元素战技,cd:{Cd} 秒" : "{Name} 点按元素战技,cd:{Cd} 秒", Name,
|
||||
Math.Round(cd, 2));
|
||||
// Logger.LogInformation(hold ? "{Name} 长按元素战技,cd:{Cd} 秒" : "{Name} 点按元素战技,cd:{Cd} 秒", Name,
|
||||
// Math.Round(cd, 2));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,9 @@ public class CombatScriptBag(List<CombatScript> combatScripts)
|
||||
}
|
||||
|
||||
if (matchCount != avatars.Count) continue;
|
||||
Logger.LogInformation("匹配到战斗脚本:{Name},共{Cnt}条指令,涉及角色:{Str}",
|
||||
combatScript.Name, combatScript.CombatCommands.Count, string.Join(",", combatScript.AvatarNames));
|
||||
// Logger.LogInformation("匹配到战斗脚本:{Name},共{Cnt}条指令,涉及角色:{Str}",
|
||||
// combatScript.Name, combatScript.CombatCommands.Count, string.Join(",", combatScript.AvatarNames));
|
||||
Logger.LogInformation("匹配到战斗脚本:{Name}", combatScript.Name);
|
||||
return combatScript.CombatCommands;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,21 @@ public class SwitchPartyTask
|
||||
RegionOfInterest = new Rect(partyViewBtn.Right, partyViewBtn.Top, (int)(350 * _assetScale),
|
||||
partyViewBtn.Height)
|
||||
}).Text;
|
||||
|
||||
var tempName = currTeamName
|
||||
.Replace("\"", "") // 移除所有双引号(核心新增,解决日志里的""问题)
|
||||
.Replace("\r\n", "") // 清理Windows换行符
|
||||
.Replace("\r", ""); // 先清理所有双引号,避免引号干扰后续处理
|
||||
|
||||
// 核心逻辑:找到第一个换行符(\n)的位置,截断并删除换行+后面所有字符
|
||||
int firstNewLineIndex = tempName.IndexOf('\n');
|
||||
if (firstNewLineIndex != -1) // 存在换行符,截取到换行符前
|
||||
{
|
||||
tempName = tempName.Substring(0, firstNewLineIndex);
|
||||
}
|
||||
|
||||
// 最后统一去首尾所有空白(空格、制表符、回车符\r等),得到纯净队伍名
|
||||
currTeamName = tempName.Trim();
|
||||
|
||||
Logger.LogInformation("切换队伍,当前队伍名称: {Text},使用正则表达式规则进行模糊匹配", currTeamName);
|
||||
if (Regex.IsMatch(currTeamName, partyName))
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
1. `git clone https://github.com/babalae/better-genshin-impact.git`
|
||||
2. 需要使用 [Visual Studio 2022](https://visualstudio.microsoft.com/zh-hans/downloads/) 打开本项目。
|
||||
|
||||
请注意当前 `/Asset` 目录下的部分文件过大,比如地图特征数据(300M+),需要手动从 Release 包中获取并拷贝至对应的编译目录下,软件才能够正常运行对应的功能。(当前仅影响地图追踪、自动传送相关功能)
|
||||
~~请注意当前 `/Asset` 目录下的部分文件过大,比如地图特征数据(300M+),需要手动从 Release 包中获取并拷贝至对应的编译目录下,软件才能够正常运行对应的功能。(当前仅影响地图追踪、自动传送相关功能)~~ 现在已经丢到 nuget 上可以直接编译构建了
|
||||
|
||||
## 如何通过 Github Action 直接构建完整包?
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ public sealed class MaskMapPointService : IMaskMapPointService
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "调用米游社地图接口获取点位列表失败");
|
||||
_logger.LogDebug(ex, "调用米游社地图接口获取点位列表失败");
|
||||
return new MaskMapPointsResult { Labels = labels, Points = Array.Empty<MaskMapPoint>() };
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ public class UpdateService : IUpdateService
|
||||
}
|
||||
else
|
||||
{
|
||||
Process.Start(new ProcessStartInfo("https://github.com/babalae/better-genshin-impact/actions/workflows/publish.yml") { UseShellExecute = true });
|
||||
Process.Start(new ProcessStartInfo("https://cnb.cool/bettergi/better-genshin-impact/-/releases") { UseShellExecute = true });
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -538,8 +538,8 @@ public class PointsCanvas : FrameworkElement
|
||||
}
|
||||
_viewportRect = newRect;
|
||||
Debug.WriteLine($"Viewport updated: {_viewportRect}");
|
||||
Refresh();
|
||||
ViewportChanged?.Invoke(this, EventArgs.Empty);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
xmlns:converters="clr-namespace:BetterGenshinImpact.View.Converters"
|
||||
xmlns:controls="clr-namespace:BetterGenshinImpact.View.Controls"
|
||||
xmlns:gif="https://github.com/XamlAnimatedGif/XamlAnimatedGif"
|
||||
xmlns:sys="clr-namespace:System;assembly=System.Runtime"
|
||||
Title="MaskWindow"
|
||||
Width="500"
|
||||
Height="800"
|
||||
@@ -57,6 +58,8 @@
|
||||
<ResourceDictionary Source="/View/Controls/Overlay/AdjustableOverlayItemStyles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<converters:OverlayRelativeOrAbsoluteConverter x:Key="OverlayRelativeOrAbsoluteConverter" />
|
||||
<sys:Double x:Key="MapPointPickerHeightRatio">0.62</sys:Double>
|
||||
<sys:Double x:Key="MapPointPickerVerticalOffset">-12</sys:Double>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
|
||||
@@ -657,8 +660,8 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="58*" />
|
||||
<ColumnDefinition Width="12*" />
|
||||
<ColumnDefinition Width="540*" />
|
||||
<ColumnDefinition Width="1192*" />
|
||||
<ColumnDefinition Width="640*" />
|
||||
<ColumnDefinition Width="1092*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="328*" />
|
||||
@@ -667,266 +670,9 @@
|
||||
<RowDefinition Height="58*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Width="540"
|
||||
Height="640"
|
||||
Background="#C81F232A"
|
||||
BorderBrush="#26FFFFFF"
|
||||
BorderThickness="1"
|
||||
CornerRadius="12"
|
||||
Visibility="{Binding IsMapPointPickerOpen, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Opacity="0.7" BlurRadius="28" ShadowDepth="0" Color="#FF000000" />
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Margin="12,12,12,8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ComboBox Grid.Column="0"
|
||||
Height="32"
|
||||
MinWidth="140"
|
||||
Margin="0,0,12,0"
|
||||
Padding="12,0,6,0"
|
||||
VerticalContentAlignment="Center"
|
||||
ItemsSource="{Binding MapPointApiProviderOptions}"
|
||||
SelectedItem="{Binding SelectedMapPointApiProviderOption, Mode=TwoWay}"
|
||||
DisplayMemberPath="DisplayName" />
|
||||
|
||||
<ui:TextBox x:Name="MapLabelSearchTextBox"
|
||||
Grid.Column="1"
|
||||
Height="32"
|
||||
PlaceholderText="搜索当前区域下的标点分类"
|
||||
Text="{Binding MapLabelSearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
PreviewMouseLeftButtonDown="MapLabelSearchTextBox_OnPreviewMouseLeftButtonDown" />
|
||||
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="8,0,0,0">
|
||||
<ui:Button Height="32"
|
||||
Padding="12,0"
|
||||
Background="#FF2B2F37"
|
||||
Foreground="White"
|
||||
Content="重置选择"
|
||||
Command="{Binding ResetSelectedMapLabelSelectionCommand}" />
|
||||
|
||||
<ui:Button Margin="8,0,0,0"
|
||||
Width="32"
|
||||
Height="32"
|
||||
Background="#FF2B2F37"
|
||||
Foreground="White"
|
||||
Icon="{ui:SymbolIcon Dismiss24}"
|
||||
Command="{Binding ToggleMapPointPickerCommand}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1" Margin="12,0,12,12">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="140" />
|
||||
<ColumnDefinition Width="12" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Column="0"
|
||||
Background="#B2232831"
|
||||
BorderBrush="#1FFFFFFF"
|
||||
BorderThickness="1"
|
||||
CornerRadius="10"
|
||||
Padding="8">
|
||||
<ui:ListView x:Name="MapLabelCategoriesListView"
|
||||
ItemsSource="{Binding MapLabelCategories}"
|
||||
SelectedItem="{Binding SelectedMapLabelCategory, Mode=TwoWay}"
|
||||
SelectionMode="Single"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
PreviewMouseLeftButtonDown="MapLabelCategoriesListView_OnPreviewMouseLeftButtonDown">
|
||||
<ui:ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Margin="0,1"
|
||||
Padding="6,6"
|
||||
Background="Transparent">
|
||||
<TextBlock Foreground="White"
|
||||
Text="{Binding Name}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ui:ListView.ItemTemplate>
|
||||
</ui:ListView>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Column="2"
|
||||
Background="#B2232831"
|
||||
BorderBrush="#1FFFFFFF"
|
||||
BorderThickness="1"
|
||||
CornerRadius="10"
|
||||
Padding="10">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ui:TextBlock Grid.Row="0"
|
||||
Margin="2,0,0,8"
|
||||
Foreground="{ui:ThemeResource TextFillColorSecondaryBrush}"
|
||||
Text="{Binding SelectedMapLabelCategory.Name, TargetNullValue=''}" />
|
||||
|
||||
<ScrollViewer Grid.Row="1"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled">
|
||||
<ItemsControl ItemsSource="{Binding MapLabelItems}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel IsItemsHost="True" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Width="160"
|
||||
Height="54"
|
||||
Margin="0,0,8,8"
|
||||
Background="#B22C323C"
|
||||
BorderBrush="#403A424F"
|
||||
BorderThickness="1"
|
||||
Padding="8,0"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Center"
|
||||
Command="{Binding DataContext.SelectMapLabelItemCommand, RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
CommandParameter="{Binding}">
|
||||
<DockPanel HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
LastChildFill="True">
|
||||
<Border DockPanel.Dock="Left"
|
||||
Width="36"
|
||||
Height="36"
|
||||
CornerRadius="8"
|
||||
Background="#80232831"
|
||||
Margin="0,0,4,0">
|
||||
<Image Width="28"
|
||||
Height="28"
|
||||
Stretch="Uniform"
|
||||
Source="{Binding IconImage}" />
|
||||
</Border>
|
||||
|
||||
<TextBlock DockPanel.Dock="Right"
|
||||
Width="42"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
TextAlignment="Right"
|
||||
Foreground="{ui:ThemeResource TextFillColorSecondaryBrush}"
|
||||
Text="{Binding PointCount}" />
|
||||
|
||||
<TextBlock VerticalAlignment="Center"
|
||||
Foreground="White"
|
||||
HorizontalAlignment="Stretch"
|
||||
TextAlignment="Left"
|
||||
Text="{Binding Name}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</DockPanel>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.Row="1"
|
||||
Visibility="{Binding IsMapLabelTreeLoading, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Background="#AA232831">
|
||||
<ui:TextBlock HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="White"
|
||||
FontTypography="BodyStrong"
|
||||
Text="加载中..." />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<ItemsControl Grid.Row="1"
|
||||
Grid.Column="3"
|
||||
Width="64"
|
||||
MaxHeight="640"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Margin="12,0,0,0"
|
||||
ItemsSource="{Binding SelectedMapLabelItems}">
|
||||
<ItemsControl.Style>
|
||||
<Style TargetType="ItemsControl">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="HasItems" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
</Trigger>
|
||||
<DataTrigger Binding="{Binding IsMapPointPickerOpen}" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ItemsControl.Style>
|
||||
<ItemsControl.Template>
|
||||
<ControlTemplate TargetType="ItemsControl">
|
||||
<Border Background="#C81F232A"
|
||||
BorderBrush="#26FFFFFF"
|
||||
BorderThickness="1"
|
||||
CornerRadius="12"
|
||||
Padding="8">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Opacity="0.7" BlurRadius="28" ShadowDepth="0" Color="#FF000000" />
|
||||
</Border.Effect>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="0"
|
||||
Margin="0">
|
||||
<ItemsPresenter />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</ItemsControl.Template>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Width="40"
|
||||
Height="40"
|
||||
Margin="0,0,0,8"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Padding="0"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Command="{Binding DataContext.SelectMapLabelItemCommand, RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
CommandParameter="{Binding}">
|
||||
<Border Width="40"
|
||||
Height="40"
|
||||
CornerRadius="20"
|
||||
Background="#C82C323C"
|
||||
BorderBrush="#403A424F"
|
||||
BorderThickness="1">
|
||||
<Image Width="30"
|
||||
Height="30"
|
||||
Stretch="Uniform"
|
||||
Source="{Binding IconImage}" />
|
||||
</Border>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<Viewbox Grid.Row="3" Grid.Column="0"
|
||||
<Viewbox x:Name="MapPointPickerToggleViewbox"
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Stretch="Uniform"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
@@ -958,6 +704,296 @@
|
||||
</Border>
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
|
||||
<Popup AllowsTransparency="True"
|
||||
IsOpen="{Binding IsMapPointPickerOpen}"
|
||||
PlacementTarget="{Binding ElementName=MapPointPickerToggleViewbox}"
|
||||
Placement="Top"
|
||||
HorizontalOffset="0"
|
||||
VerticalOffset="{StaticResource MapPointPickerVerticalOffset}"
|
||||
StaysOpen="True">
|
||||
<Grid VerticalAlignment="Top">
|
||||
<Grid.Height>
|
||||
<MultiBinding Converter="{StaticResource OverlayRelativeOrAbsoluteConverter}">
|
||||
<Binding Source="{StaticResource MapPointPickerHeightRatio}" />
|
||||
<Binding Path="MaskWindowHeight" />
|
||||
</MultiBinding>
|
||||
</Grid.Height>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="540" />
|
||||
<ColumnDefinition Width="12" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Column="0"
|
||||
Width="540"
|
||||
Background="#C81F232A"
|
||||
BorderBrush="#26FFFFFF"
|
||||
BorderThickness="1"
|
||||
CornerRadius="12">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Opacity="0.7" BlurRadius="28" ShadowDepth="0" Color="#FF000000" />
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Margin="12,12,12,8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ComboBox Grid.Column="0"
|
||||
Height="32"
|
||||
MinWidth="140"
|
||||
Margin="0,0,12,0"
|
||||
Padding="12,0,6,0"
|
||||
VerticalContentAlignment="Center"
|
||||
ItemsSource="{Binding MapPointApiProviderOptions}"
|
||||
SelectedItem="{Binding SelectedMapPointApiProviderOption, Mode=TwoWay}"
|
||||
DisplayMemberPath="DisplayName" />
|
||||
|
||||
<ui:TextBox x:Name="MapLabelSearchTextBox"
|
||||
Grid.Column="1"
|
||||
Height="32"
|
||||
PlaceholderText="搜索当前区域下的标点分类"
|
||||
Text="{Binding MapLabelSearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
PreviewMouseLeftButtonDown="MapLabelSearchTextBox_OnPreviewMouseLeftButtonDown" />
|
||||
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="8,0,0,0">
|
||||
<ui:Button
|
||||
Width="32"
|
||||
Height="32"
|
||||
Background="#FF2B2F37"
|
||||
Foreground="White"
|
||||
Icon="{ui:SymbolIcon Dismiss24}"
|
||||
Command="{Binding ToggleMapPointPickerCommand}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1" Margin="12,0,12,12">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="140" />
|
||||
<ColumnDefinition Width="12" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Column="0"
|
||||
Background="#B2232831"
|
||||
BorderBrush="#1FFFFFFF"
|
||||
BorderThickness="1"
|
||||
CornerRadius="10"
|
||||
Padding="8">
|
||||
<ui:ListView x:Name="MapLabelCategoriesListView"
|
||||
ItemsSource="{Binding MapLabelCategories}"
|
||||
SelectedItem="{Binding SelectedMapLabelCategory, Mode=TwoWay}"
|
||||
SelectionMode="Single"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
PreviewMouseLeftButtonDown="MapLabelCategoriesListView_OnPreviewMouseLeftButtonDown">
|
||||
<ui:ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Margin="0,1"
|
||||
Padding="6,6"
|
||||
Background="Transparent">
|
||||
<TextBlock Foreground="White"
|
||||
Text="{Binding Name}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ui:ListView.ItemTemplate>
|
||||
</ui:ListView>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Column="2"
|
||||
Background="#B2232831"
|
||||
BorderBrush="#1FFFFFFF"
|
||||
BorderThickness="1"
|
||||
CornerRadius="10"
|
||||
Padding="10">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ui:TextBlock Grid.Row="0"
|
||||
Margin="2,0,0,8"
|
||||
Foreground="{ui:ThemeResource TextFillColorSecondaryBrush}"
|
||||
Text="{Binding SelectedMapLabelCategory.Name, TargetNullValue=''}" />
|
||||
|
||||
<ScrollViewer Grid.Row="1"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled">
|
||||
<ItemsControl ItemsSource="{Binding MapLabelItems}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel IsItemsHost="True" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Width="160"
|
||||
Height="54"
|
||||
Margin="0,0,8,8"
|
||||
Background="#B22C323C"
|
||||
BorderBrush="#403A424F"
|
||||
BorderThickness="1"
|
||||
Padding="8,0"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Center"
|
||||
Command="{Binding DataContext.SelectMapLabelItemCommand, RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
CommandParameter="{Binding}">
|
||||
<DockPanel HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
LastChildFill="True">
|
||||
<Border DockPanel.Dock="Left"
|
||||
Width="36"
|
||||
Height="36"
|
||||
CornerRadius="8"
|
||||
Background="#80232831"
|
||||
Margin="0,0,4,0">
|
||||
<Image Width="28"
|
||||
Height="28"
|
||||
Stretch="Uniform"
|
||||
Source="{Binding IconImage}" />
|
||||
</Border>
|
||||
|
||||
<TextBlock DockPanel.Dock="Right"
|
||||
Width="42"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
TextAlignment="Right"
|
||||
Foreground="{ui:ThemeResource TextFillColorSecondaryBrush}"
|
||||
Text="{Binding PointCount}" />
|
||||
|
||||
<TextBlock VerticalAlignment="Center"
|
||||
Foreground="White"
|
||||
HorizontalAlignment="Stretch"
|
||||
TextAlignment="Left"
|
||||
Text="{Binding Name}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</DockPanel>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.Row="1"
|
||||
Visibility="{Binding IsMapLabelTreeLoading, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Background="#AA232831">
|
||||
<ui:TextBlock HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="White"
|
||||
FontTypography="BodyStrong"
|
||||
Text="加载中..." />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<ItemsControl Grid.Column="2"
|
||||
Width="64"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Stretch"
|
||||
ItemsSource="{Binding SelectedMapLabelItems}">
|
||||
<ItemsControl.Style>
|
||||
<Style TargetType="ItemsControl">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="HasItems" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ItemsControl.Style>
|
||||
<ItemsControl.Template>
|
||||
<ControlTemplate TargetType="ItemsControl">
|
||||
<Border Background="#C81F232A"
|
||||
BorderBrush="#26FFFFFF"
|
||||
BorderThickness="1"
|
||||
CornerRadius="12"
|
||||
Padding="8">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Opacity="0.7" BlurRadius="28" ShadowDepth="0" Color="#FF000000" />
|
||||
</Border.Effect>
|
||||
<DockPanel LastChildFill="True">
|
||||
<Button DockPanel.Dock="Top"
|
||||
Width="40"
|
||||
Height="40"
|
||||
Margin="0,0,0,8"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Padding="0"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
ToolTip="重置选择"
|
||||
Command="{Binding ResetSelectedMapLabelSelectionCommand}">
|
||||
<Border Width="40"
|
||||
Height="40"
|
||||
CornerRadius="20"
|
||||
Background="#C82C323C"
|
||||
BorderBrush="#403A424F"
|
||||
BorderThickness="1">
|
||||
<ui:SymbolIcon Width="22"
|
||||
Height="22"
|
||||
Foreground="White"
|
||||
Symbol="Broom24" />
|
||||
</Border>
|
||||
</Button>
|
||||
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="0"
|
||||
Margin="0">
|
||||
<ItemsPresenter />
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</ItemsControl.Template>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Width="40"
|
||||
Height="40"
|
||||
Margin="0,0,0,8"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Padding="0"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Command="{Binding DataContext.SelectMapLabelItemCommand, RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
CommandParameter="{Binding}">
|
||||
<Border Width="40"
|
||||
Height="40"
|
||||
CornerRadius="20"
|
||||
Background="#C82C323C"
|
||||
BorderBrush="#403A424F"
|
||||
BorderThickness="1">
|
||||
<Image Width="30"
|
||||
Height="30"
|
||||
Stretch="Uniform"
|
||||
Source="{Binding IconImage}" />
|
||||
</Border>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</Popup>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -144,7 +144,11 @@ public partial class MaskWindow : Window
|
||||
return;
|
||||
}
|
||||
|
||||
(DataContext as MaskWindowViewModel)?.PointInfoPopup.CloseCommand.Execute(null);
|
||||
if (DataContext is MaskWindowViewModel vm)
|
||||
{
|
||||
vm.PointInfoPopup.CloseCommand.Execute(null);
|
||||
vm.IsMapPointPickerOpen = false;
|
||||
}
|
||||
|
||||
if (_mapLabelSearchWindow != null)
|
||||
{
|
||||
@@ -159,7 +163,11 @@ public partial class MaskWindow : Window
|
||||
return;
|
||||
}
|
||||
|
||||
(DataContext as MaskWindowViewModel)?.PointInfoPopup.CloseCommand.Execute(null);
|
||||
if (DataContext is MaskWindowViewModel vm)
|
||||
{
|
||||
vm.PointInfoPopup.CloseCommand.Execute(null);
|
||||
vm.IsMapPointPickerOpen = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||
@@ -205,7 +213,11 @@ public partial class MaskWindow : Window
|
||||
|
||||
private void PointsCanvasControlOnViewportChanged(object? sender, EventArgs e)
|
||||
{
|
||||
_viewModel?.PointInfoPopup.CloseCommand.Execute(null);
|
||||
if (_viewModel != null)
|
||||
{
|
||||
_viewModel.PointInfoPopup.CloseCommand.Execute(null);
|
||||
_viewModel.IsMapPointPickerOpen = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
@@ -249,6 +261,14 @@ public partial class MaskWindow : Window
|
||||
Dispatcher.Invoke(UpdateClickThroughState);
|
||||
}
|
||||
|
||||
if (e.PropertyName == nameof(MaskWindowViewModel.IsMapPointPickerOpen))
|
||||
{
|
||||
if (_viewModel?.IsMapPointPickerOpen != true && _mapLabelSearchWindow != null)
|
||||
{
|
||||
Dispatcher.Invoke(() => _mapLabelSearchWindow.Hide());
|
||||
}
|
||||
}
|
||||
|
||||
if (e.PropertyName == nameof(MaskWindowViewModel.MapPointLabels))
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
@@ -385,8 +405,8 @@ public partial class MaskWindow : Window
|
||||
var point = textbox.PointToScreen(new Point(0, 0));
|
||||
var popupHeight = _mapLabelSearchWindow.ActualHeight > 0 ? _mapLabelSearchWindow.ActualHeight : _mapLabelSearchWindow.Height;
|
||||
|
||||
_mapLabelSearchWindow.Left = point.X;
|
||||
_mapLabelSearchWindow.Top = point.Y - popupHeight - 4;
|
||||
_mapLabelSearchWindow.Left = point.X / DpiHelper.ScaleY;
|
||||
_mapLabelSearchWindow.Top = (point.Y - 4) / DpiHelper.ScaleY - popupHeight;
|
||||
|
||||
if (!_mapLabelSearchWindow.IsVisible)
|
||||
{
|
||||
@@ -604,4 +624,4 @@ file static class MaskWindowExtension
|
||||
style |= (int)User32.WindowStyles.WS_CHILD;
|
||||
_ = User32.SetWindowLong(hWnd, User32.WindowLongFlags.GWL_STYLE, style);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
<emoji:TextBlock Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Text="Mirror酱服务 ⚡"
|
||||
Text="Mirror酱服务 💰"
|
||||
TextWrapping="Wrap" />
|
||||
<ui:TextBlock Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
|
||||
@@ -30,7 +30,7 @@ public partial class CheckUpdateWindow : FluentWindow
|
||||
|
||||
[ObservableProperty] private bool showOtherUpdateTip = false;
|
||||
|
||||
[ObservableProperty] private string selectedGitSource = "Github";
|
||||
[ObservableProperty] private string selectedGitSource = "CNB";
|
||||
|
||||
public string GitSourceDescription => SelectedGitSource == "CNB" ? "【国内】直接从 CNB 下载并更新" : "【国外】直接从 Github 下载并更新";
|
||||
|
||||
@@ -68,26 +68,8 @@ public partial class CheckUpdateWindow : FluentWindow
|
||||
|
||||
// 隐藏开源渠道和Steambird服务卡片
|
||||
GitSourceCard.Visibility = Visibility.Collapsed;
|
||||
SteambirdCard.Visibility = Visibility.Collapsed;
|
||||
|
||||
// // 删除前几行
|
||||
// MyGrid.RowDefinitions.RemoveAt(0);
|
||||
// MyGrid.RowDefinitions.RemoveAt(0);
|
||||
//
|
||||
// // 注意:删除行定义后,需要调整剩余元素的 Grid.Row 属性
|
||||
// foreach (FrameworkElement child in MyGrid.Children)
|
||||
// {
|
||||
// int currentRow = System.Windows.Controls.Grid.GetRow(child);
|
||||
// if (currentRow > 1) // 如果元素在第三行或之后
|
||||
// {
|
||||
// Grid.SetRow(child, currentRow - 2); // 行号减2
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (ServerPanel.Children.Count > 0)
|
||||
// {
|
||||
// ServerPanel.Children.RemoveAt(0);
|
||||
// }
|
||||
// SteambirdCard.Visibility = Visibility.Collapsed;
|
||||
|
||||
SizeToContent = SizeToContent.Height; // 设置高度为自动
|
||||
UpdateLayout();
|
||||
}
|
||||
@@ -186,12 +168,31 @@ public partial class CheckUpdateWindow : FluentWindow
|
||||
[RelayCommand]
|
||||
private async Task UpdateFromSteambirdAsync()
|
||||
{
|
||||
await RunUpdaterAsync("-I");
|
||||
if (_option.Channel == UpdateChannel.Stable)
|
||||
{
|
||||
await RunUpdaterAsync("-I");
|
||||
}
|
||||
else
|
||||
{
|
||||
await RunUpdaterAsync("-I --source dfs-alpha");
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task UpdateFromMirrorChyanAsync()
|
||||
{
|
||||
// 没输入 CDK 的情况下提示这是收费渠道
|
||||
if (string.IsNullOrEmpty(MirrorChyanHelper.GetCdk()))
|
||||
{
|
||||
var result = await ThemedMessageBox.ShowAsync("Mirror酱是一个【付费】更新渠道!\n更新窗上有多个可用的【免费】国内更新渠道!\n(使用有问题可以直接反馈,或者过一段时间后重试,也可以点击左下角按钮进行手动更新)\n是否继续使用 Mirror酱 渠道更新?",
|
||||
"您已选择「Mirror酱」作为更新源", System.Windows.MessageBoxButton.OKCancel, ThemedMessageBox.MessageBoxIcon.Warning);
|
||||
if (result != MessageBoxResult.OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var cdk = MirrorChyanHelper.GetAndPromptCdk();
|
||||
if (string.IsNullOrEmpty(cdk))
|
||||
{
|
||||
|
||||
@@ -352,12 +352,12 @@ public partial class CommonSettingsPageViewModel : ViewModel
|
||||
});
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task GotoGithubActionAsync()
|
||||
{
|
||||
await Launcher.LaunchUriAsync(
|
||||
new Uri("https://github.com/babalae/better-genshin-impact/actions/workflows/publish.yml"));
|
||||
}
|
||||
// [RelayCommand]
|
||||
// private async Task GotoGithubActionAsync()
|
||||
// {
|
||||
// await Launcher.LaunchUriAsync(
|
||||
// new Uri("https://github.com/babalae/better-genshin-impact/actions/workflows/publish.yml"));
|
||||
// }
|
||||
|
||||
[RelayCommand]
|
||||
private async Task OnGameLangSelectionChanged(KeyValuePair<string, string> type)
|
||||
|
||||
Reference in new issue
Block a user