mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-14 20:53:30 +08:00
配置弹窗UI优化,更新截取物品图标导航地址 (#2499)
This commit is contained in:
@@ -22,10 +22,11 @@ public class SettingItem
|
||||
{
|
||||
var list = new List<UIElement>();
|
||||
|
||||
var label = new Label
|
||||
var label = new TextBlock
|
||||
{
|
||||
Content = Label,
|
||||
Margin = new Thickness(0, 0, 0, 5)
|
||||
Text = Label,
|
||||
Margin = new Thickness(0, 0, 0, 5),
|
||||
TextWrapping = TextWrapping.Wrap
|
||||
};
|
||||
list.Add(label);
|
||||
|
||||
@@ -40,7 +41,8 @@ public class SettingItem
|
||||
var textBox = new TextBox
|
||||
{
|
||||
Name = Name,
|
||||
Margin = new Thickness(0, 0, 0, 10)
|
||||
Margin = new Thickness(0, 0, 0, 10),
|
||||
TextWrapping = TextWrapping.Wrap
|
||||
};
|
||||
if (Default != null)
|
||||
{
|
||||
|
||||
@@ -21,9 +21,10 @@
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVisConverter"/>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<ScrollViewer MaxHeight="350" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Margin="0,0,20,0">
|
||||
|
||||
<!--<TextBlock Margin="0,0,0,10" Text="执行周期" />
|
||||
<!--<TextBlock Margin="0,0,0,10" Text="执行周期" />
|
||||
<ComboBox Margin="0,0,0,20"
|
||||
DisplayMemberPath="Value"
|
||||
ItemsSource="{Binding Source={StaticResource ScheduleDescriptionsProvider}}"
|
||||
@@ -33,64 +34,65 @@
|
||||
<TextBlock Margin="0,0,0,10" Text="执行次数" />
|
||||
<TextBox Margin="0,0,0,20" Text="{Binding RunNum, Mode=TwoWay}" />-->
|
||||
|
||||
<TextBlock Margin="0,0,0,10" Text="状态" />
|
||||
<ComboBox DisplayMemberPath="Value"
|
||||
ItemsSource="{Binding Source={StaticResource StatusDescriptionsProvider}}"
|
||||
SelectedValue="{Binding Status, Mode=TwoWay}"
|
||||
SelectedValuePath="Key" />
|
||||
<TextBlock Margin="0,10,0,5" Text="JS 通知权限"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
|
||||
<ComboBox Margin="0,0,0,10"
|
||||
ItemsSource="{Binding JsNotificationOptions}"
|
||||
DisplayMemberPath="Value"
|
||||
SelectedValuePath="Key"
|
||||
IsEnabled="{Binding GlobalJsNotificationEnabled}"
|
||||
ToolTip="{Binding JsNotificationToolTip}"
|
||||
SelectedValue="{Binding AllowJsNotification, Mode=TwoWay}"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}">
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Margin="0,10,0,5" Text="JS HTTP权限"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
|
||||
<TextBlock Margin="0,0,0,5"
|
||||
Text="允许脚本发送HTTP请求,可能会带来安全风险,请谨慎开启。"
|
||||
Foreground="Orange"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
|
||||
<TextBlock Margin="0,0,0,5"
|
||||
Text="注意:脚本更新http_allowed_urls后,需手动重新启用权限。"
|
||||
Foreground="Orange"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
|
||||
<ItemsControl Margin="0,0,0,0" ItemsSource="{Binding JsHTTPInfoText}"
|
||||
<TextBlock Margin="0,0,0,10" Text="状态" />
|
||||
<ComboBox DisplayMemberPath="Value"
|
||||
ItemsSource="{Binding Source={StaticResource StatusDescriptionsProvider}}"
|
||||
SelectedValue="{Binding Status, Mode=TwoWay}"
|
||||
SelectedValuePath="Key" />
|
||||
<TextBlock Margin="0,10,0,5" Text="JS 通知权限"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
|
||||
<ComboBox Margin="0,0,0,10"
|
||||
ItemsSource="{Binding JsNotificationOptions}"
|
||||
DisplayMemberPath="Value"
|
||||
SelectedValuePath="Key"
|
||||
IsEnabled="{Binding GlobalJsNotificationEnabled}"
|
||||
ToolTip="{Binding JsNotificationToolTip}"
|
||||
SelectedValue="{Binding AllowJsNotification, Mode=TwoWay}"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Text}"
|
||||
Foreground="{Binding Color}"
|
||||
FontSize="11"
|
||||
TextWrapping="NoWrap"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<ItemsControl Margin="0,0,0,10" ItemsSource="{Binding JsHTTPInfo}"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding Text}"
|
||||
IsReadOnly="True"
|
||||
Foreground="{Binding Color}"
|
||||
FontSize="11"
|
||||
FontFamily="Consolas"
|
||||
TextWrapping="NoWrap"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<ComboBox DisplayMemberPath="Value"
|
||||
ItemsSource="{Binding JsNotificationOptions}"
|
||||
SelectedValue="{Binding AllowJsHTTP, Mode=TwoWay}"
|
||||
SelectedValuePath="Key"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}">
|
||||
</ComboBox>
|
||||
</ComboBox>
|
||||
|
||||
</StackPanel>
|
||||
<TextBlock Margin="0,10,0,5" Text="JS HTTP权限"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
|
||||
<TextBlock Margin="0,0,0,5"
|
||||
Text="允许脚本发送HTTP请求,可能会带来安全风险,请谨慎开启。"
|
||||
Foreground="Orange"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
|
||||
<TextBlock Margin="0,0,0,5"
|
||||
Text="注意:脚本更新http_allowed_urls后,需手动重新启用权限。"
|
||||
Foreground="Orange"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
|
||||
<ItemsControl Margin="0,0,0,0" ItemsSource="{Binding JsHTTPInfoText}"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Text}"
|
||||
Foreground="{Binding Color}"
|
||||
FontSize="11"
|
||||
TextWrapping="NoWrap"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<ItemsControl Margin="0,0,0,10" ItemsSource="{Binding JsHTTPInfo}"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding Text}"
|
||||
IsReadOnly="True"
|
||||
Foreground="{Binding Color}"
|
||||
FontSize="11"
|
||||
FontFamily="Consolas"
|
||||
TextWrapping="NoWrap"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<ComboBox DisplayMemberPath="Value"
|
||||
ItemsSource="{Binding JsNotificationOptions}"
|
||||
SelectedValue="{Binding AllowJsHTTP, Mode=TwoWay}"
|
||||
SelectedValuePath="Key"
|
||||
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}">
|
||||
</ComboBox>
|
||||
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -633,7 +633,7 @@ public partial class TaskSettingsPageViewModel : ViewModel
|
||||
[RelayCommand]
|
||||
private async Task OnGoToGetGridIconsUrlAsync()
|
||||
{
|
||||
await Launcher.LaunchUriAsync(new Uri("https://bettergi.com/feats/task/getGridIcons.html"));
|
||||
await Launcher.LaunchUriAsync(new Uri("https://bettergi.com/dev/getGridIcons.html"));
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
|
||||
@@ -125,6 +125,20 @@ public class ScriptGroupProjectEditorViewModel : ObservableObject
|
||||
public ScriptGroupProjectEditorViewModel(ScriptGroupProject project)
|
||||
{
|
||||
_project = project ?? throw new ArgumentNullException(nameof(project));
|
||||
|
||||
// 如果是JS脚本,每次打开配置窗口时强制重新加载项目信息,以读取最新的manifest.json
|
||||
if (_project.Type == "Javascript")
|
||||
{
|
||||
try
|
||||
{
|
||||
_project.BuildScriptProjectRelation();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 忽略加载失败,避免无法打开窗口,界面上会显示相关错误或为空
|
||||
}
|
||||
}
|
||||
|
||||
_globalNotificationConfig = TaskContext.Instance().Config.NotificationConfig;
|
||||
// 监听全局配置变更
|
||||
_project.PropertyChanged += (s, e) =>
|
||||
|
||||
Reference in New Issue
Block a user