mirror of
https://github.com/sp-tarkov/launcher.git
synced 2025-02-12 22:30:43 -05:00
added edition tooltips, cleaned up some namespaces
This commit is contained in:
parent
ea6cd3640e
commit
c1679ff141
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;
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace Aki.Launch.Models.Aki
|
namespace Aki.Launcher.Models.Aki
|
||||||
{
|
{
|
||||||
public class AkiVersion : INotifyPropertyChanged
|
public class AkiVersion : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Aki.Launcher
|
namespace Aki.Launcher
|
||||||
{
|
{
|
||||||
public class ServerInfo
|
public class ServerInfo
|
||||||
@ -14,12 +16,14 @@ namespace Aki.Launcher
|
|||||||
public string backendUrl;
|
public string backendUrl;
|
||||||
public string name;
|
public string name;
|
||||||
public string[] editions;
|
public string[] editions;
|
||||||
|
public Dictionary<string, string> profileDescriptions;
|
||||||
|
|
||||||
public ServerInfo()
|
public ServerInfo()
|
||||||
{
|
{
|
||||||
backendUrl = "http://127.0.0.1:6969";
|
backendUrl = "http://127.0.0.1:6969";
|
||||||
name = "Local SPT-AKI Server";
|
name = "Local SPT-AKI Server";
|
||||||
editions = new string[0];
|
editions = new string[0];
|
||||||
|
profileDescriptions = new Dictionary<string, string>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using Aki.Launcher.Models.Aki;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
|
||||||
@ -41,8 +42,8 @@ namespace Aki.Launcher.Models.Launcher
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string _SelectedEdition;
|
private AkiEdition _SelectedEdition;
|
||||||
public string SelectedEdition
|
public AkiEdition SelectedEdition
|
||||||
{
|
{
|
||||||
get => _SelectedEdition;
|
get => _SelectedEdition;
|
||||||
set
|
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()
|
public EditionCollection()
|
||||||
{
|
{
|
||||||
SelectedEditionIndex = 0;
|
SelectedEditionIndex = 0;
|
||||||
|
|
||||||
|
foreach(var edition in ServerManager.SelectedServer.editions)
|
||||||
|
{
|
||||||
|
AvailableEditions.Add(new AkiEdition(edition));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
* waffle.lord
|
* waffle.lord
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using Aki.Launch.Models.Aki;
|
|
||||||
using Aki.Launcher.Helpers;
|
using Aki.Launcher.Helpers;
|
||||||
using Aki.Launcher.MiniCommon;
|
using Aki.Launcher.MiniCommon;
|
||||||
using Aki.Launcher.Models.Aki;
|
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.Helpers;
|
||||||
using Aki.Launcher.Models.Launcher;
|
using Aki.Launcher.Models.Launcher;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
|
@ -50,9 +50,9 @@ namespace Aki.Launcher.ViewModels
|
|||||||
{
|
{
|
||||||
var result = await ShowDialog(new RegisterDialogViewModel(null, Login.Username));
|
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)
|
switch (registerResult)
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,7 @@ using Aki.Launcher.Models;
|
|||||||
using Aki.Launcher.MiniCommon;
|
using Aki.Launcher.MiniCommon;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Splat;
|
using Splat;
|
||||||
using Aki.Launch.Models.Aki;
|
using Aki.Launcher.Models.Aki;
|
||||||
using Aki.Launcher.Helpers;
|
using Aki.Launcher.Helpers;
|
||||||
|
|
||||||
namespace Aki.Launcher.ViewModels
|
namespace Aki.Launcher.ViewModels
|
||||||
|
@ -11,6 +11,7 @@ using Avalonia.Threading;
|
|||||||
using System.Reactive.Disposables;
|
using System.Reactive.Disposables;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using Aki.Launcher.Models.Aki;
|
||||||
|
|
||||||
namespace Aki.Launcher.ViewModels
|
namespace Aki.Launcher.ViewModels
|
||||||
{
|
{
|
||||||
@ -161,9 +162,9 @@ namespace Aki.Launcher.ViewModels
|
|||||||
{
|
{
|
||||||
var result = await ShowDialog(new ChangeEditionDialogViewModel(null));
|
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)
|
switch (status)
|
||||||
{
|
{
|
||||||
|
@ -15,11 +15,17 @@
|
|||||||
Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=wipe_warning}"
|
Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=wipe_warning}"
|
||||||
Foreground="IndianRed"
|
Foreground="IndianRed"
|
||||||
/>
|
/>
|
||||||
<ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
|
<ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
Items="{Binding editions.AvailableEditions}"
|
Items="{Binding editions.AvailableEditions}"
|
||||||
SelectedItem="{Binding editions.SelectedEdition}"
|
SelectedItem="{Binding editions.SelectedEdition}"
|
||||||
PlaceholderText="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=select_edition}"
|
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">
|
<StackPanel Spacing="10" Grid.Row="3" Grid.Column="2" Orientation="Horizontal">
|
||||||
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=update}"
|
<Button Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=update}"
|
||||||
|
@ -14,14 +14,21 @@
|
|||||||
<TextBlock Text="{Binding Question}" Grid.ColumnSpan="2" FontSize="15"
|
<TextBlock Text="{Binding Question}" Grid.ColumnSpan="2" FontSize="15"
|
||||||
Foreground="{StaticResource AKI_Foreground_Light}"
|
Foreground="{StaticResource AKI_Foreground_Light}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ComboBox Items="{Binding Editions.AvailableEditions}"
|
<ComboBox Items="{Binding Editions.AvailableEditions}"
|
||||||
Margin="0 10"
|
Margin="0 10"
|
||||||
Grid.Row="1" Grid.ColumnSpan="2"
|
Grid.Row="1" Grid.ColumnSpan="2"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
SelectedItem="{Binding Editions.SelectedEdition}"
|
SelectedItem="{Binding Editions.SelectedEdition}"
|
||||||
PlaceholderText="{Binding ComboBoxPlaceholderText}"
|
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"
|
<StackPanel Grid.Row="2" Grid.Column="1"
|
||||||
Orientation="Horizontal" Spacing="10"
|
Orientation="Horizontal" Spacing="10"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user