This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using UnityEngine; | |
namespace UINumericFloatEdit | |
{ | |
[KSPAddon(KSPAddon.Startup.FlightAndEditor, false)] | |
public class CustomPartActionControlSpawner : MonoBehaviour | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HarmonyPatch(typeof(UIPartActionInventorySlot))] | |
[HarmonyPatch("OnPointerClick")] | |
class UIPartActionInventorySlot_OnPointerClick | |
{ | |
static bool Prefix(UIPartActionInventorySlot __instance, PointerEventData eventData, ModuleInventoryPart ___moduleInventoryPart, InventoryPartListTooltipController ___tooltipController) | |
{ | |
if (!(___moduleInventoryPart is ModuleActiveInventoryPart activeInventory)) | |
{ | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add a collapsed by default PAW group to all ModuleInventoryPart : | |
[HarmonyPatch(typeof(ModuleInventoryPart))] | |
[HarmonyPatch("OnStart")] | |
class ModuleInventoryPart_OnStart | |
{ | |
static void Postfix(ModuleInventoryPart __instance) | |
{ | |
__instance.Fields["InventorySlots"].group = new BasePAWGroup("Inventory", "Inventory", true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using KSP.Localization; | |
using KSP.UI.Screens; | |
using KSP.UI.Screens.SpaceCenter.MissionSummaryDialog; | |
using KSP.UI.Util; | |
using UnityEngine; | |
namespace TestPlugin | |
{ | |
[KSPAddon(KSPAddon.Startup.AllGameScenes, false)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Experimental patch that force all BaseConverter derivatives to use the Kerbalism resource simulation, intended for NFE/FFT/SystemHeat support | |
// This will get ride of the "incoherent producer" message on loaded vessels, but there are some limitations : | |
// - This bypass resource flow priorities and modes, excepted in the case of a NO_FLOW resource. | |
// Specifically, NFE reactors should act correctly as far as uranium is concerned. | |
// - This use the last sim step information to attempt to compensate the stock high timewarp speeds issues, | |
// but since this works outside of the main kerbalism recipes loop, this will likely still act in weird ways | |
// when a mix of stock and kerbalism producers/consumers are active for the same resource. | |
// - This require renaming Kerbalism's own ResourceBroker class to something like KsmResourceBroker so harmony doesn't get confused | |
using System; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using KSP.UI.Screens.Flight; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Reflection; | |
using UnityEngine; | |
using Debug = UnityEngine.Debug; | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OpenFileDialog | |
{ | |
[DllImport("comdlg32.dll", SetLastError = true, CharSet = CharSet.Auto)] | |
private static extern bool GetOpenFileName([In, Out] OpenFileName ofn); | |
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] | |
private class OpenFileName | |
{ | |
public int structSize = 0; | |
public IntPtr dlgOwner = IntPtr.Zero; |
NewerOlder