Skip to content

Commit

Permalink
Merge pull request #160 from SkiTles55/spt-3.10
Browse files Browse the repository at this point in the history
SPT 3.10
  • Loading branch information
SkiTles55 authored Jan 12, 2025
2 parents 0fac272 + 98076d9 commit 1c1db5d
Show file tree
Hide file tree
Showing 37 changed files with 1,088 additions and 681 deletions.
4 changes: 1 addition & 3 deletions CHREADME.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ LTC: MNtz8Zz1cPD1CZadoc38jT5qeqeFBS6Aif\

### [提交Bug报告 \ 功能要求](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/issues/new/choose)

### [版本 3.1 适配服务器 SPT 3.10.5](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/3.1)
### [版本 3.0 适配服务器 SPT 3.9.0](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/3.0)
### [版本 2.9.3 适配服务器 SPT-AKI 3.8.0 - 3.8.3](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/2.9.3)
### [版本 2.8.6 适配服务器 SPT-AKI 3.7.0 - 3.7.6](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/2.8.6)
Expand Down Expand Up @@ -74,6 +75,3 @@ Lomenot - 中文本地化
![Screenshot5](/screenshots/5CH.png?raw=true)
![Screenshot6](/screenshots/6CH.png?raw=true)
![Screenshot7](/screenshots/7CH.png?raw=true)

