From 167f53e2dfada206460c250f476077400c6f1097 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Mon, 28 Apr 2025 21:35:41 +0800 Subject: [PATCH] tech unlock fix --- UXAssist/Functions/TechFunctions.cs | 10 +++++----- UXAssist/Patches/TechPatch.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/UXAssist/Functions/TechFunctions.cs b/UXAssist/Functions/TechFunctions.cs index 0cc271a..fcd4086 100644 --- a/UXAssist/Functions/TechFunctions.cs +++ b/UXAssist/Functions/TechFunctions.cs @@ -184,17 +184,17 @@ public static class TechFunctions techProtos.Add(techProto); } } - UnlockProtoWithMetadataAndPrompt([.. techProtos], false); + UnlockProtoWithMetadataAndPrompt([.. techProtos], 16, false); } - public static void UnlockProtoWithMetadataAndPrompt(TechProto[] techProtos, bool withPrerequisites = true) + public static void UnlockProtoWithMetadataAndPrompt(TechProto[] techProtos, int toLevel, bool withPrerequisites = true) { var techList = new List>(); var properties = new SortedList(); var history = GameMain.history; foreach (var techProto in techProtos) { - CheckTechUnlockProperties(history, techProto, properties, techList, -1, withPrerequisites); + CheckTechUnlockProperties(history, techProto, properties, techList, toLevel, withPrerequisites); } var propertySystem = DSPGame.propertySystem; var clusterSeedKey = history.gameData.GetClusterSeedKey(); @@ -207,7 +207,7 @@ public static class TechFunctions } if (!enough) { - UIRealtimeTip.Popup("元数据不足".Translate(), true, 0); + UIMessageBox.Show("元数据".Translate(), "元数据不足".Translate(), "确定".Translate(), 3); return; } @@ -286,7 +286,7 @@ public static class TechFunctions } foreach (var techProto in techProtos) { - UnlockTechImmediately(techProto, -1, withPrerequisites); + UnlockTechImmediately(techProto, toLevel, withPrerequisites); } history.VarifyTechQueue(); if (history.currentTech != history.techQueue[0]) diff --git a/UXAssist/Patches/TechPatch.cs b/UXAssist/Patches/TechPatch.cs index 07c4f45..e1cbdc8 100644 --- a/UXAssist/Patches/TechPatch.cs +++ b/UXAssist/Patches/TechPatch.cs @@ -288,7 +288,7 @@ public static class TechPatch } var techProto = __instance.techProto; if (techProto == null) return false; - Functions.TechFunctions.UnlockProtoWithMetadataAndPrompt([techProto], true); + Functions.TechFunctions.UnlockProtoWithMetadataAndPrompt([techProto], -1, true); return false; } }