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

Skip to content

Commit 66832af

Browse files
committed
Misc
1 parent 680fb87 commit 66832af

5 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/ST.Client.CommandLine/CommandLineHost.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,15 @@ void MainHandlerByCLT_(Action? onInitStartuped)
175175

176176
var currentuser = users.Where(s => s.AccountName == account).FirstOrDefault();
177177

178+
await steamService.ShutdownSteam();
179+
178180
if (currentuser != null)
179181
{
180182
currentuser.MostRecent = true;
181183
steamService.UpdateLocalUserData(users);
182184
steamService.SetCurrentUser(account);
183185
}
184186

185-
await steamService.ShutdownSteam();
186187
steamService.StartSteam();
187188
}
188189
});

src/ST.Client.Desktop.Avalonia/Application/UI/Views/Windows/SteamAccountPage/ShareManageWindow.axaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
x:CompileBindings="True">
2323
<Panel>
2424
<controls:TitleBar/>
25-
<Panel x:Name="TitleBarHost"
25+
<Panel x:Name="TitleBarHost"
2626
VerticalAlignment="Top"
2727
Background="Transparent"
2828
Height="{StaticResource TitleBarHeight}"/>
@@ -180,6 +180,7 @@
180180
HorizontalAlignment="Stretch"
181181
MaxWidth="200"
182182
Command="{ReflectionBinding #u.DataContext.SetFirstButton_Click}"
183+
IsEnabled="{Binding !Disable}"
183184
CommandParameter="{Binding}">
184185
<controls:ScrollingTextBlock Text="{ReflectionBinding Path=Res.Top,Mode=OneWay,Source={x:Static resx:R.Current}}"></controls:ScrollingTextBlock>
185186
</Button>
@@ -189,6 +190,7 @@
189190
HorizontalAlignment="Stretch"
190191
MaxWidth="200"
191192
Command="{ReflectionBinding #u.DataContext.UpButton_Click}"
193+
IsEnabled="{Binding !Disable}"
192194
CommandParameter="{Binding}">
193195
<controls:ScrollingTextBlock Text="{ReflectionBinding Path=Res.Up,Mode=OneWay,Source={x:Static resx:R.Current}}"></controls:ScrollingTextBlock>
194196
</Button>
@@ -198,6 +200,7 @@
198200
MaxWidth="200"
199201
HorizontalAlignment="Stretch"
200202
Command="{ReflectionBinding #u.DataContext.DownButton_Click}"
203+
IsEnabled="{Binding !Disable}"
201204
CommandParameter="{Binding}">
202205
<controls:ScrollingTextBlock Text="{ReflectionBinding Path=Res.Dow,Mode=OneWay,Source={x:Static resx:R.Current}}"></controls:ScrollingTextBlock>
203206
</Button>

src/ST.Client/Services/ISteamService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public interface ISteamService
5555
void StartSteam(string? arguments = null);
5656

5757
/// <summary>
58-
/// 退出 Steam
58+
/// 安全退出 Steam(如果有修改Steam数据的操作请退出后在执行不然Steam安全退出会还原修改)
5959
/// </summary>
6060
Task ShutdownSteam();
6161

src/ST.Client/UI/ViewModels/Pages/SteamAccountPageViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ private async void ReStartSteamByUser(SteamUser? user = null)
131131
foreach (var item in SteamUsers.Where(x => x.MostRecent))
132132
item.MostRecent = false;
133133

134+
await steamService.ShutdownSteam();
135+
134136
if (user != null)
135137
{
136138
user.MostRecent = true;
@@ -142,7 +144,6 @@ private async void ReStartSteamByUser(SteamUser? user = null)
142144
steamService.SetCurrentUser(string.Empty);
143145
}
144146

145-
await steamService.ShutdownSteam();
146147
steamService.StartSteam(SteamSettings.SteamStratParameter.Value);
147148
}
148149

src/ST.Client/UI/ViewModels/Windows/SteamAccountPage/ShareManageViewModel.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ public void Refresh_Click()
6161
Timeused = x.Timeused,
6262
Description = x.Description,
6363
Disable = true,
64-
Tokenid = x.Tokenid
64+
Tokenid = x.Tokenid,
6565
}));
66-
int count = allList.Count - 1;
6766
foreach (var item in allList)
6867
{
6968
var temp = userlist.FirstOrDefault(x => x.SteamId32 == item.SteamId3_Int);
@@ -198,7 +197,7 @@ public async void SetActivity_Click()
198197
var result = await MessageBox.ShowAsync(AppResources.AccountChange_RestartSteam, button: MessageBox.Button.OKCancel);
199198
if (result.IsOK())
200199
{
201-
await steamService.ShutdownSteam();
200+
steamService.TryKillSteamProcess();
202201
steamService.StartSteam();
203202
}
204203
}

0 commit comments

Comments
 (0)