diff --git a/SIT.Manager/Localization/en-US.axaml b/SIT.Manager/Localization/en-US.axaml index a0c29d7a..2d1ebc51 100644 --- a/SIT.Manager/Localization/en-US.axaml +++ b/SIT.Manager/Localization/en-US.axaml @@ -428,6 +428,7 @@ Play Login + Logout Add Server diff --git a/SIT.Manager/Localization/ru-RU.axaml b/SIT.Manager/Localization/ru-RU.axaml index 5775f0cf..4a14102b 100644 --- a/SIT.Manager/Localization/ru-RU.axaml +++ b/SIT.Manager/Localization/ru-RU.axaml @@ -429,6 +429,7 @@ Играть Войти + Выход Добавить сервер diff --git a/SIT.Manager/Localization/uk-UA.axaml b/SIT.Manager/Localization/uk-UA.axaml index 72a7f9ae..022a8597 100644 --- a/SIT.Manager/Localization/uk-UA.axaml +++ b/SIT.Manager/Localization/uk-UA.axaml @@ -430,6 +430,7 @@ Грати Ввійти + Вихід Додати сервер diff --git a/SIT.Manager/Localization/zh-CN.axaml b/SIT.Manager/Localization/zh-CN.axaml index 2b97656d..30678e62 100644 --- a/SIT.Manager/Localization/zh-CN.axaml +++ b/SIT.Manager/Localization/zh-CN.axaml @@ -430,6 +430,7 @@ 登录 + 注销 添加服务器 diff --git a/SIT.Manager/Localization/zh-HK.axaml b/SIT.Manager/Localization/zh-HK.axaml index 271f2ee1..e1a1d0ae 100644 --- a/SIT.Manager/Localization/zh-HK.axaml +++ b/SIT.Manager/Localization/zh-HK.axaml @@ -429,6 +429,7 @@ 登錄 + 注销 添加伺服器 diff --git a/SIT.Manager/Localization/zh-TW.axaml b/SIT.Manager/Localization/zh-TW.axaml index d900a589..1e07fe22 100644 --- a/SIT.Manager/Localization/zh-TW.axaml +++ b/SIT.Manager/Localization/zh-TW.axaml @@ -430,6 +430,7 @@ 登入 + 注销 添加伺服器 diff --git a/SIT.Manager/ViewModels/Play/CharacterSummaryViewModel.cs b/SIT.Manager/ViewModels/Play/CharacterSummaryViewModel.cs index bd7d0dc7..c635ecb2 100644 --- a/SIT.Manager/ViewModels/Play/CharacterSummaryViewModel.cs +++ b/SIT.Manager/ViewModels/Play/CharacterSummaryViewModel.cs @@ -9,6 +9,8 @@ using SIT.Manager.Services.Caching; using SIT.Manager.Views.Play; using System; +using System.Collections; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -43,6 +45,8 @@ public partial class CharacterSummaryViewModel : ObservableRecipient public IAsyncRelayCommand PlayCommand { get; } + public IAsyncRelayCommand LogoutCommand { get; } + public CharacterSummaryViewModel(AkiServer server, AkiMiniProfile profile, ILocalizationService localizationService, @@ -86,6 +90,7 @@ public CharacterSummaryViewModel(AkiServer server, Task.Run(SetSideImage); PlayCommand = new AsyncRelayCommand(Play); + LogoutCommand = new AsyncRelayCommand(Logout); } private async Task SetSideImage() @@ -140,11 +145,6 @@ private async Task Play() if (success && rememberLogin) { _connectedServer.Characters.Add(character); - int index = _configService.Config.BookmarkedServers.FindIndex(x => x.Address == _connectedServer.Address); - if (index != -1 && !_configService.Config.BookmarkedServers[index].Characters.Any(x => x.Username == character.Username)) - { - _configService.Config.BookmarkedServers[index].Characters.Add(character); - } _configService.UpdateConfig(_configService.Config); RequireLogin = false; } @@ -161,4 +161,14 @@ private async Task Play() await errorDialog.ShowAsync(); } } + + private async Task Logout() + { + if (character != null) + { + _connectedServer.Characters.Remove(character); + _configService.UpdateConfig(_configService.Config); + RequireLogin = true; + } + } } diff --git a/SIT.Manager/Views/Play/CharacterSummaryView.axaml b/SIT.Manager/Views/Play/CharacterSummaryView.axaml index a93c0912..bcf2a6df 100644 --- a/SIT.Manager/Views/Play/CharacterSummaryView.axaml +++ b/SIT.Manager/Views/Play/CharacterSummaryView.axaml @@ -9,7 +9,7 @@ x:Class="SIT.Manager.Views.Play.CharacterSummaryView" x:DataType="vm:CharacterSummaryViewModel"> - + + +