0
0
mirror of https://github.com/sp-tarkov/launcher.git synced 2025-02-12 17:30:42 -05:00

Merge pull request 'feature/mods-info' (!13) from waffle.lord/Launcher:feature/mods-info into master

Reviewed-on: SPT-AKI/Launcher#13
This commit is contained in:
chomp 2023-08-14 14:00:38 +00:00
commit cc3130b2f5
24 changed files with 540 additions and 14 deletions

View File

@ -94,5 +94,15 @@ namespace Aki.Launcher
{
return request.GetJson("/launcher/profile/compatibleTarkovVersion");
}
public static string RequestLoadedServerMods()
{
return request.GetJson("/launcher/server/loadedServerMods");
}
public static string RequestProfileMods()
{
return request.GetJson("/launcher/server/serverModsUsedByProfile");
}
}
}

View File

@ -8,6 +8,8 @@
using Aki.Launcher.MiniCommon;
using Aki.Launcher.Models.Aki;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Aki.Launcher
@ -62,6 +64,34 @@ namespace Aki.Launcher
}
}
public static Dictionary<string, AkiServerModInfo> GetLoadedServerMods()
{
try
{
string json = RequestHandler.RequestLoadedServerMods();
return Json.Deserialize<Dictionary<string, AkiServerModInfo>>(json);
}
catch
{
return new Dictionary<string, AkiServerModInfo>();
}
}
public static AkiProfileModInfo[] GetProfileMods()
{
try
{
string json = RequestHandler.RequestProfileMods();
return Json.Deserialize<AkiProfileModInfo[]>(json);
}
catch
{
return new AkiProfileModInfo[] { };
}
}
public static void LoadServer(string backendUrl)
{
string json = "";

View File

@ -171,6 +171,9 @@ namespace Aki.Launcher.Helpers
englishLocale.i_understand = "I Understand";
englishLocale.game_version_mismatch_format_2 = "SPT is unable to run, this is because SPT expected to find EFT version '{1}',\nbut instead found version '{0}'\n\nEnsure you've downgraded your EFT as described in the install guide\non the page you downloaded SPT from";
englishLocale.description = "Description";
englishLocale.server_mods = "Server Mods";
englishLocale.profile_mods = "Profile Mods";
englishLocale.author = "Author";
#endregion
Directory.CreateDirectory(LocalizationProvider.DefaultLocaleFolderPath);
@ -1519,6 +1522,55 @@ namespace Aki.Launcher.Helpers
}
#endregion
#region server_mods
private string _server_mods;
public string server_mods
{
get => _server_mods;
set
{
if (_server_mods != value)
{
_server_mods = value;
RaisePropertyChanged(nameof(server_mods));
}
}
}
#endregion
#region profile_mods
private string _profile_mods;
public string profile_mods
{
get => _profile_mods;
set
{
if (_profile_mods != value)
{
_profile_mods = value;
RaisePropertyChanged(nameof(profile_mods));
}
}
}
#endregion
#region author
private string _author;
public string author
{
get => _author;
set
{
if (_author != value)
{
_author = value;
RaisePropertyChanged(nameof(author));
}
}
}
#endregion
#endregion
public event PropertyChangedEventHandler PropertyChanged;

View File

