From e9b9c2ce15f38f608cdf1b188786318eb5982d96 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Wed, 4 Sep 2024 18:02:26 +0200 Subject: [PATCH 01/35] Proto for upcoming spt release --- ConsoleCommands/BaseTemplateCommand.cs | 4 ++-- ConsoleCommands/Spawn.cs | 4 ++-- ConsoleCommands/Template.cs | 2 +- ConsoleCommands/TrackList.cs | 2 +- Extensions/ItemExtensions.cs | 18 +++++++++--------- Features/Ammunition.cs | 4 ++-- Features/Examine.cs | 4 ++-- Features/Health.cs | 7 ++++++- Features/Hits.cs | 3 ++- Features/Quests.cs | 4 ++-- KnownTemplateIds.cs | 2 +- Model/ActiveHealthControllerWrapper.cs | 10 ++++++++++ NLog.EFT.Trainer.csproj | 1 + 13 files changed, 41 insertions(+), 24 deletions(-) create mode 100644 Model/ActiveHealthControllerWrapper.cs diff --git a/ConsoleCommands/BaseTemplateCommand.cs b/ConsoleCommands/BaseTemplateCommand.cs index 4c0562af..7d0a76ce 100644 --- a/ConsoleCommands/BaseTemplateCommand.cs +++ b/ConsoleCommands/BaseTemplateCommand.cs @@ -14,10 +14,10 @@ internal abstract class BaseTemplateCommand : ConsoleCommandWithArgument protected static ItemTemplate[] FindTemplates(string searchShortNameOrTemplateId) { - if (!Singleton.Instantiated) + if (!Singleton.Instantiated) return []; - var templates = Singleton + var templates = Singleton .Instance .ItemTemplates; diff --git a/ConsoleCommands/Spawn.cs b/ConsoleCommands/Spawn.cs index 0f1f0c65..6bb7781f 100644 --- a/ConsoleCommands/Spawn.cs +++ b/ConsoleCommands/Spawn.cs @@ -79,7 +79,7 @@ private static void SpawnTemplate(ItemTemplate template, Player player, ConsoleC } else { - var itemFactory = Singleton.Instance; + var itemFactory = Singleton.Instance; var item = itemFactory.CreateItem(MongoID.Generate(), template._id, null); if (item == null) { @@ -93,7 +93,7 @@ private static void SpawnTemplate(ItemTemplate template, Player player, ConsoleC var go = poolManager.CreateLootPrefab(item, ECameraType.Default); go.SetActive(value: true); - var lootItem = Singleton.Instance.CreateLootWithRigidbody(go, item, item.ShortName, Singleton.Instance, randomRotation: false, null, out _); + var lootItem = Singleton.Instance.CreateLootWithRigidbody(go, item, item.ShortName, randomRotation: false, null, out _, true); var transform = player.Transform; var position = transform.position diff --git a/ConsoleCommands/Template.cs b/ConsoleCommands/Template.cs index 81f73492..8019c99d 100644 --- a/ConsoleCommands/Template.cs +++ b/ConsoleCommands/Template.cs @@ -20,7 +20,7 @@ public override void Execute(Match match) if (matchGroup is not { Success: true }) return; - if (!Singleton.Instantiated) + if (!Singleton.Instantiated) return; var search = matchGroup.Value; diff --git a/ConsoleCommands/TrackList.cs b/ConsoleCommands/TrackList.cs index d074a034..67995a57 100644 --- a/ConsoleCommands/TrackList.cs +++ b/ConsoleCommands/TrackList.cs @@ -23,7 +23,7 @@ internal static void ShowTrackList(ConsoleCommand command, Features.LootItems lo command.AddConsoleLog(Strings.CommandTrackListUpdated); foreach (var templateId in lootItems.Wishlist) - command.AddConsoleLog(string.Format(Strings.CommandTrackListWishListEnumerateFormat, templateId.LocalizedShortName())); + command.AddConsoleLog(string.Format(Strings.CommandTrackListWishListEnumerateFormat, ((MongoID)templateId).LocalizedShortName())); foreach (var item in lootItems.TrackedNames) { diff --git a/Extensions/ItemExtensions.cs b/Extensions/ItemExtensions.cs index d5ffc5eb..d1089ec4 100644 --- a/Extensions/ItemExtensions.cs +++ b/Extensions/ItemExtensions.cs @@ -21,16 +21,16 @@ public static bool IsFiltered(this Item item) if (ItemViewFactory.IsSecureContainer(item)) return true; - if (item.CurrentAddress?.Container is { ParentItem.TemplateId: KnownTemplateIds.BossContainer }) + if (item.CurrentAddress?.Container?.ParentItem?.TemplateId == (MongoID)KnownTemplateIds.BossContainer) return true; - return item.TemplateId switch - { - KnownTemplateIds.DefaultInventory or KnownTemplateIds.Pockets => true, - _ => false - // KnownTemplateIds.Dollars or KnownTemplateIds.Euros or KnownTemplateIds.Roubles => false, - // Incompatible with extra mods like AllInOne, setting item weight to zero - //_ => item.Weight <= 0f,// easy way to remove special items like "Pockets" or "Default Inventory" - }; + if (item.TemplateId == (MongoID)KnownTemplateIds.DefaultInventory || item.TemplateId == (MongoID)KnownTemplateIds.Pockets) + return true; + + // KnownTemplateIds.Dollars or KnownTemplateIds.Euros or KnownTemplateIds.Roubles => false, + // Incompatible with extra mods like AllInOne, setting item weight to zero + //_ => item.Weight <= 0f,// easy way to remove special items like "Pockets" or "Default Inventory" + + return false; } } diff --git a/Features/Ammunition.cs b/Features/Ammunition.cs index 8c1b6779..dbbe6397 100644 --- a/Features/Ammunition.cs +++ b/Features/Ammunition.cs @@ -62,11 +62,11 @@ private static void ShootPostfix(object shot) private static Item CreateAmmo(Item ammo) { - var instantiated = Singleton.Instantiated; + var instantiated = Singleton.Instantiated; if (!instantiated) return ammo; - var instance = Singleton.Instance; + var instance = Singleton.Instance; var itemId = Guid.NewGuid().ToString("N").Substring(0, 24); return instance.CreateItem(itemId, ammo.TemplateId, null) ?? ammo; } diff --git a/Features/Examine.cs b/Features/Examine.cs index 0dfd8cfe..cac9b3e2 100644 --- a/Features/Examine.cs +++ b/Features/Examine.cs @@ -36,7 +36,7 @@ protected static bool GetSearchStatePrefix(SearchableItemClass __instance) if (player == null) return true; - __instance.UncoverAll(player.ProfileId); + //__instance.UncoverAll(player.ProfileId); return true; } @@ -47,7 +47,7 @@ protected override void UpdateWhenEnabled() { HarmonyPrefix(harmony, typeof(Profile), nameof(Profile.Examined), nameof(ExaminedPrefix), [typeof(string)]); HarmonyPrefix(harmony, typeof(Profile), nameof(Profile.Examined), nameof(ExaminedPrefix), [typeof(Item)]); - HarmonyPrefix(harmony, typeof(SearchableItemClass), nameof(SearchableItemClass.GetSearchState), nameof(GetSearchStatePrefix)); + //HarmonyPrefix(harmony, typeof(SearchableItemClass), nameof(SearchableItemClass.GetSearchState), nameof(GetSearchStatePrefix)); }); } } diff --git a/Features/Health.cs b/Features/Health.cs index 7cc5dd67..3e554565 100644 --- a/Features/Health.cs +++ b/Features/Health.cs @@ -3,6 +3,7 @@ using EFT.HealthSystem; using EFT.Trainer.Configuration; using EFT.Trainer.Extensions; +using EFT.Trainer.Model; using EFT.Trainer.Properties; using JetBrains.Annotations; @@ -33,7 +34,11 @@ internal class Health : ToggleFeature [UsedImplicitly] protected static bool ApplyDamagePrefix(EBodyPart bodyPart, ActiveHealthController? __instance, ref float __result) { - if (UseBuiltinDamageLogic(__instance?.Player, bodyPart)) + if (__instance == null) + return true; // keep using original code + + var wrapper = new ActiveHealthControllerWrapper(__instance); + if (UseBuiltinDamageLogic(wrapper.Player, bodyPart)) return true; // keep using original code __result = 0f; diff --git a/Features/Hits.cs b/Features/Hits.cs index d74c142f..394aa622 100644 --- a/Features/Hits.cs +++ b/Features/Hits.cs @@ -2,6 +2,7 @@ using EFT.HealthSystem; using EFT.Trainer.Configuration; using EFT.Trainer.Extensions; +using EFT.Trainer.Model; using EFT.Trainer.Properties; using EFT.Trainer.UI; using JetBrains.Annotations; @@ -64,7 +65,7 @@ protected static void ApplyDamagePostfix(EBodyPart bodyPart, float damage, Damag if (__instance == null) return; - var victim = __instance.Player; + var victim = new ActiveHealthControllerWrapper(__instance).Player; if (victim == null || victim.IsYourPlayer) return; diff --git a/Features/Quests.cs b/Features/Quests.cs index 8b215a19..286615bd 100644 --- a/Features/Quests.cs +++ b/Features/Quests.cs @@ -102,7 +102,7 @@ private void RefreshFindItemLocations(QuestDataClass[] startedQuests, GameWorld { foreach (var condition in quest.Template!.Conditions[EQuestStatus.AvailableForFinish].OfType()) { - if (!condition.target.Contains(lootItem.Item.TemplateId) || quest.CompletedConditions.Contains(condition.id)) + if (!condition.target.Contains(lootItem.Item.TemplateId.ToString()) || quest.CompletedConditions.Contains(condition.id)) continue; var position = lootItem.transform.position; @@ -129,7 +129,7 @@ private void RefreshPlaceOrRepairItemLocations(QuestDataClass[] startedQuests, P if (quest.CompletedConditions.Contains(condition.id)) continue; - var result = allPlayerItems.FirstOrDefault(x => condition.target.Contains(x.TemplateId)); + var result = allPlayerItems.FirstOrDefault(x => condition.target.Contains(x.TemplateId.ToString())); if (result == null) continue; diff --git a/KnownTemplateIds.cs b/KnownTemplateIds.cs index 2e875322..27a4449f 100644 --- a/KnownTemplateIds.cs +++ b/KnownTemplateIds.cs @@ -18,5 +18,5 @@ public static class KnownTemplateIds public const string AirDropSupply = "622334fa3136504a544d160c"; public const string AirDropWeapon = "6223351bb5d97a7b2c635ca7"; - public static string DefaultInventoryLocalizedShortName = DefaultInventory.LocalizedShortName(); + public static string DefaultInventoryLocalizedShortName = ((MongoID)DefaultInventory).LocalizedShortName(); } diff --git a/Model/ActiveHealthControllerWrapper.cs b/Model/ActiveHealthControllerWrapper.cs new file mode 100644 index 00000000..20f89f71 --- /dev/null +++ b/Model/ActiveHealthControllerWrapper.cs @@ -0,0 +1,10 @@ +using EFT.HealthSystem; + +#nullable enable + +namespace EFT.Trainer.Model; + +internal class ActiveHealthControllerWrapper(ActiveHealthController instance) : ReflectionWrapper(instance) +{ + public Player? Player => GetFieldValue(nameof(Player)); +} diff --git a/NLog.EFT.Trainer.csproj b/NLog.EFT.Trainer.csproj index 6efbaf83..f8952f02 100644 --- a/NLog.EFT.Trainer.csproj +++ b/NLog.EFT.Trainer.csproj @@ -209,6 +209,7 @@ + From 8f683ddf6edae1b430ef74190575e0a5d0d3365e Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Wed, 4 Sep 2024 18:11:45 +0200 Subject: [PATCH 02/35] Rewrite --- Extensions/ItemExtensions.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Extensions/ItemExtensions.cs b/Extensions/ItemExtensions.cs index d1089ec4..bbad3c6b 100644 --- a/Extensions/ItemExtensions.cs +++ b/Extensions/ItemExtensions.cs @@ -21,16 +21,16 @@ public static bool IsFiltered(this Item item) if (ItemViewFactory.IsSecureContainer(item)) return true; - if (item.CurrentAddress?.Container?.ParentItem?.TemplateId == (MongoID)KnownTemplateIds.BossContainer) + if (item.CurrentAddress?.Container?.ParentItem?.TemplateId.ToString() == KnownTemplateIds.BossContainer) return true; - if (item.TemplateId == (MongoID)KnownTemplateIds.DefaultInventory || item.TemplateId == (MongoID)KnownTemplateIds.Pockets) - return true; - - // KnownTemplateIds.Dollars or KnownTemplateIds.Euros or KnownTemplateIds.Roubles => false, - // Incompatible with extra mods like AllInOne, setting item weight to zero - //_ => item.Weight <= 0f,// easy way to remove special items like "Pockets" or "Default Inventory" - - return false; + return item.TemplateId.ToString() switch + { + KnownTemplateIds.DefaultInventory or KnownTemplateIds.Pockets => true, + _ => false + // KnownTemplateIds.Dollars or KnownTemplateIds.Euros or KnownTemplateIds.Roubles => false, + // Incompatible with extra mods like AllInOne, setting item weight to zero + //_ => item.Weight <= 0f,// easy way to remove special items like "Pockets" or "Default Inventory" + }; } } From 8d66285c9564243ae69a4c6b2cd01f3dbbdfafeb Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Thu, 5 Sep 2024 20:02:52 +0200 Subject: [PATCH 03/35] Fix instant-reveal --- Features/Examine.cs | 29 ++++++++++---------- Features/Feature.cs | 65 ++++++++++++++++++++++++++------------------- 2 files changed, 53 insertions(+), 41 deletions(-) diff --git a/Features/Examine.cs b/Features/Examine.cs index cac9b3e2..823cf216 100644 --- a/Features/Examine.cs +++ b/Features/Examine.cs @@ -1,6 +1,15 @@ -using EFT.InventoryLogic; +using System; +using System.Linq; +using EFT.InventoryLogic; +using EFT.InventoryLogic.Operations; +using EFT.Trainer.Extensions; using EFT.Trainer.Properties; +using GPUInstancer; +using HarmonyLib; using JetBrains.Annotations; +using UnityEngine.Profiling; +using static EFT.Player; + #nullable enable @@ -22,32 +31,24 @@ protected static bool ExaminedPrefix(ref bool __result) return true; // keep using original code, we are not enabled __result = true; - return false; // skip the original code and all other prefix methods + return false; // skip the original code and all other prefix methods } [UsedImplicitly] - protected static bool GetSearchStatePrefix(SearchableItemClass __instance) + protected static bool SinglePlayerInventoryControllerConstructorPrefix(Player player, Profile profile, ref bool examined) { - var feature = FeatureFactory.GetFeature(); - if (feature == null || !feature.Enabled) - return true; // keep using original code, we are not enabled - - var player = GameState.Current?.LocalPlayer; - if (player == null) - return true; - - //__instance.UncoverAll(player.ProfileId); + // this will make the game use the passthrough type implementing IPlayerSearchController, ISearchController with all items known and searched + examined = true; return true; } - protected override void UpdateWhenEnabled() { HarmonyPatchOnce(harmony => { HarmonyPrefix(harmony, typeof(Profile), nameof(Profile.Examined), nameof(ExaminedPrefix), [typeof(string)]); HarmonyPrefix(harmony, typeof(Profile), nameof(Profile.Examined), nameof(ExaminedPrefix), [typeof(Item)]); - //HarmonyPrefix(harmony, typeof(SearchableItemClass), nameof(SearchableItemClass.GetSearchState), nameof(GetSearchStatePrefix)); + HarmonyConstructorPrefix(harmony, typeof(SinglePlayerInventoryController), nameof(SinglePlayerInventoryControllerConstructorPrefix), [typeof(Player), typeof(Profile), typeof(bool)]); }); } } diff --git a/Features/Feature.cs b/Features/Feature.cs index c4b97820..efc8a2a4 100644 --- a/Features/Feature.cs +++ b/Features/Feature.cs @@ -1,4 +1,5 @@ using System; +using System.Reflection; using EFT.InputSystem; using EFT.UI; using Newtonsoft.Json; @@ -30,48 +31,58 @@ public void HarmonyPatchOnce(Action action) action(harmony); } - public void HarmonyPrefix(HarmonyLib.Harmony harmony, Type originalType, string originalMethod, string newMethod, Type[]? parameters = null) + public void HarmonyDispatch(HarmonyLib.Harmony harmony, Type originalType, string? originalMethod, string? newPrefixMethod, string? newPostfixMethod, Type[]? parameters = null) { - var original = HarmonyLib.AccessTools.Method(originalType, originalMethod, parameters); + MethodBase original = originalMethod == null + ? HarmonyLib.AccessTools.Constructor(originalType, parameters) + : HarmonyLib.AccessTools.Method(originalType, originalMethod, parameters); + if (original == null) { - AddConsoleLog(string.Format(Properties.Strings.ErrorCannotFindOriginalMethodFormat, $"{originalType}.{originalMethod}")); + AddConsoleLog(string.Format(Properties.Strings.ErrorCannotFindOriginalMethodFormat, $"{originalType}.{originalMethod ?? "ctor"}").Red()); return; } - var prefix = HarmonyLib.AccessTools.Method(GetType(), newMethod); - if (prefix == null) - { - AddConsoleLog(string.Format(Properties.Strings.ErrorCannotFindPrefixMethodFormat, newMethod)); + var prefix = GetTargetMethod(newPrefixMethod, Properties.Strings.ErrorCannotFindPrefixMethodFormat); + var postfix = GetTargetMethod(newPostfixMethod, Properties.Strings.ErrorCannotFindPostfixMethodFormat); + + if (prefix != null && postfix != null) + return; + + if (prefix == null && postfix == null) return; - } - harmony.Patch(original, prefix: new HarmonyLib.HarmonyMethod(prefix)); + harmony.Patch(original, prefix: prefix, postfix: postfix); #if DEBUG - AddConsoleLog(string.Format(Properties.Strings.DebugPatchedMethodFormat, $"{originalType}.{originalMethod}", $"{GetType()}.{newMethod}")); + AddConsoleLog(string.Format(Properties.Strings.DebugPatchedMethodFormat, $"{originalType}.{originalMethod}", $"{GetType()}.{newPrefixMethod ?? newPostfixMethod}")); #endif } - public void HarmonyPostfix(HarmonyLib.Harmony harmony, Type originalType, string originalMethod, string newMethod) + private HarmonyLib.HarmonyMethod? GetTargetMethod(string? methodName, string errorFormat) { - var original = HarmonyLib.AccessTools.Method(originalType, originalMethod); - if (original == null) - { - AddConsoleLog(string.Format(Properties.Strings.ErrorCannotFindOriginalMethodFormat, $"{originalType}.{originalMethod}")); - return; - } + if (methodName == null) + return null; - var postfix = HarmonyLib.AccessTools.Method(GetType(), newMethod); - if (postfix == null) - { - AddConsoleLog(string.Format(Properties.Strings.ErrorCannotFindPostfixMethodFormat, newMethod)); - return; - } + var method = HarmonyLib.AccessTools.Method(GetType(), methodName); + if (method == null) + AddConsoleLog(string.Format(errorFormat, methodName).Red()); - harmony.Patch(original, postfix: new HarmonyLib.HarmonyMethod(postfix)); -#if DEBUG - AddConsoleLog(string.Format(Properties.Strings.DebugPatchedMethodFormat, $"{originalType}.{originalMethod}", $"{GetType()}.{newMethod}")); -#endif + return new HarmonyLib.HarmonyMethod(method); + } + + public void HarmonyPrefix(HarmonyLib.Harmony harmony, Type originalType, string originalMethod, string newMethod, Type[]? parameters = null) + { + HarmonyDispatch(harmony, originalType, originalMethod, newPrefixMethod: newMethod, newPostfixMethod: null, parameters); + } + + public void HarmonyConstructorPrefix(HarmonyLib.Harmony harmony, Type originalType, string newMethod, Type[]? parameters) + { + HarmonyDispatch(harmony, originalType, null, newPrefixMethod: newMethod, newPostfixMethod: null, parameters); + } + + public void HarmonyPostfix(HarmonyLib.Harmony harmony, Type originalType, string originalMethod, string newMethod, Type[]? parameters = null) + { + HarmonyDispatch(harmony, originalType, originalMethod, newPrefixMethod: null, newPostfixMethod: newMethod, parameters); } protected void AddConsoleLog(string log) From 46d5b5241e61a606b8d8d89646728b64e446f4f7 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Thu, 5 Sep 2024 20:07:15 +0200 Subject: [PATCH 04/35] Remove unused namespaces --- Features/Examine.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Features/Examine.cs b/Features/Examine.cs index 823cf216..86906135 100644 --- a/Features/Examine.cs +++ b/Features/Examine.cs @@ -1,13 +1,6 @@ -using System; -using System.Linq; -using EFT.InventoryLogic; -using EFT.InventoryLogic.Operations; -using EFT.Trainer.Extensions; +using EFT.InventoryLogic; using EFT.Trainer.Properties; -using GPUInstancer; -using HarmonyLib; using JetBrains.Annotations; -using UnityEngine.Profiling; using static EFT.Player; From cbd927fc71b7926135bb79ad2b6fd89ef10098fa Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Thu, 5 Sep 2024 20:07:41 +0200 Subject: [PATCH 05/35] Removve newline --- Features/Examine.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Features/Examine.cs b/Features/Examine.cs index 86906135..f203c751 100644 --- a/Features/Examine.cs +++ b/Features/Examine.cs @@ -3,7 +3,6 @@ using JetBrains.Annotations; using static EFT.Player; - #nullable enable namespace EFT.Trainer.Features; From 4b64f3696b507dfcc96932b1b48aec68b9767e29 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Thu, 5 Sep 2024 21:00:13 +0200 Subject: [PATCH 06/35] Only enable when needed --- Features/Examine.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Features/Examine.cs b/Features/Examine.cs index f203c751..e9408e75 100644 --- a/Features/Examine.cs +++ b/Features/Examine.cs @@ -29,6 +29,10 @@ protected static bool ExaminedPrefix(ref bool __result) [UsedImplicitly] protected static bool SinglePlayerInventoryControllerConstructorPrefix(Player player, Profile profile, ref bool examined) { + var feature = FeatureFactory.GetFeature(); + if (feature == null || !feature.Enabled) + return true; // keep using original code, we are not enabled + // this will make the game use the passthrough type implementing IPlayerSearchController, ISearchController with all items known and searched examined = true; return true; From 00360896a3a264d13f5f5c6f2f68c4008e971618 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Fri, 6 Sep 2024 07:51:13 +0200 Subject: [PATCH 07/35] Fix wishlist --- Features/LootItems.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Features/LootItems.cs b/Features/LootItems.cs index 1c751b5e..b3572bc8 100644 --- a/Features/LootItems.cs +++ b/Features/LootItems.cs @@ -71,19 +71,18 @@ public bool UnTrack(string lootname) private HashSet RefreshWishlist() { - var result = new HashSet(); if (!TrackWishlist) - return result; + return []; - var uiContextInstance = ItemUiContext.Instance; // warning instance is a MonoBehavior so no null propagation permitted - if (uiContextInstance == null) - return result; + var player = GameState.Current?.LocalPlayer; + if (!player.IsValid()) + return []; - var rawWishList = uiContextInstance.Session?.RagFair?.Wishlist; - if (rawWishList == null) - return result; + var manager = player.Profile?.WishlistManager; + if (manager == null) + return []; - return [.. rawWishList.Keys]; + return [.. manager.UserItems.Keys]; } public override void RefreshData(List data) From c8f989727c46440e1e30ecc60fcef10e021b6f47 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Fri, 6 Sep 2024 08:23:12 +0200 Subject: [PATCH 08/35] Add an option to track the auto-wishlist --- Features/LootItems.cs | 14 +++++++++++--- Features/PointOfInterests.cs | 1 - Properties/Strings.Designer.cs | 9 +++++++++ Properties/Strings.fr.resx | 3 +++ Properties/Strings.resx | 3 +++ Properties/Strings.zh-cn.resx | 3 +++ 6 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Features/LootItems.cs b/Features/LootItems.cs index b3572bc8..96061290 100644 --- a/Features/LootItems.cs +++ b/Features/LootItems.cs @@ -7,7 +7,6 @@ using EFT.Trainer.Configuration; using EFT.Trainer.Extensions; using EFT.Trainer.Properties; -using EFT.UI; using JsonType; using UnityEngine; @@ -39,6 +38,9 @@ internal class LootItems : PointOfInterests [ConfigurationProperty] public bool TrackWishlist { get; set; } = false; + [ConfigurationProperty] + public bool TrackAutoWishlist { get; set; } = false; + public override float CacheTimeInSec { get; set; } = 3f; public override Color GroupingColor => Color; @@ -71,7 +73,7 @@ public bool UnTrack(string lootname) private HashSet RefreshWishlist() { - if (!TrackWishlist) + if (!TrackWishlist && !TrackAutoWishlist) return []; var player = GameState.Current?.LocalPlayer; @@ -82,7 +84,13 @@ private HashSet RefreshWishlist() if (manager == null) return []; - return [.. manager.UserItems.Keys]; + return TrackWishlist switch + { + true when TrackAutoWishlist => [.. manager.GetWishlist().Keys], // this will get user items + auto-add hideout items if enabled in settings + true when !TrackAutoWishlist => [.. manager.UserItems.Keys], // this will get user items only + false when TrackAutoWishlist => [.. manager.GetWishlist().Keys.Except(manager.UserItems.Keys)], + _ => [] + }; } public override void RefreshData(List data) diff --git a/Features/PointOfInterests.cs b/Features/PointOfInterests.cs index 5e7ee5cc..7feb2e1b 100644 --- a/Features/PointOfInterests.cs +++ b/Features/PointOfInterests.cs @@ -2,7 +2,6 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; -using System.Text; using EFT.Trainer.Configuration; using EFT.Trainer.Extensions; using EFT.Trainer.Properties; diff --git a/Properties/Strings.Designer.cs b/Properties/Strings.Designer.cs index d1502a1b..979210a2 100644 --- a/Properties/Strings.Designer.cs +++ b/Properties/Strings.Designer.cs @@ -2312,6 +2312,15 @@ internal static string PropertyThickness { } } + /// + /// Looks up a localized string similar to Track Auto Wishlist. + /// + internal static string PropertyTrackAutoWishlist { + get { + return ResourceManager.GetString("PropertyTrackAutoWishlist", resourceCulture); + } + } + /// /// Looks up a localized string similar to Example: ["foo", "bar"] or with extended properties: [{"Name":"foo","Color":[1.0,0.0,0.0,1.0]},{"Name":"bar","Color":[1.0,1.0,1.0,0.8],"Rarity":"Rare"}]. /// diff --git a/Properties/Strings.fr.resx b/Properties/Strings.fr.resx index d1329f57..0ef51a5a 100644 --- a/Properties/Strings.fr.resx +++ b/Properties/Strings.fr.resx @@ -937,4 +937,7 @@ Les couleurs sont stockées sous la forme d'un tableau de valeurs flottantes 'RG spawnqi + + Suivre la liste de souhaits auto + \ No newline at end of file diff --git a/Properties/Strings.resx b/Properties/Strings.resx index cc86fb41..128f6a1b 100644 --- a/Properties/Strings.resx +++ b/Properties/Strings.resx @@ -937,4 +937,7 @@ Colors are stored as an array of 'RGBA' floats spawnqi + + Track Auto Wishlist + \ No newline at end of file diff --git a/Properties/Strings.zh-cn.resx b/Properties/Strings.zh-cn.resx index 3e34b1ab..55392811 100644 --- a/Properties/Strings.zh-cn.resx +++ b/Properties/Strings.zh-cn.resx @@ -938,4 +938,7 @@ spawnqi + + 跟踪汽车愿望清单 + \ No newline at end of file From 61e341fe1fd9a58f7a3e347b4e969a7eee1a63b2 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Fri, 6 Sep 2024 09:05:36 +0200 Subject: [PATCH 09/35] Add `spawnhi` command --- ConsoleCommands/SpawnHideoutItems.cs | 40 ++++++++++++++++++++++++++++ NLog.EFT.Trainer.csproj | 1 + Properties/Strings.Designer.cs | 9 +++++++ Properties/Strings.fr.resx | 3 +++ Properties/Strings.resx | 3 +++ Properties/Strings.zh-cn.resx | 3 +++ README.md | 1 + 7 files changed, 60 insertions(+) create mode 100644 ConsoleCommands/SpawnHideoutItems.cs diff --git a/ConsoleCommands/SpawnHideoutItems.cs b/ConsoleCommands/SpawnHideoutItems.cs new file mode 100644 index 00000000..f74520e0 --- /dev/null +++ b/ConsoleCommands/SpawnHideoutItems.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using System.Linq; +using EFT.Trainer.Extensions; +using EFT.Trainer.Features; +using EFT.Trainer.Properties; +using HarmonyLib; +using JetBrains.Annotations; + +#nullable enable + +namespace EFT.Trainer.ConsoleCommands; + +[UsedImplicitly] +internal class SpawnHideoutItems : ConsoleCommandWithoutArgument +{ + public override string Name => Strings.CommandSpawnHideoutItems; + + public override void Execute() + { + var player = GameState.Current?.LocalPlayer; + if (!player.IsValid()) + return; + + var manager = player.Profile?.WishlistManager; + if (manager == null) + return; + + // Find the obfuscated method that returns the computed hidout items + // We need to have the auto-add hideout items enabled in EFT settings + var method = AccessTools + .GetDeclaredMethods(manager.GetType()) + .FirstOrDefault(m => m.ReturnType == typeof(IEnumerable)); + + if (method?.Invoke(manager, []) is not IEnumerable templates) + return; + + foreach (var template in templates) + Spawn.SpawnTemplate(template, player, this, i => true); + } +} diff --git a/NLog.EFT.Trainer.csproj b/NLog.EFT.Trainer.csproj index f8952f02..28fa1c8c 100644 --- a/NLog.EFT.Trainer.csproj +++ b/NLog.EFT.Trainer.csproj @@ -131,6 +131,7 @@ + diff --git a/Properties/Strings.Designer.cs b/Properties/Strings.Designer.cs index 979210a2..53e0620b 100644 --- a/Properties/Strings.Designer.cs +++ b/Properties/Strings.Designer.cs @@ -260,6 +260,15 @@ internal static string CommandSpawnBotEnumerateFormat { } } + /// + /// Looks up a localized string similar to spawnhi. + /// + internal static string CommandSpawnHideoutItems { + get { + return ResourceManager.GetString("CommandSpawnHideoutItems", resourceCulture); + } + } + /// /// Looks up a localized string similar to spawnqi. /// diff --git a/Properties/Strings.fr.resx b/Properties/Strings.fr.resx index 0ef51a5a..35086165 100644 --- a/Properties/Strings.fr.resx +++ b/Properties/Strings.fr.resx @@ -940,4 +940,7 @@ Les couleurs sont stockées sous la forme d'un tableau de valeurs flottantes 'RG Suivre la liste de souhaits auto + + spawnhi + \ No newline at end of file diff --git a/Properties/Strings.resx b/Properties/Strings.resx index 128f6a1b..6c478c53 100644 --- a/Properties/Strings.resx +++ b/Properties/Strings.resx @@ -940,4 +940,7 @@ Colors are stored as an array of 'RGBA' floats Track Auto Wishlist + + spawnhi + \ No newline at end of file diff --git a/Properties/Strings.zh-cn.resx b/Properties/Strings.zh-cn.resx index 55392811..a6381da0 100644 --- a/Properties/Strings.zh-cn.resx +++ b/Properties/Strings.zh-cn.resx @@ -941,4 +941,7 @@ 跟踪汽车愿望清单 + + spawnhi + \ No newline at end of file diff --git a/README.md b/README.md index e09ca801..5dee6077 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,7 @@ This trainer hooks into the command system, so you can easily setup features usi | savetl | `[filename]` | | Save current tracklist to file | | spawn | `[name]` | | Spawn object in front of player | | spawnbot | `[name]` or `*` | | Spawn a bot, ex `spawnbot bossKilla` | +| spawnhi | | | Spawn required hideout items | | spawnqi | | | Spawn items-to-find in active quests | | stamina | `on` or `off` | `off` | Enable/Disable unlimited stamina | | stash | `on` or `off` | `off` | Show/Hide stashes | From d17130f10184960df92aeacf04807bf358e51d9b Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Mon, 9 Sep 2024 17:51:08 +0200 Subject: [PATCH 10/35] Reword/consistency, do not use `wallhack` term anymore. Nothing to change regarding configuration nor code, we are already using `EFT.Trainer.Features.Players` in the `trainer.ini` file. --- Properties/Strings.Designer.cs | 4 ++-- Properties/Strings.fr.resx | 4 ++-- Properties/Strings.resx | 4 ++-- Properties/Strings.zh-cn.resx | 2 +- README.md | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Properties/Strings.Designer.cs b/Properties/Strings.Designer.cs index 53e0620b..69dbe524 100644 --- a/Properties/Strings.Designer.cs +++ b/Properties/Strings.Designer.cs @@ -1233,7 +1233,7 @@ internal static string FeatureNoVisorName { } /// - /// Looks up a localized string similar to Wallhack (you'll see Bear/Boss/Cultist/Scav/Usec with configurable colors through walls). Charms, boxes, info (weapon and health), skeletons and distance.. + /// Looks up a localized string similar to Players (you'll see Bear/Boss/Cultist/Scav/Usec with configurable colors through walls). Charms, boxes, info (weapon and health), skeletons and distance.. /// internal static string FeaturePlayersDescription { get { @@ -1251,7 +1251,7 @@ internal static string FeaturePlayersFormat { } /// - /// Looks up a localized string similar to wallhack. + /// Looks up a localized string similar to players. /// internal static string FeaturePlayersName { get { diff --git a/Properties/Strings.fr.resx b/Properties/Strings.fr.resx index 35086165..2a90ca79 100644 --- a/Properties/Strings.fr.resx +++ b/Properties/Strings.fr.resx @@ -523,14 +523,14 @@ Les couleurs sont stockées sous la forme d'un tableau de valeurs flottantes 'RG novisor - Wallhack (vous verrez Bear/Boss/Cultist/Scav/Usec avec des couleurs configurables à travers les murs). Silhouettes, boîtes, infos (armes et santé), squelettes et distance. + Joueurs (vous verrez Bear/Boss/Cultist/Scav/Usec avec des couleurs configurables à travers les murs). Silhouettes, boîtes, infos (armes et santé), squelettes et distance. {0} {1}% {2} Weapon name, health %, distance - wallhack + players [{0}m] diff --git a/Properties/Strings.resx b/Properties/Strings.resx index 6c478c53..e4b376d6 100644 --- a/Properties/Strings.resx +++ b/Properties/Strings.resx @@ -523,14 +523,14 @@ Colors are stored as an array of 'RGBA' floats novisor - Wallhack (you'll see Bear/Boss/Cultist/Scav/Usec with configurable colors through walls). Charms, boxes, info (weapon and health), skeletons and distance. + Players (you'll see Bear/Boss/Cultist/Scav/Usec with configurable colors through walls). Charms, boxes, info (weapon and health), skeletons and distance. {0} {1}% {2} Weapon name, health %, distance - wallhack + players [{0}m] diff --git a/Properties/Strings.zh-cn.resx b/Properties/Strings.zh-cn.resx index a6381da0..05548a40 100644 --- a/Properties/Strings.zh-cn.resx +++ b/Properties/Strings.zh-cn.resx @@ -531,7 +531,7 @@ Weapon name, health %, distance - 辅助视野 + 球员 [{0}米] diff --git a/README.md b/README.md index 5dee6077..881a5ac9 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ This is an attempt -for educational purposes only- to alter a Unity game at runt | `NoRecoil` | `norecoil` | No recoil. | | `NoSway` | `nosway` | No sway. | | `NoVisor` | `novisor` | No visor, so even when using a face shield-visor you won't see it. | -| `Players` | `wallhack` | Wallhack (you'll see Bear/Boss/Cultist/Scav/Usec with configurable colors through walls). Charms, boxes, info (weapon and health), skeletons and distance. | +| `Players` | `players` | Players (you'll see Bear/Boss/Cultist/Scav/Usec with configurable colors through walls). Charms, boxes, info (weapon and health), skeletons and distance. | | `Quests` | `quest` | Locations for taking/placing quest items. Only items related to your started quests are displayed. | | `QuickThrow` | `quickthrow` | Quick-throw grenades. | | `Radar` | `radar` | 2D radar. | @@ -61,7 +61,7 @@ This is an attempt -for educational purposes only- to alter a Unity game at runt You can Load/Save all settings using the `console` or the `GUI`. -![Wallhack](https://user-images.githubusercontent.com/638167/222186879-a88a267e-16ba-4532-85ec-8cb385737947.png) +![Players](https://user-images.githubusercontent.com/638167/222186879-a88a267e-16ba-4532-85ec-8cb385737947.png) ![Radar](https://user-images.githubusercontent.com/638167/222524208-589dc7ff-f053-4b0c-902b-49fa8d1f7ddd.png) ![Map](https://user-images.githubusercontent.com/769465/224330696-d09960a2-8940-4980-8489-0533b44534f9.png) ![Exfils](https://user-images.githubusercontent.com/638167/135586735-143ab160-ca20-4ec9-8ad4-9ce7bde58295.png) @@ -83,7 +83,7 @@ You can try to compile the code yourself (you will need a recent Visual Studio, Copy all files in your EFT directory like `C:\Battlestate Games\EFT`: - `EscapeFromTarkov_Data\Managed\NLog.EFT.Trainer.dll` (this is the compiled code for the trainer) -- `EscapeFromTarkov_Data\outline` (this is the dedicated shader we use to outline players [wallhack]) +- `EscapeFromTarkov_Data\outline` (this is the dedicated shader we use to outline players [players]) ### If you are using the Live version (you should NOT do that, you'll be detected and banned): @@ -130,6 +130,7 @@ This trainer hooks into the command system, so you can easily setup features usi | norecoil | `on` or `off` | `off` | Disable/Enable recoil | | nosway | `on` or `off` | `off` | Disable/Enable sway | | novisor | `on` or `off` | `off` | Disable/Enable visor | +| players | `on` or `off` | `on` | Show/hide players | | quest | `on` or `off` | `off` | Show/Hide quest POI | | radar | `on` or `off` | `off` | Show/Hide radar | | save | | | Save settings to `trainer.ini` | @@ -150,7 +151,6 @@ This trainer hooks into the command system, so you can easily setup features usi | tracksr | same as `track` | | Track super rare items only | | tracklist | | | Show tracked items | | untrack | `[name]` or `*` | | Untrack a `name` or `*` for all | -| wallhack | `on` or `off` | `on` | Show/hide players | | wallshoot | `on` or `off` | `on` | Enable/Disable shoot through walls | ## Translations From bc0d583f9bcdb74a62babc76662e951e27b93942 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Mon, 9 Sep 2024 19:20:00 +0200 Subject: [PATCH 11/35] Update Strings.zh-cn.resx --- Properties/Strings.zh-cn.resx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Properties/Strings.zh-cn.resx b/Properties/Strings.zh-cn.resx index 05548a40..faa31ffc 100644 --- a/Properties/Strings.zh-cn.resx +++ b/Properties/Strings.zh-cn.resx @@ -531,7 +531,7 @@ Weapon name, health %, distance - 球员 + 显示玩家 [{0}米] @@ -944,4 +944,4 @@ spawnhi - \ No newline at end of file + From 35b9861a0b428f9370d254d585c27dc1874d91b7 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Tue, 10 Sep 2024 07:14:07 +0200 Subject: [PATCH 12/35] Update Strings.zh-cn.resx --- Properties/Strings.zh-cn.resx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Properties/Strings.zh-cn.resx b/Properties/Strings.zh-cn.resx index faa31ffc..37181d79 100644 --- a/Properties/Strings.zh-cn.resx +++ b/Properties/Strings.zh-cn.resx @@ -523,7 +523,7 @@ 无视野遮挡 - 透视(通过墙壁你会看到Bear/Boss/邪教徒/Scav/Usec)。可配置颜色、描边、人物盒子、人物信息(武器和生命值),人物骨骼和距离。 + 显示玩家(通过墙壁你会看到Bear/Boss/邪教徒/Scav/Usec)。可配置颜色、描边、人物盒子、人物信息(武器和生命值),人物骨骼和距离。 From c7b1e1b5273fabd3118fafedcee14f51f7f2814f Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Tue, 10 Sep 2024 20:37:46 +0200 Subject: [PATCH 13/35] Add noflash feature --- Features/NoFlash.cs | 34 ++++++++++++++++++++++++++++++++++ NLog.EFT.Trainer.csproj | 1 + Properties/Strings.Designer.cs | 18 ++++++++++++++++++ Properties/Strings.fr.resx | 6 ++++++ Properties/Strings.resx | 6 ++++++ Properties/Strings.zh-cn.resx | 8 +++++++- 6 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 Features/NoFlash.cs diff --git a/Features/NoFlash.cs b/Features/NoFlash.cs new file mode 100644 index 00000000..c9cc992b --- /dev/null +++ b/Features/NoFlash.cs @@ -0,0 +1,34 @@ +using EFT.Trainer.Properties; +using JetBrains.Annotations; + +#nullable enable + +namespace EFT.Trainer.Features; + +[UsedImplicitly] +internal class NoFlash : ToggleFeature +{ + public override string Name => Strings.FeatureNoFlashName; + public override string Description => Strings.FeatureNoFlashDescription; + + public override bool Enabled { get; set; } = false; + + protected override void UpdateWhenEnabled() + { + var camera = GameState.Current?.Camera; + if (camera == null) + return; + + if (camera.GetComponent() is { enabled: true } flash) + { + flash.enabled = false; + flash.EffectStrength = 0; + } + + if (camera.GetComponent() is { enabled: true } eyeburn) + { + eyeburn.enabled = false; + eyeburn.EyesBurn = false; + } + } +} diff --git a/NLog.EFT.Trainer.csproj b/NLog.EFT.Trainer.csproj index 28fa1c8c..7afa37f8 100644 --- a/NLog.EFT.Trainer.csproj +++ b/NLog.EFT.Trainer.csproj @@ -186,6 +186,7 @@ + diff --git a/Properties/Strings.Designer.cs b/Properties/Strings.Designer.cs index 69dbe524..a4bec5c3 100644 --- a/Properties/Strings.Designer.cs +++ b/Properties/Strings.Designer.cs @@ -1160,6 +1160,24 @@ internal static string FeatureNoCollisionName { } } + /// + /// Looks up a localized string similar to No persistent flash or eye-burn effect after a flash grenade.. + /// + internal static string FeatureNoFlashDescription { + get { + return ResourceManager.GetString("FeatureNoFlashDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to noflash. + /// + internal static string FeatureNoFlashName { + get { + return ResourceManager.GetString("FeatureNoFlashName", resourceCulture); + } + } + /// /// Looks up a localized string similar to No weapon malfunctions: no misfires or failures to eject or feed. No jammed bolts or overheating.. /// diff --git a/Properties/Strings.fr.resx b/Properties/Strings.fr.resx index 2a90ca79..b0f9977e 100644 --- a/Properties/Strings.fr.resx +++ b/Properties/Strings.fr.resx @@ -943,4 +943,10 @@ Les couleurs sont stockées sous la forme d'un tableau de valeurs flottantes 'RG spawnhi + + noflash + + + Pas d'effet de flash persistant ou de brûlure oculaire après une grenade flash. + \ No newline at end of file diff --git a/Properties/Strings.resx b/Properties/Strings.resx index e4b376d6..025794cf 100644 --- a/Properties/Strings.resx +++ b/Properties/Strings.resx @@ -943,4 +943,10 @@ Colors are stored as an array of 'RGBA' floats spawnhi + + noflash + + + No persistent flash or eye-burn effect after a flash grenade. + \ No newline at end of file diff --git a/Properties/Strings.zh-cn.resx b/Properties/Strings.zh-cn.resx index 37181d79..9afa7939 100644 --- a/Properties/Strings.zh-cn.resx +++ b/Properties/Strings.zh-cn.resx @@ -944,4 +944,10 @@ spawnhi - + + 不闪烁 + + + 闪光弹爆炸后不会产生持续闪光或灼伤眼睛的效果。 + + \ No newline at end of file From 0570c8990872ffbef1f4546c9dfdd0acca1e6977 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Tue, 10 Sep 2024 20:40:45 +0200 Subject: [PATCH 14/35] Update readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 881a5ac9..dd3e8fb4 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ This is an attempt -for educational purposes only- to alter a Unity game at runt | `Map` | `map` | Full screen map with radar esp. | | `NightVision` | `night` | Night vision. | | `NoCollision` | `nocoll` | No physical collisions, making you immune to bullets, grenades and barbed wires. | +| `NoFlash` | `noflash` | No persistent flash or eye-burn effect after a flash grenade. | | `NoMalfunctions` | `nomal` | No weapon malfunctions: no misfires or failures to eject or feed. No jammed bolts or overheating. | | `NoRecoil` | `norecoil` | No recoil. | | `NoSway` | `nosway` | No sway. | @@ -126,6 +127,7 @@ This trainer hooks into the command system, so you can easily setup features usi | loot | `on` or `off` | | Show/Hide tracked items | | night | `on` or `off` | `off` | Enable/Disable night vision | | nocoll | `on` or `off` | `off` | Disable/Enable physical collisions | +| noflash | `on` or `off` | `off` | Disable/Enable flash/eyeburn effects | | nomal | `on` or `off` | `off` | Disable/Enable weapon malfunctions | | norecoil | `on` or `off` | `off` | Disable/Enable recoil | | nosway | `on` or `off` | `off` | Disable/Enable sway | From 4169c94ec7fbe7c822356f501b9b6813bee42d72 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Wed, 11 Sep 2024 20:22:29 +0200 Subject: [PATCH 15/35] Refine installer --- Installer/InstallCommand.cs | 23 +++++++++++++---------- Installer/Installation.cs | 10 ++++++++++ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Installer/InstallCommand.cs b/Installer/InstallCommand.cs index 0dc7659e..d781c216 100644 --- a/Installer/InstallCommand.cs +++ b/Installer/InstallCommand.cs @@ -66,6 +66,19 @@ public override async Task ExecuteAsync(CommandContext commandContext, Sett AnsiConsole.MarkupLine($"Target [green]EscapeFromTarkov ({installation.Version})[/] in [blue]{installation.Location.EscapeMarkup()}[/]."); + if (installation.UsingSptAki) + { + AnsiConsole.MarkupLine("[green][[SPT-AKI]][/] detected. Please make sure you have run the game at least once before installing the trainer."); + AnsiConsole.MarkupLine("SPT-AKI is patching binaries during the first run, and we [underline]need[/] to compile against those patched binaries."); + AnsiConsole.MarkupLine("If you install this trainer on stock binaries, we'll be unable to compile or the game will freeze at the startup screen."); + + if (installation.UsingSptAkiButNeverRun) + AnsiConsole.MarkupLine("[yellow]Warning: it seems that you have never run your SPT-AKI installation. You should quit now and rerun this installer once it's done.[/]"); + + if (!AnsiConsole.Confirm("Continue installation (yes I have run the game at least once) ?")) + return (int)ExitCode.Canceled; + } + const string features = "Features"; const string commands = "ConsoleCommands"; @@ -81,16 +94,6 @@ public override async Task ExecuteAsync(CommandContext commandContext, Sett return (int)ExitCode.CompilationFailed; } - if (installation.UsingSptAki) - { - AnsiConsole.MarkupLine("[green][[SPT-AKI]][/] detected. Please make sure you have run the game at least once before installing the trainer."); - AnsiConsole.MarkupLine("SPT-AKI is patching binaries during the first run, and we [underline]need[/] to compile against those patched binaries."); - AnsiConsole.MarkupLine("If you install this trainer on stock binaries, the game will freeze at the startup screen."); - - if (!AnsiConsole.Confirm("Continue installation (yes I have run the game at least once) ?")) - return (int)ExitCode.Canceled; - } - if (!CreateDll(installation, "NLog.EFT.Trainer.dll", dllPath => result.Compilation.Emit(dllPath, manifestResources: result.Resources))) return (int)ExitCode.CreateDllFailed; diff --git a/Installer/Installation.cs b/Installer/Installation.cs index b9475e3b..0775f031 100644 --- a/Installer/Installation.cs +++ b/Installer/Installation.cs @@ -14,6 +14,7 @@ internal class Installation { public Version Version { get; } public bool UsingSptAki { get; private set; } + public bool UsingSptAkiButNeverRun { get; private set; } public bool UsingBepInEx { get; private set; } public string Location { get; } public string Data => Path.Combine(Location, "EscapeFromTarkov_Data"); @@ -91,6 +92,10 @@ private static IEnumerable DiscoverInstallations() if (TryDiscoverInstallation(Path.GetDirectoryName(AppContext.BaseDirectory), out installation)) yield return installation; + // SPT-AKI default installation path + if (TryDiscoverInstallation(Path.Combine(Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System))!, "SPT"), out installation)) + yield return installation; + using var hive = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); using var eft = hive.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\EscapeFromTarkov", false); @@ -143,6 +148,11 @@ private static bool TryDiscoverInstallation(string? path, [NotNullWhen(true)] ou var akiFolder = Path.Combine(path, "SPT_Data"); installation.UsingSptAki = Directory.Exists(akiFolder) || Directory.Exists(legacyAkiFolder); + + var battleye = Path.Combine(path, "BattlEye"); + var user = Path.Combine(path, "user"); + installation.UsingSptAkiButNeverRun = installation.UsingSptAki && (Directory.Exists(battleye) || !Directory.Exists(user)); + installation.UsingBepInEx = Directory.Exists(installation.BepInExPlugins); return true; From c728c4d254e25c4c1c6dcb20436b49945632984f Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Thu, 12 Sep 2024 08:05:01 +0200 Subject: [PATCH 16/35] Improve prompt --- Installer/Installation.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Installer/Installation.cs b/Installer/Installation.cs index 0775f031..cb0946d5 100644 --- a/Installer/Installation.cs +++ b/Installer/Installation.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Runtime.Versioning; +using System.Text; using Microsoft.Win32; using Spectre.Console; @@ -73,11 +74,7 @@ public override int GetHashCode() var first = installations.First(); return AnsiConsole.Confirm($"Continue with [green]EscapeFromTarkov ({first.Version})[/] in [blue]{first.Location.EscapeMarkup()}[/] ?") ? first : null; default: - var prompt = new SelectionPrompt - { - Converter = i => i.Location.EscapeMarkup(), - Title = promptTitle - }; + var prompt = new SelectionPrompt { Title = promptTitle }; prompt.AddChoices(installations); return AnsiConsole.Prompt(prompt); } @@ -162,4 +159,12 @@ private static bool TryDiscoverInstallation(string? path, [NotNullWhen(true)] ou return false; } } + + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append($"{Location.EscapeMarkup()} - [[{Version}]] "); + sb.Append(UsingSptAki ? "[b]SPT-AKI[/]" : "Vanilla"); + return sb.ToString(); + } } From 798cbb069b36d1868813d6e1a1aa399a4f665ca6 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Thu, 12 Sep 2024 08:58:55 +0200 Subject: [PATCH 17/35] Bump installer version --- Installer/Installer.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installer/Installer.csproj b/Installer/Installer.csproj index 14b5c563..2939eda9 100644 --- a/Installer/Installer.csproj +++ b/Installer/Installer.csproj @@ -17,7 +17,7 @@ Sebastien Lebreton https://github.com/sailro/EscapeFromTarkov-Trainer - 3.0.0.0 + 3.1.0.0 Sebastien Lebreton From 91ded69e27316f643dc430f0b090bfb8705ff502 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Thu, 12 Sep 2024 20:43:05 +0200 Subject: [PATCH 18/35] Check if the version is supported --- Installer/Installation.cs | 6 ++++- Installer/VersionChecker.cs | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 Installer/VersionChecker.cs diff --git a/Installer/Installation.cs b/Installer/Installation.cs index cb0946d5..64a1a2e6 100644 --- a/Installer/Installation.cs +++ b/Installer/Installation.cs @@ -164,7 +164,11 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append($"{Location.EscapeMarkup()} - [[{Version}]] "); - sb.Append(UsingSptAki ? "[b]SPT-AKI[/]" : "Vanilla"); + sb.Append(UsingSptAki ? "[b]SPT-AKI[/] " : "Vanilla "); + + if (VersionChecker.IsVersionSupported(Version) && UsingSptAki) + sb.Append("[green](Supported)[/]"); + return sb.ToString(); } } diff --git a/Installer/VersionChecker.cs b/Installer/VersionChecker.cs new file mode 100644 index 00000000..3eef306a --- /dev/null +++ b/Installer/VersionChecker.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading.Tasks; +using Spectre.Console; + +namespace Installer; + +internal class VersionChecker +{ + + private static readonly Dictionary _versions = []; + + public static async Task IsVersionSupportedAsync(Version version) + { + if (_versions.TryGetValue(version, out var supported)) + return supported; + + try + { + var branch = $"dev-{version}"; + using var client = new HttpClient(); + var result = await client.GetAsync(new Uri($"https://github.com/sailro/EscapeFromTarkov-Trainer/archive/refs/heads/{branch}.zip")); + _versions[version] = result.IsSuccessStatusCode; + return _versions[version]; + } + catch (Exception e) + { +#if DEBUG + AnsiConsole.WriteException(e); +#endif + + return false; + } + } + + public static bool IsVersionSupported(Version version) + { +#pragma warning disable VSTHRD002 + return IsVersionSupportedAsync(version) + .GetAwaiter() + .GetResult(); +#pragma warning restore VSTHRD002 + } +} From fbf66166d9f4ec1aec5124a95b2922bb5ac1e420 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Thu, 12 Sep 2024 20:53:54 +0200 Subject: [PATCH 19/35] Faster branch check --- Installer/VersionChecker.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Installer/VersionChecker.cs b/Installer/VersionChecker.cs index 3eef306a..ea04ff9d 100644 --- a/Installer/VersionChecker.cs +++ b/Installer/VersionChecker.cs @@ -10,6 +10,7 @@ internal class VersionChecker { private static readonly Dictionary _versions = []; + private static readonly HttpClient _client = new(); public static async Task IsVersionSupportedAsync(Version version) { @@ -19,8 +20,8 @@ public static async Task IsVersionSupportedAsync(Version version) try { var branch = $"dev-{version}"; - using var client = new HttpClient(); - var result = await client.GetAsync(new Uri($"https://github.com/sailro/EscapeFromTarkov-Trainer/archive/refs/heads/{branch}.zip")); + var uri = new Uri($"https://github.com/sailro/EscapeFromTarkov-Trainer/tree/{branch}"); + var result = await _client.GetAsync(uri); _versions[version] = result.IsSuccessStatusCode; return _versions[version]; } From 0d219d96322e142da096c6d276ce9411e097e09d Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Fri, 13 Sep 2024 08:16:54 +0200 Subject: [PATCH 20/35] Refine implementation --- Features/Examine.cs | 2 ++ Installer/Installation.cs | 19 ++++++++++++++----- Installer/VersionChecker.cs | 17 +++++++++++++---- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/Features/Examine.cs b/Features/Examine.cs index e9408e75..f77ae6c5 100644 --- a/Features/Examine.cs +++ b/Features/Examine.cs @@ -26,6 +26,7 @@ protected static bool ExaminedPrefix(ref bool __result) return false; // skip the original code and all other prefix methods } +#pragma warning disable IDE0060 [UsedImplicitly] protected static bool SinglePlayerInventoryControllerConstructorPrefix(Player player, Profile profile, ref bool examined) { @@ -37,6 +38,7 @@ protected static bool SinglePlayerInventoryControllerConstructorPrefix(Player pl examined = true; return true; } +#pragma warning restore IDE0060 protected override void UpdateWhenEnabled() { diff --git a/Installer/Installation.cs b/Installer/Installation.cs index 64a1a2e6..56c53e00 100644 --- a/Installer/Installation.cs +++ b/Installer/Installation.cs @@ -18,6 +18,8 @@ internal class Installation public bool UsingSptAkiButNeverRun { get; private set; } public bool UsingBepInEx { get; private set; } public string Location { get; } + public string DisplayString { get; private set; } = string.Empty; + public string Data => Path.Combine(Location, "EscapeFromTarkov_Data"); public string Managed => Path.Combine(Data, "Managed"); public string BepInEx => Path.Combine(Location, "BepInEx"); @@ -58,10 +60,10 @@ public override int GetHashCode() installations = DiscoverInstallations() .Distinct() .ToList(); - }); - if (path is not null && TryDiscoverInstallation(path, out var installation)) - installations.Add(installation); + if (path is not null && TryDiscoverInstallation(path, out var installation)) + installations.Add(installation); + }); installations = [.. installations.Distinct().OrderBy(i => i.Location)]; @@ -152,6 +154,8 @@ private static bool TryDiscoverInstallation(string? path, [NotNullWhen(true)] ou installation.UsingBepInEx = Directory.Exists(installation.BepInExPlugins); + installation.DisplayString = installation.ComputeDisplayString(); + return true; } catch (IOException) @@ -160,15 +164,20 @@ private static bool TryDiscoverInstallation(string? path, [NotNullWhen(true)] ou } } - public override string ToString() + private string ComputeDisplayString() { var sb = new StringBuilder(); sb.Append($"{Location.EscapeMarkup()} - [[{Version}]] "); sb.Append(UsingSptAki ? "[b]SPT-AKI[/] " : "Vanilla "); - if (VersionChecker.IsVersionSupported(Version) && UsingSptAki) + if (UsingSptAki && VersionChecker.IsVersionSupported(Version)) sb.Append("[green](Supported)[/]"); return sb.ToString(); } + + public override string ToString() + { + return DisplayString; + } } diff --git a/Installer/VersionChecker.cs b/Installer/VersionChecker.cs index ea04ff9d..7ac4168e 100644 --- a/Installer/VersionChecker.cs +++ b/Installer/VersionChecker.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using Spectre.Console; @@ -11,19 +12,21 @@ internal class VersionChecker private static readonly Dictionary _versions = []; private static readonly HttpClient _client = new(); + private static readonly SemaphoreSlim _semaphore = new(1, 1); public static async Task IsVersionSupportedAsync(Version version) { - if (_versions.TryGetValue(version, out var supported)) - return supported; + await _semaphore.WaitAsync(); try { + if (_versions.TryGetValue(version, out var supported)) + return supported; + var branch = $"dev-{version}"; var uri = new Uri($"https://github.com/sailro/EscapeFromTarkov-Trainer/tree/{branch}"); var result = await _client.GetAsync(uri); _versions[version] = result.IsSuccessStatusCode; - return _versions[version]; } catch (Exception e) { @@ -31,8 +34,14 @@ public static async Task IsVersionSupportedAsync(Version version) AnsiConsole.WriteException(e); #endif - return false; + _versions[version] = false; + } + finally + { + _semaphore.Release(); } + + return _versions[version]; } public static bool IsVersionSupported(Version version) From de3c69830c22ebb0700eb16c5ba4bb2d41a6333a Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Mon, 16 Sep 2024 08:45:44 +0200 Subject: [PATCH 21/35] Reword --- README.md | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index dd3e8fb4..8529fc7e 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,11 @@ [![Sponsor](https://img.shields.io/badge/sponsor-%E2%9D%A4-lightgrey?logo=github&style=flat-square)](https://github.com/sponsors/sailro) -*I'm not responsible for any consequences that result from using this code. BattleState / BattlEye will ban you if you try to use it 'live'.* +*I'm not responsible for any consequences that result from using this code. BattleState / BattlEye will ban you if you try to use it 'live'. Use it safely offline with [SPT-AKI](https://sp-tarkov.com/).* ***TLDR => Use the [Universal Installer](https://github.com/sailro/EscapeFromTarkov-Trainer/releases).*** Default key for in-game GUI is `Right-Alt`. -This is an attempt -for educational purposes only- to alter a Unity game at runtime without patching the binaries (so without using [Cecil](https://github.com/jbevain/cecil) nor [Reflexil](https://github.com/sailro/reflexil)). - -`master` branch can build against `EFT 0.14.9.30626` (tested with [`spt-aki Version 3.9.8`](https://hub.sp-tarkov.com/files/file/16-spt-aki/#versions)). If you are looking for another version, see [`branches`](https://github.com/sailro/EscapeFromTarkov-Trainer/branches) and [`releases`](https://github.com/sailro/EscapeFromTarkov-Trainer/releases). +`master` branch can build against `EFT 0.14.9.30626` (tested with [`SPT-AKI Version 3.9.8`](https://hub.sp-tarkov.com/files/file/16-spt-aki/#versions)). If you are looking for another version, see [`branches`](https://github.com/sailro/EscapeFromTarkov-Trainer/branches) and [`releases`](https://github.com/sailro/EscapeFromTarkov-Trainer/releases). > If you want to compile the code yourself, make sure you cleaned-up your solution properly after upgrading your EFT/sptarkov bits (even removing `bin` and `obj` folders) and check all your references. @@ -77,26 +75,6 @@ You can Load/Save all settings using the `console` or the `GUI`. Simply use the [Universal Installer](https://github.com/sailro/EscapeFromTarkov-Trainer/releases). -## Manual installation - -You can try to compile the code yourself (you will need a recent Visual Studio, because we are using CSharp 9). You can use a precompiled release as well. - -Copy all files in your EFT directory like `C:\Battlestate Games\EFT`: - -- `EscapeFromTarkov_Data\Managed\NLog.EFT.Trainer.dll` (this is the compiled code for the trainer) -- `EscapeFromTarkov_Data\outline` (this is the dedicated shader we use to outline players [players]) - -### If you are using the Live version (you should NOT do that, you'll be detected and banned): - -Rename `EscapeFromTarkov_Data\Managed\NLog.dll.nlog-live` to `NLog.dll.nlog`. This will work only for legacy versions. Given EscapeFromTarkov `0.13.0.21531` or later prevent this trainer to be loaded using NLog configuration. It is now mandatory to use SPT-AKI/BepInEx for recent versions. - -### If you are using sptarkov (https://www.sp-tarkov.com): - -Overwrite the existing `EscapeFromTarkov_Data\Managed\NLog.dll.nlog` using `NLog.dll.nlog-sptarkov`, or update the existing file accordingly. We must include the following -`` in the `targets` section for the trainer to be loaded properly. This is for legacy versions before EscapeFromTarkov `0.13.0.21531`. - -For newer versions, copy `aki-efttrainer.dll` (this is the compiled code for the BepInEx plugin) to `BepInEx\plugins`. - ## Configuration ![console](https://user-images.githubusercontent.com/638167/149630825-7d76b102-0836-4eb9-a27f-d33fb519452f.png) From 8d12206aa238b2507d47225981b5f77fef510e36 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Tue, 17 Sep 2024 08:39:05 +0200 Subject: [PATCH 22/35] Detect SPT-AKI install locations from MUI cache --- Installer/Installation.cs | 19 ++++------- Installer/Registry.cs | 68 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 Installer/Registry.cs diff --git a/Installer/Installation.cs b/Installer/Installation.cs index 56c53e00..5753c162 100644 --- a/Installer/Installation.cs +++ b/Installer/Installation.cs @@ -6,7 +6,6 @@ using System.Linq; using System.Runtime.Versioning; using System.Text; -using Microsoft.Win32; using Spectre.Console; namespace Installer; @@ -95,18 +94,14 @@ private static IEnumerable DiscoverInstallations() if (TryDiscoverInstallation(Path.Combine(Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System))!, "SPT"), out installation)) yield return installation; - using var hive = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); - using var eft = hive.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\EscapeFromTarkov", false); - - if (eft == null) - yield break; - - var exe = eft.GetValue("DisplayIcon") as string; - if (string.IsNullOrEmpty(exe) || !File.Exists(exe)) - yield break; + // SPT-AKI locations from MUI cache + foreach (var sptpath in Registry.GetSptAkiInstallationsFromMuiCache()) + { + if (TryDiscoverInstallation(sptpath, out installation)) + yield return installation; + } - var path = Path.GetDirectoryName(exe); - if (string.IsNullOrEmpty(path) || !Directory.Exists(path)) + if (!Registry.TryGetEscapeFromTarkovInstallationPath(out var path)) yield break; if (TryDiscoverInstallation(path, out installation)) diff --git a/Installer/Registry.cs b/Installer/Registry.cs new file mode 100644 index 00000000..802b52ac --- /dev/null +++ b/Installer/Registry.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Linq; +using System.Runtime.Versioning; +using Microsoft.Win32; + +namespace Installer +{ + [SupportedOSPlatform("windows")] + internal class Registry + { + public static bool TryGetEscapeFromTarkovInstallationPath([NotNullWhen(true)] out string? installationPath) + { + installationPath = null; + + try + { + using var hive = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); + using var eft = hive.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\EscapeFromTarkov", false); + + if (eft == null) + return false; + + var exe = eft.GetValue("DisplayIcon") as string; + if (string.IsNullOrEmpty(exe) || !File.Exists(exe)) + return false; + + var path = Path.GetDirectoryName(exe); + if (string.IsNullOrEmpty(path) || !Directory.Exists(path)) + return false; + + installationPath = path; + return true; + } + catch + { + return false; + } + } + + public static IEnumerable GetSptAkiInstallationsFromMuiCache() + { + try + { + using var hive = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32); + using var mui = hive.OpenSubKey(@"Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache", false); + + if (mui == null) + return []; + + const string attribute = ".FriendlyAppName"; + string[] candidates = ["SPT.Launcher.exe", "SPT.Server.exe", "Aki.Launcher.exe"]; + + return mui + .GetValueNames() + .Where(v => candidates.Any(c => v.Contains($"{c}{attribute}", StringComparison.OrdinalIgnoreCase))) + .Select(v => Path.GetDirectoryName(v.Replace(attribute, string.Empty))) + .Distinct(); + } + catch + { + return []; + } + } + } +} From 16918564e984d0da37c86e51d0e9c2de86cfac04 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Tue, 17 Sep 2024 09:22:10 +0200 Subject: [PATCH 23/35] handle 'The variable 'e' is declared but never used' --- Installer/VersionChecker.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installer/VersionChecker.cs b/Installer/VersionChecker.cs index 7ac4168e..71d7c368 100644 --- a/Installer/VersionChecker.cs +++ b/Installer/VersionChecker.cs @@ -33,7 +33,7 @@ public static async Task IsVersionSupportedAsync(Version version) #if DEBUG AnsiConsole.WriteException(e); #endif - + _ = e; _versions[version] = false; } finally From 52f2fc40f3a4ab16d654efc27d0f2656f48a385a Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Tue, 17 Sep 2024 09:32:13 +0200 Subject: [PATCH 24/35] Bump installer version --- Installer/Installer.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installer/Installer.csproj b/Installer/Installer.csproj index 2939eda9..b3999f9c 100644 --- a/Installer/Installer.csproj +++ b/Installer/Installer.csproj @@ -17,7 +17,7 @@ Sebastien Lebreton https://github.com/sailro/EscapeFromTarkov-Trainer - 3.1.0.0 + 3.2.0.0 Sebastien Lebreton From f7e284737ec3dfefbe80b521991aa66e61d9c63b Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Mon, 23 Sep 2024 19:37:13 +0200 Subject: [PATCH 25/35] Minor fixes --- Installer/VersionChecker.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Installer/VersionChecker.cs b/Installer/VersionChecker.cs index 71d7c368..3d8ce2f7 100644 --- a/Installer/VersionChecker.cs +++ b/Installer/VersionChecker.cs @@ -3,7 +3,6 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Spectre.Console; namespace Installer; @@ -31,7 +30,7 @@ public static async Task IsVersionSupportedAsync(Version version) catch (Exception e) { #if DEBUG - AnsiConsole.WriteException(e); + Spectre.Console.AnsiConsole.WriteException(e); #endif _ = e; _versions[version] = false; From 532768daab926f0c3ed3cac07c1bd849dfbd407d Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Wed, 25 Sep 2024 20:42:33 +0200 Subject: [PATCH 26/35] Add extra setup for spawned items --- ConsoleCommands/Spawn.cs | 38 ++++++++++++++++++++++++++++++++++++-- KnownTemplateIds.cs | 2 ++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/ConsoleCommands/Spawn.cs b/ConsoleCommands/Spawn.cs index 6bb7781f..b257ff2b 100644 --- a/ConsoleCommands/Spawn.cs +++ b/ConsoleCommands/Spawn.cs @@ -10,7 +10,6 @@ using EFT.Trainer.Features; using EFT.Trainer.Properties; using JetBrains.Annotations; -using UnityEngine; using Random = UnityEngine.Random; #nullable enable @@ -87,7 +86,7 @@ private static void SpawnTemplate(ItemTemplate template, Player player, ConsoleC } else { - item.SpawnedInSession = true; // found in raid + SetupItem(itemFactory, item); _ = new TraderControllerClass(item, item.Id, item.ShortName); var go = poolManager.CreateLootPrefab(item, ECameraType.Default); @@ -110,4 +109,39 @@ private static void SpawnTemplate(ItemTemplate template, Player player, ConsoleC return Task.CompletedTask; }); } + + private static void SetupItem(ItemFactoryClass itemFactory, Item item) + { + item.SpawnedInSession = true; // found in raid + + if (item.TryGetItemComponent(out var dogtag)) + { + dogtag.AccountId = Random.Range(0, int.MaxValue).ToString(); + dogtag.ProfileId = Random.Range(0, int.MaxValue).ToString(); + dogtag.Nickname = $"Rambo{Random.Range(1, 256)}"; + dogtag.Side = Enum.GetValues(typeof(EPlayerSide)).Cast().Random(); + dogtag.Level = Random.Range(1, 69); + dogtag.Time = DateTime.Now; + dogtag.Status = "died"; + dogtag.KillerAccountId = Random.Range(0, int.MaxValue).ToString(); + dogtag.KillerProfileId = Random.Range(0, int.MaxValue).ToString(); + dogtag.KillerName = ""; + dogtag.WeaponName = ""; + } + + if (item.TryGetItemComponent(out var armorHolder)) + { + foreach (var slot in armorHolder.ArmorSlots) + { + var plate = itemFactory.CreateItem(MongoID.Generate(), KnownTemplateIds.CultTermiteBallisticPlate, null); + slot.AddWithoutRestrictions(plate); + } + } + + if (item.TryGetItemComponent(out var repairable)) + { + repairable.MaxDurability = repairable.TemplateDurability; + repairable.Durability = repairable.MaxDurability; + } + } } diff --git a/KnownTemplateIds.cs b/KnownTemplateIds.cs index 27a4449f..45750dd2 100644 --- a/KnownTemplateIds.cs +++ b/KnownTemplateIds.cs @@ -18,5 +18,7 @@ public static class KnownTemplateIds public const string AirDropSupply = "622334fa3136504a544d160c"; public const string AirDropWeapon = "6223351bb5d97a7b2c635ca7"; + public const string CultTermiteBallisticPlate = "656fa99800d62bcd2e024088"; + public static string DefaultInventoryLocalizedShortName = ((MongoID)DefaultInventory).LocalizedShortName(); } From fa1c0f29fe8cfc9664620b323cdcdafa8cde7793 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Fri, 27 Sep 2024 11:33:08 +0200 Subject: [PATCH 27/35] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8529fc7e..9af0d248 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ***TLDR => Use the [Universal Installer](https://github.com/sailro/EscapeFromTarkov-Trainer/releases).*** Default key for in-game GUI is `Right-Alt`. -`master` branch can build against `EFT 0.14.9.30626` (tested with [`SPT-AKI Version 3.9.8`](https://hub.sp-tarkov.com/files/file/16-spt-aki/#versions)). If you are looking for another version, see [`branches`](https://github.com/sailro/EscapeFromTarkov-Trainer/branches) and [`releases`](https://github.com/sailro/EscapeFromTarkov-Trainer/releases). +`master` branch can build against `EFT 0.15.2.32678` (tested with [`SPT-AKI Version 3.10.0`](https://hub.sp-tarkov.com/files/file/16-spt-aki/#versions)). If you are looking for another version, see [`branches`](https://github.com/sailro/EscapeFromTarkov-Trainer/branches) and [`releases`](https://github.com/sailro/EscapeFromTarkov-Trainer/releases). > If you want to compile the code yourself, make sure you cleaned-up your solution properly after upgrading your EFT/sptarkov bits (even removing `bin` and `obj` folders) and check all your references. From bb59f457e7590c8b0fba282d038598d059338888 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Fri, 27 Sep 2024 20:05:26 +0200 Subject: [PATCH 28/35] Triggers a mortar strike at the player's location --- Features/Mortar.cs | 30 ++++++++++++++++++++++++++++++ NLog.EFT.Trainer.csproj | 1 + Properties/Strings.Designer.cs | 18 ++++++++++++++++++ Properties/Strings.fr.resx | 6 ++++++ Properties/Strings.resx | 6 ++++++ Properties/Strings.zh-cn.resx | 6 ++++++ README.md | 1 + 7 files changed, 68 insertions(+) create mode 100644 Features/Mortar.cs diff --git a/Features/Mortar.cs b/Features/Mortar.cs new file mode 100644 index 00000000..5c9cbddf --- /dev/null +++ b/Features/Mortar.cs @@ -0,0 +1,30 @@ +using Comfort.Common; +using EFT.Trainer.Properties; +using JetBrains.Annotations; +using UnityEngine; + +#nullable enable + +namespace EFT.Trainer.Features; + +[UsedImplicitly] +internal class Mortar : TriggerFeature +{ + public override string Name => Strings.FeatureMortarName; + public override string Description => Strings.FeatureMortarDescription; + + public override KeyCode Key { get; set; } = KeyCode.None; + + protected override void UpdateOnceWhenTriggered() + { + var world = Singleton.Instance; + if (world == null) + return; + + var player = GameState.Current?.LocalPlayer; + if (player == null) + return; + + world.ServerShellingController?.StartShellingPosition(player.Transform.position); + } +} diff --git a/NLog.EFT.Trainer.csproj b/NLog.EFT.Trainer.csproj index 7afa37f8..00bc9f8a 100644 --- a/NLog.EFT.Trainer.csproj +++ b/NLog.EFT.Trainer.csproj @@ -202,6 +202,7 @@ + diff --git a/Properties/Strings.Designer.cs b/Properties/Strings.Designer.cs index a4bec5c3..9c149837 100644 --- a/Properties/Strings.Designer.cs +++ b/Properties/Strings.Designer.cs @@ -1124,6 +1124,24 @@ internal static string FeatureMapName { } } + /// + /// Looks up a localized string similar to Triggers a mortar strike at the player's location.. + /// + internal static string FeatureMortarDescription { + get { + return ResourceManager.GetString("FeatureMortarDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to mortar. + /// + internal static string FeatureMortarName { + get { + return ResourceManager.GetString("FeatureMortarName", resourceCulture); + } + } + /// /// Looks up a localized string similar to Night vision.. /// diff --git a/Properties/Strings.fr.resx b/Properties/Strings.fr.resx index b0f9977e..bc05e793 100644 --- a/Properties/Strings.fr.resx +++ b/Properties/Strings.fr.resx @@ -949,4 +949,10 @@ Les couleurs sont stockées sous la forme d'un tableau de valeurs flottantes 'RG Pas d'effet de flash persistant ou de brûlure oculaire après une grenade flash. + + mortar + + + Déclenche une attaque de mortier à l'endroit où se trouve le joueur. + \ No newline at end of file diff --git a/Properties/Strings.resx b/Properties/Strings.resx index 025794cf..fb5f2fb4 100644 --- a/Properties/Strings.resx +++ b/Properties/Strings.resx @@ -949,4 +949,10 @@ Colors are stored as an array of 'RGBA' floats No persistent flash or eye-burn effect after a flash grenade. + + mortar + + + Triggers a mortar strike at the player's location. + \ No newline at end of file diff --git a/Properties/Strings.zh-cn.resx b/Properties/Strings.zh-cn.resx index 9afa7939..c82917a9 100644 --- a/Properties/Strings.zh-cn.resx +++ b/Properties/Strings.zh-cn.resx @@ -950,4 +950,10 @@ 闪光弹爆炸后不会产生持续闪光或灼伤眼睛的效果。 + + 灰浆 + + + 触发对玩家所在位置的迫击炮攻击。 + \ No newline at end of file diff --git a/README.md b/README.md index 9af0d248..fa0a28c7 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ | `LootableContainers` | `stash` | Hidden/special stashes like buried barrels, ground caches, air drops or corpses. | | `LootItems` | `loot` | List all lootable items and track any item by name or rarity or in-game wishlist in raid (even in containers and corpses). | | `Map` | `map` | Full screen map with radar esp. | +| `Mortar` | `mortar` | Triggers a mortar strike at the player's location. | | `NightVision` | `night` | Night vision. | | `NoCollision` | `nocoll` | No physical collisions, making you immune to bullets, grenades and barbed wires. | | `NoFlash` | `noflash` | No persistent flash or eye-burn effect after a flash grenade. | From 21da983af5019fa3ea02978c9485180258e0f62a Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Sun, 29 Sep 2024 19:43:23 +0200 Subject: [PATCH 29/35] Improve spawn --- ConsoleCommands/Spawn.cs | 38 +++++++++++++++++++++++++++++--------- KnownTemplateIds.cs | 2 -- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/ConsoleCommands/Spawn.cs b/ConsoleCommands/Spawn.cs index b257ff2b..846baff6 100644 --- a/ConsoleCommands/Spawn.cs +++ b/ConsoleCommands/Spawn.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; @@ -86,8 +87,6 @@ private static void SpawnTemplate(ItemTemplate template, Player player, ConsoleC } else { - SetupItem(itemFactory, item); - _ = new TraderControllerClass(item, item.Id, item.ShortName); var go = poolManager.CreateLootPrefab(item, ECameraType.Default); @@ -102,6 +101,9 @@ private static void SpawnTemplate(ItemTemplate template, Player player, ConsoleC lootItem.transform.SetPositionAndRotation(position, transform.rotation); lootItem.LastOwner = player; + + // setup after loot item is created, else we are hitting issues with weapon + SetupItem(itemFactory, item); } } }); @@ -130,18 +132,36 @@ private static void SetupItem(ItemFactoryClass itemFactory, Item item) } if (item.TryGetItemComponent(out var armorHolder)) - { - foreach (var slot in armorHolder.ArmorSlots) - { - var plate = itemFactory.CreateItem(MongoID.Generate(), KnownTemplateIds.CultTermiteBallisticPlate, null); - slot.AddWithoutRestrictions(plate); - } - } + FillSlots(itemFactory, armorHolder.ArmorSlots); if (item.TryGetItemComponent(out var repairable)) { repairable.MaxDurability = repairable.TemplateDurability; repairable.Durability = repairable.MaxDurability; } + + if (item is CompoundItem compound) + FillSlots(itemFactory, compound.AllSlots); + } + + private static void FillSlots(ItemFactoryClass itemFactory, IEnumerable slots) + { + foreach (var slot in slots) + { + if (slot.Items.Any()) + continue; + + var filter = slot + .Filters.FirstOrDefault()? + .Filter.Random(); + + if (filter == null) + continue; + + var item = itemFactory.CreateItem(MongoID.Generate(), filter, null); + SetupItem(itemFactory, item); + + slot.AddWithoutRestrictions(item); + } } } diff --git a/KnownTemplateIds.cs b/KnownTemplateIds.cs index 45750dd2..27a4449f 100644 --- a/KnownTemplateIds.cs +++ b/KnownTemplateIds.cs @@ -18,7 +18,5 @@ public static class KnownTemplateIds public const string AirDropSupply = "622334fa3136504a544d160c"; public const string AirDropWeapon = "6223351bb5d97a7b2c635ca7"; - public const string CultTermiteBallisticPlate = "656fa99800d62bcd2e024088"; - public static string DefaultInventoryLocalizedShortName = ((MongoID)DefaultInventory).LocalizedShortName(); } From f115e222107b1fbbb98d259379bcd5403fcba882 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Mon, 30 Sep 2024 18:22:52 +0200 Subject: [PATCH 30/35] Triggers an airdrop at the player's location --- ConsoleCommands/BaseTemplateCommand.cs | 24 ------------------ ConsoleCommands/Spawn.cs | 4 +-- ConsoleCommands/Template.cs | 3 ++- Features/AirDrop.cs | 35 ++++++++++++++++++++++++++ Features/TemplateHelper.cs | 32 +++++++++++++++++++++++ KnownTemplateIds.cs | 2 ++ NLog.EFT.Trainer.csproj | 2 ++ Properties/Strings.Designer.cs | 18 +++++++++++++ Properties/Strings.fr.resx | 6 +++++ Properties/Strings.resx | 6 +++++ Properties/Strings.zh-cn.resx | 6 +++++ README.md | 1 + 12 files changed, 112 insertions(+), 27 deletions(-) create mode 100644 Features/AirDrop.cs create mode 100644 Features/TemplateHelper.cs diff --git a/ConsoleCommands/BaseTemplateCommand.cs b/ConsoleCommands/BaseTemplateCommand.cs index 7d0a76ce..e20d1f30 100644 --- a/ConsoleCommands/BaseTemplateCommand.cs +++ b/ConsoleCommands/BaseTemplateCommand.cs @@ -1,9 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using Comfort.Common; -using EFT.InventoryLogic; - #nullable enable namespace EFT.Trainer.ConsoleCommands; @@ -11,25 +8,4 @@ namespace EFT.Trainer.ConsoleCommands; internal abstract class BaseTemplateCommand : ConsoleCommandWithArgument { public override string Pattern => RequiredArgumentPattern; - - protected static ItemTemplate[] FindTemplates(string searchShortNameOrTemplateId) - { - if (!Singleton.Instantiated) - return []; - - var templates = Singleton - .Instance - .ItemTemplates; - - // Match by TemplateId - if (templates.TryGetValue(searchShortNameOrTemplateId, out var template)) - return [template]; - - // Match by short name(s) - return templates - .Values - .Where(t => t.ShortNameLocalizationKey.Localized().IndexOf(searchShortNameOrTemplateId, StringComparison.OrdinalIgnoreCase) >= 0 - || t.NameLocalizationKey.Localized().IndexOf(searchShortNameOrTemplateId, StringComparison.OrdinalIgnoreCase) >= 0) - .ToArray(); - } } diff --git a/ConsoleCommands/Spawn.cs b/ConsoleCommands/Spawn.cs index 846baff6..0b2861a0 100644 --- a/ConsoleCommands/Spawn.cs +++ b/ConsoleCommands/Spawn.cs @@ -33,7 +33,7 @@ public override void Execute(Match match) return; var search = matchGroup.Value; - var templates = FindTemplates(search); + var templates = TemplateHelper.FindTemplates(search); switch (templates.Length) { @@ -54,7 +54,7 @@ public override void Execute(Match match) internal static void SpawnTemplate(string template, Player player, ConsoleCommand command, Func filter) { - var result = FindTemplates(template) + var result = TemplateHelper.FindTemplates(template) .FirstOrDefault(filter); if (result == null) diff --git a/ConsoleCommands/Template.cs b/ConsoleCommands/Template.cs index 8019c99d..c19ca8bd 100644 --- a/ConsoleCommands/Template.cs +++ b/ConsoleCommands/Template.cs @@ -2,6 +2,7 @@ using System.Text.RegularExpressions; using Comfort.Common; using EFT.Trainer.Extensions; +using EFT.Trainer.Features; using EFT.Trainer.Properties; using JetBrains.Annotations; @@ -25,7 +26,7 @@ public override void Execute(Match match) var search = matchGroup.Value; - var templates = FindTemplates(search).ToArray(); + var templates = TemplateHelper.FindTemplates(search); foreach (var template in templates) AddConsoleLog(string.Format(Strings.CommandTemplateEnumerateFormat, template._id, template.ShortNameLocalizationKey.Localized().Green(), template.NameLocalizationKey.Localized())); diff --git a/Features/AirDrop.cs b/Features/AirDrop.cs new file mode 100644 index 00000000..cc49cc7c --- /dev/null +++ b/Features/AirDrop.cs @@ -0,0 +1,35 @@ +using System.Linq; +using Comfort.Common; +using EFT.InventoryLogic; +using EFT.Trainer.Properties; +using JetBrains.Annotations; +using UnityEngine; + +#nullable enable + +namespace EFT.Trainer.Features; + +[UsedImplicitly] +internal class AirDrop : TriggerFeature +{ + public override string Name => Strings.FeatureAirDropName; + public override string Description => Strings.FeatureAirDropDescription; + + public override KeyCode Key { get; set; } = KeyCode.None; + + protected override void UpdateOnceWhenTriggered() + { + var world = Singleton.Instance; + if (world == null) + return; + + var player = GameState.Current?.LocalPlayer; + if (player == null) + return; + + if (TemplateHelper.FindTemplates(KnownTemplateIds.RedSignalFlare).FirstOrDefault() is not AmmoTemplate template) + return; + + player.HandleFlareSuccessEvent(player.Transform.position, template); + } +} diff --git a/Features/TemplateHelper.cs b/Features/TemplateHelper.cs new file mode 100644 index 00000000..59eba5fb --- /dev/null +++ b/Features/TemplateHelper.cs @@ -0,0 +1,32 @@ +using System; +using System.Linq; +using Comfort.Common; +using EFT.InventoryLogic; + +#nullable enable + +namespace EFT.Trainer.Features; + +internal class TemplateHelper +{ + internal static ItemTemplate[] FindTemplates(string searchShortNameOrTemplateId) + { + if (!Singleton.Instantiated) + return []; + + var templates = Singleton + .Instance + .ItemTemplates; + + // Match by TemplateId + if (templates.TryGetValue(searchShortNameOrTemplateId, out var template)) + return [template]; + + // Match by short name(s) + return templates + .Values + .Where(t => t.ShortNameLocalizationKey.Localized().IndexOf(searchShortNameOrTemplateId, StringComparison.OrdinalIgnoreCase) >= 0 + || t.NameLocalizationKey.Localized().IndexOf(searchShortNameOrTemplateId, StringComparison.OrdinalIgnoreCase) >= 0) + .ToArray(); + } +} diff --git a/KnownTemplateIds.cs b/KnownTemplateIds.cs index 27a4449f..5ffcfd35 100644 --- a/KnownTemplateIds.cs +++ b/KnownTemplateIds.cs @@ -18,5 +18,7 @@ public static class KnownTemplateIds public const string AirDropSupply = "622334fa3136504a544d160c"; public const string AirDropWeapon = "6223351bb5d97a7b2c635ca7"; + public const string RedSignalFlare = "624c09cfbc2e27219346d955"; + public static string DefaultInventoryLocalizedShortName = ((MongoID)DefaultInventory).LocalizedShortName(); } diff --git a/NLog.EFT.Trainer.csproj b/NLog.EFT.Trainer.csproj index 00bc9f8a..c6090c70 100644 --- a/NLog.EFT.Trainer.csproj +++ b/NLog.EFT.Trainer.csproj @@ -164,6 +164,7 @@ + @@ -199,6 +200,7 @@ + diff --git a/Properties/Strings.Designer.cs b/Properties/Strings.Designer.cs index 9c149837..d291332d 100644 --- a/Properties/Strings.Designer.cs +++ b/Properties/Strings.Designer.cs @@ -692,6 +692,24 @@ internal static string FeatureAimbotName { } } + /// + /// Looks up a localized string similar to Triggers an airdrop at the player's location.. + /// + internal static string FeatureAirDropDescription { + get { + return ResourceManager.GetString("FeatureAirDropDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to airdrop. + /// + internal static string FeatureAirDropName { + get { + return ResourceManager.GetString("FeatureAirDropName", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unlimited ammo.. /// diff --git a/Properties/Strings.fr.resx b/Properties/Strings.fr.resx index bc05e793..825bdd35 100644 --- a/Properties/Strings.fr.resx +++ b/Properties/Strings.fr.resx @@ -955,4 +955,10 @@ Les couleurs sont stockées sous la forme d'un tableau de valeurs flottantes 'RG Déclenche une attaque de mortier à l'endroit où se trouve le joueur. + + airdrop + + + Déclenche un largage aérien à l'endroit où se trouve le joueur. + \ No newline at end of file diff --git a/Properties/Strings.resx b/Properties/Strings.resx index fb5f2fb4..71efdc5c 100644 --- a/Properties/Strings.resx +++ b/Properties/Strings.resx @@ -955,4 +955,10 @@ Colors are stored as an array of 'RGBA' floats Triggers a mortar strike at the player's location. + + airdrop + + + Triggers an airdrop at the player's location. + \ No newline at end of file diff --git a/Properties/Strings.zh-cn.resx b/Properties/Strings.zh-cn.resx index c82917a9..575d3090 100644 --- a/Properties/Strings.zh-cn.resx +++ b/Properties/Strings.zh-cn.resx @@ -956,4 +956,10 @@ 触发对玩家所在位置的迫击炮攻击。 + + 空投 + + + 触发玩家所在位置的空投。 + \ No newline at end of file diff --git a/README.md b/README.md index fa0a28c7..cc0228f8 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ | trainer.ini section | GUI/console | Description | |---------------------------|--------------|-------------| | `Aimbot` | `aimbot` | Aimbot (distance, smoothness, silent aim with speed factor and shot delay, fov radius, fov circle). | +| `AirDrop` | `airdrop` | Triggers an airdrop at the player's location. | | `Ammunition` | `ammo` | Unlimited ammo. | | `AutomaticGun` | `autogun` | Force all guns (even bolt action guns) to use automatic firing mode with customizable fire rate. | | `Commands` | `commands` | Popup window to enable/disable all features (use right-alt or setup your own key in [trainer.ini](#sample-trainerini-configuration-file)). | From 0ed1cabe392819034e02b974c188dfee104d9628 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Mon, 30 Sep 2024 18:24:30 +0200 Subject: [PATCH 31/35] Simplify --- Features/AirDrop.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Features/AirDrop.cs b/Features/AirDrop.cs index cc49cc7c..f3e95605 100644 --- a/Features/AirDrop.cs +++ b/Features/AirDrop.cs @@ -19,10 +19,6 @@ internal class AirDrop : TriggerFeature protected override void UpdateOnceWhenTriggered() { - var world = Singleton.Instance; - if (world == null) - return; - var player = GameState.Current?.LocalPlayer; if (player == null) return; From e0f6c0dd4bf7949e7925d5157472ee8ee1bd06c1 Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Mon, 30 Sep 2024 18:35:36 +0200 Subject: [PATCH 32/35] Comment is now incorrect --- KnownTemplateIds.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/KnownTemplateIds.cs b/KnownTemplateIds.cs index 5ffcfd35..ba306ef1 100644 --- a/KnownTemplateIds.cs +++ b/KnownTemplateIds.cs @@ -12,7 +12,6 @@ public static class KnownTemplateIds public const string DefaultInventory = "55d7217a4bdc2d86028b456d"; public const string BossContainer = "5c0a794586f77461c458f892"; - //air drop id. After testing, only the common one is used even the air drop is the other type. public const string AirDropCommon = "6223349b3136504a544d1608"; public const string AirDropMedical = "622334c873090231d904a9fc"; public const string AirDropSupply = "622334fa3136504a544d160c"; From 78eaa8ee52e64037628bee1af3a1199560cc9fcb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:20:54 +0000 Subject: [PATCH 33/35] Bump Microsoft.CodeAnalysis.Analyzers in the roslyn group Bumps the roslyn group with 1 update: [Microsoft.CodeAnalysis.Analyzers](https://github.com/dotnet/roslyn-analyzers). Updates `Microsoft.CodeAnalysis.Analyzers` from 3.3.4 to 3.11.0 - [Release notes](https://github.com/dotnet/roslyn-analyzers/releases) - [Changelog](https://github.com/dotnet/roslyn-analyzers/blob/main/PostReleaseActivities.md) - [Commits](https://github.com/dotnet/roslyn-analyzers/commits) --- updated-dependencies: - dependency-name: Microsoft.CodeAnalysis.Analyzers dependency-type: direct:production update-type: version-update:semver-minor dependency-group: roslyn ... Signed-off-by: dependabot[bot] --- Installer/Installer.csproj | 2 +- NLog.EFT.Trainer.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Installer/Installer.csproj b/Installer/Installer.csproj index 14b5c563..57a075ae 100644 --- a/Installer/Installer.csproj +++ b/Installer/Installer.csproj @@ -22,7 +22,7 @@ - + diff --git a/NLog.EFT.Trainer.csproj b/NLog.EFT.Trainer.csproj index 6efbaf83..300bbb3f 100644 --- a/NLog.EFT.Trainer.csproj +++ b/NLog.EFT.Trainer.csproj @@ -236,7 +236,7 @@ - + From 1c6773fc0100595e81009fa7a5d28da846cc3dbc Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Thu, 24 Oct 2024 14:37:00 +0200 Subject: [PATCH 34/35] Fix translation --- Properties/Strings.zh-cn.resx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Properties/Strings.zh-cn.resx b/Properties/Strings.zh-cn.resx index 575d3090..e7568e69 100644 --- a/Properties/Strings.zh-cn.resx +++ b/Properties/Strings.zh-cn.resx @@ -939,7 +939,7 @@ spawnqi - 跟踪汽车愿望清单 + 自动跟踪愿望单 spawnhi From 9f80c94ec68e8fd836304660fa20667a91219a6c Mon Sep 17 00:00:00 2001 From: Sebastien Lebreton Date: Thu, 24 Oct 2024 14:49:35 +0200 Subject: [PATCH 35/35] Enable IAmDevShowMeLogs --- Features/Commands.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Features/Commands.cs b/Features/Commands.cs index 9af1b99d..4cb923d0 100644 --- a/Features/Commands.cs +++ b/Features/Commands.cs @@ -42,6 +42,10 @@ protected override void Update() if (!PreloaderUI.Instantiated) return; +#if DEBUG + ConsoleScreen.IAmDevShowMeLogs = true; +#endif + RegisterPropertyDisplays(); RegisterCommands(); }