// Airplane Plus TWEAKS patch
// version of this patch: 1.0.0
// GameData/AirplanePlus/Updates
// Airplane Plus:  https://forum.kerbalspaceprogram.com/index.php?/topic/140262-14x-18x-airplane-plus-r264-fixed-issuesgithub-is-up-to-date-dec-21-2019/
// ============================================================================
// add airlock and ladder on the exit hatch to: Size 1.5 Crew Cabin (s1p5CrewCabin)
// ============================================================================
@PART[s1p5CrewCabin]
{
	MODEL
	{
		model = AirplanePlus/Parts/Structure and Fuel/bombardierset/modelcabinAirlocksLadders
	}
}
// end

// ============================================================================
// add new stock wheel parameters
// ============================================================================
@PART[biplanegear,blackhawkgear,herculesgear]
{
	@MODULE[ModuleWheelBase]
	{
		%useNewFrictionModel = true
	}
	@MODULE[ModuleWheelSuspension]
	{
		%useDistributedMass = true
	}
}
@PART[miggear,airbusreargear,b29gear,fightergear,herculesfrontgear,sidegear,x1gear,x1sidegear]
{
	@MODULE[ModuleWheelBase]
	{
		%useNewFrictionModel = true
	}
	@MODULE[ModuleWheelSuspension]
	{
		%useDistributedMass = true
	}
	@MODULE[ModuleWheelSteering]
	{
		%autoSteeringAdjust = true
	}
}
// end

// ============================================================================
// delete air intake module, the part don't have intake air the model(title = Mk2/Object 1.44 Non-Commercial Cockpit)
// ============================================================================
@PART[144cockpit]
{
	!MODULE[ModuleResourceIntake]{}
}

// ============================================================================
// delete light module that doesn't exist in model							 **************** to be removed after original .cfg clean ******************
// ============================================================================
@PART[herculesgear]:HAS[@MODULE[ModuleStatusLight]]
{
	!MODULE[ModuleStatusLight]{}
}
// end

// ============================================================================
// reset weird Center of mass offset at the center of the part ? (bad backward compatibility for crafts)
// ============================================================================
// @PART[cessnacabin]
// {
	// %CoMOffset = 0.0, 0.0, 0.0 //0.0, 0.5, 0.0
// }
// @PART[mk3galaxy]
// {
	// %CoMOffset = 0.0, 1.0, 0.0 //0.0, 0.5, 0.0
// }
// end

// ============================================================================
// Replace not working light modules for cessnacabin, and match the same properties for the cockpit
// ============================================================================
@PART[cessnacabin,cessnacockpit]
{
!MODULE[ModuleAnimateGeneric]:HAS[#animationName[cessnacockpitlight]]{}
	MODULE
	{
		name = ModuleColorChanger
		shaderProperty = _EmissiveColor
		animRate = 0.8
		animState = false
		useRate = true
		toggleInEditor = true
		toggleInFlight = true
		toggleInFlight = true
		unfocusedRange = 5
		toggleName = #autoLOC_502011 //#autoLOC_502011 = Toggle Lights
		eventOnName = #autoLOC_502012 //#autoLOC_502012 = Lights On
		eventOffName = #autoLOC_502013 //#autoLOC_502013 = Lights Off
		toggleAction = True
		//defaultActionGroup = Light
		redCurve
		{
			key = 0 0 0 3
			key = 1 1 0 0
		}
		greenCurve
		{
			key = 0 0 0 1
			key = 1 1 1 0
		}
		blueCurve
		{
			key = 0 0 0 0
			key = 1 0.7 1.5 0
		}
		alphaCurve
		{
			key = 0 1
		}
	}
}
// end