@ -0,0 +1,11 @@
namespace Aki.Launcher.Models.Aki
{
public class AkiMod
{
public bool InServer { get; set; }
public bool InProfile { get; set; }
public string Author { get; set; }
public string Name { get; set; }
public string Version { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System;
namespace Aki.Launcher.Models.Aki
{
public class AkiProfileModInfo : AkiMod
{
public string DateAdded { get; set; }
}
}
/*
"author": "Boop",
"dateAdded": 1687150604114,
"name": "Boop's Quest Zone API",
"version": "1.0.0"
*/

View File

@ -0,0 +1,41 @@
using System.Collections.Generic;
namespace Aki.Launcher.Models.Aki
{
public class AkiServerModInfo : AkiMod
{
public string Main { get; set; }
public string License { get; set; }
public string AkiVersion { get; set; }
public Dictionary<string, string> Scripts { get; set; }
public DevDependencies DevDependencies { get; set; }
}
}
/*
{
"wafflelord-ZeroToHeroPlus-1.0.0": {
"name": "ZeroToHeroPlus",
"version": "1.0.0",
"main": "src/mod.ts",
"license": "MIT",
"author": "waffle.lord",
"akiVersion": "~3.6",
"scripts": {
"setup": "npm i",
"build": "node ./packageBuild.ts"
},
"devDependencies": {
"@types/node": "16.18.10",
"@typescript-eslint/eslint-plugin": "5.46.1",
"@typescript-eslint/parser": "5.46.1",
"bestzip": "2.2.1",
"eslint": "8.30.0",
"fs-extra": "11.1.0",
"glob": "8.0.3",
"tsyringe": "4.7.0",
"typescript": "4.9.4"
}
}
}
*/

View File

@ -0,0 +1,37 @@
using Newtonsoft.Json;
namespace Aki.Launcher.Models.Aki
{
public class DevDependencies
{
[JsonProperty("@types/node")]
public string TypesNode { get; set; }
[JsonProperty("@typescript-eslint/eslint-plugin")]
public string EslintPlugin { get; set; }
[JsonProperty("@typescript-eslint/parser")]
public string EslintParser { get; set; }
public string BestZip { get; set; }
public string Eslint { get; set; }
[JsonProperty("fs-extra")]
public string FsExtra { get; set; }
public string Glob { get; set; }
public string Tsyringe { get; set; }
public string Typescript { get; set; }
}
}
/*
"@types/node": "16.18.10",
"@typescript-eslint/eslint-plugin": "5.46.1",
"@typescript-eslint/parser": "5.46.1",
"bestzip": "2.2.1",
"eslint": "8.30.0",
"fs-extra": "11.1.0",
"glob": "8.0.3",
"tsyringe": "4.7.0",
"typescript": "4.9.4"
*/

View File

@ -0,0 +1,106 @@
using Aki.Launcher.Models.Aki;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
namespace Aki.Launcher.Models.Launcher
{
public class ModInfoCollection : INotifyPropertyChanged
{
private int _serverModsCount;
public int ServerModsCount
{
get => _serverModsCount;
set
{
if (_serverModsCount != value)
{
_serverModsCount = value;
RaisePropertyChanged(nameof(ServerModsCount));
}
}
}
private int _profileModsCount;
public int ProfileModsCount
{
get => _profileModsCount;
set
{
if (_profileModsCount != value)
{
_profileModsCount = value;
RaisePropertyChanged(nameof(ProfileModsCount));
}
}
}
private bool _hasProfileOnlyMods;
public bool HasProfileOnlyMods
{
get => _hasProfileOnlyMods;
set
{
if (_hasProfileOnlyMods != value)
{
_hasProfileOnlyMods = value;
RaisePropertyChanged(nameof(HasProfileOnlyMods));
}
}
}
private bool _hasMods;
public bool HasMods
{
get => _hasMods;
set
{
if (_hasMods != value)
{
_hasMods = value;
RaisePropertyChanged(nameof(HasMods));
}
}
}
public ObservableCollection<AkiMod> Mods { get; private set; } = new ObservableCollection<AkiMod>();
public ModInfoCollection()
{
var serverMods = ServerManager.GetLoadedServerMods().Values.ToList();
var profileMods = ServerManager.GetProfileMods().ToList();
ServerModsCount = serverMods?.Count() ?? 0;
ProfileModsCount = profileMods?.Count() ?? 0;
foreach (var serverMod in serverMods)
{
serverMod.InServer = true;
Mods.Add(serverMod);
}
foreach (var profileMod in profileMods)
{
var existingMod = Mods.Where(x => x.Name == profileMod.Name && x.Version == profileMod.Version && x.Author == profileMod.Author).FirstOrDefault();
if (existingMod != null)
{
existingMod.InProfile = true;
continue;
}
profileMod.InProfile = true;
Mods.Add(profileMod);
}
HasMods = Mods.Count() > 0;
HasProfileOnlyMods = Mods.Where(x => x.InProfile && !x.InServer).Count() > 0;
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void RaisePropertyChanged(string property)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
}
}
}

View File

@ -80,5 +80,8 @@
"profile_remove_question_format_1": "永久移除档案 '{0}'吗?",
"i_understand": "我了解",
"game_version_mismatch_format_2": "SPT无法运行这是由于SPT需要EFT版本 '{1}'\n但现有版本是 '{0}'\n\n确保你已经按照你下载SPT的页面上的\n安装指导的描述降级你的EFT",
"description": "描述"
"description": "描述",
"server_mods": "Server Mods",
"profile_mods": "Profile Mods",
"author": "Author"
}

View File

@ -80,5 +80,8 @@
"profile_remove_question_format_1": "Permanently remove profile '{0}'?",
"i_understand": "I Understand",
"game_version_mismatch_format_2": "SPT is unable to run, this is because SPT expected to find EFT version '{1}',\nbut instead found version '{0}'\n\nEnsure you've downgraded your EFT as described in the install guide\non the page you downloaded SPT from",
"description": "Description"
"description": "Description",
"server_mods": "Server Mods",
"profile_mods": "Profile Mods",
"author": "Author"
}

View File

@ -80,5 +80,8 @@
"profile_remove_question_format_1": "Permanently remove profile '{0}'?",
"i_understand": "I Understand",
"game_version_mismatch_format_2": "SPT is unable to run, this is because SPT expected to find EFT version '{1}',\nbut instead found version '{0}'\n\nEnsure you've downgraded your EFT as described in the install guide\non the page you downloaded SPT from",
"description": "Description"
"description": "Description",
"server_mods": "Server Mods",
"profile_mods": "Profile Mods",
"author": "Author"
}

View File

@ -80,5 +80,8 @@
"profile_remove_question_format_1": "Permanently remove profile '{0}'?",
"i_understand": "I Understand",
"game_version_mismatch_format_2": "SPT is unable to run, this is because SPT expected to find EFT version '{1}',\nbut instead found version '{0}'\n\nEnsure you've downgraded your EFT as described in the install guide\non the page you downloaded SPT from",
"description": "Description"
"description": "Description",
"server_mods": "Server Mods",
"profile_mods": "Profile Mods",
"author": "Author"
}

