Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 209634c

Browse files
committed
🐛 改进挂卡登录账号检测行为
1 parent d22a832 commit 209634c

4 files changed

Lines changed: 72 additions & 14 deletions

File tree

src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ public async Task IdleRunStartOrStop_Click()
128128
if (SteamLoginState.Success && SteamLoginState.SteamId != (ulong?)SteamConnectService.Current.CurrentSteamUser?.SteamId64)
129129
{
130130
Toast.Show(ToastIcon.Error, Strings.SteamIdle_LoginSteamUserError);
131-
RunState = false;
132-
RunLoaingState = false;
133-
return;
131+
//RunState = false;
132+
//RunLoaingState = false;
133+
//return;
134134
}
135135
}
136136

@@ -255,7 +255,6 @@ await IWindowManager.Instance.ShowTaskDialogAsync(vm, Strings.Steam_Login,
255255
if (SteamLoginState.Success && sid.HasValue && SteamLoginState.SteamId != (ulong)sid.Value)
256256
{
257257
Toast.Show(ToastIcon.Error, Strings.SteamIdle_LoginSteamUserError);
258-
return IsLogin = false;
259258
}
260259
}
261260

src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml

Lines changed: 67 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
xmlns:spp_enums="using:BD.WTTS.Enums"
1313
xmlns:ui="using:FluentAvalonia.UI.Controls"
1414
Title="{Binding Name, Source={x:Static s:Plugin.Instance}, Mode=OneWay}"
15-
d:DesignHeight="450"
15+
d:DesignHeight="600"
1616
d:DesignWidth="800"
1717
x:CompileBindings="True"
1818
x:DataType="spp:IdleCardPageViewModel"
@@ -244,7 +244,18 @@
244244
</MultiBinding>
245245
</TextBlock.Text>
246246
</TextBlock>-->
247-
<TextBlock Text="{Binding UserIdleInfo.UserName, Mode=OneWay}" />
247+
<TextBlock>
248+
<TextBlock.Text>
249+
<MultiBinding Converter="{StaticResource VisibleStringConverter}">
250+
<CompiledBinding Mode="OneWay" Path="IsLogin" />
251+
<CompiledBinding Mode="OneWay" Path="UserIdleInfo.UserName" />
252+
<CompiledBinding
253+
Mode="OneWay"
254+
Path="Res.Idle_NeedLoginSteam"
255+
Source="{x:Static s:ResourceService.Current}" />
256+
</MultiBinding>
257+
</TextBlock.Text>
258+
</TextBlock>
248259
</spp:OptionsDisplayItem.Header>
249260
<spp:OptionsDisplayItem.Description>
250261
<Panel>
@@ -270,6 +281,7 @@
270281
VerticalAlignment="Center"
271282
DecodeWidth="64"
272283
DockPanel.Dock="Top"
284+
FallbackSource="avares://BD.WTTS.Client.Avalonia/UI/Assets/avatar.jpg"
273285
Source="{Binding UserIdleInfo.AvatarUrl, Mode=OneWay}"
274286
Stretch="UniformToFill">
275287
<spp:Image2.Clip>
@@ -332,11 +344,48 @@
332344
Maximum="100"
333345
Value="{Binding UserIdleInfo.NextLevelExpPercentage}" />
334346

347+
<StackPanel
348+
Margin="0,6,0,0"
349+
Orientation="Horizontal"
350+
Spacing="5">
351+
<TextBlock VerticalAlignment="Center" Text="当前 Steam 客户端登录账号:" />
352+
<spp:Image2
353+
Width="24"
354+
Height="24"
355+
Margin="0,0,5,0"
356+
VerticalAlignment="Center"
357+
DecodeWidth="36"
358+
FallbackSource="avares://BD.WTTS.Client.Avalonia/UI/Assets/avatar.jpg"
359+
Source="{Binding Source={x:Static s:SteamConnectService.Current}, Path=CurrentSteamUser.AvatarMedium, Mode=OneWay}"
360+
Stretch="Uniform">
361+
<spp:Image2.Clip>
362+
<EllipseGeometry Rect="0,0,24,24" />
363+
</spp:Image2.Clip>
364+
</spp:Image2>
365+
<TextBlock VerticalAlignment="Center">
366+
<TextBlock.Text>
367+
<MultiBinding Converter="{StaticResource VisibleStringConverter}">
368+
<CompiledBinding
369+
Mode="OneWay"
370+
Path="IsConnectToSteam"
371+
Source="{x:Static s:SteamConnectService.Current}" />
372+
<CompiledBinding
373+
Mode="OneWay"
374+
Path="CurrentSteamUser.SteamNickName"
375+
Source="{x:Static s:SteamConnectService.Current}" />
376+
<CompiledBinding
377+
Mode="OneWay"
378+
Path="Res.SteamAppType_Unknown"
379+
Source="{x:Static s:ResourceService.Current}" />
380+
</MultiBinding>
381+
</TextBlock.Text>
382+
</TextBlock>
383+
</StackPanel>
384+
335385
<Border
336386
Height="1"
337387
Margin="-50,6"
338388
Background="{DynamicResource ApplicationPageBackgroundThemeBrush}" />
339-
340389
<Panel>
341390
<WrapPanel HorizontalAlignment="Left">
342391
<TextBlock FontSize="36" Text="{Binding TotalCardsRemaining}" />
@@ -421,13 +470,23 @@
421470
Text="{Binding Path=IdleTime, Mode=OneWay, Converter={StaticResource StringFormatConverter}}" />
422471
</Panel>
423472

424-
<WrapPanel
425-
Grid.Row="2"
426-
Grid.Column="1"
427-
HorizontalAlignment="Center">
428-
<TextBlock FontSize="22.6" Text="{Binding RuningCount, Mode=OneWay}" />
473+
<WrapPanel HorizontalAlignment="Center">
474+
<TextBlock VerticalAlignment="Center" Text="挂卡进度 " />
475+
<TextBlock FontSize="22.6">
476+
<TextBlock.Text>
477+
<MultiBinding StringFormat="{}{0} / {1}">
478+
<CompiledBinding Path="DropCardsCount" />
479+
<CompiledBinding Path="DroppedCardsCount" />
480+
</MultiBinding>
481+
</TextBlock.Text>
482+
</TextBlock>
483+
</WrapPanel>
484+
485+
<WrapPanel HorizontalAlignment="Center">
486+
<TextBlock FontSize="24.6" Text="{Binding RuningCount, Mode=OneWay}" />
429487
<TextBlock VerticalAlignment="Center" Text=" 个游戏正在运行" />
430488
</WrapPanel>
489+
431490
<!--<TextBlock
432491
Grid.Row="2"
433492
Grid.Column="1"

src/BD.WTTS.Client/Resources/Strings.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/BD.WTTS.Client/Resources/Strings.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2864,7 +2864,7 @@
28642864
<value>停止</value>
28652865
</data>
28662866
<data name="SteamIdle_LoginSteamUserError" xml:space="preserve">
2867-
<value>登录的账号与当前 Steam 客户端账号不一致,无法挂卡
2867+
<value>登录的账号与当前 Steam 客户端账号不一致,可能会导致挂卡出现问题
28682868
请注销切换登录账号与 Steam 客户端账号一致,
28692869
或切换 Steam 客户端登录账号与挂卡账号一致!</value>
28702870
</data>

0 commit comments

Comments
 (0)