新增steam登录时通知我设置项

This commit is contained in:
rmbgame
2021-08-05 16:31:05 +08:00
parent 1ba0c1f785
commit dab60bcd25
6 changed files with 138 additions and 52 deletions
@@ -7,57 +7,62 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="System.Application.UI.Views.Pages.Settings_Steam">
<ScrollViewer>
<StackPanel Orientation="Vertical"
HorizontalAlignment="Stretch"
Spacing="20">
<StackPanel.Styles>
<Style Selector="TextBlock">
<Setter Property="FontSize" Value="{StaticResource FontSizeH7}"/>
<Setter Property="Foreground" Value="{DynamicResource HighlightForegroundBrushKey}" />
</Style>
<Style Selector="DockPanel > TextBlock">
<Setter Property="Margin" Value="0 0 20 0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="(DockPanel.Dock)" Value="Left" />
</Style>
<Style Selector="DockPanel > ToggleSwitch">
<Setter Property="Margin" Value="0 0 -12 0" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="OnContent" Value="{x:Null}" />
<Setter Property="OffContent" Value="{x:Null}" />
</Style>
</StackPanel.Styles>
<ScrollViewer>
<StackPanel Orientation="Vertical"
HorizontalAlignment="Stretch"
Spacing="20">
<StackPanel.Styles>
<Style Selector="TextBlock">
<Setter Property="FontSize" Value="{StaticResource FontSizeH7}"/>
<Setter Property="Foreground" Value="{DynamicResource HighlightForegroundBrushKey}" />
</Style>
<Style Selector="DockPanel > TextBlock">
<Setter Property="Margin" Value="0 0 20 0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="(DockPanel.Dock)" Value="Left" />
</Style>
<Style Selector="DockPanel > ToggleSwitch">
<Setter Property="Margin" Value="0 0 -12 0" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="OnContent" Value="{x:Null}" />
<Setter Property="OffContent" Value="{x:Null}" />
</Style>
</StackPanel.Styles>
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_AutoRunSteam,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsAutoRunSteam},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_AutoRunSteam,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsAutoRunSteam},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_RuningMinimize,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsRunSteamMinimized},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_RuningMinimize,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsRunSteamMinimized},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_NotCheckUpdate,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsRunSteamNoCheckUpdate},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_NotCheckUpdate,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsRunSteamNoCheckUpdate},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<Separator Classes="Separator"/>
<DockPanel>
<TextBlock Text="{ReflectionBinding Path=Res.Settings_Steam_CheckSteamRuningNotification,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:SteamSettings.IsEnableSteamLaunchNotification},Path=Value, Mode=TwoWay}"/>
</DockPanel>
<StackPanel Spacing="10">
<!--<TextBlock Text= "{ReflectionBinding Path=Res.Settings_Steam_SteamStratParameter,Mode=OneWay,Source={x:Static resx:R.Current}}" />-->
<TextBox Watermark="{ReflectionBinding Path=Res.Settings_Steam_SteamStratParameter,Mode=OneWay,Source={x:Static resx:R.Current}}"
UseFloatingWatermark="True"
Text="{ReflectionBinding Source={x:Static ms:SteamSettings.SteamStratParameter},Path=Value, Mode=TwoWay}"
MinHeight="150"
AcceptsReturn="True"
TextWrapping="Wrap"></TextBox>
</StackPanel>
<Separator Classes="Separator"/>
<Separator Classes="Separator"/>
</StackPanel>
</ScrollViewer>
<StackPanel Spacing="10">
<!--<TextBlock Text= "{ReflectionBinding Path=Res.Settings_Steam_SteamStratParameter,Mode=OneWay,Source={x:Static resx:R.Current}}" />-->
<TextBox Watermark="{ReflectionBinding Path=Res.Settings_Steam_SteamStratParameter,Mode=OneWay,Source={x:Static resx:R.Current}}"
UseFloatingWatermark="True"
Text="{ReflectionBinding Source={x:Static ms:SteamSettings.SteamStratParameter},Path=Value, Mode=TwoWay}"
MinHeight="150"
AcceptsReturn="True"
TextWrapping="Wrap"></TextBox>
</StackPanel>
<Separator Classes="Separator"/>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -57,9 +57,9 @@ namespace System.Application.Models.Settings
= GetProperty(defaultValue: false, autoSave: true);
/// <summary>
/// 检测到Steam启动时弹出消息通知
/// 检测到Steam登录时弹出消息通知
/// </summary>
public static SerializableProperty<bool> IsEnableSteamLaunchNotification { get; }
= GetProperty(defaultValue: false, autoSave: true);
= GetProperty(defaultValue: true, autoSave: true);
}
}
@@ -199,9 +199,18 @@ namespace System.Application.Services
IsSteamChinaLauncher = ApiService.IsSteamChinaLauncher();
#region 初始化需要steam启动才能使用的功能
if (GameLibrarySettings.IsAutoAFKApps.Value)
RunAFKApps();
if (SteamSettings.IsEnableSteamLaunchNotification.Value)
{
INotificationService.Instance.Notify($"{AppResources.Steam_CheckStarted}({(IsSteamChinaLauncher ? AppResources.Steam_SteamChina : AppResources.Steam_SteamWorld)}){Environment.NewLine}{Environment.NewLine}{AppResources.Steam_CurrentUser}{CurrentSteamUser.SteamNickName}{Environment.NewLine}{AppResources.Steam_CurrentIPCountry}{CurrentSteamUser.IPCountry}", NotificationType.Announcement);
}
if (GameLibrarySettings.IsAutoAFKApps.Value)
{
RunAFKApps();
}
//仅在有游戏数据情况下加载登录用户的游戏
if (SteamApps.Items.Any())
{
LoadGames(ApiService.OwnsApps(await ISteamService.Instance.GetAppInfos()));
+54
View File
@@ -3222,6 +3222,15 @@ namespace System.Application.UI.Resx {
}
}
/// <summary>
/// 查找类似 当Steam客户端登录时通知我 的本地化字符串。
/// </summary>
public static string Settings_Steam_CheckSteamRuningNotification {
get {
return ResourceManager.GetString("Settings_Steam_CheckSteamRuningNotification", resourceCulture);
}
}
/// <summary>
/// 查找类似 Steam启动时不检查更新 的本地化字符串。
/// </summary>
@@ -3339,6 +3348,33 @@ namespace System.Application.UI.Resx {
}
}
/// <summary>
/// 查找类似 检测到启动: 的本地化字符串。
/// </summary>
public static string Steam_CheckStarted {
get {
return ResourceManager.GetString("Steam_CheckStarted", resourceCulture);
}
}
/// <summary>
/// 查找类似 Steam客户端登录区域: 的本地化字符串。
/// </summary>
public static string Steam_CurrentIPCountry {
get {
return ResourceManager.GetString("Steam_CurrentIPCountry", resourceCulture);
}
}
/// <summary>
/// 查找类似 Steam登录用户: 的本地化字符串。
/// </summary>
public static string Steam_CurrentUser {
get {
return ResourceManager.GetString("Steam_CurrentUser", resourceCulture);
}
}
/// <summary>
/// 查找类似 输入图中验证码 的本地化字符串。
/// </summary>
@@ -3357,6 +3393,24 @@ namespace System.Application.UI.Resx {
}
}
/// <summary>
/// 查找类似 Steam国服 的本地化字符串。
/// </summary>
public static string Steam_SteamChina {
get {
return ResourceManager.GetString("Steam_SteamChina", resourceCulture);
}
}
/// <summary>
/// 查找类似 Steam国际服 的本地化字符串。
/// </summary>
public static string Steam_SteamWorld {
get {
return ResourceManager.GetString("Steam_SteamWorld", resourceCulture);
}
}
/// <summary>
/// 查找类似 Steam用户名 的本地化字符串。
/// </summary>
@@ -1519,4 +1519,22 @@
<data name="SetBootAutoStartTrueFail_" xml:space="preserve">
<value>启用开机自启动失败,原因: {0}</value>
</data>
<data name="Settings_Steam_CheckSteamRuningNotification" xml:space="preserve">
<value>当Steam客户端登录时通知我</value>
</data>
<data name="Steam_CheckStarted" xml:space="preserve">
<value>检测到启动:</value>
</data>
<data name="Steam_CurrentIPCountry" xml:space="preserve">
<value>Steam客户端登录区域:</value>
</data>
<data name="Steam_CurrentUser" xml:space="preserve">
<value>Steam登录用户:</value>
</data>
<data name="Steam_SteamChina" xml:space="preserve">
<value>Steam国服</value>
</data>
<data name="Steam_SteamWorld" xml:space="preserve">
<value>Steam国际服</value>
</data>
</root>
@@ -278,7 +278,7 @@ namespace System.Application.UI.ViewModels
// }
//#endif
INotificationService.Instance.Notify("测试Test🎆🎇→→", NotificationType.Announcement);
//ShowDialogButton_Click1();
ShowDialogButton_Click1();
}
#if DEBUG