From a43665e2190b59513c436334bcf518c3d50919ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bure=C5=A1?= Date: Mon, 13 Mar 2023 21:59:21 +0100 Subject: [PATCH 1/2] Project cleanup (NuGet packages where available instead of .dll references) --- CommunityFixes.csproj | 279 +-------------------------------------- src/CommunityFixesMod.cs | 8 +- 2 files changed, 10 insertions(+), 277 deletions(-) diff --git a/CommunityFixes.csproj b/CommunityFixes.csproj index 63c3fca..6d0bc18 100644 --- a/CommunityFixes.csproj +++ b/CommunityFixes.csproj @@ -5,289 +5,22 @@ true latest true + + https://api.nuget.org/v3/index.json; + https://nuget.bepinex.dev/v3/index.json + external_dlls\Assembly-CSharp.dll - - external_dlls\Assembly-CSharp-firstpass.dll - - - external_dlls\SpaceWarp.dll - - - external_dlls\Unity.Addressables.dll - - - external_dlls\Unity.Analytics.DataPrivacy.dll - - - external_dlls\Unity.Burst.dll - - - external_dlls\Unity.Burst.Cecil.dll - - - external_dlls\Unity.Burst.Cecil.Mdb.dll - - - external_dlls\Unity.Burst.Cecil.Pdb.dll - - - external_dlls\Unity.Burst.Cecil.Rocks.dll - - - external_dlls\Unity.Burst.Unsafe.dll - - - external_dlls\Unity.Collections.dll - - - external_dlls\Unity.Collections.LowLevel.ILSupport.dll - - - external_dlls\Unity.Formats.USD.Runtime.dll - - - external_dlls\Unity.InputSystem.dll - - - external_dlls\Unity.Jobs.dll - - - external_dlls\Unity.Mathematics.dll - - - external_dlls\Unity.MemoryProfiler.dll - - - external_dlls\Unity.Postprocessing.Runtime.dll - - - external_dlls\Unity.ResourceManager.dll - - - external_dlls\Unity.ScriptableBuildPipeline.dll - - - external_dlls\Unity.TextMeshPro.dll - - - external_dlls\Unity.Timeline.dll - - - external_dlls\UnityEngine.dll - - - external_dlls\UnityEngine.AccessibilityModule.dll - - - external_dlls\UnityEngine.AIModule.dll - - - external_dlls\UnityEngine.AndroidJNIModule.dll - - - external_dlls\UnityEngine.AnimationModule.dll - - - external_dlls\UnityEngine.ARModule.dll - - - external_dlls\UnityEngine.AssetBundleModule.dll - - - external_dlls\UnityEngine.AudioModule.dll - - - external_dlls\UnityEngine.ClothModule.dll - - - external_dlls\UnityEngine.ClusterInputModule.dll - - - external_dlls\UnityEngine.ClusterRendererModule.dll - - - external_dlls\UnityEngine.CoreModule.dll - - - external_dlls\UnityEngine.CrashReportingModule.dll - - - external_dlls\UnityEngine.DirectorModule.dll - - - external_dlls\UnityEngine.DSPGraphModule.dll - - - external_dlls\UnityEngine.GameCenterModule.dll - - - external_dlls\UnityEngine.GIModule.dll - - - external_dlls\UnityEngine.GridModule.dll - - - external_dlls\UnityEngine.HotReloadModule.dll - - - external_dlls\UnityEngine.ImageConversionModule.dll - - - external_dlls\UnityEngine.IMGUIModule.dll - - - external_dlls\UnityEngine.InputLegacyModule.dll - - - external_dlls\UnityEngine.InputModule.dll - - - external_dlls\UnityEngine.JSONSerializeModule.dll - - - external_dlls\UnityEngine.LocalizationModule.dll - - - external_dlls\UnityEngine.ParticleSystemModule.dll - - - external_dlls\UnityEngine.PerformanceReportingModule.dll - - - external_dlls\UnityEngine.Physics2DModule.dll - - - external_dlls\UnityEngine.PhysicsModule.dll - - - external_dlls\UnityEngine.ProfilerModule.dll - - - external_dlls\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - - - external_dlls\UnityEngine.ScreenCaptureModule.dll - - - external_dlls\UnityEngine.SharedInternalsModule.dll - - - external_dlls\UnityEngine.SpatialTracking.dll - - - external_dlls\UnityEngine.SpriteMaskModule.dll - - - external_dlls\UnityEngine.SpriteShapeModule.dll - - - external_dlls\UnityEngine.StreamingModule.dll - - - external_dlls\UnityEngine.SubstanceModule.dll - - - external_dlls\UnityEngine.SubsystemsModule.dll - - - external_dlls\UnityEngine.TerrainModule.dll - - - external_dlls\UnityEngine.TerrainPhysicsModule.dll - - - external_dlls\UnityEngine.TestRunner.dll - - - external_dlls\UnityEngine.TextCoreModule.dll - - - external_dlls\UnityEngine.TextRenderingModule.dll - - - external_dlls\UnityEngine.TilemapModule.dll - - - external_dlls\UnityEngine.TLSModule.dll - - - external_dlls\UnityEngine.UI.dll - - - external_dlls\UnityEngine.UIElementsModule.dll - - - external_dlls\UnityEngine.UIElementsNativeModule.dll - - - external_dlls\UnityEngine.UIModule.dll - - - external_dlls\UnityEngine.UmbraModule.dll - - - external_dlls\UnityEngine.UNETModule.dll - - - external_dlls\UnityEngine.UnityAnalyticsModule.dll - - - external_dlls\UnityEngine.UnityConnectModule.dll - - - external_dlls\UnityEngine.UnityCurlModule.dll - - - external_dlls\UnityEngine.UnityTestProtocolModule.dll - - - external_dlls\UnityEngine.UnityWebRequestAssetBundleModule.dll - - - external_dlls\UnityEngine.UnityWebRequestAudioModule.dll - - - external_dlls\UnityEngine.UnityWebRequestModule.dll - - - external_dlls\UnityEngine.UnityWebRequestTextureModule.dll - - - external_dlls\UnityEngine.UnityWebRequestWWWModule.dll - - - external_dlls\UnityEngine.VehiclesModule.dll - - - external_dlls\UnityEngine.VFXModule.dll - - - external_dlls\UnityEngine.VideoModule.dll - - - external_dlls\UnityEngine.VirtualTexturingModule.dll - - - external_dlls\UnityEngine.VRModule.dll - - - external_dlls\UnityEngine.WindModule.dll - - - external_dlls\UnityEngine.XR.LegacyInputHelpers.dll - - - external_dlls\UnityEngine.XRModule.dll - + + diff --git a/src/CommunityFixesMod.cs b/src/CommunityFixesMod.cs index 65783f3..d9fe155 100644 --- a/src/CommunityFixesMod.cs +++ b/src/CommunityFixesMod.cs @@ -14,7 +14,7 @@ public class CommunityFixesMod : BaseSpaceWarpPlugin public const string ModName = "Community Fixes"; public const string ModVer = "0.1.0"; - private static readonly Assembly _assembly = typeof(CommunityFixesMod).Assembly; + private static readonly Assembly Assembly = typeof(CommunityFixesMod).Assembly; private CommunityFixesConfig _config; public override void OnInitialized() @@ -22,7 +22,7 @@ public override void OnInitialized() Type[] types; try { - types = _assembly.GetTypes(); + types = Assembly.GetTypes(); } catch (Exception ex) { @@ -53,7 +53,7 @@ public override void OnInitialized() Logger.LogInfo($"{ModName} finished loading."); } - internal bool LoadFix(Type type) + private bool LoadFix(Type type) { var fixName = GetFixName(type); @@ -72,7 +72,7 @@ internal bool LoadFix(Type type) } else { - fix = _assembly.CreateInstance(type.FullName!) as IFix; + fix = Assembly.CreateInstance(type.FullName!) as IFix; } if (fix == null) From d8c3674ba145022149f8316119bc5513a4ee2711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bure=C5=A1?= Date: Mon, 13 Mar 2023 21:59:57 +0100 Subject: [PATCH 2/2] Added Vessel Landed State fix --- README.md | 5 ++++- src/CommunityFixesMod.cs | 2 +- .../VesselLandedState/VesselLandedStateFix.cs | 16 ++++++++++++++++ swinfo.json | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 src/Fix/VesselLandedState/VesselLandedStateFix.cs diff --git a/README.md b/README.md index 623b7e7..dbe68b7 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,15 @@ This project aims to bring together community bug fixes for Kerbal Space Program ## Compatibility - Tested with Kerbal Space Program 2 v0.1.0.0.20892 -- Requires **[SpaceWarp 0.4+](https://github.com/SpaceWarpDev/SpaceWarp/releases/tag/spacewarp-0.4.0)** +- Requires **[SpaceWarp 0.4+](https://github.com/SpaceWarpDev/SpaceWarp/releases/)** ## Implemented fixes - **Separation CommNet Fix** by [munix](https://github.com/jan-bures) - Fixes CommNet disconnecting after separating two controllable vessels. - **Sticky Orbit Markers** by [munix](https://github.com/jan-bures) - Makes Ap/Pe and other orbit markers stay pinned when plotting a maneuver. - **KSP 2 Save Fix** by [jayouimet](https://github.com/jayouimet) - Replaces the Control Owner Part to the first available Command module or to the Root part if not found when it is set to null. +- **Vessel Landed State Fix*** by [munix](https://github.com/jan-bures) - Checks if the vessel's state is Landed when not actually near the ground and resets it. + +_*This fix is experimental and untested for now - if you are experiencing the bug with its fix enabled, please create an issue [here](https://github.com/Bit-Studios/CommunityFixes/issues)._ ## Planned fixes To see what fixes are planned to be implemented, you can visit the [Issues page](https://github.com/Bit-Studios/CommunityFixes/issues) on the project's GitHub. diff --git a/src/CommunityFixesMod.cs b/src/CommunityFixesMod.cs index d9fe155..27f4fe1 100644 --- a/src/CommunityFixesMod.cs +++ b/src/CommunityFixesMod.cs @@ -12,7 +12,7 @@ public class CommunityFixesMod : BaseSpaceWarpPlugin { public const string ModGuid = "com.github.communityfixes"; public const string ModName = "Community Fixes"; - public const string ModVer = "0.1.0"; + public const string ModVer = "0.3.0"; private static readonly Assembly Assembly = typeof(CommunityFixesMod).Assembly; private CommunityFixesConfig _config; diff --git a/src/Fix/VesselLandedState/VesselLandedStateFix.cs b/src/Fix/VesselLandedState/VesselLandedStateFix.cs new file mode 100644 index 0000000..1f99ba7 --- /dev/null +++ b/src/Fix/VesselLandedState/VesselLandedStateFix.cs @@ -0,0 +1,16 @@ +using KSP.Sim.impl; + +namespace CommunityFixes.Fix.VesselLandedState; + +[Fix("Vessel Landed State")] +public class VesselLandedStateFix: BaseFix +{ + private void LateUpdate() + { + var vessel = Game.ViewController.GetActiveSimVessel(); + if (vessel != null && vessel.Situation == VesselSituations.Landed && vessel.AltitudeFromTerrain > 50) + { + vessel.Landed = false; + } + } +} \ No newline at end of file diff --git a/swinfo.json b/swinfo.json index 8563f02..09b03a0 100644 --- a/swinfo.json +++ b/swinfo.json @@ -4,7 +4,7 @@ "name": "Community Fixes", "description": "Community project that aims to bring together bug fixes for KSP 2.", "source": "https://github.com/Bit-Studios/CommunityFixes", - "version": "0.1.0", + "version": "0.3.0", "dependencies": [], "ksp2_version": { "min": "0.1.0",