View File

@ -80,5 +80,8 @@
"profile_remove_question_format_1": "Permanently remove profile '{0}'?",
"i_understand": "I Understand",
"game_version_mismatch_format_2": "SPT is unable to run, this is because SPT expected to find EFT version '{1}',\nbut instead found version '{0}'\n\nEnsure you've downgraded your EFT as described in the install guide\non the page you downloaded SPT from",
"description": "Description"
"description": "Description",
"server_mods": "Server Mods",
"profile_mods": "Profile Mods",
"author": "Author"
}

View File

@ -80,5 +80,8 @@
"profile_remove_question_format_1": "Rimuovere permanentemente il profilo '{0}'?",
"i_understand": "Accetto",
"game_version_mismatch_format_2": "SPT non riesce ad avviarsi, questo è perché SPT si aspettava la versione di EFT '{1}',\nmentre invece tu hai la versione '{0}'\n\nAssicurati di aver downgradato correttamente EFT come descritto nella guida all'installazione\nche hai trovato sulla pagina web da cui hai scaricato SPT",
"description": "Descrizione"
"description": "Descrizione",
"server_mods": "Server Mods",
"profile_mods": "Profile Mods",
"author": "Author"
}

View File

@ -80,5 +80,8 @@
"profile_remove_question_format_1": "プロファイル '{0}' を完全に削除しますか?",
"i_understand": "了解",
"game_version_mismatch_format_2": "SPT を実行できません。これは、SPT が EFT バージョン '{1}' を検出することを期待していたためです\n代わりにバージョン '{0}' を検出しました\n\nインストール ガイドの説明に従って EFT をダウングレードしたことを確認してください\n SPT をダウンロードしたページ",
"description": "Description"
"description": "Description",
"server_mods": "Server Mods",
"profile_mods": "Profile Mods",
"author": "Author"
}

View File

@ -80,5 +80,8 @@
"profile_remove_question_format_1": "프로필 '{0}'을 영구적으로 삭제하시겠습니까?",
"i_understand": "이해하였습니다",
"game_version_mismatch_format_2": "당신의 게임 버전은 '{0}'이며 호환되는 버전은 '{1}' 입니다.\n\n게임 실행에 문제가 발생하거나 되지 않을 수 있습니다.",
"description": "Description"
"description": "Description",
"server_mods": "Server Mods",
"profile_mods": "Profile Mods",
"author": "Author"
}

View File

@ -80,5 +80,8 @@
"profile_remove_question_format_1": "Удалить профиль '{0}' безвозвратно?",
"i_understand": "Я понимаю",
"game_version_mismatch_format_2": "Ваша версия игры: '{0}' и совместимая версия: '{1}'.\n\nИгра может работать некорректно или не работать вообще.",
"description": "Description"
"description": "Description",
"server_mods": "Server Mods",
"profile_mods": "Profile Mods",
"author": "Author"
}

View File

@ -80,5 +80,8 @@
"profile_remove_question_format_1": "Confirma si quieres borrar el perfil: '{0}'",
"i_understand": "Lo entiendo",
"game_version_mismatch_format_2": "SPT no puede iniciar, esto es debido a que la versión de EFT esperada es '{1}',\npero la versión encontrada es '{0}'\n\nAsegurate de haber realizado el downgrade de tu versión de EFT, tal como se indica en la guía de instalación\nen la página en la que has descargado SPT",
"description": "Descripción"
"description": "Descripción",
"server_mods": "Server Mods",
"profile_mods": "Profile Mods",
"author": "Author"
}

View File

