mirror of
https://github.com/sp-tarkov/launcher.git
synced 2025-02-12 16:30:42 -05:00
Merge pull request 'added edition tooltips, cleaned up some namespaces' (!3) from waffle.lord/Launcher:add-edition-tooltips into master
Reviewed-on: SPT-AKI/Launcher#3
This commit is contained in:
commit
08d0c6ed4f
17
project/Aki.Launcher.Base/Models/Aki/AkiEdition.cs
Normal file
17
project/Aki.Launcher.Base/Models/Aki/AkiEdition.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using Aki.Launcher;
|
||||
|
||||
namespace Aki.Launcher.Models.Aki
|
||||
{
|
||||
public class AkiEdition
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public AkiEdition(string name)
|
||||
{
|
||||
Name = name;
|
||||
ServerManager.SelectedServer.profileDescriptions.TryGetValue(name, out string desc);
|
||||
Description = desc;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Aki.Launch.Models.Aki
|
||||
namespace Aki.Launcher.Models.Aki
|
||||
{
|
||||
public class AkiVersion : INotifyPropertyChanged
|
||||
{
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aki.Launcher
|
||||
{
|
||||
public class ServerInfo
|
||||
@ -14,12 +16,14 @@ namespace Aki.Launcher
|
||||
public string backendUrl;
|
||||
public string name;
|
||||
public string[] editions;
|
||||
public Dictionary<string, string> profileDescriptions;
|
||||
|
||||
public ServerInfo()
|
||||
{
|
||||
backendUrl = "http://127.0.0.1:6969";
|
||||
name = "Local SPT-AKI Server";
|
||||
editions = new string[0];
|
||||
profileDescriptions = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
|
||||
using Aki.Launcher.Models.Aki;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
|
||||
@ -41,8 +42,8 @@ namespace Aki.Launcher.Models.Launcher
|
||||
}
|
||||
}
|
||||
|
||||
private string _SelectedEdition;
|
||||
public string SelectedEdition
|
||||
private AkiEdition _SelectedEdition;
|
||||
public AkiEdition SelectedEdition
|
||||
{
|
||||
get => _SelectedEdition;
|
||||
set
|
||||
@ -55,11 +56,16 @@ namespace Aki.Launcher.Models.Launcher
|
||||
}
|
||||
}
|
||||
}
|
||||
public ObservableCollection<string> AvailableEditions { get; private set; } = new ObservableCollection<string>(ServerManager.SelectedServer.editions);
|
||||
public ObservableCollection<AkiEdition> AvailableEditions { get; private set; } = new ObservableCollection<AkiEdition>();
|
||||
|
||||
public EditionCollection()
|
||||
{
|
||||
SelectedEditionIndex = 0;
|
||||
|
||||
foreach(var edition in ServerManager.SelectedServer.editions)
|
||||
{
|
||||
AvailableEditions.Add(new AkiEdition(edition));
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
@ -6,7 +6,6 @@
|
||||
* waffle.lord
|
||||
*/
|
||||
|
||||
using Aki.Launch.Models.Aki;
|
||||
using Aki.Launcher.Helpers;
|
||||
using Aki.Launcher.MiniCommon;
|
||||
using Aki.Launcher.Models.Aki;
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Aki.Launch.Models.Aki;
|
||||
using Aki.Launcher.Models.Aki;
|
||||
using Aki.Launcher.Helpers;
|
||||
using Aki.Launcher.Models.Launcher;
|
||||
using ReactiveUI;
|
||||
|
@ -50,9 +50,9 @@ namespace Aki.Launcher.ViewModels
|
||||
{
|
||||
var result = await ShowDialog(new RegisterDialogViewModel(null, Login.Username));
|
||||
|
||||
if (result != null && result is string edition)
|
||||
if (result != null && result is AkiEdition edition)
|
||||
{
|
||||
AccountStatus registerResult = await AccountManager.RegisterAsync(Login.Username, Login.Password, edition);
|
||||
AccountStatus registerResult = await AccountManager.RegisterAsync(Login.Username, Login.Password, edition.Name);
|
||||
|
||||
switch (registerResult)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@ using Aki.Launcher.Models;
|
||||
using Aki.Launcher.MiniCommon;
|
||||
using System.IO;
|
||||
using Splat;
|
||||
using Aki.Launch.Models.Aki;
|
||||
using Aki.Launcher.Models.Aki;
|
||||
using Aki.Launcher.Helpers;
|
||||
|
||||
namespace Aki.Launcher.ViewModels
|
||||
|
@ -11,6 +11,7 @@ using Avalonia.Threading;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using Aki.Launcher.Models.Aki;
|
||||
|
||||
namespace Aki.Launcher.ViewModels
|
||||
{
|
||||
@ -161,9 +162,9 @@ namespace Aki.Launcher.ViewModels
|
||||
{
|
||||
var result = await ShowDialog(new ChangeEditionDialogViewModel(null));
|
||||
|
||||
if(result != null && result is string edition)
|
||||
if(result != null && result is AkiEdition edition)
|
||||
{
|
||||
AccountStatus status = await AccountManager.WipeAsync(edition);
|
||||
AccountStatus status = await AccountManager.WipeAsync(edition.Name);
|
||||
|
||||
switch (status)
|
||||
{
|
||||
|
@ -15,11 +15,17 @@
|
||||
Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=wipe_warning}"
|
||||
Foreground="IndianRed"
|
||||
/>
|
||||
<ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
|
||||
Items="{Binding editions.AvailableEditions}"
|
||||
SelectedItem="{Binding editions.SelectedEdition}"
|
||||
PlaceholderText="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=select_edition}"
|
||||
/>
|
||||
<ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
|
||||
Items="{Binding editions.AvailableEditions}"
|
||||
SelectedItem="{Binding editions.SelectedEdition}"
|
||||
PlaceholderText="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=select_edition}"
|
||||
>
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Background="Transparent" Content="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<StackPanel Spacing="10" Grid.Row="3" Grid.Column="2" Orientation="Horizontal">
|
||||
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=update}"
|
||||
|
@ -14,14 +14,21 @@
|
||||
<TextBlock Text="{Binding Question}" Grid.ColumnSpan="2" FontSize="15"
|
||||
Foreground="{StaticResource AKI_Foreground_Light}"
|
||||
/>
|
||||
|
||||
<ComboBox Items="{Binding Editions.AvailableEditions}"
|
||||
Margin="0 10"
|
||||
Grid.Row="1" Grid.ColumnSpan="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
SelectedItem="{Binding Editions.SelectedEdition}"
|
||||
PlaceholderText="{Binding ComboBoxPlaceholderText}"
|
||||
/>
|
||||
|
||||
<ComboBox Items="{Binding Editions.AvailableEditions}"
|
||||
Margin="0 10"
|
||||
Grid.Row="1" Grid.ColumnSpan="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
SelectedItem="{Binding Editions.SelectedEdition}"
|
||||
PlaceholderText="{Binding ComboBoxPlaceholderText}"
|
||||
>
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Background="Transparent" Content="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
|
||||
</ComboBox>
|
||||
|
||||
<StackPanel Grid.Row="2" Grid.Column="1"
|
||||
Orientation="Horizontal" Spacing="10"
|
||||
|
Loading…
x
Reference in New Issue
Block a user