diff --git a/GalacticScale2/Scripts/Bootstrap.cs b/GalacticScale2/Scripts/Bootstrap.cs index 2369362b..110b5266 100644 --- a/GalacticScale2/Scripts/Bootstrap.cs +++ b/GalacticScale2/Scripts/Bootstrap.cs @@ -20,7 +20,7 @@ public partial class GS2 [BepInDependency(NebulaAPI.NebulaModAPI.API_GUID)] public class Bootstrap : BaseUnityPlugin { - public const string VERSION = "2.2.0.25"; + public const string VERSION = "2.2.0.26"; public new static ManualLogSource Logger; diff --git a/GalacticScale2/Scripts/GalacticScale2.0/Init.cs b/GalacticScale2/Scripts/GalacticScale2.0/Init.cs index 3452cf98..b6e16690 100644 --- a/GalacticScale2/Scripts/GalacticScale2.0/Init.cs +++ b/GalacticScale2/Scripts/GalacticScale2.0/Init.cs @@ -121,6 +121,7 @@ public static void Init() if (File.Exists(Path.Combine(AssemblyPath, "icon.png"))) { + if (ActiveGenerator != null && ActiveGenerator.GUID == "space.customizing.generators.vanilla") updateMessage += "Note: Settings for this mod are in the settings menu. Make sure to change the Generator to get the full Galactic Scale experience.\r\n"; updateMessage += "Update Detected. Please do not save over existing saves \r\nuntil you are sure you can load saves saved with this version!\r\nPlease Click GS2 Help and click the link to join our community on discord for preview builds and to help shape the mod going forward".Translate(); File.Delete(Path.Combine(AssemblyPath, "icon.png")); updateMessage += "The latest DSP update has added additional planet themes which are yet to be included in GS2. \r\nI'm working on getting them added to the GS2 themeset, as well as implementing their new subtheme system"; diff --git a/GalacticScale2/Scripts/GalacticScale2.0/Patches/-Debug/Debug.cs b/GalacticScale2/Scripts/GalacticScale2.0/Patches/-Debug/Debug.cs index cb0075d5..ca2fa74c 100644 --- a/GalacticScale2/Scripts/GalacticScale2.0/Patches/-Debug/Debug.cs +++ b/GalacticScale2/Scripts/GalacticScale2.0/Patches/-Debug/Debug.cs @@ -6,8 +6,76 @@ namespace GalacticScale { + public class PatchOnWhatever { + [HarmonyPrefix, HarmonyPatch(typeof(PlanetData), "AddHeightMapModLevel")] + public static bool AddHeightMapModLevel(int index, int level, PlanetData __instance) + { + if (__instance.data.AddModLevel(index, level)) + { + int num = __instance.precision / __instance.segment; + int num2 = index % __instance.data.stride; + int num3 = index / __instance.data.stride; + int num4 = ((num2 < __instance.data.substride) ? 0 : 1) + ((num3 < __instance.data.substride) ? 0 : 2); + int num5 = num2 % __instance.data.substride; + int num6 = num3 % __instance.data.substride; + int num7 = (num5 - 1) / num; + int num8 = (num6 - 1) / num; + int num9 = num5 / num; + int num10 = num6 / num; + if (num9 >= __instance.segment) + { + num9 = __instance.segment - 1; + } + if (num10 >= __instance.segment) + { + num10 = __instance.segment - 1; + } + int num11 = num4 * __instance.segment * __instance.segment; + int num12 = num7 + num8 * __instance.segment + num11; + int num13 = num9 + num8 * __instance.segment + num11; + int num14 = num7 + num10 * __instance.segment + num11; + int num15 = num9 + num10 * __instance.segment + num11; + num12 = Mathf.Clamp(num12, 0, 99); + num13 = Mathf.Clamp(num13, 0, 99); + num14 = Mathf.Clamp(num14, 0, 99); + num15 = Mathf.Clamp(num15, 0, 99); + __instance.dirtyFlags[num12] = true; + __instance.dirtyFlags[num13] = true; + __instance.dirtyFlags[num14] = true; + __instance.dirtyFlags[num15] = true; + } + + return false; + } + + [HarmonyPostfix, HarmonyPatch(typeof(BuildTool_Inserter), "CheckBuildConditions")] + public static void BuildToolInserter(BuildTool_Inserter __instance, ref bool __result) + { + if (__instance.buildPreviews.Count == 0) + { + return; + } + // if (__instance.buildPreviews == null) return; + var preview = __instance.buildPreviews[0]; + // GS2.Warn(preview?.condition.ToString()); + + if (__instance.planet.realRadius < 20) + { + if (preview.condition == EBuildCondition.TooSkew) + { + preview.condition = EBuildCondition.Ok; + // GS2.Warn("TooSkew"); + __instance.cursorValid = true; // Prevent red text + __result = true; // Override the build condition check + UICursor.SetCursor(ECursor.Default); // Get rid of that ban cursor + __instance.actionBuild.model.cursorText = "Click to build"; + __instance.actionBuild.model.cursorState = 0; + } + } + } + [HarmonyPrefix, HarmonyPatch(typeof(UILoadGameWindow), "_OnOpen")] public static bool UILoadGameWindow_OnOpen() { diff --git a/GalacticScale2/Scripts/GalacticScale2.0/Patches/BuildTool_Click/CheckBuildConditions.cs b/GalacticScale2/Scripts/GalacticScale2.0/Patches/BuildTool_Click/CheckBuildConditions.cs index 78ec45cb..aac34e8e 100644 --- a/GalacticScale2/Scripts/GalacticScale2.0/Patches/BuildTool_Click/CheckBuildConditions.cs +++ b/GalacticScale2/Scripts/GalacticScale2.0/Patches/BuildTool_Click/CheckBuildConditions.cs @@ -20,5 +20,7 @@ public static IEnumerable Transpiler(IEnumerable 200) + { + var diff = __instance.planet.realRadius - 200; + var mod = diff / 300f; + modifier *= (1 + mod); + } num *= (modifier + 1f); __result = num; return false; diff --git a/GalacticScale2/Scripts/GalacticScale2.0/Patches/UIGameLoadingSplash/Update.cs b/GalacticScale2/Scripts/GalacticScale2.0/Patches/UIGameLoadingSplash/Update.cs index c406c108..cb46f337 100644 --- a/GalacticScale2/Scripts/GalacticScale2.0/Patches/UIGameLoadingSplash/Update.cs +++ b/GalacticScale2/Scripts/GalacticScale2.0/Patches/UIGameLoadingSplash/Update.cs @@ -12,14 +12,20 @@ public static void Update(ref Text ___promptText) var status = "WARNING - Galactic Scale savegames can be broken by updates.Read the FAQ @ http://customizing.space\r\n".Translate(); if (GameMain.localStar != null && !GameMain.localStar.loaded) status += "Loading Planets: ".Translate(); + // GS2.Warn("A"); status += $"{HandleLocalStarPlanets.GetStarLoadingStatus(GameMain.localStar)}"; - if (HandleLocalStarPlanets.GetLoadedPlanetCount(GameMain.localStar) >= GameMain.localStar.planets.Length || GS2.Vanilla) return; - var loadingPlanet = GameMain.localStar.planets[HandleLocalStarPlanets.GetLoadedPlanetCount(GameMain.localStar)]; - status += $" {loadingPlanet.name} a {loadingPlanet.realRadius} Radius {GS2.GetGSPlanet(loadingPlanet).GsTheme.Name} "; - if (loadingPlanet.orbitAroundPlanet != null) status += "Moon " ; + // GS2.Warn("B"); + if (GameMain.localStar != null && HandleLocalStarPlanets.GetLoadedPlanetCount(GameMain.localStar) >= GameMain.localStar.planets.Length || GS2.Vanilla) return; + // GS2.Warn("C"); + var loadingPlanet = GameMain.localStar?.planets[HandleLocalStarPlanets.GetLoadedPlanetCount(GameMain.localStar)]; + // GS2.Warn("D"); + status += $" {loadingPlanet?.name}, a size {loadingPlanet?.realRadius} {GS2.GetGSPlanet(loadingPlanet)?.GsTheme?.DisplayName} "; + // GS2.Warn("E"); + if (loadingPlanet?.orbitAroundPlanet != null) status += "Moon " ; else status += "Planet "; //status += $"with a {loadingPlanet.orbitRadius}AU Orbit"; - ___promptText.text = status; + // GS2.Warn("F"); + if (___promptText != null) ___promptText.text = status; } } } \ No newline at end of file diff --git a/GalacticScale2/Scripts/GalacticScale2.0/Planet Generation/LUT Rework.cs b/GalacticScale2/Scripts/GalacticScale2.0/Planet Generation/LUT Rework.cs index fb49425f..f536cfd5 100644 --- a/GalacticScale2/Scripts/GalacticScale2.0/Planet Generation/LUT Rework.cs +++ b/GalacticScale2/Scripts/GalacticScale2.0/Planet Generation/LUT Rework.cs @@ -13,7 +13,7 @@ public static void SetLuts(int segments, float planetRadius) if (!DSPGame.IsMenuDemo && !Vanilla) { // Prevent special LUT's being created in main menu - if (keyedLUTs.ContainsKey(segments) && keyedLUTs.ContainsKey(segments) && PatchOnUIBuildingGrid.LUT512.ContainsKey(segments)) return; + if (keyedLUTs.ContainsKey(segments) && PatchOnUIBuildingGrid.LUT512.ContainsKey(segments)) return; var numSegments = segments / 4; //Number of segments on a quarter circle (the other 3/4 will result by mirroring) var lut = new int[numSegments]; var segmentAngle = Mathf.PI / 2f / numSegments; //quarter circle divided by num segments is the angle per segment diff --git a/GalacticScale2/obj/DSP_Plugins.GalacticScale.csproj.nuget.g.props b/GalacticScale2/obj/DSP_Plugins.GalacticScale.csproj.nuget.g.props index 7a37b412..bda3845b 100644 --- a/GalacticScale2/obj/DSP_Plugins.GalacticScale.csproj.nuget.g.props +++ b/GalacticScale2/obj/DSP_Plugins.GalacticScale.csproj.nuget.g.props @@ -5,18 +5,18 @@ NuGet $(MSBuildThisFileDirectory)project.assets.json $(UserProfile)\.nuget\packages\ - C:\Users\Tony\.nuget\packages\ + C:\Users\inno\.nuget\packages\ PackageReference - 5.9.1 + 5.10.0 - + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - C:\Users\Tony\.nuget\packages\bepinex.core\5.4.17 - C:\Users\Tony\.nuget\packages\bepinex.analyzers\1.0.8 + C:\Users\inno\.nuget\packages\bepinex.core\5.4.17 + C:\Users\inno\.nuget\packages\bepinex.analyzers\1.0.8 \ No newline at end of file diff --git a/GalacticScale2/obj/project.assets.json b/GalacticScale2/obj/project.assets.json index 46c374ae..eb223f35 100644 --- a/GalacticScale2/obj/project.assets.json +++ b/GalacticScale2/obj/project.assets.json @@ -2,7 +2,7 @@ "version": 3, "targets": { ".NETFramework,Version=v4.8": { - "BepInEx.Analyzers/1.0.7": { + "BepInEx.Analyzers/1.0.8": { "type": "package" }, "BepInEx.BaseLib/5.4.17": { @@ -158,7 +158,7 @@ } }, ".NETFramework,Version=v4.8/win": { - "BepInEx.Analyzers/1.0.7": { + "BepInEx.Analyzers/1.0.8": { "type": "package" }, "BepInEx.BaseLib/5.4.17": { @@ -314,7 +314,7 @@ } }, ".NETFramework,Version=v4.8/win-x64": { - "BepInEx.Analyzers/1.0.7": { + "BepInEx.Analyzers/1.0.8": { "type": "package" }, "BepInEx.BaseLib/5.4.17": { @@ -470,7 +470,7 @@ } }, ".NETFramework,Version=v4.8/win-x86": { - "BepInEx.Analyzers/1.0.7": { + "BepInEx.Analyzers/1.0.8": { "type": "package" }, "BepInEx.BaseLib/5.4.17": { @@ -627,16 +627,16 @@ } }, "libraries": { - "BepInEx.Analyzers/1.0.7": { - "sha512": "/RZ1GzpvD9Va5/pW+2Kce5rcaIX5mXiTvzwMqjgPGxsVzNGxt6wulw3zCS6jZYJWA1j4D5YQQ2jVbcz/Dkpjdg==", + "BepInEx.Analyzers/1.0.8": { + "sha512": "xrfNmunsPhBx+vStTxLonq/aHkRrDH77c9tG/x3m5eejrKe5B0nf7cJPRRt6x330sGI0bLaPTtygdeHUgvI3wQ==", "type": "package", - "path": "bepinex.analyzers/1.0.7", + "path": "bepinex.analyzers/1.0.8", "hasTools": true, "files": [ ".nupkg.metadata", "analyzers/dotnet/cs/BepInEx.Analyzers.CodeFixes.dll", "analyzers/dotnet/cs/BepInEx.Analyzers.dll", - "bepinex.analyzers.1.0.7.nupkg.sha512", + "bepinex.analyzers.1.0.8.nupkg.sha512", "bepinex.analyzers.nuspec", "tools/install.ps1", "tools/uninstall.ps1" diff --git a/GalacticScale2/obj/project.nuget.cache b/GalacticScale2/obj/project.nuget.cache index 16945120..3ae6eef3 100644 --- a/GalacticScale2/obj/project.nuget.cache +++ b/GalacticScale2/obj/project.nuget.cache @@ -4,7 +4,7 @@ "success": true, "projectFilePath": "E:\\code\\GalacticScale2\\GalacticScale2\\DSP_Plugins.GalacticScale.csproj", "expectedPackageFiles": [ - "C:\\Users\\inno\\.nuget\\packages\\bepinex.analyzers\\1.0.7\\bepinex.analyzers.1.0.7.nupkg.sha512", + "C:\\Users\\inno\\.nuget\\packages\\bepinex.analyzers\\1.0.8\\bepinex.analyzers.1.0.8.nupkg.sha512", "C:\\Users\\inno\\.nuget\\packages\\bepinex.baselib\\5.4.17\\bepinex.baselib.5.4.17.nupkg.sha512", "C:\\Users\\inno\\.nuget\\packages\\bepinex.core\\5.4.17\\bepinex.core.5.4.17.nupkg.sha512", "C:\\Users\\inno\\.nuget\\packages\\harmonyx\\2.5.5\\harmonyx.2.5.5.nupkg.sha512", diff --git a/GalacticScale2/obj/rider.project.restore.info b/GalacticScale2/obj/rider.project.restore.info index bbafeb9f..e4bfe3ea 100644 --- a/GalacticScale2/obj/rider.project.restore.info +++ b/GalacticScale2/obj/rider.project.restore.info @@ -1 +1 @@ -16427529176811194 \ No newline at end of file +16433724626720096 \ No newline at end of file diff --git a/Galactic_Scale-GalacticScale-2.2.26.zip b/Galactic_Scale-GalacticScale-2.2.26.zip new file mode 100644 index 00000000..0cf64e55 Binary files /dev/null and b/Galactic_Scale-GalacticScale-2.2.26.zip differ diff --git a/Package/README.md b/Package/README.md index 295b053c..bcc90a75 100644 --- a/Package/README.md +++ b/Package/README.md @@ -1,4 +1,9 @@ # DSP Galactic Scale 2.0 Mod +- Version 2.2.0.26 - Hopefully Geothermal is working on every planet now :) + +- Version 2.2.0.25 - Fixed Geothermal for Vanilla, Fixed Error on New Game. Added Debug Option to revert Scarlet Ice Lake + +- Version 2.2.0.24 - Fixed Geothermal. Fixed Scarlet Ice Lake. Added some planet info to loading screen. - Version 2.2.0.23 - Fixed Planet Detail Panel. Fixed Ghost Planets. Broke Nebula compatibility. (Nebula isn't updated yet afaik so no big deal here) diff --git a/thunderstore.toml b/thunderstore.toml index a31b5fb5..d7f65ce9 100644 --- a/thunderstore.toml +++ b/thunderstore.toml @@ -4,8 +4,8 @@ schemaVersion = "0.0.1" [package] namespace = "Galactic_Scale" name = "GalacticScale" -versionNumber = "2.2.23" -description = "v2.2.0.23 Minor Fixes" +versionNumber = "2.2.26" +description = "v2.2.0.26 Geothermal Fix (Hopefully the last one)" websiteUrl = "https://github.com/Touhma/DSP_Plugins" containsNsfwContent = false