diff --git a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.cs b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.cs index bbf05a68fa7..ad0352a9d9f 100644 --- a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.cs +++ b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.cs @@ -3,7 +3,7 @@ using BD.SteamClient.Models.Idle; using BD.SteamClient.Services; using BD.WTTS.UI.Views.Pages; -using Newtonsoft.Json.Linq; +using BD.SteamClient.Constants; namespace BD.WTTS.UI.ViewModels; @@ -50,9 +50,12 @@ public IdleCardPageViewModel() } }); - //this.ChangeState = ReactiveCommand.Create(i => - //{ - //}); + NavAppToSteamViewCommand = ReactiveCommand.Create((appid) => + { + var url = string.Format(SteamApiUrls.STEAM_NAVGAME_URL, appid); + Process2.Start(url, useShellExecute: true); + }); + OpenLinkUrlCommand = ReactiveCommand.Create(async url => await Browser2.OpenAsync(url)); } public override void Activation() @@ -102,7 +105,7 @@ public async Task IdleRunStartOrStop_Click() { //await SteamConnectService.Current.RefreshGamesListAsync(); RunState = await ReadyToGoIdle(); - RunOrStopAutoNext(SteamIdleSettings.IsAutoNextOn); + RunOrStopAutoNext(SteamIdleSettings.IsAutoNextOn.Value); RunOrStopAutoCardDropCheck(true); } else @@ -224,7 +227,6 @@ private async Task LoadBadges() foreach (var badge in badges) { - TotalCardsAvgPrice += badge.RegularAvgPrice * badge.CardsRemaining; TotalCardsRemaining += badge.CardsRemaining; } diff --git a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs index 844c4dc6766..b91fe2f50fd 100644 --- a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs +++ b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs @@ -14,6 +14,10 @@ public sealed partial class IdleCardPageViewModel //public ICommand ChangeState { get; } + public ICommand NavAppToSteamViewCommand { get; } + + public ICommand OpenLinkUrlCommand { get; } + [Reactive] public bool IsLogin { get; set; } @@ -56,6 +60,8 @@ public sealed partial class IdleCardPageViewModel [Reactive] public int TotalCardsRemaining { get; set; } + public int DropCardsCount => DroppedCardsCount - TotalCardsRemaining; + [Reactive] public decimal TotalCardsAvgPrice { get; set; } diff --git a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleSteamLoginPageViewModel.cs b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleSteamLoginPageViewModel.cs index 3f585c3d2dc..06850653c1e 100644 --- a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleSteamLoginPageViewModel.cs +++ b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleSteamLoginPageViewModel.cs @@ -77,10 +77,10 @@ private async void CookieLoginAsync() if (!string.IsNullOrEmpty(SeesionId) && !string.IsNullOrEmpty(SteamLoginSecure)) { var temps = SteamLoginSecure.Split(SteamLoginSecure.Contains("||") ? "||" : "%7C%7C"); - if (temps.Length == 2) + if (temps.Length == 2 && ulong.TryParse(temps[0], out var steamid)) { - var steamid = temps[0]; - var accecstoken = temps[1]; + SteamLoginState.SteamId = steamid; + SteamLoginState.AccessToken = temps[1]; var cookieContainer = new CookieContainer(); cookieContainer.Add(new Cookie("steamLoginSecure", SteamLoginSecure, "/", "steamcommunity.com")); cookieContainer.Add(new Cookie("sessionid", SeesionId, "/", "steamcommunity.com")); @@ -88,8 +88,8 @@ private async void CookieLoginAsync() cookieContainer.Add(new Cookie("sessionid", SeesionId, "/", "steampowered.com")); SteamSession session = new SteamSession() { - SteamId = steamid, - AccessToken = accecstoken, + SteamId = steamid.ToString(), + AccessToken = SteamLoginState.AccessToken, RefreshToken = string.Empty, CookieContainer = cookieContainer, }; diff --git a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml index d438f7cd886..9dae37c2b91 100644 --- a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml +++ b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml @@ -31,7 +31,7 @@ Text="优先运行此游戏" /> @@ -39,12 +39,17 @@ - + @@ -74,51 +79,61 @@ Theme="{StaticResource TransparentButton}"> - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -193,9 +208,9 @@ OnContent="{Binding Path=Res.Idle_OpenAutoNext, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" /> - + - + @@ -436,8 +451,22 @@ Spacing="6"> - 123 + + + + + string.Format(SteamApiUrls.STEAMDBINFO_APP_URL, app.AppId), + "steamcardexchange" => string.Format(SteamApiUrls.STEAMCARDEXCHANGE_APP_URL, app.AppId), + _ => string.Format(SteamApiUrls.STEAMSTORE_APP_URL, app.AppId), + }; + ViewModel?.OpenLinkUrlCommand.Execute(url); + } + } } diff --git a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleSteamLoginPage.axaml b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleSteamLoginPage.axaml index ba0f4357d2c..4d24494bdba 100644 --- a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleSteamLoginPage.axaml +++ b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleSteamLoginPage.axaml @@ -45,6 +45,7 @@ MaxWidth="280" Classes="revealPasswordButton" PasswordChar="{StaticResource PasswordChar}" + ScrollViewer.HorizontalScrollBarVisibility="Disabled" Text="{Binding PasswordText}" Watermark="{Binding Path=Res.Steam_Password, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" /> @@ -96,7 +97,7 @@ diff --git a/src/BD.WTTS.Client/Resources/Strings.Designer.cs b/src/BD.WTTS.Client/Resources/Strings.Designer.cs index 45ba60ec503..e18579e2bff 100644 --- a/src/BD.WTTS.Client/Resources/Strings.Designer.cs +++ b/src/BD.WTTS.Client/Resources/Strings.Designer.cs @@ -6882,6 +6882,15 @@ public static string SteamGuardData { } } + /// + /// 查找类似 已掉落 {0} 张卡牌 的本地化字符串。 + /// + public static string SteamIdle_DroppedCardsCountTip_ { + get { + return ResourceManager.GetString("SteamIdle_DroppedCardsCountTip_", resourceCulture); + } + } + /// /// 查找类似 已游玩 {0} 小时 ///{1} 张剩余卡牌掉落 diff --git a/src/BD.WTTS.Client/Resources/Strings.resx b/src/BD.WTTS.Client/Resources/Strings.resx index 7a0c1e57f0d..0256648efb0 100644 --- a/src/BD.WTTS.Client/Resources/Strings.resx +++ b/src/BD.WTTS.Client/Resources/Strings.resx @@ -2874,5 +2874,8 @@ Cookie 登录 + + + 已掉落 {0} 张卡牌 \ No newline at end of file diff --git a/src/BD.WTTS.Client/UI/ViewModels/Pages/DebugPageViewModel.cs b/src/BD.WTTS.Client/UI/ViewModels/Pages/DebugPageViewModel.cs index 49f6911761e..b46f3dfb413 100644 --- a/src/BD.WTTS.Client/UI/ViewModels/Pages/DebugPageViewModel.cs +++ b/src/BD.WTTS.Client/UI/ViewModels/Pages/DebugPageViewModel.cs @@ -24,8 +24,6 @@ public string DebugString set => this.RaiseAndSetIfChanged(ref _DebugString, value); } - string? phonenumber; - sealed class D : Repository { @@ -107,7 +105,7 @@ public async void Debug(string? cmd) // catch (Exception ex) // { // } - + string phonenumber = cmds[0]; if (phonenumber == null) phonenumber = "180" + Random2.GenerateRandomNum(8); if (cmds[1] == "sms") {