Skip to content

Commit

Permalink
Bug Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbadmin committed Jun 9, 2022
1 parent 6a8cd68 commit bbcf171
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 23 deletions.
2 changes: 1 addition & 1 deletion references/SteamAchievementManager
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@
</DockPanel>
</StackPanel>

<StackPanel Spacing="15"
Margin="0 60 0 0"
VerticalAlignment="Center"
HorizontalAlignment="Center"
IsVisible="{Binding IsLoading}">
<ProgressBar Classes="Circle"
Width="50"
Height="50"
IsIndeterminate="True"/>
<TextBlock Text="{ReflectionBinding Path=Res.GameList_IsLoading,Mode=OneWay,Source={x:Static resx:R.Current}}"></TextBlock>
</StackPanel>

<TabControl Classes="flat"
Margin="0 20 0 0"
ZIndex="1">
Expand Down
11 changes: 10 additions & 1 deletion src/ST.Client/UI/Resx/AppResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/ST.Client/UI/Resx/AppResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ AAAAA-BBBBB-CCCC3</value>
<value>没有获取到任何游戏数据</value>
</data>
<data name="GameList_IsLoading" xml:space="preserve">
<value>正在加载游戏列表...</value>
<value>正在加载...</value>
</data>
<data name="GameList_ListCount" xml:space="preserve">
<value>已添加 ({0}/{1})</value>
Expand Down Expand Up @@ -2282,6 +2282,9 @@ AAAAA-BBBBB-CCCC3</value>
<data name="GameList_CloudArchiveDeleteTip" xml:space="preserve">
<value>确定要删除当前选中的存档数据吗?</value>
</data>
<data name="GameList_CloudArchiveDeleteAllTip" xml:space="preserve">
<value>确定要删除全部存档数据吗,请一定要明白你在做什么,该操作会清除当前游戏的全部云存档数据!!!</value>
</data>
<data name="GameList_UploadCloudArchiveFile" xml:space="preserve">
<value>手动上传存档文件</value>
</data>
Expand Down
10 changes: 4 additions & 6 deletions src/ST.Client/UI/ViewModels/Pages/GameListPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,10 @@ public static async void ManageCloudArchive_Click(SteamApp app)
Toast.Show(AppResources.GameList_SteamNotRuning);
return;
}
if (app.IsCloudArchive)
{
Toast.Show(AppResources.GameList_RuningWait);
app.StartSteamAppProcess(SteamAppRunType.CloudManager);
SteamConnectService.Current.RuningSteamApps.TryAdd(app.AppId, app);
}

Toast.Show(AppResources.GameList_RuningWait);
app.StartSteamAppProcess(SteamAppRunType.CloudManager);
SteamConnectService.Current.RuningSteamApps.TryAdd(app.AppId, app);
}

public static void AppGridReSize()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ public class CloudArchiveWindowViewModel : WindowViewModel
public ReadOnlyObservableCollection<SteamRemoteFile>? CloudArchivews => _CloudArchivews;

public string CloudArchivewCountStr => string.Format(AppResources.FileNumber, CloudArchivews?.Count ?? 0);

private bool _IsLoading;

public bool IsLoading
{
get => _IsLoading;
set => this.RaiseAndSetIfChanged(ref _IsLoading, value);
}
#endregion

//private bool? _IsCheckAll;
Expand All @@ -40,15 +48,15 @@ public class CloudArchiveWindowViewModel : WindowViewModel
// set => this.RaiseAndSetIfChanged(ref _IsCheckAll, value);
//}

public bool IsCloudEnabledForAccount { get; }
//public bool IsCloudEnabledForAccount { get; }

private bool _IsCloudEnabledForApp;
//private bool _IsCloudEnabledForApp;

public bool IsCloudEnabledForApp
{
get => _IsCloudEnabledForApp;
set => this.RaiseAndSetIfChanged(ref _IsCloudEnabledForApp, value);
}
//public bool IsCloudEnabledForApp
//{
// get => _IsCloudEnabledForApp;
// set => this.RaiseAndSetIfChanged(ref _IsCloudEnabledForApp, value);
//}

private int _UsedQutoa;

Expand Down Expand Up @@ -100,21 +108,30 @@ public CloudArchiveWindowViewModel(int appid)

public void RefreshList()
{
var results = ISteamworksLocalApiService.Instance.GetCloudArchiveFiles();
_CloudArchivewSourceList.Clear();
if (results.Any_Nullable())
_CloudArchivewSourceList.AddRange(results);

if (!IsLoading)
{
IsLoading = true;
var results = ISteamworksLocalApiService.Instance.GetCloudArchiveFiles();
_CloudArchivewSourceList.Clear();
if (results.Any_Nullable())
_CloudArchivewSourceList.AddRange(results);
IsLoading = false;
}
_CloudArchivewSourceList.Items.Sum(x => x.Size);
ISteamworksLocalApiService.Instance.GetCloudArchiveQuota(out var totalBytes, out var availBytes);
TotalQutoa = (int)(totalBytes / 1024 / 1024);
UsedQutoa = (int)((totalBytes - availBytes) / 1024 / 1024);
UsedQutoa = (int)(_CloudArchivewSourceList.Items.Sum(x => x.Size) / 1024 / 1024);
}

public async void ClearAllFiles()
{
var result = await MessageBox.ShowAsync(AppResources.Achievement_ResetWaring_1, Title, MessageBox.Button.OKCancel);
var result = await MessageBox.ShowAsync(AppResources.GameList_CloudArchiveDeleteAllTip, Title, MessageBox.Button.OKCancel);
if (result.IsOK())
{
foreach (var file in _CloudArchivewSourceList.Items)
{
DeleteFile(file);
}
RefreshList();
}
}
Expand Down

0 comments on commit bbcf171

Please sign in to comment.