@ -48,5 +48,17 @@
<PathGeometry x:Key="Gear" Figures="m 4.4615102 11.271429 c 0 -0.992273 -0.845292 -1.7685001 -1.6612536 -1.5255145 C 1.5450127 10.119702 1.3309542 10.039187 0.67223375 8.9455133 L 0.00700434 7.8410343 0.69579591 7.1261827 C 1.5704786 6.2184053 1.5693913 5.4953105 0.69230711 4.7875001 L 0 4.228826 0.66874495 3.0894129 C 1.3304739 1.9619619 1.5415251 1.879247 2.8002845 2.2540889 3.6162462 2.4970745 4.4615381 1.7208472 4.4615381 0.7285713 4.4615381 0.05428908 4.5761682 0 6 0 c 1.4238306 0 1.5384619 0.05431176 1.5384619 0.7285713 0 0.9922759 0.8452919 1.7685032 1.6612536 1.5255176 1.2587595 -0.3748419 1.4698105 -0.292127 2.1315395 0.835324 L 12 4.228826 11.307692 4.7875001 c -0.877111 0.7078104 -0.878199 1.4309052 -0.0035 2.3386826 l 0.688796 0.7148516 -0.665233 1.104479 C 10.669034 10.039187 10.454975 10.119702 9.1997324 9.7459145 8.3837708 9.5029289 7.5384788 10.279156 7.5384788 11.271429 7.5384788 11.945711 7.4238487 12 6.0000169 12 4.5761863 12 4.461555 11.945688 4.461555 11.271429 Z M 7.4416793 7.4477106 C 8.3356062 6.628907 8.3527385 5.4951178 7.4848013 4.5943362 6.6450019 3.7227628 5.4821482 3.7060611 4.5582677 4.5522701 3.6643409 5.3710738 3.6472085 6.504863 4.5151457 7.4056445 5.3549451 8.2772179 6.5177988 8.2939196 7.4416793 7.4477106 Z" FillRule="NonZero"
/>
<PathGeometry x:Key="Server" Figures="M 1.6494282 17.929812 C 0.92664202 17.718549 0.3836749 17.162385 0.17114 16.415592 0.09187098 16.137063 0.0863444 15.971619 0.0863444 13.877198 c 0 -2.111449 0.004995 -2.258008 0.08674468 -2.545427 0.21592147 -0.75914 0.82682106 -1.3631677 1.54512992 -1.52775 0.3218444 -0.07374 14.284014 -0.074326 14.609533 -5.317e-4 0.842712 0.1908397 1.507625 0.9632907 1.630128 1.8937857 0.05616 0.426587 0.05616 3.933413 0 4.360001 -0.122896 0.933497 -0.784698 1.702333 -1.630128 1.893786 -0.161986 0.03667 -2.304745 0.05092 -7.3392714 0.04872 -6.0119248 -0.0025 -7.1458037 -0.01334 -7.3390524 -0.06989 z m 2.5421672 -2.991734 c 0.4100526 -0.159172 0.6868605 -0.586709 0.6868605 -1.06088 0 -0.952833 -1.0222858 -1.471242 -1.6855312 -0.854751 -0.2565468 0.238465 -0.3619533 0.48738 -0.3619533 0.854751 0 0.366373 0.1076352 0.621854 0.3582541 0.85034 0.2889152 0.2634 0.6634988 0.342079 1.0023699 0.21054 z m 10.5739626 -0.39758 c 0.447008 -0.25795 0.498036 -0.92881 0.09599 -1.26185 l -0.154666 -0.128119 -3.910457 -0.01398 c -2.6646075 -0.0095 -3.9607586 0.0019 -4.0683469 0.03574 -0.4386452 0.13812 -0.6081135 0.789478 -0.3066319 1.178555 0.2209522 0.28515 0.025427 0.272622 4.2859348 0.27462 3.722244 0.0018 3.914897 -0.0023 4.058185 -0.08497 z M 1.467854 8.1629798 C 0.95417626 7.9826349 0.60805366 7.7025173 0.33776606 7.2483968 0.00402544 6.6876657 0 6.6507887 0 4.1541464 0 1.7200918 0.00839022 1.6245238 0.26479626 1.1378639 0.43887006 0.80747199 0.7595484 0.47034506 1.0714819 0.28980176 1.6031353 -0.01791494 1.1093443 2.0102425e-4 8.965172 2.0102425e-4 c 5.041311 0 7.200906 0.0152029958 7.36258 0.0518070457 0.865249 0.19594118 1.513849 0.96757553 1.63473 1.94483093 0.02999 0.2424025 0.04105 1.1050261 0.03067 2.3909693 -0.01524 1.8913722 -0.02165 2.029278 -0.10668 2.3046735 -0.22977 0.7441927 -0.818438 1.3420951 -1.485878 1.509186 -0.123856 0.031004 -2.700479 0.04695 -7.4423765 0.04605 C 2.1266812 8.2464458 1.6915 8.2414898 1.4678485 8.1629786 Z M 4.3859875 5.0844445 C 4.7811078 4.8191684 4.9780404 4.2439044 4.8349315 3.7730215 4.7668555 3.5490256 4.5236513 3.2565013 4.2985765 3.1278962 4.0565272 2.9895915 3.6283308 2.9891697 3.3890159 3.1270101 2.7753048 3.4804635 2.6278188 4.3017289 3.0782612 4.8574294 3.3235181 5.1599969 3.5311532 5.2576628 3.8906484 5.2395503 4.1184172 5.2280683 4.2189566 5.1965975 4.3859875 5.0844569 Z M 14.837282 4.7559538 c 0.14415 -0.1141452 0.316152 -0.4583749 0.316152 -0.63272 0 -0.220612 -0.182401 -0.5222009 -0.386823 -0.6395916 l -0.187995 -0.1079544 -3.867912 0.00107 c -3.6787004 8.85e-4 -3.8765704 0.00529 -4.0448738 0.088298 -0.2617344 0.129081 -0.3842788 0.3424391 -0.3842788 0.6690602 0 0.2988716 0.080394 0.456782 0.3243274 0.6370544 l 0.1437 0.1061964 3.9829142 -0.01245 c 3.943322 -0.0123 3.984126 -0.01341 4.104791 -0.1089408 z" FillRule="NonZero"
/>
<PathGeometry x:Key="Profile" Figures="M 0.3329837 17.929 C 0.00508737 17.786405 -0.05110024 17.571418 0.03778307 16.799492 0.21646558 15.247684 0.95166383 13.834441 2.1658392 12.708809 c 1.3245634 -1.227967 2.9780762 -1.948137 4.8821724 -2.126377 0.5043111 -0.04721 3.4014294 -0.04717 3.9052184 3.6e-5 1.864914 0.174797 3.523972 0.885292 4.81329 2.061304 0.61887 0.564483 1.01831 1.064696 1.421974 1.780722 0.414766 0.735716 0.679701 1.547648 0.774964 2.374986 0.0877 0.761611 0.02794 0.991461 -0.293283 1.128074 L 17.499859 18 8.9979909 17.999972 C 0.55177854 17.999945 0.49505365 17.99944 0.3329837 17.929 Z M 8.3202612 9.4552574 C 7.1251577 9.3077085 6.0490147 8.8364362 5.1960615 8.0870837 4.3957904 7.384015 3.9359491 6.6300486 3.6909315 5.6192336 c -0.099356 -0.4098937 -0.099356 -1.3393063 0 -1.7491988 0.2454098 -1.0124321 0.7072521 -1.770154 1.503966 -2.4674819 2.1352618 -1.86890084 5.5016125 -1.87023371 7.6098625 -0.00302 0.803679 0.7117955 1.260458 1.4612436 1.505737 2.4704958 0.09932 0.4086858 0.09751 1.3356865 -0.0034 1.7536027 -0.243884 1.0097439 -0.698668 1.7557954 -1.502304 2.4644693 -1.011372 0.8918597 -2.211142 1.3476572 -3.6440554 1.3843916 -0.3191689 0.00819 -0.6973691 3.986e-4 -0.8404447 -0.017241 z" FillRule="NonZero"
/>
<PathGeometry x:Key="Visible" Figures="M 8.1460091 11.992296 C 8.0833771 11.983726 7.8271527 11.94962 7.5766226 11.916501 5.4738087 11.63851 3.307191 10.538502 1.8055895 8.9865036 0.99350307 8.1471622 0.20885269 7.0014962 0.06261515 6.4415911 -0.09543836 5.836446 0.03094743 5.3924299 0.61168637 4.5126082 2.1934171 2.1162758 4.7047482 0.51722245 7.5576432 0.08986881 c 0.9965425 -0.14927859 2.4004313 -0.10960705 3.4270298 0.09684267 2.587437 0.52033387 4.890733 2.06079622 6.355054 4.25030892 0.880364 1.3163559 0.880364 1.8205157 0 3.1368717 -1.380858 2.0647171 -3.549401 3.5770229 -5.961514 4.1574569 -0.856848 0.206187 -1.237872 0.251481 -2.2262878 0.264644 -0.4906213 0.0066 -0.9432835 0.0049 -1.0059161 -0.0037 z M 10.00375 10.823681 c 1.580402 -0.184064 3.036374 -0.762072 4.334267 -1.7206639 0.806911 -0.5959633 1.727678 -1.6082743 2.255807 -2.4800822 0.223791 -0.3694213 0.244819 -0.4223443 0.244819 -0.6161567 0 -0.1907713 -0.02194 -0.2486339 -0.21891 -0.5772594 C 16.139008 4.6274618 15.319355 3.6858065 14.599055 3.1080687 13.549615 2.2663343 12.226695 1.6291427 10.931036 1.3413472 9.9257068 1.1180407 8.6514186 1.072587 7.6715205 1.2250823 6.4596265 1.413681 5.1758323 1.9009827 4.1603039 2.5578651 3.0858698 3.2528506 2.0336925 4.3396206 1.3810777 5.4284632 1.1844957 5.7564459 1.1628006 5.8137957 1.1628006 6.0054569 c 0 0.1916598 0.021695 0.2490095 0.2182771 0.5769922 0.4872889 0.8130086 1.2646309 1.703609 2.0200442 2.314365 1.3732099 1.1102489 3.0038256 1.7700389 4.839785 1.9583019 0.3582986 0.03674 1.3255717 0.0195 1.7628431 -0.03143 z M 8.424282 9.4462967 C 7.0826815 9.2020122 6.0360496 8.2699061 5.6341892 6.9615064 5.5409652 6.657984 5.5320793 6.5747813 5.5320793 6.0054569 c 0 -0.5693258 0.00889 -0.6525285 0.1021099 -0.956051 C 6.0036849 3.8463811 6.8861656 2.98618 8.1120346 2.6341171 c 0.2585334 -0.07425 0.383092 -0.085715 0.9070338 -0.083493 0.5461548 0.00231 0.6409868 0.012785 0.9412556 0.1039219 1.207183 0.3663972 2.073584 1.2475045 2.425556 2.4667264 0.07295 0.2527006 0.08614 0.3880692 0.08614 0.8841842 0 0.496115 -0.01319 0.6314836 -0.08614 0.8841829 C 12.02934 8.1246855 11.135575 9.0195412 9.9085538 9.3699912 9.5936312 9.4599382 8.7401624 9.5038134 8.424282 9.4462967 Z M 9.5076368 8.2923324 C 10.366726 8.1111151 11.114966 7.3661384 11.296977 6.5107909 11.468942 5.7026559 11.242767 4.9478995 10.65252 4.360227 10.185215 3.8949588 9.636363 3.6635631 9.0000888 3.6635631 c -1.0832373 0 -2.0747915 0.7928324 -2.2968886 1.8365583 -0.3563824 1.6747866 1.1223165 3.1470402 2.8044366 2.792211 z" FillRule="NonZero"
/>
<PathGeometry x:Key="Hide" Figures="M 2.5679207 11.950279 C 2.3351669 11.848352 2.2120578 11.621794 2.2615536 11.386472 2.2829097 11.284935 2.406899 11.16048 3.1342095 10.510528 3.600479 10.093851 3.975073 9.7476909 3.9666412 9.7412802 3.9582112 9.7348758 3.8563174 9.6765531 3.7402151 9.6116894 3.3432865 9.3899331 2.6146862 8.8843852 2.1745934 8.5253631 1.4755105 7.9550599 0.84697928 7.3017345 0.31975495 6.5973519 -0.1109968 6.0218597 -0.11001266 5.9715658 0.34380475 5.3683051 0.79713357 4.765693 1.2026605 4.3294038 1.821751 3.7782437 3.7996358 2.0173822 6.0828481 1.0932904 8.6657661 1.0082442 10.026095 0.96345226 11.294642 1.1629888 12.616829 1.6297255 l 0.362446 0.1279451 0.974489 -0.86206028 c 0.837883 -0.74121476 0.992984 -0.86511728 1.106424 -0.88386597 0.21226 -0.03508435 0.368054 0.0073974 0.518943 0.14147897 0.150551 0.13379088 0.198392 0.27172359 0.159952 0.46116733 C 15.717813 0.71921597 15.049325 1.3236974 9.4288293 6.3204432 5.9712731 9.3942863 3.0924188 11.930313 3.031374 11.956056 c -0.1436299 0.06056 -0.3168835 0.0584 -0.4634533 -0.0057 z M 5.5437673 8.3678503 6.2560185 7.7343309 6.1633995 7.6132055 C 6.0040135 7.4047614 5.8024019 6.9884285 5.7209365 6.6995065 5.6090617 6.3027367 5.6099817 5.6572624 5.7229565 5.2822485 5.8927146 4.7187469 6.1459432 4.320735 6.5899974 3.9194756 6.9337774 3.6088273 7.0919375 3.5033071 7.4695602 3.3326582 8.1983138 3.0033307 9.0070431 2.9203596 9.8076645 3.0927787 c 0.2832505 0.061 0.8108265 0.2649442 1.0409555 0.4023996 l 0.107086 0.063963 0.575769 -0.5123722 0.575769 -0.5123724 -0.137527 -0.051372 C 11.711023 2.3863919 11.032607 2.2156744 10.605468 2.1397237 9.4891497 1.9412282 8.2164836 1.9591805 7.1001438 2.1891692 5.8981601 2.4368028 4.5599509 3.0274763 3.5126657 3.7726496 2.8673014 4.2318435 2.0748395 4.9620744 1.5536836 5.5777938 1.1801385 6.0191182 1.1964931 5.9664432 1.3646818 6.1865377 1.9217887 6.9155785 2.8853398 7.7984046 3.7491949 8.3712784 4.0718054 8.585221 4.7673686 8.9959869 4.8136027 8.9998664 4.8234527 9.000666 5.1520285 8.7162858 5.5437673 8.3678503 Z M 10.086881 4.2605975 C 10.067181 4.2394984 9.9135181 4.1778344 9.7454186 4.1235664 7.988299 3.5563118 6.2448663 5.0974724 6.8849361 6.652174 6.9441441 6.7959868 7.0116945 6.9341123 7.0350489 6.9591191 7.0704519 6.9970277 7.3306566 6.7796712 8.6001105 5.6517746 9.7238916 4.6533037 10.113324 4.288912 10.086881 4.2605975 Z M 8.1813482 10.971535 C 7.5499084 10.917127 6.4080707 10.717759 6.2299494 10.630815 6.2017084 10.617031 6.3448223 10.469281 6.6395743 10.207928 L 7.0926051 9.8062269 7.4921782 9.87207 C 9.9454769 10.276376 12.393655 9.70425 14.463597 8.2428879 14.893119 7.9396484 15.588421 7.3422784 15.964397 6.9534718 16.196594 6.7133514 16.670924 6.1637582 16.753226 6.0394799 16.805706 5.960226 16.167191 5.2229443 15.551859 4.6522887 15.179021 4.3065193 14.60341 3.8468374 14.322107 3.670209 14.240277 3.6188319 14.172994 3.5624863 14.172581 3.544996 14.17165 3.503098 14.918434 2.842055 14.966762 2.842055 c 0.07393 0 0.745326 0.5199281 1.22835 0.9512387 0.575718 0.5140811 1.055156 1.0323984 1.474944 1.5945542 0.440243 0.589546 0.440174 0.6400726 -0.0017 1.2281406 -0.436413 0.5808359 -0.906604 1.0863801 -1.507523 1.6208737 -1.703071 1.5148164 -3.683425 2.4230968 -5.859106 2.6872508 -0.4787235 0.05813 -1.6834787 0.08506 -2.1204051 0.04742 z M 8.4428581 8.9563226 C 8.3009079 8.932297 8.1749454 8.9039084 8.1629407 8.893237 8.1509357 8.8825655 8.3635109 8.6762041 8.6353285 8.434648 L 9.1295436 7.9954549 9.4037532 7.9531385 C 9.7371384 7.9016912 10.176641 7.7204083 10.432705 7.5287264 10.822544 7.2369024 11.11352 6.7908395 11.198832 6.3542595 l 0.04662 -0.2385996 0.486402 -0.4330774 c 0.267519 -0.2381921 0.497363 -0.4330762 0.510763 -0.4330762 0.05888 0 0.115139 0.3897577 0.112833 0.7816379 -0.002 0.3483443 -0.01813 0.4743231 -0.09206 0.7210941 -0.388323 1.2961642 -1.647372 2.1872689 -3.1578417 2.2349937 -0.2590625 0.00822 -0.4974358 -0.003 -0.6626892 -0.0309 z" FillRule="NonZero"
/>
</Application.Resources>
</Application>