### 其他有用的模组
[Weapon builds for Mechanic quests (by Clerance)](https://hub.sp-tarkov.com/files/file/1310-gunsmith-presets-updated/)
4 changes: 1 addition & 3 deletions ENGREADME.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ LTC: MNtz8Zz1cPD1CZadoc38jT5qeqeFBS6Aif\

### [Submit a bug report \ Feature request](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/issues/new/choose)

### [Version 3.1 for server SPT 3.10.5](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/3.1)
### [Version 3.0 for server SPT 3.9.0](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/3.0)
### [Version 2.9.3 for server SPT-AKI 3.8.0 - 3.8.3](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/2.9.3)
### [Version 2.8.6 for server SPT-AKI 3.7.0 - 3.7.6](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/2.8.6)
Expand Down Expand Up @@ -74,6 +75,3 @@ Lomenot - Chinese localization
![Screenshot5](/screenshots/5EN.PNG?raw=true)
![Screenshot6](/screenshots/6EN.PNG?raw=true)
![Screenshot7](/screenshots/7EN.PNG?raw=true)

### Helpful
[Weapon builds for Mechanic quests (by Clerance)](https://hub.sp-tarkov.com/files/file/1310-gunsmith-presets-updated/)
6 changes: 2 additions & 4 deletions JPREADME.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ LTC: MNtz8Zz1cPD1CZadoc38jT5qeqeFBS6Aif\

### [アプリ不具合 \ 追加したい機能](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/issues/new/choose)

### [バージョン 3.0 サーバー SPT-AKI 3.9.0 適用](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/3.0)
### [バージョン 3.1 サーバー SPT 3.10.5 適用](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/3.1)
### [バージョン 3.0 サーバー SPT 3.9.0 適用](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/3.0)
### [バージョン 2.9.3 サーバー SPT-AKI 3.8.0 - 3.8.3 適用](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/2.9.3)
### [バージョン 2.8.6 サーバー SPT-AKI 3.7.0 - 3.7.6 適用](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/2.8.6)
### [バージョン 2.7 サーバー SPT-AKI 3.4.0 - 3.6.1 適用](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/2.7)
Expand Down Expand Up @@ -74,6 +75,3 @@ Lomenot - 日本語&中国語の翻訳
![Screenshot5](/screenshots/5CH.png?raw=true)
![Screenshot6](/screenshots/6CH.png?raw=true)
![Screenshot7](/screenshots/7CH.png?raw=true)

### その他の便利なMOD
[Weapon builds for Mechanic quests (by Clerance)](https://hub.sp-tarkov.com/files/file/1310-gunsmith-presets-updated/)
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ LTC: MNtz8Zz1cPD1CZadoc38jT5qeqeFBS6Aif\

### [Отправить баг репорт \ Предложить новую функцию](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/issues/new/choose)

### [Версия 3.1 для сервера SPT 3.10.5](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/3.1)
### [Версия 3.0 для сервера SPT 3.9.0](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/3.0)
### [Версия 2.9.3 для сервера SPT-AKI 3.8.0 - 3.8.3](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/2.9.3)
### [Версия 2.8.6 для сервера SPT-AKI 3.7.0 - 3.7.6](https://github.com/SkiTles55/SPT-AKI-Profile-Editor/releases/tag/2.8.6)
Expand Down Expand Up @@ -74,6 +75,3 @@ Lomenot - Китайская локализация
![Скриншот5](/screenshots/5.PNG?raw=true)
![Скриншот6](/screenshots/6.PNG?raw=true)
![Скриншот7](/screenshots/7.PNG?raw=true)

### Полезное
[Сборки оружия для квестов Механика (by Clerance)](https://hub.sp-tarkov.com/files/file/1310-gunsmith-presets-updated/)
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:SPT-AKI Profile Editor"
"ProductCode" = "8:{60FA71FE-89B9-45C0-9D7E-04B3CCECA2D8}"
"PackageCode" = "8:{DEE5B707-289B-485E-A344-EF8ACAE13C69}"
"ProductCode" = "8:{4E0E512F-DF9F-439D-9B78-5DC55CB3741E}"
"PackageCode" = "8:{98881099-AEFE-451C-9160-1113A9D8F48B}"
"UpgradeCode" = "8:{1F669B59-9085-4108-BADB-9359D4FBA0D0}"
"AspNetVersion" = "8:"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:3.0.0"
"ProductVersion" = "8:3.1.0"
"Manufacturer" = "8:SkiTles"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:https://github.com/SkiTles55/SPT-AKI-Profile-Editor"
Expand Down
2 changes: 1 addition & 1 deletion SPT-AKI Profile Editor.Tests/Hepers/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace SPT_AKI_Profile_Editor.Tests.Hepers
internal class TestHelpers
{
public static readonly JsonSerializerSettings seriSettings = new() { Formatting = Formatting.Indented, Converters = new List<JsonConverter>() { new StringEnumConverterExt() } };
public static readonly string profileFile = @"D:\SPT\user\profiles\668a193f0002aeaa425816ac.json";
public static readonly string profileFile = @"D:\SPT\user\profiles\67796e1f0004b59665cc84f3.json";
public static readonly string serverPath = @"D:\SPT";
public static readonly string wrongServerPath = @"D:\WinSetupFromUSB";
public static readonly string profileWithDuplicatedItems = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "testFiles", "profileWithDuplicatedItems.json");
Expand Down
47 changes: 35 additions & 12 deletions SPT-AKI Profile Editor.Tests/ProfileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,6 @@ public void UnlockedInfoLoadsCorrectly()
public void RagfairInfoNotNull()
=> Assert.That(AppData.Profile.Characters.Pmc.RagfairInfo, Is.Not.Null, "RagfairInfo is null");

[Test]
public void RagfairStandingLoadCorrectly() =>
Assert.That(AppData.Profile.Characters.Pmc.TraderStandingsExt.First(x => x.Id == AppData.AppSettings.RagfairTraderId).Standing,
Is.EqualTo(AppData.Profile.Characters.Pmc.RagfairInfo.Rating),
"Ragfair standing not load correctly");

[Test]
public void QuestsLoadCorrectly()
{
Expand Down Expand Up @@ -489,8 +483,7 @@ public void ProfileSavesCorrectly()
public void TraderSalesSumAndStandingCanIncreaseLevel()
{
static bool CanBeUsedForTest(CharacterTraderStandingExtended x)
=> x.Id != AppData.AppSettings.RagfairTraderId
&& x.LoyaltyLevel < 2
=> x.LoyaltyLevel < 2
&& x.TraderBase.LoyaltyLevels.Count > x.LoyaltyLevel;

AppData.Profile.Load(TestHelpers.profileFile);
Expand Down Expand Up @@ -524,7 +517,7 @@ public void TradersLoadedCorrectly()
Assert.That(AppData.Profile.Characters.Pmc.TraderStandingsExt.Any(x => x.BitmapImage == null),
Is.False,
"Traders BitmapImage's not loaded");
Assert.That(AppData.Profile.Characters.Pmc.TraderStandingsExt.Any(x => x.Id != AppData.AppSettings.RagfairTraderId && x.LocalizedName == x.Id),
Assert.That(AppData.Profile.Characters.Pmc.TraderStandingsExt.Any(x => x.LocalizedName == x.Id),
Is.False,
"Traders LocalizedName's not loaded");
Assert.That(AppData.Profile.Characters.Pmc.TraderStandingsExt.Any(x => x.SalesSum != x.TraderStanding.SalesSum),
Expand All @@ -543,6 +536,18 @@ public void TradersSavesCorrectly()
"TraderStandingsExt not in max levels");
}

[Test]
public void RagfairStandingSavesCorrectly()
{
AppData.Profile.Load(TestHelpers.profileFile);
var startingRating = AppData.Profile.Characters.Pmc.RagfairInfo.Rating;
AppData.Profile.Characters.Pmc.RagfairInfo.Rating += 3;
TestHelpers.SaveAndLoadProfile("testRagfairStanding.json");
Assert.That(AppData.Profile.Characters.Pmc.RagfairInfo.Rating,
Is.EqualTo(startingRating + 3),
"Ragfair standing not saves correctly");
}

[Test]
public void ChangeFenceStandingAffectScavCharacter()
{
Expand Down Expand Up @@ -628,7 +633,25 @@ public void HideoutAreaLevelsSavesCorrectly()
AppData.Profile.Characters.Pmc.SetAllHideoutAreasMax();
TestHelpers.SaveAndLoadProfile("testHideouts.json");
Assert.That(AppData.Profile.Characters.Pmc.Hideout.Areas
.All(x => x.Level == x.MaxLevel || !x.CanSetMaxLevel), Is.True);
.All(x => x.Level == x.MaxLevel), Is.True);
var inventory = AppData.Profile.Characters.Pmc.Inventory;
Assert.That(inventory.HideoutAreaStashes.Count,
Is.GreaterThan(1),
"Stashes for hideout areas not writed");
foreach (var hideoutAreaStash in inventory.HideoutAreaStashes)
{
var item = inventory.Items.FirstOrDefault(x => x.Id == hideoutAreaStash.Value);
Assert.That(item, Is.Not.Null, "Inventory not contains stash for hideout area");
}

void CheckItemsAmount(string tpl, string failMessage)
{
var items = inventory.Items.Where(x => x.Tpl == tpl);
Assert.That(items.Count(), Is.GreaterThan(1), failMessage);
}

CheckItemsAmount(AppData.AppSettings.MannequinInventoryTpl, "Mannequins not added");
CheckItemsAmount(inventory.Pockets, "Pockets for mannequins not added");
}

[Test]
Expand Down Expand Up @@ -1034,8 +1057,8 @@ public void WeaponBuildCalculatingCorrectly()
var build = AppData.Profile.UserBuilds.WeaponBuilds.Where(x => x.Name == "TestBuild").FirstOrDefault();
Assert.That(build, Is.Not.Null);
Assert.That(build.Ergonomics, Is.EqualTo(36));
Assert.That(build.RecoilForceUp, Is.EqualTo(36));
Assert.That(build.RecoilForceBack, Is.EqualTo(145));
Assert.That(build.RecoilForceUp, Is.EqualTo(68));
Assert.That(build.RecoilForceBack, Is.EqualTo(193));
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ private void PrepareTestProfile()

foreach (var suit in AppData.ServerDatabase.TraderSuits.Where(x => !x.Boughted).Take(4))
suit.Boughted = true;
suitsList = AppData.ServerDatabase.TraderSuits.Where(x => x.Boughted).Select(x => x.SuiteId).ToArray();
suitsList = AppData.ServerDatabase.TraderSuits.Where(x => x.Boughted).Select(x => x.SuiteId).Union(AppData.Profile.Suits).ToArray();

pmc.SetAllCommonSkills(500);
pmcCommonSkills = pmc.Skills.Common.ToDictionary(x => x.Id, y => y.Progress);
Expand Down
5 changes: 5 additions & 0 deletions SPT-AKI Profile Editor.Tests/ServerDatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ public void ItemsDBHaveItemsWithDescription()
=> Assert.That(AppData.ServerDatabase.ItemsDB.Any(x => x.Value.LocalizedDescription != x.Value.Id),
Is.True);

[Test]
public void ItemsDBHaveItemsWithSlots()
=> Assert.That(AppData.ServerDatabase.ItemsDB.Any(x => x.Value.Properties?.Slots?.Any() ?? false),
Is.True);

[Test]
public void PocketsNotNul() => Assert.That(AppData.ServerDatabase.Pockets, Is.Not.Null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ namespace SPT_AKI_Profile_Editor.Tests.ViewModelsTests
internal class FastModeViewModelTests
{
[OneTimeSetUp]
public void Setup() => TestHelpers.LoadDatabaseAndProfile();
public void Setup() => TestHelpers.LoadDatabase();

[Test]
public void CanInitialize()
{
AppData.Profile.Load(TestHelpers.profileFile);
FastModeViewModel viewModel = new(null);
Assert.That(viewModel, Is.Not.Null);
Assert.That(viewModel.Pmc, Is.Not.Null);
Expand All @@ -40,6 +41,7 @@ public void HasNeededData()
[Test]
public void CanDidOpenningRefresh()
{
AppData.Profile.Load(TestHelpers.profileFile);
FastModeViewModel viewModel = new(null);
viewModel.OpenningRefresh.Execute(null);
Assert.That(viewModel, Is.Not.Null);
Expand All @@ -52,17 +54,23 @@ public void CanDidOpenningRefresh()
}

[Test]
public void CanSaveProfile()
public void CanApplyAndSaveProfile() => CheckApplyExecution(true);

[Test]
public void CanApplyWithoutSave() => CheckApplyExecution(false);

private static void CheckApplyExecution(bool withSave)
{
AppData.Profile.Load(TestHelpers.profileFile);
bool saveExecuted = false;
RelayCommand command = new((obj) => saveExecuted = true);
FastModeViewModel viewModel = new(command);
viewModel.OpenningRefresh.Execute(null);
var expectedExp = viewModel.Pmc.Experience;
Assert.That(AppData.Profile.Characters.Pmc.Info.Experience, Is.Not.EqualTo(expectedExp));
viewModel.SaveProfile.Execute(null);
viewModel.SaveProfile.Execute(withSave);
Assert.That(AppData.Profile.Characters.Pmc.Info.Experience, Is.EqualTo(expectedExp));
Assert.That(saveExecuted, Is.True);
Assert.That(saveExecuted, Is.EqualTo(withSave));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void CanSetAllAreasMax()
{
TestHelpers.LoadDatabase();
HideoutTabViewModel.SetAllMaxCommand.Execute(null);
Assert.That(AppData.Profile.Characters.Pmc.Hideout.Areas.All(x => x.Level == x.MaxLevel || !x.CanSetMaxLevel),
Assert.That(AppData.Profile.Characters.Pmc.Hideout.Areas.All(x => x.Level == x.MaxLevel),
Is.True);
}

Expand Down
18 changes: 14 additions & 4 deletions SPT-AKI Profile Editor/Core/AppData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ private static void LoadHideoutProduction()
: Path.Combine(AppSettings.ServerPath, AppSettings.FilesList[SPTServerFile.production]);
try
{
HideoutProduction[] HideoutProduction = JsonConvert.DeserializeObject<HideoutProduction[]>(File.ReadAllText(path));
ServerDatabase.HideoutProduction = HideoutProduction;
HideoutProductions HideoutProductions = JsonConvert.DeserializeObject<HideoutProductions>(File.ReadAllText(path));
ServerDatabase.HideoutProduction = HideoutProductions.Recipes;
}
catch (Exception ex) { Logger.Log($"ServerDatabase HideoutProduction ({path}) loading error: {ex.Message}"); }
}
Expand All @@ -287,8 +287,18 @@ private static void FindPockets() => ServerDatabase.Pockets = ServerDatabase.Ite
.OrderBy(x => x.Value.SlotsCount)
.ToDictionary(x => x.Key, x => GetPocketsName(x.Value));

private static string GetPocketsName(TarkovItem x) =>
$"{x.LocalizedName} ({x.SlotsCount})";
private static string GetPocketsName(TarkovItem x)
{
var name = $"{x.LocalizedName} ({x.SlotsCount})";
var specSlotsCount = x.Properties?.Slots?.Where(x => x.Name.StartsWith("SpecialSlot")).Count() ?? 0;
if (specSlotsCount > 0)
{
var key = "InventoryScreen/SpecialSlotsHeader";
var header = ServerDatabase.LocalesGlobal.ContainsKey(key) ? ServerDatabase.LocalesGlobal[key] : "special slots";
name += $" + {header} ({specSlotsCount})";
}
return name;
}

private static void LoadTraderSuits()
{
Expand Down
Loading

0 comments on commit 1c1db5d

Please sign in to comment.