View File

@ -4,7 +4,7 @@
xmlns:rxui="using:Avalonia.ReactiveUI"
>
<Design.PreviewWith>
<StackPanel Spacing="5" Background="{StaticResource AKI_Background_Dark}">
<StackPanel Spacing="5" Background="{StaticResource AKI_Background_Dark}" Margin="50">
<Button Content="Blah"/>
<TextBox Text="Some cool text here" Margin="5"/>
<TextBox Watermark="This is a watermark" Margin="5"/>
@ -472,5 +472,4 @@
<Setter Property="BorderBrush" Value="{StaticResource AKI_Brush_Yellow}" />
<Setter Property="TextBlock.Foreground" Value="{StaticResource AKI_Background_Dark}" />
</Style>
</Styles>

View File

@ -0,0 +1,51 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:helpers="using:Aki.Launcher.Helpers"
x:Class="Aki.Launcher.CustomControls.ModInfoCard">
<Border CornerRadius="5" HorizontalAlignment="Stretch"
BorderBrush="{StaticResource AKI_Background_Dark}"
BorderThickness="5"
>
<Grid RowDefinitions="10,AUTO,AUTO,AUTO,10" ColumnDefinitions="10,AUTO,*,AUTO,10"
Background="{StaticResource AKI_Background_Dark}"
>
<StackPanel Grid.Row="1" Grid.ColumnSpan="3" Grid.Column="1"
VerticalAlignment="Center"
Orientation="Horizontal" Spacing="5"
>
<Path Data="{StaticResource Server}" Fill="{StaticResource AKI_Brush_DarkGrayBlue}"
IsVisible="{Binding IsInServer, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
<Path Data="{StaticResource Profile}" Fill="{StaticResource AKI_Brush_DarkGrayBlue}"
IsVisible="{Binding IsInProfile, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
<Path Data="{StaticResource Alert}" Fill="{StaticResource AKI_Brush_Yellow}" Margin="0 2 0 0"
>
<Path.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="IsInProfile" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
<Binding Path="!IsInServer" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
</MultiBinding>
</Path.IsVisible>
</Path>
</StackPanel>
<Label Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
Content="{Binding ModName, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
<Label Grid.Row="3" Grid.Column="1" FontSize="12" Foreground="DimGray"
Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=author}"
/>
<Label Grid.Row="3" Grid.Column="2" FontSize="12" HorizontalAlignment="Left"
Content="{Binding Author, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
<Label Grid.Row="3" Grid.Column="3" FontSize="12"
Content="{Binding Version, RelativeSource={RelativeSource AncestorType=UserControl}}"
/>
</Grid>
</Border>
</UserControl>

View File

@ -0,0 +1,59 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Aki.Launcher.CustomControls
{
public partial class ModInfoCard : UserControl
{
public ModInfoCard()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public string Author
{
get => GetValue(AuthorProperty);
set => SetValue(AuthorProperty, value);
}
public static readonly StyledProperty<string> AuthorProperty =
AvaloniaProperty.Register<ModInfoCard, string>(nameof(Author));
public string ModName
{
get => GetValue(ModNameProperty);
set => SetValue(ModNameProperty, value);
}
public static readonly StyledProperty<string> ModNameProperty =
AvaloniaProperty.Register<ModInfoCard, string>(nameof(ModName));
public string Version
{
get => GetValue(VersionProperty);
set => SetValue(VersionProperty, value);
}
public static readonly StyledProperty<string> VersionProperty =
AvaloniaProperty.Register<ModInfoCard, string>(nameof(Version));
public bool IsInServer
{
get => GetValue(IsInServerProperty);
set => SetValue(IsInServerProperty, value);
}
public static readonly StyledProperty<bool> IsInServerProperty =
AvaloniaProperty.Register<ModInfoCard, bool>(nameof(IsInServer));
public bool IsInProfile
{
get => GetValue(IsInProfileProperty);
set => SetValue(IsInProfileProperty, value);
}
public static readonly StyledProperty<bool> IsInProfileProperty =
AvaloniaProperty.Register<ModInfoCard, bool>(nameof(IsInProfile));
}
}

View File

@ -27,12 +27,21 @@ namespace Aki.Launcher.ViewModels
set => this.RaiseAndSetIfChanged(ref _CurrentEdition, value);
}
private bool _ModsListIsVisible;
public bool ModsListIsVisible
{
get => _ModsListIsVisible;
set => this.RaiseAndSetIfChanged(ref _ModsListIsVisible, value);
}
public string CurrentID { get; set; }
public ProfileInfo ProfileInfo { get; set; } = AccountManager.SelectedProfileInfo;
public ImageHelper SideImage { get; } = new ImageHelper();
public ModInfoCollection ModInfoCollection { get; set; } = new ModInfoCollection();
private GameStarter gameStarter = new GameStarter(new GameStarterFrontend());
private ProcessMonitor monitor { get; set; }
@ -62,6 +71,8 @@ namespace Aki.Launcher.ViewModels
CurrentEdition = AccountManager.SelectedAccount.edition;
CurrentID = AccountManager.SelectedAccount.id;
ModsListIsVisible = false;
}
private async Task GameVersionCheck()
@ -88,6 +99,8 @@ namespace Aki.Launcher.ViewModels
}
}
public void ToggleModsListCommand() => ModsListIsVisible = !ModsListIsVisible;
public void LogoutCommand()
{
AccountManager.Logout();

View File

@ -4,6 +4,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:helpers="using:Aki.Launcher.Helpers"
xmlns:cvt="using:Aki.Launcher.Converters"
xmlns:cc="using:Aki.Launcher.CustomControls"
xmlns:launcher="using:Aki.Launcher.Models.Aki"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Aki.Launcher.Views.ProfileView">
@ -11,7 +13,7 @@
<cvt:ImageSourceConverter x:Key="imageSourceCvt"/>
</UserControl.Resources>
<Grid RowDefinitions="10,AUTO,*,AUTO,10" ColumnDefinitions="10,AUTO,*,10">
<Grid RowDefinitions="10,AUTO,10,AUTO,10,*,10,AUTO,10" ColumnDefinitions="10,AUTO,10,*,10">
<!-- profile info -->
<Border Grid.Row="1" Grid.Column="1" CornerRadius="5"
@ -54,9 +56,65 @@
Command="{Binding ChangeEditionCommand}"/>
</Grid>
</Border>
<!-- Total Mods Info -->
<Border Grid.Row="3" Grid.Column="1" CornerRadius="5"
BorderBrush="{StaticResource AKI_Background_Dark}"
BorderThickness="5" IsVisible="{Binding ModInfoCollection.HasMods}"
>
<Grid RowDefinitions="10,AUTO,AUTO,10" ColumnDefinitions="10,AUTO,*,AUTO,AUTO,AUTO,10"
Background="{StaticResource AKI_Background_Dark}">
<Label Grid.Row="1" Grid.Column="1" Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=server_mods}"
/>
<Label Grid.Row="2" Grid.Column="1" Content="{Binding ModInfoCollection.ServerModsCount}"
/>
<Label Grid.Row="1" Grid.Column="3" Content="{Binding Source={x:Static helpers:LocalizationProvider.Instance}, Path=profile_mods}"
/>
<Path Grid.Row="1" Grid.Column="4" Margin="10 4 0 0" IsVisible="{Binding ModInfoCollection.HasProfileOnlyMods}"
Data="{StaticResource Alert}" Fill="{StaticResource AKI_Brush_Yellow}"
/>
<Label Grid.Row="2" Grid.Column="3" Content="{Binding ModInfoCollection.ProfileModsCount}"
/>
<Button Grid.Row="0" Grid.RowSpan="4" Grid.Column="5" Grid.ColumnSpan="2"
VerticalAlignment="Stretch" FontSize="18" Margin="10 0 0 0"
Command="{Binding ToggleModsListCommand}"
Classes="icon"
>
<Button.Content>
<DockPanel LastChildFill="True">
<Path Data="{StaticResource Visible}" Fill="{StaticResource AKI_Foreground_Light}"
VerticalAlignment="Center"
IsVisible="{Binding !ModsListIsVisible}"
/>
<Path Data="{StaticResource Hide}" Fill="{StaticResource AKI_Foreground_Light}"
VerticalAlignment="Center"
IsVisible="{Binding ModsListIsVisible}"
/>
</DockPanel>
</Button.Content>
</Button>
</Grid>
</Border>
<!-- Mods List -->
<ScrollViewer Grid.Row="1" Grid.RowSpan="5" Grid.Column="3" IsVisible="{Binding ModsListIsVisible}">
<ItemsControl Items="{Binding ModInfoCollection.Mods}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type launcher:AkiMod}">
<cc:ModInfoCard ModName="{Binding Name}"
Author="{Binding Author}"
Version="{Binding Version}"
IsInServer="{Binding InServer}"
IsInProfile="{Binding InProfile}"
Margin="0 0 0 10"
/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<!-- Bottom bar -->
<Border Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" CornerRadius="5"
<Border Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="3" CornerRadius="5"
BorderBrush="{StaticResource AKI_Background_Dark}"
BorderThickness="5"
>