Reversed 'KerbalEngineer.Unity.dll' dependancy on 'KerbalEngineer.dll'.
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,11 @@
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
[Bb]in/
[Oo]bj/
+
+# Unity specific
+[Ll]ibrary/
+[Tt]emp/
+*.unityproj
# mstest test results
TestResults
Binary files a/Assets/CurseLogo.png and /dev/null differ
Binary files a/Assets/CurseLogo.psd and /dev/null differ
Binary files a/Assets/DropDownBackground.psd and /dev/null differ
Binary files /dev/null and b/Assets/Images/app-launcher-icon.psd differ
Binary files /dev/null and b/Assets/Images/flight-menu-background.psd differ
Binary files /dev/null and b/Assets/Images/ui-drop-down.psd differ
Binary files /dev/null and b/Assets/Plugins/KerbalEngineer.Unity.dll differ
--- /dev/null
+++ b/Assets/Prefabs/FlightMenu.prefab
@@ -1,1 +1,995 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &104452
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22454998}
+ - 222: {fileID: 22296168}
+ - 114: {fileID: 11459182}
+ m_Layer: 5
+ m_Name: selected
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &116014
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22475412}
+ - 222: {fileID: 22223226}
+ - 114: {fileID: 11409704}
+ - 114: {fileID: 11424646}
+ m_Layer: 5
+ m_Name: Content
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &122098
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22401100}
+ - 222: {fileID: 22201528}
+ - 114: {fileID: 11404586}
+ - 114: {fileID: 11461688}
+ - 114: {fileID: 11415068}
+ m_Layer: 5
+ m_Name: ToggleControlBar
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &126098
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22476196}
+ - 222: {fileID: 22270862}
+ - 114: {fileID: 11423044}
+ - 114: {fileID: 11485532}
+ - 225: {fileID: 22567868}
+ - 114: {fileID: 11415294}
+ m_Layer: 5
+ m_Name: FlightMenu
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &133376
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22478174}
+ - 114: {fileID: 11443382}
+ m_Layer: 5
+ m_Name: Controls
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &137786
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22444606}
+ - 222: {fileID: 22267348}
+ - 114: {fileID: 11465882}
+ m_Layer: 5
+ m_Name: label
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &138760
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22409936}
+ - 222: {fileID: 22255938}
+ - 114: {fileID: 11403342}
+ m_Layer: 5
+ m_Name: label
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &150266
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22463980}
+ - 222: {fileID: 22210360}
+ - 114: {fileID: 11475868}
+ m_Layer: 5
+ m_Name: selected
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &156848
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22483410}
+ - 222: {fileID: 22267572}
+ - 114: {fileID: 11463504}
+ - 114: {fileID: 11453198}
+ m_Layer: 5
+ m_Name: Titlebar
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &172308
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22401786}
+ - 222: {fileID: 22247322}
+ - 114: {fileID: 11439582}
+ m_Layer: 5
+ m_Name: label
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &194088
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22469574}
+ - 222: {fileID: 22281674}
+ - 114: {fileID: 11498756}
+ - 114: {fileID: 11451984}
+ - 114: {fileID: 11485338}
+ m_Layer: 5
+ m_Name: ToggleShowEngineer
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!114 &11403342
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 138760}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 0, g: 0, b: 0, a: 1}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_FontData:
+ m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
+ m_FontSize: 12
+ m_FontStyle: 1
+ m_BestFit: 0
+ m_MinSize: 10
+ m_MaxSize: 40
+ m_Alignment: 4
+ m_RichText: 1
+ m_HorizontalOverflow: 0
+ m_VerticalOverflow: 0
+ m_LineSpacing: 1
+ m_Text: SHOW ENGINEER
+--- !u!114 &11404586
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 122098}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: .800000072, g: 1, b: 0, a: .501960814}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 0}
+ m_Type: 1
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!114 &11409704
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 116014}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: .313725501, g: .313725501, b: .313725501, a: .70588237}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 0}
+ m_Type: 1
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!114 &11415068
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 122098}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Navigation:
+ m_Mode: 3
+ m_SelectOnUp: {fileID: 0}
+ m_SelectOnDown: {fileID: 0}
+ m_SelectOnLeft: {fileID: 0}
+ m_SelectOnRight: {fileID: 0}
+ m_Transition: 1
+ m_Colors:
+ m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
+ m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1}
+ m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1}
+ m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
+ m_ColorMultiplier: 1
+ m_FadeDuration: .100000001
+ m_SpriteState:
+ m_HighlightedSprite: {fileID: 0}
+ m_PressedSprite: {fileID: 0}
+ m_DisabledSprite: {fileID: 0}
+ m_AnimationTriggers:
+ m_NormalTrigger: Normal
+ m_HighlightedTrigger: Highlighted
+ m_PressedTrigger: Pressed
+ m_DisabledTrigger: Disabled
+ m_Interactable: 1
+ m_TargetGraphic: {fileID: 11404586}
+ toggleTransition: 1
+ graphic: {fileID: 11459182}
+ m_Group: {fileID: 0}
+ onValueChanged:
+ m_PersistentCalls:
+ m_Calls:
+ - m_Target: {fileID: 11415294}
+ m_MethodName: SetControlBar
+ m_Mode: 0
+ m_Arguments:
+ m_ObjectArgument: {fileID: 0}
+ m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
+ m_IntArgument: 0
+ m_FloatArgument: 0
+ m_StringArgument:
+ m_BoolArgument: 0
+ m_CallState: 2
+ m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0,
+ Culture=neutral, PublicKeyToken=null
+ m_IsOn: 0
+--- !u!114 &11415294
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 126098}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 571159103, guid: a3a55138b08428847a08c7b48fe72efe, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_ShowEngineerToggle: {fileID: 11485338}
+ m_ControlBarToggle: {fileID: 11415068}
+ m_FastFadeDuration: .200000003
+ m_SlowFadeDuration: .5
+--- !u!114 &11423044
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 126098}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1741964061, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_HorizontalFit: 0
+ m_VerticalFit: 2
+--- !u!114 &11424646
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 116014}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Padding:
+ m_Left: 0
+ m_Right: 0
+ m_Top: 0
+ m_Bottom: 0
+ m_ChildAlignment: 0
+ m_Spacing: 0
+ m_ChildForceExpandWidth: 1
+ m_ChildForceExpandHeight: 0
+--- !u!114 &11439582
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 172308}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: .800000072, g: 1, b: 0, a: 1}
+ m_RaycastTarget: 0
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_FontData:
+ m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
+ m_FontSize: 12
+ m_FontStyle: 1
+ m_BestFit: 0
+ m_MinSize: 10
+ m_MaxSize: 40
+ m_Alignment: 3
+ m_RichText: 0
+ m_HorizontalOverflow: 0
+ m_VerticalOverflow: 0
+ m_LineSpacing: 1
+ m_Text: FLIGHT ENGINEER
+--- !u!114 &11443382
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 133376}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_IgnoreLayout: 0
+ m_MinWidth: -1
+ m_MinHeight: -1
+ m_PreferredWidth: -1
+ m_PreferredHeight: 25
+ m_FlexibleWidth: -1
+ m_FlexibleHeight: -1
+--- !u!114 &11451984
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 194088}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_IgnoreLayout: 0
+ m_MinWidth: -1
+ m_MinHeight: -1
+ m_PreferredWidth: -1
+ m_PreferredHeight: 20
+ m_FlexibleWidth: -1
+ m_FlexibleHeight: -1
+--- !u!114 &11453198
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 156848}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_IgnoreLayout: 0
+ m_MinWidth: -1
+ m_MinHeight: -1
+ m_PreferredWidth: -1
+ m_PreferredHeight: 20
+ m_FlexibleWidth: -1
+ m_FlexibleHeight: -1
+--- !u!114 &11459182
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 104452}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: .800000072, g: 1, b: 0, a: .784313738}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 0}
+ m_Type: 0
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!114 &11461688
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 122098}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_IgnoreLayout: 0
+ m_MinWidth: -1
+ m_MinHeight: -1
+ m_PreferredWidth: -1
+ m_PreferredHeight: 20
+ m_FlexibleWidth: -1
+ m_FlexibleHeight: -1
+--- !u!114 &11463504
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 156848}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: .183823526, g: .183823526, b: .183823526, a: .90196079}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 0}
+ m_Type: 0
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!114 &11465882
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 137786}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 0, g: 0, b: 0, a: 1}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_FontData:
+ m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
+ m_FontSize: 12
+ m_FontStyle: 1
+ m_BestFit: 0
+ m_MinSize: 10
+ m_MaxSize: 40
+ m_Alignment: 4
+ m_RichText: 1
+ m_HorizontalOverflow: 0
+ m_VerticalOverflow: 0
+ m_LineSpacing: 1
+ m_Text: CONTROL BAR
+--- !u!114 &11475868
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 150266}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: .800000072, g: 1, b: 0, a: .784313738}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 0}
+ m_Type: 0
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!114 &11485338
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 194088}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Navigation:
+ m_Mode: 3
+ m_SelectOnUp: {fileID: 0}
+ m_SelectOnDown: {fileID: 0}
+ m_SelectOnLeft: {fileID: 0}
+ m_SelectOnRight: {fileID: 0}
+ m_Transition: 1
+ m_Colors:
+ m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
+ m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1}
+ m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1}
+ m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
+ m_ColorMultiplier: 1
+ m_FadeDuration: .100000001
+ m_SpriteState:
+ m_HighlightedSprite: {fileID: 0}
+ m_PressedSprite: {fileID: 0}
+ m_DisabledSprite: {fileID: 0}
+ m_AnimationTriggers:
+ m_NormalTrigger: Normal
+ m_HighlightedTrigger: Highlighted
+ m_PressedTrigger: Pressed
+ m_DisabledTrigger: Disabled
+ m_Interactable: 1
+ m_TargetGraphic: {fileID: 11498756}
+ toggleTransition: 1
+ graphic: {fileID: 11475868}
+ m_Group: {fileID: 0}
+ onValueChanged:
+ m_PersistentCalls:
+ m_Calls:
+ - m_Target: {fileID: 11415294}
+ m_MethodName: SetShowEngineer
+ m_Mode: 0
+ m_Arguments:
+ m_ObjectArgument: {fileID: 0}
+ m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
+ m_IntArgument: 0
+ m_FloatArgument: 0
+ m_StringArgument:
+ m_BoolArgument: 0
+ m_CallState: 2
+ m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0,
+ Culture=neutral, PublicKeyToken=null
+ m_IsOn: 0
+--- !u!114 &11485532
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 126098}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Padding:
+ m_Left: 0
+ m_Right: 0
+ m_Top: 0
+ m_Bottom: 0
+ m_ChildAlignment: 0
+ m_Spacing: 0
+ m_ChildForceExpandWidth: 1
+ m_ChildForceExpandHeight: 1
+--- !u!114 &11498756
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 194088}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: .800000072, g: 1, b: 0, a: .501960814}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 0}
+ m_Type: 1
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!222 &22201528
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 122098}
+--- !u!222 &22210360
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 150266}
+--- !u!222 &22223226
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 116014}
+--- !u!222 &22247322
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 172308}
+--- !u!222 &22255938
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 138760}
+--- !u!222 &22267348
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 137786}
+--- !u!222 &22267572
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 156848}
+--- !u!222 &22270862
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 126098}
+--- !u!222 &22281674
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 194088}
+--- !u!222 &22296168
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 104452}
+--- !u!224 &22401100
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 122098}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 22454998}
+ - {fileID: 22444606}
+ m_Father: {fileID: 22478174}
+ m_RootOrder: 1
+ m_AnchorMin: {x: .5, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: -1, y: 0}
+ m_SizeDelta: {x: -6, y: -8}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22401786
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 172308}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 22483410}
+ m_RootOrder: 0
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 2.5, y: 0}
+ m_SizeDelta: {x: -5, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22409936
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 138760}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 22469574}
+ m_RootOrder: 1
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22444606
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 137786}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 22401100}
+ m_RootOrder: 1
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22454998
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 104452}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 22401100}
+ m_RootOrder: 0
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22463980
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 150266}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 22469574}
+ m_RootOrder: 0
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22469574
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 194088}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 22463980}
+ - {fileID: 22409936}
+ m_Father: {fileID: 22478174}
+ m_RootOrder: 0
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: .5, y: 1}
+ m_AnchoredPosition: {x: 1, y: 0}
+ m_SizeDelta: {x: -6, y: -8}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22475412
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 116014}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 22478174}
+ m_Father: {fileID: 22476196}
+ m_RootOrder: 1
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 0, y: 0}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22476196
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 126098}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 22483410}
+ - {fileID: 22475412}
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_AnchorMin: {x: .5, y: .5}
+ m_AnchorMax: {x: .5, y: .5}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 250, y: 0}
+ m_Pivot: {x: 1, y: 0}
+--- !u!224 &22478174
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 133376}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 22469574}
+ - {fileID: 22401100}
+ m_Father: {fileID: 22475412}
+ m_RootOrder: 0
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 0, y: 0}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22483410
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 156848}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 22401786}
+ m_Father: {fileID: 22476196}
+ m_RootOrder: 0
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 0, y: 0}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: 1}
+--- !u!225 &22567868
+CanvasGroup:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 126098}
+ m_Enabled: 1
+ m_Alpha: 1
+ m_Interactable: 1
+ m_BlocksRaycasts: 1
+ m_IgnoreParentGroups: 0
+--- !u!1001 &100100000
+Prefab:
+ m_ObjectHideFlags: 1
+ serializedVersion: 2
+ m_Modification:
+ m_TransformParent: {fileID: 0}
+ m_Modifications:
+ - target: {fileID: 0}
+ propertyPath: m_FastFadeDuration
+ value: .200000003
+ objectReference: {fileID: 0}
+ - target: {fileID: 0}
+ propertyPath: m_SlowFadeDuration
+ value: .5
+ objectReference: {fileID: 0}
+ m_RemovedComponents: []
+ m_ParentPrefab: {fileID: 0}
+ m_RootGameObject: {fileID: 126098}
+ m_IsPrefabParent: 1
--- /dev/null
+++ b/Assets/Prefabs/FlightMenuSection.prefab
@@ -1,1 +1,650 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &121376
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22409126}
+ - 222: {fileID: 22266612}
+ - 114: {fileID: 11461446}
+ - 114: {fileID: 11496274}
+ - 114: {fileID: 11436568}
+ m_Layer: 5
+ m_Name: ToggleDisplay
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &121536
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22446728}
+ - 222: {fileID: 22259916}
+ - 114: {fileID: 11418436}
+ m_Layer: 5
+ m_Name: Selected
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &130136
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22444842}
+ - 222: {fileID: 22269896}
+ - 114: {fileID: 11449350}
+ - 114: {fileID: 11489918}
+ - 114: {fileID: 11421724}
+ m_Layer: 5
+ m_Name: ToggleEdit
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &130812
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22478272}
+ - 114: {fileID: 11431788}
+ - 114: {fileID: 11494744}
+ m_Layer: 5
+ m_Name: FlightMenuSection
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &151828
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22485856}
+ - 222: {fileID: 22274980}
+ - 114: {fileID: 11408784}
+ m_Layer: 5
+ m_Name: Text
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &172700
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22483442}
+ - 222: {fileID: 22246486}
+ - 114: {fileID: 11462740}
+ m_Layer: 5
+ m_Name: Text
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &178618
+GameObject:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 22469204}
+ - 222: {fileID: 22219086}
+ - 114: {fileID: 11484356}
+ m_Layer: 5
+ m_Name: Selected
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!114 &11408784
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 151828}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 0, g: 0, b: 0, a: 1}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_FontData:
+ m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
+ m_FontSize: 10
+ m_FontStyle: 1
+ m_BestFit: 0
+ m_MinSize: 10
+ m_MaxSize: 40
+ m_Alignment: 4
+ m_RichText: 1
+ m_HorizontalOverflow: 0
+ m_VerticalOverflow: 0
+ m_LineSpacing: 1
+ m_Text: DISPLAY
+--- !u!114 &11418436
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 121536}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: .800000072, g: 1, b: 0, a: .784313738}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 0}
+ m_Type: 0
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!114 &11421724
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 130136}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Navigation:
+ m_Mode: 3
+ m_SelectOnUp: {fileID: 0}
+ m_SelectOnDown: {fileID: 0}
+ m_SelectOnLeft: {fileID: 0}
+ m_SelectOnRight: {fileID: 0}
+ m_Transition: 1
+ m_Colors:
+ m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
+ m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1}
+ m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1}
+ m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
+ m_ColorMultiplier: 1
+ m_FadeDuration: .100000001
+ m_SpriteState:
+ m_HighlightedSprite: {fileID: 0}
+ m_PressedSprite: {fileID: 0}
+ m_DisabledSprite: {fileID: 0}
+ m_AnimationTriggers:
+ m_NormalTrigger: Normal
+ m_HighlightedTrigger: Highlighted
+ m_PressedTrigger: Pressed
+ m_DisabledTrigger: Disabled
+ m_Interactable: 1
+ m_TargetGraphic: {fileID: 11449350}
+ toggleTransition: 1
+ graphic: {fileID: 11484356}
+ m_Group: {fileID: 0}
+ onValueChanged:
+ m_PersistentCalls:
+ m_Calls:
+ - m_Target: {fileID: 0}
+ m_MethodName: set_controlBar
+ m_Mode: 0
+ m_Arguments:
+ m_ObjectArgument: {fileID: 0}
+ m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
+ m_IntArgument: 0
+ m_FloatArgument: 0
+ m_StringArgument:
+ m_BoolArgument: 0
+ m_CallState: 2
+ m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0,
+ Culture=neutral, PublicKeyToken=null
+ m_IsOn: 0
+--- !u!114 &11431788
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 130812}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_IgnoreLayout: 0
+ m_MinWidth: -1
+ m_MinHeight: -1
+ m_PreferredWidth: -1
+ m_PreferredHeight: 15
+ m_FlexibleWidth: -1
+ m_FlexibleHeight: -1
+--- !u!114 &11436568
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 121376}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Navigation:
+ m_Mode: 3
+ m_SelectOnUp: {fileID: 0}
+ m_SelectOnDown: {fileID: 0}
+ m_SelectOnLeft: {fileID: 0}
+ m_SelectOnRight: {fileID: 0}
+ m_Transition: 1
+ m_Colors:
+ m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
+ m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1}
+ m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1}
+ m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
+ m_ColorMultiplier: 1
+ m_FadeDuration: .100000001
+ m_SpriteState:
+ m_HighlightedSprite: {fileID: 0}
+ m_PressedSprite: {fileID: 0}
+ m_DisabledSprite: {fileID: 0}
+ m_AnimationTriggers:
+ m_NormalTrigger: Normal
+ m_HighlightedTrigger: Highlighted
+ m_PressedTrigger: Pressed
+ m_DisabledTrigger: Disabled
+ m_Interactable: 1
+ m_TargetGraphic: {fileID: 11461446}
+ toggleTransition: 1
+ graphic: {fileID: 11418436}
+ m_Group: {fileID: 0}
+ onValueChanged:
+ m_PersistentCalls:
+ m_Calls:
+ - m_Target: {fileID: 0}
+ m_MethodName: set_showEngineer
+ m_Mode: 0
+ m_Arguments:
+ m_ObjectArgument: {fileID: 0}
+ m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
+ m_IntArgument: 0
+ m_FloatArgument: 0
+ m_StringArgument:
+ m_BoolArgument: 0
+ m_CallState: 2
+ m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0,
+ Culture=neutral, PublicKeyToken=null
+ m_IsOn: 0
+--- !u!114 &11449350
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 130136}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: .800000072, g: 1, b: 0, a: .501960814}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 0}
+ m_Type: 1
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!114 &11461446
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 121376}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: .800000072, g: 1, b: 0, a: .501960814}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 0}
+ m_Type: 1
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!114 &11462740
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 172700}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 0, g: 0, b: 0, a: 1}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_FontData:
+ m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
+ m_FontSize: 10
+ m_FontStyle: 1
+ m_BestFit: 0
+ m_MinSize: 10
+ m_MaxSize: 40
+ m_Alignment: 4
+ m_RichText: 1
+ m_HorizontalOverflow: 0
+ m_VerticalOverflow: 0
+ m_LineSpacing: 1
+ m_Text: EDIT
+--- !u!114 &11484356
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 178618}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: .800000072, g: 1, b: 0, a: .784313738}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 0}
+ m_Type: 0
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!114 &11489918
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 130136}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_IgnoreLayout: 0
+ m_MinWidth: -1
+ m_MinHeight: -1
+ m_PreferredWidth: -1
+ m_PreferredHeight: 20
+ m_FlexibleWidth: -1
+ m_FlexibleHeight: -1
+--- !u!114 &11494744
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 130812}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -1842827791, guid: a3a55138b08428847a08c7b48fe72efe, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_DisplayToggle: {fileID: 11436568}
+ m_DisplayText: {fileID: 11408784}
+ m_EditToggle: {fileID: 11421724}
+--- !u!114 &11496274
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 121376}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_IgnoreLayout: 0
+ m_MinWidth: -1
+ m_MinHeight: -1
+ m_PreferredWidth: -1
+ m_PreferredHeight: 20
+ m_FlexibleWidth: -1
+ m_FlexibleHeight: -1
+--- !u!222 &22219086
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 178618}
+--- !u!222 &22246486
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 172700}
+--- !u!222 &22259916
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 121536}
+--- !u!222 &22266612
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 121376}
+--- !u!222 &22269896
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 130136}
+--- !u!222 &22274980
+CanvasRenderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 151828}
+--- !u!224 &22409126
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 121376}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 22446728}
+ - {fileID: 22485856}
+ m_Father: {fileID: 22478272}
+ m_RootOrder: 0
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: .75, y: 1}
+ m_AnchoredPosition: {x: -1, y: 0}
+ m_SizeDelta: {x: -2, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22444842
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 130136}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 22469204}
+ - {fileID: 22483442}
+ m_Father: {fileID: 22478272}
+ m_RootOrder: 1
+ m_AnchorMin: {x: .75, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 1, y: 0}
+ m_SizeDelta: {x: -2, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22446728
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 121536}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 22409126}
+ m_RootOrder: 0
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22469204
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 178618}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 22444842}
+ m_RootOrder: 0
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22478272
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 130812}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 22409126}
+ - {fileID: 22444842}
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 0, y: 0}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22483442
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 172700}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 22444842}
+ m_RootOrder: 1
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!224 &22485856
+RectTransform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 151828}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 22409126}
+ m_RootOrder: 1
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!1001 &100100000
+Prefab:
+ m_ObjectHideFlags: 1
+ serializedVersion: 2
+ m_Modification:
+ m_TransformParent: {fileID: 0}
+ m_Modifications: []
+ m_RemovedComponents: []
+ m_ParentPrefab: {fileID: 0}
+ m_RootGameObject: {fileID: 130812}
+ m_IsPrefabParent: 1
--- /dev/null
+++ b/Assets/Scenes/main.unity
@@ -1,1 +1,629 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!29 &1
+SceneSettings:
+ m_ObjectHideFlags: 0
+ m_PVSData:
+ m_PVSObjectsArray: []
+ m_PVSPortalsArray: []
+ m_OcclusionBakeSettings:
+ smallestOccluder: 5
+ smallestHole: .25
+ backfaceThreshold: 100
+--- !u!104 &2
+RenderSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 6
+ m_Fog: 0
+ m_FogColor: {r: .5, g: .5, b: .5, a: 1}
+ m_FogMode: 3
+ m_FogDensity: .00999999978
+ m_LinearFogStart: 0
+ m_LinearFogEnd: 300
+ m_AmbientSkyColor: {r: .211999997, g: .226999998, b: .259000003, a: 1}
+ m_AmbientEquatorColor: {r: .114, g: .125, b: .133000001, a: 1}
+ m_AmbientGroundColor: {r: .0469999984, g: .0430000015, b: .0350000001, a: 1}
+ m_AmbientIntensity: 1
+ m_AmbientMode: 3
+ m_SkyboxMaterial: {fileID: 0}
+ m_HaloStrength: .5
+ m_FlareStrength: 1
+ m_FlareFadeSpeed: 3
+ m_HaloTexture: {fileID: 0}
+ m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
+ m_DefaultReflectionMode: 0
+ m_DefaultReflectionResolution: 128
+ m_ReflectionBounces: 1
+ m_ReflectionIntensity: 1
+ m_CustomReflection: {fileID: 0}
+ m_Sun: {fileID: 0}
+--- !u!157 &3
+LightmapSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 5
+ m_GIWorkflowMode: 1
+ m_LightmapsMode: 1
+ m_GISettings:
+ serializedVersion: 2
+ m_BounceScale: 1
+ m_IndirectOutputScale: 1
+ m_AlbedoBoost: 1
+ m_TemporalCoherenceThreshold: 1
+ m_EnvironmentLightingMode: 0
+ m_EnableBakedLightmaps: 0
+ m_EnableRealtimeLightmaps: 0
+ m_LightmapEditorSettings:
+ serializedVersion: 3
+ m_Resolution: 2
+ m_BakeResolution: 40
+ m_TextureWidth: 1024
+ m_TextureHeight: 1024
+ m_AOMaxDistance: 1
+ m_Padding: 2
+ m_CompAOExponent: 0
+ m_LightmapParameters: {fileID: 0}
+ m_TextureCompression: 1
+ m_FinalGather: 0
+ m_FinalGatherRayCount: 1024
+ m_ReflectionCompression: 2
+ m_LightmapSnapshot: {fileID: 0}
+ m_RuntimeCPUUsage: 25
+--- !u!196 &4
+NavMeshSettings:
+ serializedVersion: 2
+ m_ObjectHideFlags: 0
+ m_BuildSettings:
+ serializedVersion: 2
+ agentRadius: .5
+ agentHeight: 2
+ agentSlope: 45
+ agentClimb: .400000006
+ ledgeDropHeight: 0
+ maxJumpAcrossDistance: 0
+ accuratePlacement: 0
+ minRegionArea: 2
+ cellSize: .166666672
+ manualCellSize: 0
+ m_NavMeshData: {fileID: 0}
+--- !u!1 &476101859
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 476101860}
+ - 222: {fileID: 476101862}
+ - 114: {fileID: 476101861}
+ m_Layer: 5
+ m_Name: Background-Flight
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!224 &476101860
+RectTransform:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 476101859}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 1866791882}
+ m_RootOrder: 1
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!114 &476101861
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 476101859}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 1, g: 1, b: 1, a: 1}
+ m_RaycastTarget: 0
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 21300000, guid: 0115c816d260a0947976c8ea804febbc, type: 3}
+ m_Type: 0
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!222 &476101862
+CanvasRenderer:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 476101859}
+--- !u!224 &1026898450 stripped
+RectTransform:
+ m_PrefabParentObject: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f,
+ type: 2}
+ m_PrefabInternal: {fileID: 1220268543}
+--- !u!1001 &1220268543
+Prefab:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Modification:
+ m_TransformParent: {fileID: 1866791882}
+ m_Modifications:
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_LocalPosition.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_LocalPosition.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_LocalPosition.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_LocalRotation.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_LocalRotation.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_LocalRotation.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_LocalRotation.w
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_RootOrder
+ value: 2
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchoredPosition.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchoredPosition.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_SizeDelta.x
+ value: 250
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_SizeDelta.y
+ value: 45
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchorMin.x
+ value: .5
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchorMin.y
+ value: .5
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchorMax.x
+ value: .5
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchorMax.y
+ value: .5
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Pivot.x
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 22476196, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Pivot.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 22478174, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchorMin.y
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 22478174, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchorMax.y
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 22478174, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchoredPosition.x
+ value: 125
+ objectReference: {fileID: 0}
+ - target: {fileID: 22478174, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchoredPosition.y
+ value: -12.5
+ objectReference: {fileID: 0}
+ - target: {fileID: 22478174, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_SizeDelta.x
+ value: 250
+ objectReference: {fileID: 0}
+ - target: {fileID: 22478174, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_SizeDelta.y
+ value: 25
+ objectReference: {fileID: 0}
+ - target: {fileID: 22483410, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchorMin.y
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 22483410, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchorMax.y
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 22483410, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchoredPosition.x
+ value: 125
+ objectReference: {fileID: 0}
+ - target: {fileID: 22483410, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_SizeDelta.x
+ value: 250
+ objectReference: {fileID: 0}
+ - target: {fileID: 22483410, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_SizeDelta.y
+ value: 20
+ objectReference: {fileID: 0}
+ - target: {fileID: 22475412, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchorMin.y
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 22475412, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchorMax.y
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 22475412, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchoredPosition.x
+ value: 125
+ objectReference: {fileID: 0}
+ - target: {fileID: 22475412, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_AnchoredPosition.y
+ value: -32.5
+ objectReference: {fileID: 0}
+ - target: {fileID: 22475412, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_SizeDelta.x
+ value: 250
+ objectReference: {fileID: 0}
+ - target: {fileID: 22475412, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_SizeDelta.y
+ value: 25
+ objectReference: {fileID: 0}
+ m_RemovedComponents: []
+ m_ParentPrefab: {fileID: 100100000, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ m_IsPrefabParent: 0
+--- !u!1 &1398276586
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 1398276590}
+ - 114: {fileID: 1398276589}
+ - 114: {fileID: 1398276588}
+ - 114: {fileID: 1398276587}
+ m_Layer: 0
+ m_Name: EventSystem
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!114 &1398276587
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1398276586}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_ForceModuleActive: 0
+--- !u!114 &1398276588
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1398276586}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_HorizontalAxis: Horizontal
+ m_VerticalAxis: Vertical
+ m_SubmitButton: Submit
+ m_CancelButton: Cancel
+ m_InputActionsPerSecond: 10
+ m_RepeatDelay: .5
+ m_ForceModuleActive: 0
+--- !u!114 &1398276589
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1398276586}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_FirstSelected: {fileID: 0}
+ m_sendNavigationEvents: 1
+ m_DragThreshold: 5
+--- !u!4 &1398276590
+Transform:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1398276586}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 2
+--- !u!1 &1866791878
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 1866791882}
+ - 223: {fileID: 1866791881}
+ - 114: {fileID: 1866791880}
+ - 114: {fileID: 1866791879}
+ m_Layer: 5
+ m_Name: Canvas
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!114 &1866791879
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1866791878}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_IgnoreReversedGraphics: 1
+ m_BlockingObjects: 0
+ m_BlockingMask:
+ serializedVersion: 2
+ m_Bits: 4294967295
+--- !u!114 &1866791880
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1866791878}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_UiScaleMode: 0
+ m_ReferencePixelsPerUnit: 100
+ m_ScaleFactor: 1
+ m_ReferenceResolution: {x: 800, y: 600}
+ m_ScreenMatchMode: 0
+ m_MatchWidthOrHeight: 0
+ m_PhysicalUnit: 3
+ m_FallbackScreenDPI: 96
+ m_DefaultSpriteDPI: 96
+ m_DynamicPixelsPerUnit: 1
+--- !u!223 &1866791881
+Canvas:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1866791878}
+ m_Enabled: 1
+ serializedVersion: 2
+ m_RenderMode: 0
+ m_Camera: {fileID: 0}
+ m_PlaneDistance: 100
+ m_PixelPerfect: 0
+ m_ReceivesEvents: 1
+ m_OverrideSorting: 0
+ m_OverridePixelPerfect: 0
+ m_SortingLayerID: 0
+ m_SortingOrder: 0
+--- !u!224 &1866791882
+RectTransform:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 1866791878}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 0, y: 0, z: 0}
+ m_Children:
+ - {fileID: 2037475081}
+ - {fileID: 476101860}
+ - {fileID: 1026898450}
+ m_Father: {fileID: 0}
+ m_RootOrder: 1
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 0, y: 0}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: 0, y: 0}
+--- !u!1 &2037475080
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 4
+ m_Component:
+ - 224: {fileID: 2037475081}
+ - 222: {fileID: 2037475083}
+ - 114: {fileID: 2037475082}
+ m_Layer: 5
+ m_Name: Background-Editor
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!224 &2037475081
+RectTransform:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 2037475080}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 1866791882}
+ m_RootOrder: 0
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: .5, y: .5}
+--- !u!114 &2037475082
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 2037475080}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 1, g: 1, b: 1, a: 1}
+ m_RaycastTarget: 0
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 21300000, guid: b0e2a09d07dbbcb40b0d4db43cd044f9, type: 3}
+ m_Type: 0
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+--- !u!222 &2037475083
+CanvasRenderer:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 2037475080}
+--- !u!1 &2134872726
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 2134872731}
+ - 20: {fileID: 2134872730}
+ - 92: {fileID: 2134872729}
+ - 124: {fileID: 2134872728}
+ - 81: {fileID: 2134872727}
+ m_Layer: 0
+ m_Name: Main Camera
+ m_TagString: MainCamera
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!81 &2134872727
+AudioListener:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 2134872726}
+ m_Enabled: 1
+--- !u!124 &2134872728
+Behaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 2134872726}
+ m_Enabled: 1
+--- !u!92 &2134872729
+Behaviour:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 2134872726}
+ m_Enabled: 1
+--- !u!20 &2134872730
+Camera:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 2134872726}
+ m_Enabled: 1
+ serializedVersion: 2
+ m_ClearFlags: 2
+ m_BackGroundColor: {r: 0, g: 0, b: 0, a: .0196078438}
+ m_NormalizedViewPortRect:
+ serializedVersion: 2
+ x: 0
+ y: 0
+ width: 1
+ height: 1
+ near clip plane: .300000012
+ far clip plane: 1000
+ field of view: 60
+ orthographic: 1
+ orthographic size: 5
+ m_Depth: -1
+ m_CullingMask:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_RenderingPath: -1
+ m_TargetTexture: {fileID: 0}
+ m_TargetDisplay: 0
+ m_TargetEye: 3
+ m_HDR: 0
+ m_OcclusionCulling: 1
+ m_StereoConvergence: 10
+ m_StereoSeparation: .0219999999
+ m_StereoMirrorMode: 0
+--- !u!4 &2134872731
+Transform:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 2134872726}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: -10}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
--- /dev/null
+++ b/Assets/Scripts/Editor/BuildAssetBundles.cs
@@ -1,1 +1,29 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2016 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+using UnityEditor;
+using UnityEngine;
+
+public class BuildAssetBundles : MonoBehaviour
+{
+ [MenuItem("Assets/Build Asset Bundles")]
+ public static void Build()
+ {
+ BuildPipeline.BuildAssetBundles(Application.dataPath + "/../Output/KerbalEngineer", BuildAssetBundleOptions.UncompressedAssetBundle);
+ }
+}
Binary files /dev/null and b/Assets/Testing/background-editor.png differ
Binary files /dev/null and b/Assets/Testing/background-flight.png differ
Binary files a/Assets/ToolbarBackground.psd and /dev/null differ
Binary files a/Assets/ToolbarIcon.psd and /dev/null differ
--- a/Documents/CHANGES.txt
+++ b/Documents/CHANGES.txt
@@ -1,3 +1,95 @@
+ Added: Asset bundle loading and integration.
+ Changed: Thermal flux is now correctly indicated in kilowatts.
+ Changed: Complete rewrite of code underpinning the stock toolbar icons.
+ Changed: Flight Engineer toolbar menu recreated using Unity UI.
+ Changed: Replaced occurances of IMGUI using RenderingManager to use OnGUI directly.
+ Fixed: Toggling the 'Control Bar' now appropriately resizes the display stack.
+
+1.0.19.4, 12-02-16
+ Fixed: Only 'STAGE_STACK_FLOW' and 'STAGE_STACK_FLOW_BALANCE' resources include surface mounted parts as fuel targets.
+ Fixed: Fairing mass being doubled in the VAB (removed workaround for a KSP bug which has been fixed).
+
+1.0.19.3, 09-02-16
+ Fixed: Fuel cross-feed from surface attached parts.
+
+1.0.19.2, 19-11-15
+ Rebuild for KSP 1.0.5.1028 silent update.
+
+1.0.19.1, 09-11-15
+ Added: Key binding editor accessible under 'Settings' on the Build Engineer.
+ Added: Added current vessel name readout. (antplant)
+ Added: 'Relative Radial Velocity' and 'Time To Rendezvous' readouts. (itwtx)
+ Added: Readout help strings. (harryyoung)
+ Changed: The 'Torque' value in the editor is now precise to two decimal places.
+ Changed: Time formatting reference (Kerbin/Earth) is now based on the in-game setting.
+ Changed: Eccentric Anomaly, Mean Anomaly and Mean Anomaly At Epoc now display in degrees rather than radians.
+ Fixed: Optimised time formatting. (itwtx)
+ Fixed: TimeToAtmosphere checks that the Apoapsis is outside atmosphere. (Kerbas-ad-astra)
+ Fixed: Issue with stage priority flow. Caused Rapier calculations to fail if LF and O are drawn from different tanks. (Padishar)
+ Fixed: Issue with angle to prograde/retrograde calculations on highly inclined orbits.
+ Fixed: Editor input locks not being reset when a scene change is forced (e.g. via Kerbal Construction Time).
+ Fixed: Roll axis readout now shows the correct sign.
+ Removed: Time Formatter readout as it's not required anymore.
+
+1.0.18.0
+ Added: Orbital readouts - "Speed at Periapsis" and "Speed at Apoapsis". (Padishar)
+ Added: Manoeuvre readouts - "Post-burn Apoapsis" and "Post-burn Periapsis". (Padishar)
+ Added: Orbital readout - "Time to Atmosphere".
+ Fixed: Synched the minimum simulation time sliders and stopped them from snapping back after 999ms. (saybur)
+ Fixed: Added workaround for the bug in Vessel.horizontalSrfSpeed (Padishar)
+ Fixed: Physically insignificant part mass was not being correctly cascaded down through multiple parent parts.
+ Fixed: Intake air demand calculation not working.
+ Fixed: Some build engineer settings labels do not scale with UI size.
+
+1.0.17.0
+ Added: 'Mach Number' readout under the 'Surface' category and included it on the default surface HUD.
+ Added: Stock sections in the Flight Engineer can now become HUDs.
+ Added 'Thermal' readouts category including:
+ Internal Flux
+ Convection Flux
+ Radiation Flux
+ Critical Part Name
+ Critical Part Temperature
+ Critical Part Skin Temperature
+ Critical Part Thermal Percentage of Max Temperature
+ Hottest Part Name
+ Hottest Part Temperature
+ Hottest Part Skin Temperature
+ Coldest Part Name
+ Coldest Part Temperature
+ Coldest Part Skin Temperature
+
+ Changed: Mach on the Build Engineer now accurate to 2 decimal places.
+ Changed: Max mach in the Build Engineer defaults to 1.00 even when no jet engines are present.
+ Changed: Increased eccentricity readout to 5 decimal places.
+ Changed: Implemented Sarbian's object pooling.
+ Changed: The default selected body is now assigned via 'Planitarium.Home'.
+ Changed: HUDs to clamp fully inside the screen instead of allowing them to run off the edge by a certain amount.
+ Fixed: Physically insignificant part mass is now associated with the parent part.
+ Fixed: Longitude and Latitude readouts now use a KER formatter instead of Squad's incorrect implementation.
+ Fixed: Possible null reference in the Rendezvous Processor.
+ Fixed: Fairing mass issues introduced with regards to simulation changes.
+ Fixed: Use of per-propellant fuel flow mode override.
+ Fixed: Burn times calculated for jet engines.
+ Fixed: Thrust issues introduced with Sarbian's simulation alterations.
+ Fixed: Issue where HUDs positioned close to the top/bottom of the screen could be pushed out of position.
+
+1.0.16.6, 02-05-15
+ Fixed: Separately staged fairing mass jettisons are now calculated in the editor.
+
+1.0.16.5, 02-05-2015
+ Fixed: Delta-V not being correctly calculated.
+ Changed: Editor locking now uses the InputLockManager.
+
+1.0.16.4, 01-05-2015
+ Fixed: Physically insignificant part mass is now accounted for.
+ Changed: Module mass accounted for as it now makes its way onto the launch pad (e.g. fairings).
+
+ Various optimisations:
+ Object pooling.
+ Removed LINQ expressions.
+ Converted foreach to for loops.
+
1.0.16.3, 27-04-2015
Fixed issue with the toolbar icons not being created.
Removed superfluous 'm/s' on the mach slider in the build engineer.
@@ -24,7 +116,7 @@
1.0.15.1, 13-02-2015
Rebuild
-
+
1.0.15.0, 08-02-2015
Padishar's Fixes:
Added: Support KIDS ISP thrust correction.
@@ -34,7 +126,7 @@
1.0.14.1, 28-12-2014
Fixed: Missing texture on the ER-7500 model.
-
+
1.0.14.0, 28-12-2014
Added: Career mode that limits the Flight Engineer by:
- Requiring an Engineer Kerbal of any level, or placement of an Engineer Chip or ER-7500 part.
@@ -154,7 +246,7 @@
Added: New readout to the surface category:
- Vertical Acceleration
- Horizontal Acceleration
-
+
Changed: Atmospheric efficiency readout now shows as a percentage.
Changed: Atmospheric settings (pressure/velocity) in the editor condensed onto a single line.
Fixed: Bug where the overlays in the editor would stay open outside of parts screen.
@@ -311,6 +403,7 @@
Added: Stock toolbar support in the Flight Engineer.
Changed: Orbital Period has higher precision.
Fixed: Various NullRefs in editor window and overlay.
-
+
1.0.0.0, 24-07-2014
Initial release for public testing.
+
--- /dev/null
+++ b/KerbalEngineer.CSharp.Editor.csproj
@@ -1,1 +1,124 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.20506</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{D7B7C6CE-6B5A-CE40-5B7C-9D0E6583E469}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AssemblyName>Assembly-CSharp-Editor</AssemblyName>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Unity Full v3.5</TargetFrameworkProfile>
+ <CompilerResponseFile></CompilerResponseFile>
+ <UnityProjectType>Editor:5</UnityProjectType>
+ <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
+ <UnityVersion>5.2.4f1</UnityVersion>
+ <RootNamespace></RootNamespace>
+ <LangVersion Condition=" '$(VisualStudioVersion)' != '10.0' ">4</LangVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Temp\UnityVS_bin\Debug\</OutputPath>
+ <IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DefineConstants>DEBUG;TRACE;UNITY_5_2_4;UNITY_5_2;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_REFLECTION_BUFFERS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_EVENT_QUEUE;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Temp\UnityVS_bin\Release\</OutputPath>
+ <IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DefineConstants>TRACE;UNITY_5_2_4;UNITY_5_2;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_REFLECTION_BUFFERS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_EVENT_QUEUE;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.XML" />
+ <Reference Include="System.Core" />
+ <Reference Include="Boo.Lang" />
+ <Reference Include="UnityScript.Lang" />
+ <Reference Include="System.Runtime.Serialization" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="UnityEngine">
+ <HintPath>Library\UnityAssemblies\UnityEngine.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor">
+ <HintPath>Library\UnityAssemblies\UnityEditor.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.Advertisements">
+ <HintPath>Library\UnityAssemblies\UnityEditor.Advertisements.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UI">
+ <HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.UI">
+ <HintPath>Library\UnityAssemblies\UnityEditor.UI.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.Networking">
+ <HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.Networking">
+ <HintPath>Library\UnityAssemblies\UnityEditor.Networking.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.Graphs">
+ <HintPath>Library\UnityAssemblies\UnityEditor.Graphs.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.Android.Extensions">
+ <HintPath>Library\UnityAssemblies\UnityEditor.Android.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.iOS.Extensions">
+ <HintPath>Library\UnityAssemblies\UnityEditor.iOS.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.WP8.Extensions">
+ <HintPath>Library\UnityAssemblies\UnityEditor.WP8.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.Metro.Extensions">
+ <HintPath>Library\UnityAssemblies\UnityEditor.Metro.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.Tizen.Extensions">
+ <HintPath>Library\UnityAssemblies\UnityEditor.Tizen.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.SamsungTV.Extensions">
+ <HintPath>Library\UnityAssemblies\UnityEditor.SamsungTV.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.WebGL.Extensions">
+ <HintPath>Library\UnityAssemblies\UnityEditor.WebGL.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.LinuxStandalone.Extensions">
+ <HintPath>Library\UnityAssemblies\UnityEditor.LinuxStandalone.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.WindowsStandalone.Extensions">
+ <HintPath>Library\UnityAssemblies\UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.OSXStandalone.Extensions">
+ <HintPath>Library\UnityAssemblies\UnityEditor.OSXStandalone.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
+ <HintPath>Library\UnityAssemblies\SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
+ </Reference>
+ <Reference Include="Mono.Cecil">
+ <HintPath>Library\UnityAssemblies\Mono.Cecil.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.iOS.Extensions.Xcode">
+ <HintPath>Library\UnityAssemblies\UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
+ </Reference>
+ <Reference Include="KerbalEngineer.Unity">
+ <HintPath>Assets\Plugins\KerbalEngineer.Unity.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Assets\Scripts\Editor\BuildAssetBundles.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath)\SyntaxTree\UnityVS\2015\UnityVS.CSharp.targets" />
+</Project>
--- /dev/null
+++ b/KerbalEngineer.CSharp.csproj
@@ -1,1 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.20506</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{26D24EAD-1AF6-6749-D9C8-C47AEC4E6A98}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AssemblyName>Assembly-CSharp</AssemblyName>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Unity Subset v3.5</TargetFrameworkProfile>
+ <CompilerResponseFile></CompilerResponseFile>
+ <UnityProjectType>Game:1</UnityProjectType>
+ <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
+ <UnityVersion>5.3.3p2</UnityVersion>
+ <RootNamespace></RootNamespace>
+ <LangVersion Condition=" '$(VisualStudioVersion)' != '10.0' ">4</LangVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Temp\UnityVS_bin\Debug\</OutputPath>
+ <IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DefineConstants>DEBUG;TRACE;UNITY_5_3_3;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Temp\UnityVS_bin\Release\</OutputPath>
+ <IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DefineConstants>TRACE;UNITY_5_3_3;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.XML" />
+ <Reference Include="System.Core" />
+ <Reference Include="Boo.Lang" />
+ <Reference Include="UnityScript.Lang" />
+ <Reference Include="System.Runtime.Serialization" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="UnityEngine">
+ <HintPath>Library\UnityAssemblies\UnityEngine.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UI">
+ <HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.Networking">
+ <HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.Networking">
+ <HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UI">
+ <HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor">
+ <HintPath>Library\UnityAssemblies\UnityEditor.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Assets\Scripts\BuildAssetBundles.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath)\SyntaxTree\UnityVS\2015\UnityVS.CSharp.targets" />
+</Project>
--- /dev/null
+++ b/KerbalEngineer.Unity/CanvasGroupFader.cs
@@ -1,1 +1,106 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2016 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Unity
+{
+ using System;
+ using System.Collections;
+ using UnityEngine;
+
+ [RequireComponent(typeof(CanvasGroup))]
+ public class CanvasGroupFader : MonoBehaviour
+ {
+ private CanvasGroup m_CanvasGroup;
+ private IEnumerator m_FadeCoroutine;
+
+ public bool fading
+ {
+ get
+ {
+ return m_FadeCoroutine != null;
+ }
+ }
+
+ /// <summary>
+ /// Fades the canvas group to a specified alpha using the supplied blocking state during fade with optional callback.
+ /// </summary>
+ public void FadeTo(float alpha, float duration, Action callback = null)
+ {
+ if (m_CanvasGroup == null)
+ {
+ return;
+ }
+
+ Fade(m_CanvasGroup.alpha, alpha, duration, callback);
+ }
+
+ /// <summary>
+ /// Sets the alpha value of the canvas group.
+ /// </summary>
+ public void SetAlpha(float alpha)
+ {
+ if (m_CanvasGroup == null)
+ {
+ return;
+ }
+
+ alpha = Mathf.Clamp01(alpha);
+ m_CanvasGroup.alpha = alpha;
+ }
+
+ protected virtual void Awake()
+ {
+ // cache components
+ m_CanvasGroup = GetComponent<CanvasGroup>();
+ }
+
+ /// <summary>
+ /// Starts a fade from one alpha value to another with callback.
+ /// </summary>
+ private void Fade(float from, float to, float duration, Action callback)
+ {
+ if (m_FadeCoroutine != null)
+ {
+ StopCoroutine(m_FadeCoroutine);
+ }
+
+ m_FadeCoroutine = FadeCoroutine(from, to, duration, callback);
+ StartCoroutine(m_FadeCoroutine);
+ }
+
+ /// <summary>
+ /// Coroutine that handles the fading.
+ /// </summary>
+ private IEnumerator FadeCoroutine(float from, float to, float duration, Action callback)
+ {
+ float progress = 0.0f;
+
+ while (progress <= 1.0f)
+ {
+ progress += Time.deltaTime / duration;
+ SetAlpha(Mathf.Lerp(from, to, progress));
+ yield return null;
+ }
+
+ print(m_CanvasGroup.alpha);
+ callback?.Invoke();
+
+ m_FadeCoroutine = null;
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer.Unity/Flight/FlightMenu.cs
@@ -1,1 +1,139 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2016 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Unity.Flight
+{
+ using UnityEngine;
+ using UnityEngine.EventSystems;
+ using UnityEngine.UI;
+
+ public class FlightMenu : CanvasGroupFader, IPointerEnterHandler, IPointerExitHandler
+ {
+ [SerializeField]
+ private Toggle m_ShowEngineerToggle = null;
+
+ [SerializeField]
+ private Toggle m_ControlBarToggle = null;
+
+ [SerializeField]
+ private float m_FastFadeDuration = 0.2f;
+
+ [SerializeField]
+ private float m_SlowFadeDuration = 1.0f;
+
+ private IFlightAppLauncher m_FlightAppLauncher;
+
+ public void OnPointerEnter(PointerEventData eventData)
+ {
+ FadeIn();
+ }
+
+ public void OnPointerExit(PointerEventData eventData)
+ {
+ // slow-fade out if the application launcher button is off
+ if (m_FlightAppLauncher != null && m_FlightAppLauncher.isOn == false)
+ {
+ FadeTo(0.0f, m_SlowFadeDuration, Destroy);
+ }
+ }
+
+ /// <summary>
+ /// Fades out and destroys the menu.
+ /// </summary>
+ public void Close()
+ {
+ FadeTo(0.0f, m_FastFadeDuration, Destroy);
+ }
+
+ /// <summary>
+ /// Fades in the menu.
+ /// </summary>
+ public void FadeIn()
+ {
+ FadeTo(1.0f, m_FastFadeDuration);
+ }
+
+ /// <summary>
+ /// Sets the control bar visiblity.
+ /// </summary>
+ public void SetControlBar(bool visible)
+ {
+ if (m_FlightAppLauncher != null)
+ {
+ m_FlightAppLauncher.controlBar = visible;
+ }
+ }
+
+ /// <summary>
+ /// Sets a reference to the flight app launcher object.
+ /// </summary>
+ public void SetFlightAppLauncher(IFlightAppLauncher flightAppLauncher)
+ {
+ m_FlightAppLauncher = flightAppLauncher;
+ }
+
+ /// <summary>
+ /// Sets the display stack visibility.
+ /// </summary>
+ public void SetShowEngineer(bool visible)
+ {
+ if (m_FlightAppLauncher != null)
+ {
+ m_FlightAppLauncher.showEngineer = visible;
+ }
+ }
+
+ protected virtual void Start()
+ {
+ // set starting alpha to zero and fade in
+ SetAlpha(0.0f);
+ FadeIn();
+ }
+
+ protected virtual void Update()
+ {
+ // set toggle states to match the actual states
+ if (m_FlightAppLauncher != null)
+ {
+ SetToggle(m_ShowEngineerToggle, m_FlightAppLauncher.showEngineer);
+ SetToggle(m_ControlBarToggle, m_FlightAppLauncher.controlBar);
+ }
+ }
+
+ /// <summary>
+ /// Sets a given toggle to the specified state with null checking.
+ /// </summary>
+ private static void SetToggle(Toggle toggle, bool state)
+ {
+ if (toggle != null)
+ {
+ toggle.isOn = state;
+ }
+ }
+
+ /// <summary>
+ /// Destroys the game object.
+ /// </summary>
+ private void Destroy()
+ {
+ // disable game object first due to an issue within unity 5.2.4f1 that shows a single frame at full opaque alpha just before destruction
+ gameObject.SetActive(false);
+ Destroy(gameObject);
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer.Unity/Flight/FlightMenuSection.cs
@@ -1,1 +1,128 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2016 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Unity.Flight
+{
+ using UnityEngine;
+ using UnityEngine.UI;
+
+ public class FlightMenuSection : MonoBehaviour
+ {
+ [SerializeField]
+ private Toggle m_DisplayToggle = null;
+
+ [SerializeField]
+ private Text m_DisplayText = null;
+
+ [SerializeField]
+ private Toggle m_EditToggle = null;
+
+ // //private SectionModule m_Section;
+
+ // /// <summary>
+ // /// Gets or sets the section's display visibility.
+ // /// </summary>
+ // public bool displayVisible
+ // {
+ // get
+ // {
+ // if (m_DisplayToggle != null)
+ // {
+ // return m_DisplayToggle.isOn;
+ // }
+
+ // return true;
+ // }
+ // set
+ // {
+ // if (m_DisplayToggle != null)
+ // {
+ // m_DisplayToggle.isOn = value;
+ // }
+ // }
+ // }
+
+ // /// <summary>
+ // /// Gets or sets the section's editor visibility.
+ // /// </summary>
+ // public bool editorVisible
+ // {
+ // get
+ // {
+ // if (m_EditToggle != null)
+ // {
+ // return m_EditToggle.isOn;
+ // }
+
+ // return true;
+ // }
+ // set
+ // {
+ // if (m_EditToggle != null)
+ // {
+ // m_EditToggle.isOn = value;
+ // }
+ // }
+ // }
+
+ // /// <summary>
+ // /// Sets the assigned section to be handled by the menu object.
+ // /// </summary>
+ // public void SetAssignedSection(ISectionModule section)
+ // {
+ // if (section == null)
+ // {
+ // return;
+ // }
+
+ // //m_Section = section;
+
+ // // set initial toggle states
+ // SetDisplayVisible(section.IsVisible);
+ // SetEditorVisible(editorVisible);
+
+ // //display section name
+ // if (m_DisplayText != null)
+ // {
+ // m_DisplayText.text = section.Name;
+ // }
+ // }
+
+ // /// <summary>
+ // /// Sets the visible state of the section.
+ // /// </summary>
+ // public void SetDisplayVisible(bool visible)
+ // {
+ // if (m_DisplayToggle != null)
+ // {
+ // m_DisplayToggle.isOn = visible;
+ // }
+ // }
+
+ // /// <summary>
+ // /// Sets the section's editor visible state.
+ // /// </summary>
+ // public void SetEditorVisible(bool visible)
+ // {
+ // if (m_EditToggle != null)
+ // {
+ // m_EditToggle.isOn = visible;
+ // }
+ // }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer.Unity/Flight/IFlightAppLauncher.cs
@@ -1,1 +1,11 @@
+namespace KerbalEngineer.Unity.Flight
+{
+ public interface IFlightAppLauncher
+ {
+ bool isOn { get; }
+ bool controlBar { get; set; }
+
+ bool showEngineer { get; set; }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer.Unity/KerbalEngineer.Unity.csproj
@@ -1,1 +1,65 @@
-
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{5387BB1E-32B1-4BAC-B03F-100570B9554C}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>KerbalEngineer.Unity</RootNamespace>
+ <AssemblyName>KerbalEngineer.Unity</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>none</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\Output\KerbalEngineer\</OutputPath>
+ <DefineConstants>
+ </DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="CanvasGroupFader.cs" />
+ <Compile Include="Flight\FlightMenu.cs" />
+ <Compile Include="Flight\FlightMenuSection.cs" />
+ <Compile Include="Flight\IFlightAppLauncher.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="System">
+ <HintPath>..\..\game\KSP_Data\Managed\System.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="UnityEngine">
+ <HintPath>..\..\game\KSP_Data\Managed\UnityEngine.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="UnityEngine.UI">
+ <HintPath>..\..\game\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>copy "$(TargetPath)" "$(SolutionDir)Assets\Plugins" /Y</PostBuildEvent>
+ </PropertyGroup>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
--- /dev/null
+++ b/KerbalEngineer.Unity/Properties/AssemblyInfo.cs
@@ -1,1 +1,10 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+[assembly: AssemblyTitle("KerbalEngineer.Unity")]
+[assembly: AssemblyProduct("KerbalEngineer.Unity")]
+[assembly: AssemblyCopyright("Copyright © CYBUTEK 2016")]
+[assembly: ComVisible(false)]
+[assembly: Guid("5387bb1e-32b1-4bac-b03f-100570b9554c")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
--- a/KerbalEngineer.sln
+++ b/KerbalEngineer.sln
@@ -1,9 +1,11 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.30110.0
-MinimumVisualStudioVersion = 10.0.40219.1
+# Visual Studio 2015
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KerbalEngineer.CSharp.Editor", "KerbalEngineer.CSharp.Editor.csproj", "{D7B7C6CE-6B5A-CE40-5B7C-9D0E6583E469}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KerbalEngineer", "KerbalEngineer\KerbalEngineer.csproj", "{39806613-E0B7-46E0-89A6-A569EC538CBB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KerbalEngineer.Unity", "KerbalEngineer.Unity\KerbalEngineer.Unity.csproj", "{5387BB1E-32B1-4BAC-B03F-100570B9554C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,10 +13,18 @@
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D7B7C6CE-6B5A-CE40-5B7C-9D0E6583E469}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D7B7C6CE-6B5A-CE40-5B7C-9D0E6583E469}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D7B7C6CE-6B5A-CE40-5B7C-9D0E6583E469}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D7B7C6CE-6B5A-CE40-5B7C-9D0E6583E469}.Release|Any CPU.Build.0 = Release|Any CPU
{39806613-E0B7-46E0-89A6-A569EC538CBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39806613-E0B7-46E0-89A6-A569EC538CBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39806613-E0B7-46E0-89A6-A569EC538CBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39806613-E0B7-46E0-89A6-A569EC538CBB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5387BB1E-32B1-4BAC-B03F-100570B9554C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5387BB1E-32B1-4BAC-B03F-100570B9554C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5387BB1E-32B1-4BAC-B03F-100570B9554C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5387BB1E-32B1-4BAC-B03F-100570B9554C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
--- /dev/null
+++ b/KerbalEngineer/AppLauncherButton.cs
@@ -1,1 +1,206 @@
-
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2016 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+namespace KerbalEngineer
+{
+ using KSP.UI;
+ using KSP.UI.Screens;
+ using UnityEngine;
+
+ public class AppLauncherButton : MonoBehaviour
+ {
+ private static Texture m_IconTexture;
+ private ApplicationLauncherButton m_Button;
+
+ /// <summary>
+ /// Gets or sets the toggle button state.
+ /// </summary>
+ public bool isOn
+ {
+ get
+ {
+ return m_Button != null &&
+ m_Button.toggleButton.Button.interactable &&
+ m_Button.toggleButton.CurrentState == UIRadioButton.State.True;
+ }
+ set
+ {
+ if (m_Button == null)
+ {
+ return;
+ }
+
+ if (value)
+ {
+ SetOn();
+ }
+ else
+ {
+ SetOff();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Disables the button if not already disabled.
+ /// </summary>
+ public void Disable()
+ {
+ if (m_Button != null && m_Button.toggleButton.Button.interactable)
+ {
+ m_Button.Disable();
+ }
+ }
+
+ /// <summary>
+ /// Enables the button if not already enabled.
+ /// </summary>
+ public void Enable()
+ {
+ if (m_Button != null && m_Button.toggleButton.Button.interactable == false)
+ {
+ m_Button.Enable();
+ }
+ }
+
+ /// <summary>
+ /// Gets the anchor position for pop-up content.
+ /// </summary>
+ public Vector3 GetAnchor()
+ {
+ if (m_Button == null)
+ {
+ return Vector3.zero;
+ }
+
+ Vector3 anchor = m_Button.GetAnchor();
+
+ anchor.x -= 3.0f;
+
+ return anchor;
+ }
+
+ /// <summary>
+ /// Enables and sets the button to off.
+ /// </summary>
+ public void SetOff()
+ {
+ Enable();
+
+ if (m_Button != null && m_Button.toggleButton.CurrentState != UIRadioButton.State.False)
+ {
+ m_Button.SetTrue();
+ }
+ }
+
+ /// <summary>
+ /// Enables and sets the button to on.
+ /// </summary>
+ public void SetOn()
+ {
+ Enable();
+
+ if (m_Button != null && m_Button.toggleButton.CurrentState != UIRadioButton.State.True)
+ {
+ m_Button.SetTrue();
+ }
+ }
+
+ protected virtual void Awake()
+ {
+ // cache icon texture
+ if (m_IconTexture == null && AssetBundleLoader.images != null)
+ {
+ m_IconTexture = AssetBundleLoader.images.LoadAsset<Texture2D>("app-launcher-icon");
+ }
+
+ // subscribe event listeners
+ GameEvents.onGUIApplicationLauncherReady.Add(OnGUIApplicationLauncherReady);
+ GameEvents.onGUIApplicationLauncherUnreadifying.Add(OnGUIApplicationLauncherUnreadifying);
+ }
+
+ protected virtual void OnDestroy()
+ {
+ // unsubscribe event listeners
+ GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIApplicationLauncherReady);
+ GameEvents.onGUIApplicationLauncherUnreadifying.Remove(OnGUIApplicationLauncherUnreadifying);
+ }
+
+ /// <summary>
+ /// Called on button being disabled.
+ /// </summary>
+ protected virtual void OnDisable() { }
+
+ /// <summary>
+ /// Called on button being enabled.
+ /// </summary>
+ protected virtual void OnEnable() { }
+
+ /// <summary>
+ /// Called on button being toggled off.
+ /// </summary>
+ protected virtual void OnFalse() { }
+
+ /// <summary>
+ /// Called on mouse hovering.
+ /// </summary>
+ protected virtual void OnHover() { }
+
+ /// <summary>
+ /// Called on mouse exiting hover.
+ /// </summary>
+ protected virtual void OnHoverOut() { }
+
+ /// <summary>
+ /// Called on button being ready.
+ /// </summary>
+ protected virtual void OnReady() { }
+
+ /// <summary>
+ /// Called after the application launcher is ready and the button created.
+ /// </summary>
+ protected virtual void OnTrue() { }
+
+ /// <summary>
+ /// Called after the application launcher is unreadified and the button removed.
+ /// </summary>
+ protected virtual void OnUnreadifying() { }
+
+ private void OnGUIApplicationLauncherReady()
+ {
+ // create button
+ if (ApplicationLauncher.Instance != null)
+ {
+ m_Button = ApplicationLauncher.Instance.AddModApplication(OnTrue, OnFalse, OnHover, OnHoverOut, OnEnable, OnDisable, ApplicationLauncher.AppScenes.ALWAYS, m_IconTexture);
+ }
+
+ OnReady();
+ }
+
+ private void OnGUIApplicationLauncherUnreadifying(GameScenes scene)
+ {
+ // remove button
+ if (ApplicationLauncher.Instance != null && m_Button != null)
+ {
+ ApplicationLauncher.Instance.RemoveModApplication(m_Button);
+ }
+
+ OnUnreadifying();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/AssetBundleLoader.cs
@@ -1,1 +1,59 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2016 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer
+{
+ using UnityEngine;
+
+ [KSPAddon(KSPAddon.Startup.Instantly, false)]
+ public class AssetBundleLoader : MonoBehaviour
+ {
+ private static AssetBundle m_Images;
+ private static AssetBundle m_Prefabs;
+
+ /// <summary>
+ /// Gets the loaded images asset bundle.
+ /// </summary>
+ public static AssetBundle images
+ {
+ get
+ {
+ return m_Images;
+ }
+ }
+
+ /// <summary>
+ /// Gets the loaded prefabs asset bundle.
+ /// </summary>
+ public static AssetBundle prefabs
+ {
+ get
+ {
+ return m_Prefabs;
+ }
+ }
+
+ protected virtual void Awake()
+ {
+ string bundlePath = EngineerGlobals.AssemblyPath;
+
+ m_Images = AssetBundle.CreateFromFile(bundlePath + "/images");
+ m_Prefabs = AssetBundle.CreateFromFile(bundlePath + "/prefabs");
+ }
+ }
+}
--- a/KerbalEngineer/CelestialBodies.cs
+++ b/KerbalEngineer/CelestialBodies.cs
@@ -37,7 +37,8 @@
try
{
SystemBody = new BodyInfo(PSystemManager.Instance.localBodies.Find(b => b.referenceBody == null || b.referenceBody == b));
- if (!SetSelectedBody("Kerbin"))
+ String homeCBName = Planetarium.fetch.Home.bodyName;
+ if (!SetSelectedBody(homeCBName))
{
SelectedBody = SystemBody;
SelectedBody.SetSelected(true);
--- a/KerbalEngineer/Control/ControlCentre.cs
+++ b/KerbalEngineer/Control/ControlCentre.cs
@@ -142,7 +142,7 @@
try
{
GUI.skin = null;
- this.position = GUILayout.Window(this.GetInstanceID(), this.position, this.Window, "KERBAL ENGINEER REDUX " + EngineerGlobals.AssemblyVersion + " - CONTROL CENTRE", HighLogic.Skin.window);
+ this.position = GUILayout.Window(this.GetInstanceID(), this.position, this.Window, "KERBAL ENGINEER REDUX " + EngineerGlobals.ASSEMBLY_VERSION + " - CONTROL CENTRE", HighLogic.Skin.window);
this.CentreWindow();
}
catch (Exception ex)
--- a/KerbalEngineer/Editor/BuildAdvanced.cs
+++ b/KerbalEngineer/Editor/BuildAdvanced.cs
@@ -1,7 +1,5 @@
//
-// Kerbal Engineer Redux
-//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -19,25 +17,26 @@
namespace KerbalEngineer.Editor
{
- #region Using Directives
-
using System;
- using System.Linq;
using Extensions;
using Flight;
using Helpers;
+ using KeyBinding;
using Settings;
using UIControls;
using UnityEngine;
using VesselSimulator;
- #endregion
-
[KSPAddon(KSPAddon.Startup.EditorAny, false)]
public class BuildAdvanced : MonoBehaviour
{
- #region Fields
- public static float Altitude = 0.0f;
+ public static float Altitude;
+
+ private static Rect compactModeRect = new Rect(0.0f, 5.0f, 0.0f, 20.0f);
+ private static Stage stage;
+ private static int stagesCount;
+ private static int stagesLength;
+ private static string title;
private GUIStyle areaSettingStyle;
private GUIStyle areaStyle;
@@ -54,6 +53,7 @@
private bool hasChanged;
private GUIStyle infoStyle;
private bool isEditorLocked;
+ private float maxMach;
private int numberOfStages;
private Rect position = new Rect(265.0f, 45.0f, 0, 0);
private GUIStyle settingAtmoStyle;
@@ -65,11 +65,6 @@
private GUIStyle titleStyle;
private bool visible = true;
private GUIStyle windowStyle;
- private float maxMach;
-
- #endregion
-
- #region Properties
/// <summary>
/// Gets the current instance if started or returns null.
@@ -81,8 +76,14 @@
/// </summary>
public bool CompactMode
{
- get { return this.compactMode; }
- set { this.compactMode = value; }
+ get
+ {
+ return compactMode;
+ }
+ set
+ {
+ compactMode = value;
+ }
}
/// <summary>
@@ -90,8 +91,14 @@
/// </summary>
public bool ShowAllStages
{
- get { return this.showAllStages; }
- set { this.showAllStages = value; }
+ get
+ {
+ return showAllStages;
+ }
+ set
+ {
+ showAllStages = value;
+ }
}
/// <summary>
@@ -99,8 +106,14 @@
/// </summary>
public bool ShowAtmosphericDetails
{
- get { return this.showAtmosphericDetails; }
- set { this.showAtmosphericDetails = value; }
+ get
+ {
+ return showAtmosphericDetails;
+ }
+ set
+ {
+ showAtmosphericDetails = value;
+ }
}
/// <summary>
@@ -108,8 +121,14 @@
/// </summary>
public bool ShowSettings
{
- get { return this.showSettings; }
- set { this.showSettings = value; }
+ get
+ {
+ return showSettings;
+ }
+ set
+ {
+ showSettings = value;
+ }
}
/// <summary>
@@ -117,26 +136,28 @@
/// </summary>
public bool Visible
{
- get { return this.visible; }
- set { this.visible = value; }
- }
-
- #endregion
-
- #region Methods
+ get
+ {
+ return visible;
+ }
+ set
+ {
+ visible = value;
+ }
+ }
protected void Awake()
{
try
{
Instance = this;
- this.bodiesList = this.gameObject.AddComponent<DropDown>();
- this.bodiesList.DrawCallback = this.DrawBodiesList;
- this.Load();
+ bodiesList = gameObject.AddComponent<DropDown>();
+ bodiesList.DrawCallback = DrawBodiesList;
+ Load();
SimManager.UpdateModSettings();
- SimManager.OnReady -= this.GetStageInfo;
- SimManager.OnReady += this.GetStageInfo;
+ SimManager.OnReady -= GetStageInfo;
+ SimManager.OnReady += GetStageInfo;
}
catch (Exception ex)
{
@@ -149,70 +170,90 @@
/// </summary>
protected void OnDestroy()
{
+ Logger.Log("BuildAdvanced->OnDestroy");
+
try
{
- var handler = new SettingHandler();
- handler.Set("visible", this.visible);
- handler.Set("windowPositionX", this.position.x);
- handler.Set("windowPositionY", this.position.y);
- handler.Set("compactMode", this.compactMode);
- handler.Set("compactCollapseRight", this.compactCollapseRight);
- handler.Set("showAllStages", this.showAllStages);
- handler.Set("showAtmosphericDetails", this.showAtmosphericDetails);
- handler.Set("showSettings", this.showSettings);
+ SettingHandler handler = new SettingHandler();
+ handler.Set("visible", visible);
+ handler.Set("windowPositionX", position.x);
+ handler.Set("windowPositionY", position.y);
+ handler.Set("compactMode", compactMode);
+ handler.Set("compactCollapseRight", compactCollapseRight);
+ handler.Set("showAllStages", showAllStages);
+ handler.Set("showAtmosphericDetails", showAtmosphericDetails);
+ handler.Set("showSettings", showSettings);
handler.Set("selectedBodyName", CelestialBodies.SelectedBody.Name);
handler.Save("BuildAdvanced.xml");
- GuiDisplaySize.OnSizeChanged -= this.OnSizeChanged;
+ GuiDisplaySize.OnSizeChanged -= OnSizeChanged;
}
catch (Exception ex)
{
Logger.Exception(ex, "BuildAdvanced.OnDestroy()");
}
+
+ EditorLock(false);
}
protected void OnGUI()
{
try
{
- if (!this.visible || EditorLogic.fetch == null || EditorLogic.fetch.ship.parts.Count == 0 || EditorLogic.fetch.editorScreen != EditorScreen.Parts)
+ if (!visible || EditorLogic.fetch == null || EditorLogic.fetch.ship.parts.Count == 0 || EditorLogic.fetch.editorScreen != EditorScreen.Parts)
{
return;
}
- if (this.stages == null)
+ if (stages == null)
{
return;
}
// Change the window title based on whether in compact mode or not.
- var title = !this.compactMode ? "KERBAL ENGINEER REDUX " + EngineerGlobals.AssemblyVersion : "K.E.R. " + EngineerGlobals.AssemblyVersion + (this.showAtmosphericDetails ? " (ATMOS.)" : String.Empty);
+ title = !compactMode ? "KERBAL ENGINEER REDUX " + EngineerGlobals.ASSEMBLY_VERSION : "K.E.R. " + EngineerGlobals.ASSEMBLY_VERSION;
// Reset the window size when the staging or something else has changed.
- var stageCount = this.stages.Count(stage => this.showAllStages || stage.deltaV > 0);
- if (this.hasChanged || stageCount != this.numberOfStages)
- {
- this.hasChanged = false;
- this.numberOfStages = stageCount;
-
- this.position.width = 0;
- this.position.height = 0;
+ stagesLength = stages.Length;
+ if (showAllStages)
+ {
+ stagesCount = stagesLength;
+ }
+ if (showAllStages == false)
+ {
+ stagesCount = 0;
+ for (int i = 0; i < stagesLength; ++i)
+ {
+ if (stages[i].deltaV > 0.0f)
+ {
+ stagesCount = stagesCount + 1;
+ }
+ }
+ }
+
+ if (hasChanged || stagesCount != numberOfStages)
+ {
+ hasChanged = false;
+ numberOfStages = stagesCount;
+
+ position.width = 0;
+ position.height = 0;
}
GUI.skin = null;
- this.position = GUILayout.Window(this.GetInstanceID(), this.position, this.Window, title, this.windowStyle).ClampToScreen();
-
- if (this.compactCheck > 0 && this.compactCollapseRight)
- {
- this.position.x = this.compactRight - this.position.width;
- this.compactCheck--;
- }
- else if (this.compactCheck > 0)
- {
- this.compactCheck = 0;
+ position = GUILayout.Window(GetInstanceID(), position, Window, title, windowStyle).ClampToScreen();
+
+ if (compactCheck > 0 && compactCollapseRight)
+ {
+ position.x = compactRight - position.width;
+ compactCheck--;
+ }
+ else if (compactCheck > 0)
+ {
+ compactCheck = 0;
}
// Check editor lock to manage click-through.
- this.CheckEditorLock();
+ CheckEditorLock();
}
catch (Exception ex)
{
@@ -224,8 +265,8 @@
{
try
{
- this.InitialiseStyles();
- GuiDisplaySize.OnSizeChanged += this.OnSizeChanged;
+ InitialiseStyles();
+ GuiDisplaySize.OnSizeChanged += OnSizeChanged;
}
catch (Exception ex)
{
@@ -239,23 +280,23 @@
{
if (Input.GetKeyDown(KeyBinder.EditorShowHide))
{
- this.visible = !this.visible;
- if (!this.visible)
+ visible = !visible;
+ if (!visible)
{
- this.EditorLock(false);
+ EditorLock(false);
}
}
- if (!this.visible || EditorLogic.fetch == null || EditorLogic.fetch.ship.parts.Count == 0)
- {
- this.bodiesList.enabled = false;
+ if (!visible || EditorLogic.fetch == null || EditorLogic.fetch.ship.parts.Count == 0)
+ {
+ bodiesList.enabled = false;
return;
}
// Configure the simulation parameters based on the selected reference body.
SimManager.Gravity = CelestialBodies.SelectedBody.Gravity;
- if (this.showAtmosphericDetails)
+ if (showAtmosphericDetails)
{
SimManager.Atmosphere = CelestialBodies.SelectedBody.GetAtmospheres(Altitude);
}
@@ -264,7 +305,7 @@
SimManager.Atmosphere = 0;
}
- SimManager.Mach = this.atmosphericMach;
+ SimManager.Mach = atmosphericMach;
SimManager.RequestSimulation();
SimManager.TryStartSimulation();
@@ -280,13 +321,13 @@
/// </summary>
private void CheckEditorLock()
{
- if ((this.position.MouseIsOver() || this.bodiesList.Position.MouseIsOver()) && !this.isEditorLocked)
- {
- this.EditorLock(true);
- }
- else if (!this.position.MouseIsOver() && !this.bodiesList.Position.MouseIsOver() && this.isEditorLocked)
- {
- this.EditorLock(false);
+ if ((position.MouseIsOver() || bodiesList.Position.MouseIsOver()) && !isEditorLocked)
+ {
+ EditorLock(true);
+ }
+ else if (!position.MouseIsOver() && !bodiesList.Position.MouseIsOver() && isEditorLocked)
+ {
+ EditorLock(false);
}
}
@@ -299,7 +340,7 @@
{
GUILayout.BeginHorizontal();
GUILayout.BeginVertical();
- GUILayout.Label("Altitude: " + (Altitude * 0.001f).ToString("F1") + "km", this.settingAtmoStyle, GUILayout.Width(125.0f * GuiDisplaySize.Offset));
+ GUILayout.Label("Altitude: " + (Altitude * 0.001f).ToString("F1") + "km", settingAtmoStyle, GUILayout.Width(125.0f * GuiDisplaySize.Offset));
GUI.skin = HighLogic.Skin;
Altitude = GUILayout.HorizontalSlider(Altitude, 0.0f, (float)(CelestialBodies.SelectedBody.CelestialBody.atmosphereDepth));
GUI.skin = null;
@@ -308,7 +349,7 @@
GUILayout.Space(5.0f);
GUILayout.BeginVertical();
- GUILayout.Label("Mach: " + this.atmosphericMach.ToString("F1"), this.settingAtmoStyle, GUILayout.Width(125.0f * GuiDisplaySize.Offset));
+ GUILayout.Label("Mach: " + atmosphericMach.ToString("F2"), settingAtmoStyle, GUILayout.Width(125.0f * GuiDisplaySize.Offset));
GUI.skin = HighLogic.Skin;
atmosphericMach = GUILayout.HorizontalSlider(Mathf.Clamp(atmosphericMach, 0.0f, maxMach), 0.0f, maxMach);
GUI.skin = null;
@@ -325,13 +366,13 @@
{
if (CelestialBodies.SystemBody == CelestialBodies.SelectedBody)
{
- this.DrawBody(CelestialBodies.SystemBody);
+ DrawBody(CelestialBodies.SystemBody);
}
else
{
- foreach (var body in CelestialBodies.SystemBody.Children)
- {
- this.DrawBody(body);
+ foreach (CelestialBodies.BodyInfo body in CelestialBodies.SystemBody.Children)
+ {
+ DrawBody(body);
}
}
}
@@ -340,19 +381,19 @@
{
GUILayout.BeginHorizontal();
GUILayout.Space(20.0f * depth);
- if (GUILayout.Button(bodyInfo.Children.Count > 0 ? bodyInfo.Name + " [" + bodyInfo.Children.Count + "]" : bodyInfo.Name, bodyInfo.Selected && bodyInfo.SelectedDepth == 0 ? this.bodiesButtonActiveStyle : this.bodiesButtonStyle))
+ if (GUILayout.Button(bodyInfo.Children.Count > 0 ? bodyInfo.Name + " [" + bodyInfo.Children.Count + "]" : bodyInfo.Name, bodyInfo.Selected && bodyInfo.SelectedDepth == 0 ? bodiesButtonActiveStyle : bodiesButtonStyle))
{
CelestialBodies.SetSelectedBody(bodyInfo.Name);
Altitude = 0.0f;
- this.bodiesList.Resize = true;
+ bodiesList.Resize = true;
}
GUILayout.EndHorizontal();
if (bodyInfo.Selected)
{
- foreach (var body in bodyInfo.Children)
- {
- this.DrawBody(body, depth + 1);
+ for (int i = 0; i < bodyInfo.Children.Count; ++i)
+ {
+ DrawBody(bodyInfo.Children[i], depth + 1);
}
}
}
@@ -363,12 +404,13 @@
private void DrawBurnTime()
{
GUILayout.BeginVertical(GUILayout.Width(75.0f * GuiDisplaySize.Offset));
- GUILayout.Label("BURN", this.titleStyle);
- foreach (var stage in this.stages)
- {
- if (this.showAllStages || stage.deltaV > 0)
- {
- GUILayout.Label(TimeFormatter.ConvertToString(stage.time), this.infoStyle);
+ GUILayout.Label("BURN", titleStyle);
+ for (int i = 0; i < stagesLength; ++i)
+ {
+ stage = stages[i];
+ if (showAllStages || stage.deltaV > 0.0)
+ {
+ GUILayout.Label(TimeFormatter.ConvertToString(stage.time), infoStyle);
}
}
GUILayout.EndVertical();
@@ -380,12 +422,13 @@
private void DrawCost()
{
GUILayout.BeginVertical(GUILayout.Width(110.0f * GuiDisplaySize.Offset));
- GUILayout.Label("COST", this.titleStyle);
- foreach (var stage in this.stages)
- {
- if (this.showAllStages || stage.deltaV > 0)
- {
- GUILayout.Label(Units.Cost(stage.cost, stage.totalCost), this.infoStyle);
+ GUILayout.Label("COST", titleStyle);
+ for (int i = 0; i < stagesLength; ++i)
+ {
+ stage = stages[i];
+ if (showAllStages || stage.deltaV > 0.0)
+ {
+ GUILayout.Label(Units.Cost(stage.cost, stage.totalCost), infoStyle);
}
}
GUILayout.EndVertical();
@@ -397,12 +440,13 @@
private void DrawDeltaV()
{
GUILayout.BeginVertical(GUILayout.Width(100.0f * GuiDisplaySize.Offset));
- GUILayout.Label("DELTA-V", this.titleStyle);
- foreach (var stage in this.stages)
- {
- if (this.showAllStages || stage.deltaV > 0)
- {
- GUILayout.Label(stage.deltaV.ToString("N0") + " / " + stage.inverseTotalDeltaV.ToString("N0") + "m/s", this.infoStyle);
+ GUILayout.Label("DELTA-V", titleStyle);
+ for (int i = 0; i < stagesLength; ++i)
+ {
+ stage = stages[i];
+ if (showAllStages || stage.deltaV > 0.0)
+ {
+ GUILayout.Label(stage.deltaV.ToString("N0") + " / " + stage.inverseTotalDeltaV.ToString("N0") + "m/s", infoStyle);
}
}
GUILayout.EndVertical();
@@ -414,12 +458,13 @@
private void DrawIsp()
{
GUILayout.BeginVertical(GUILayout.Width(75.0f * GuiDisplaySize.Offset));
- GUILayout.Label("ISP", this.titleStyle);
- foreach (var stage in this.stages)
- {
- if (this.showAllStages || stage.deltaV > 0)
- {
- GUILayout.Label(stage.isp.ToString("F1") + "s", this.infoStyle);
+ GUILayout.Label("ISP", titleStyle);
+ for (int i = 0; i < stagesLength; ++i)
+ {
+ stage = stages[i];
+ if (showAllStages || stage.deltaV > 0.0)
+ {
+ GUILayout.Label(stage.isp.ToString("F1") + "s", infoStyle);
}
}
GUILayout.EndVertical();
@@ -431,12 +476,13 @@
private void DrawMass()
{
GUILayout.BeginVertical(GUILayout.Width(110.0f * GuiDisplaySize.Offset));
- GUILayout.Label("MASS", this.titleStyle);
- foreach (var stage in this.stages)
- {
- if (this.showAllStages || stage.deltaV > 0)
- {
- GUILayout.Label(Units.ToMass(stage.mass, stage.totalMass), this.infoStyle);
+ GUILayout.Label("MASS", titleStyle);
+ for (int i = 0; i < stagesLength; ++i)
+ {
+ stage = stages[i];
+ if (showAllStages || stage.deltaV > 0.0)
+ {
+ GUILayout.Label(Units.ToMass(stage.mass, stage.totalMass), infoStyle);
}
}
GUILayout.EndVertical();
@@ -448,12 +494,13 @@
private void DrawPartCount()
{
GUILayout.BeginVertical(GUILayout.Width(50.0f * GuiDisplaySize.Offset));
- GUILayout.Label("PARTS", this.titleStyle);
- foreach (var stage in this.stages)
- {
- if (this.showAllStages || stage.deltaV > 0)
- {
- GUILayout.Label(stage.partCount + " / " + stage.totalPartCount, this.infoStyle);
+ GUILayout.Label("PARTS", titleStyle);
+ for (int i = 0; i < stagesLength; ++i)
+ {
+ stage = stages[i];
+ if (showAllStages || stage.deltaV > 0.0)
+ {
+ GUILayout.Label(stage.partCount + " / " + stage.totalPartCount, infoStyle);
}
}
GUILayout.EndVertical();
@@ -465,50 +512,64 @@
private void DrawSettings()
{
GUILayout.BeginHorizontal();
- GUILayout.Label("Compact mode collapses to the:", this.settingStyle);
- this.compactCollapseRight = !GUILayout.Toggle(!this.compactCollapseRight, "LEFT", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
- this.compactCollapseRight = GUILayout.Toggle(this.compactCollapseRight, "RIGHT", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+ GUILayout.Label("Compact mode collapses to the:", settingStyle);
+ compactCollapseRight = !GUILayout.Toggle(!compactCollapseRight, "LEFT", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+ compactCollapseRight = GUILayout.Toggle(compactCollapseRight, "RIGHT", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
- GUILayout.Label("Simulate using vectored thrust values:");
- SimManager.vectoredThrust = GUILayout.Toggle(SimManager.vectoredThrust, "ENABLED", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+ GUILayout.Label("Simulate using vectored thrust values:", settingStyle);
+ SimManager.vectoredThrust = GUILayout.Toggle(SimManager.vectoredThrust, "ENABLED", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
- GUILayout.Label("Build Engineer Overlay:", this.settingStyle);
- BuildOverlay.Visible = GUILayout.Toggle(BuildOverlay.Visible, "VISIBLE", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
- BuildOverlayPartInfo.NamesOnly = GUILayout.Toggle(BuildOverlayPartInfo.NamesOnly, "NAMES ONLY", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
- BuildOverlayPartInfo.ClickToOpen = GUILayout.Toggle(BuildOverlayPartInfo.ClickToOpen, "CLICK TO OPEN", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+ GUILayout.Label("Verbose Simulation Log:", settingStyle);
+ SimManager.logOutput = GUILayout.Toggle(SimManager.logOutput, "ENABLED", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
- GUILayout.Label("Flight Engineer activation mode:", this.settingStyle);
- FlightEngineerCore.IsCareerMode = GUILayout.Toggle(FlightEngineerCore.IsCareerMode, "CAREER", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
- FlightEngineerCore.IsCareerMode = !GUILayout.Toggle(!FlightEngineerCore.IsCareerMode, "PARTLESS", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+ GUILayout.Label("Build Engineer Overlay:", settingStyle);
+ BuildOverlay.Visible = GUILayout.Toggle(BuildOverlay.Visible, "VISIBLE", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+ BuildOverlayPartInfo.NamesOnly = GUILayout.Toggle(BuildOverlayPartInfo.NamesOnly, "NAMES ONLY", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+ BuildOverlayPartInfo.ClickToOpen = GUILayout.Toggle(BuildOverlayPartInfo.ClickToOpen, "CLICK TO OPEN", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
- GUILayout.Label("Flight Engineer Career Limitations:", this.settingStyle);
- FlightEngineerCore.IsKerbalLimited = GUILayout.Toggle(FlightEngineerCore.IsKerbalLimited, "KERBAL", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
- FlightEngineerCore.IsTrackingStationLimited = GUILayout.Toggle(FlightEngineerCore.IsTrackingStationLimited, "TRACKING", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+ GUILayout.Label("Flight Engineer activation mode:", settingStyle);
+ FlightEngineerCore.IsCareerMode = GUILayout.Toggle(FlightEngineerCore.IsCareerMode, "CAREER", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+ FlightEngineerCore.IsCareerMode = !GUILayout.Toggle(!FlightEngineerCore.IsCareerMode, "PARTLESS", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
- GUILayout.Label("GUI Size: " + GuiDisplaySize.Increment, this.settingStyle);
- if (GUILayout.Button("<", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset)))
+ GUILayout.Label("Flight Engineer Career Limitations:", settingStyle);
+ FlightEngineerCore.IsKerbalLimited = GUILayout.Toggle(FlightEngineerCore.IsKerbalLimited, "KERBAL", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+ FlightEngineerCore.IsTrackingStationLimited = GUILayout.Toggle(FlightEngineerCore.IsTrackingStationLimited, "TRACKING", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset));
+ GUILayout.EndHorizontal();
+
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("Key Bindings:", settingStyle);
+ if (GUILayout.Button("EDIT KEY BINDINGS", buttonStyle, GUILayout.Width(200.0f * GuiDisplaySize.Offset)))
+ {
+ KeyBinder.Show();
+ }
+ GUILayout.EndHorizontal();
+
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("GUI Size: " + GuiDisplaySize.Increment, settingStyle);
+ if (GUILayout.Button("<", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset)))
{
GuiDisplaySize.Increment--;
}
- if (GUILayout.Button(">", this.buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset)))
+ if (GUILayout.Button(">", buttonStyle, GUILayout.Width(100.0f * GuiDisplaySize.Offset)))
{
GuiDisplaySize.Increment++;
}
GUILayout.EndHorizontal();
- GUILayout.Label("Minimum delay between simulations: " + SimManager.minSimTime.Milliseconds + "ms", this.settingStyle);
+ GUILayout.Label("Minimum delay between simulations: " + SimManager.minSimTime.TotalMilliseconds + "ms", settingStyle);
GUI.skin = HighLogic.Skin;
- SimManager.minSimTime = new TimeSpan(0, 0, 0, 0, (int)GUILayout.HorizontalSlider(SimManager.minSimTime.Milliseconds, 0, 2000.0f));
+ SimManager.minSimTime = TimeSpan.FromMilliseconds(GUILayout.HorizontalSlider((float)SimManager.minSimTime.TotalMilliseconds, 0, 2000.0f));
+
GUI.skin = null;
}
@@ -518,12 +579,13 @@
private void DrawStageNumbers()
{
GUILayout.BeginVertical(GUILayout.Width(30.0f * GuiDisplaySize.Offset));
- GUILayout.Label(string.Empty, this.titleStyle);
- foreach (var stage in this.stages)
- {
- if (this.showAllStages || stage.deltaV > 0)
- {
- GUILayout.Label("S" + stage.number, this.titleStyle);
+ GUILayout.Label(string.Empty, titleStyle);
+ for (int i = 0; i < stagesLength; ++i)
+ {
+ stage = stages[i];
+ if (showAllStages || stage.deltaV > 0.0)
+ {
+ GUILayout.Label("S" + stage.number, titleStyle);
}
}
GUILayout.EndVertical();
@@ -535,12 +597,13 @@
private void DrawThrust()
{
GUILayout.BeginVertical(GUILayout.Width(75.0f * GuiDisplaySize.Offset));
- GUILayout.Label("THRUST", this.titleStyle);
- foreach (var stage in this.stages)
- {
- if (this.showAllStages || stage.deltaV > 0)
- {
- GUILayout.Label(stage.thrust.ToForce(), this.infoStyle);
+ GUILayout.Label("THRUST", titleStyle);
+ for (int i = 0; i < stagesLength; ++i)
+ {
+ stage = stages[i];
+ if (showAllStages || stage.deltaV > 0.0)
+ {
+ GUILayout.Label(stage.thrust.ToForce(), infoStyle);
}
}
GUILayout.EndVertical();
@@ -552,12 +615,13 @@
private void DrawTorque()
{
GUILayout.BeginVertical(GUILayout.Width(75.0f * GuiDisplaySize.Offset));
- GUILayout.Label("TORQUE", this.titleStyle);
- foreach (var stage in this.stages)
- {
- if (this.showAllStages || stage.deltaV > 0)
- {
- GUILayout.Label(stage.maxThrustTorque.ToTorque(), this.infoStyle);
+ GUILayout.Label("TORQUE", titleStyle);
+ for (int i = 0; i < stagesLength; ++i)
+ {
+ stage = stages[i];
+ if (showAllStages || stage.deltaV > 0.0)
+ {
+ GUILayout.Label(stage.maxThrustTorque.ToTorque(), infoStyle);
}
}
GUILayout.EndVertical();
@@ -569,12 +633,13 @@
private void DrawTwr()
{
GUILayout.BeginVertical(GUILayout.Width(100.0f * GuiDisplaySize.Offset));
- GUILayout.Label("TWR (MAX)", this.titleStyle);
- foreach (var stage in this.stages)
- {
- if (this.showAllStages || stage.deltaV > 0)
- {
- GUILayout.Label(stage.thrustToWeight.ToString("F2") + " (" + stage.maxThrustToWeight.ToString("F2") + ")", this.infoStyle);
+ GUILayout.Label("TWR (MAX)", titleStyle);
+ for (int i = 0; i < stagesLength; ++i)
+ {
+ stage = stages[i];
+ if (showAllStages || stage.deltaV > 0.0)
+ {
+ GUILayout.Label(stage.thrustToWeight.ToString("F2") + " (" + stage.maxThrustToWeight.ToString("F2") + ")", infoStyle);
}
}
GUILayout.EndVertical();
@@ -584,15 +649,15 @@
{
if (state)
{
- EditorLogic.fetch.Lock(true, true, true, "KER_BuildAdvanced");
+ InputLockManager.SetControlLock(ControlTypes.All, "KER_BuildAdvanced");
BuildOverlayPartInfo.Hidden = true;
- this.isEditorLocked = true;
+ isEditorLocked = true;
}
else
{
- EditorLogic.fetch.Unlock("KER_BuildAdvanced");
+ InputLockManager.SetControlLock(ControlTypes.None, "KER_BuildAdvanced");
BuildOverlayPartInfo.Hidden = false;
- this.isEditorLocked = false;
+ isEditorLocked = false;
}
}
@@ -610,22 +675,22 @@
/// </summary>
private void InitialiseStyles()
{
- this.windowStyle = new GUIStyle(HighLogic.Skin.window)
+ windowStyle = new GUIStyle(HighLogic.Skin.window)
{
alignment = TextAnchor.UpperLeft
};
- this.areaStyle = new GUIStyle(HighLogic.Skin.box)
+ areaStyle = new GUIStyle(HighLogic.Skin.box)
{
padding = new RectOffset(0, 0, 9, 0)
};
- this.areaSettingStyle = new GUIStyle(HighLogic.Skin.box)
+ areaSettingStyle = new GUIStyle(HighLogic.Skin.box)
{
padding = new RectOffset(10, 10, 10, 10)
};
- this.buttonStyle = new GUIStyle(HighLogic.Skin.button)
+ buttonStyle = new GUIStyle(HighLogic.Skin.button)
{
normal =
{
@@ -636,7 +701,7 @@
alignment = TextAnchor.MiddleCenter
};
- this.titleStyle = new GUIStyle(HighLogic.Skin.label)
+ titleStyle = new GUIStyle(HighLogic.Skin.label)
{
normal =
{
@@ -645,10 +710,10 @@
fontSize = (int)(11 * GuiDisplaySize.Offset),
fontStyle = FontStyle.Bold,
alignment = TextAnchor.MiddleCenter,
- stretchWidth = true,
- };
-
- this.infoStyle = new GUIStyle(HighLogic.Skin.label)
+ stretchWidth = true
+ };
+
+ infoStyle = new GUIStyle(HighLogic.Skin.label)
{
fontSize = (int)(11 * GuiDisplaySize.Offset),
fontStyle = FontStyle.Bold,
@@ -656,21 +721,21 @@
stretchWidth = true
};
- this.settingStyle = new GUIStyle(this.titleStyle)
+ settingStyle = new GUIStyle(titleStyle)
{
alignment = TextAnchor.MiddleLeft,
stretchWidth = true,
stretchHeight = true
};
- this.settingAtmoStyle = new GUIStyle(this.titleStyle)
+ settingAtmoStyle = new GUIStyle(titleStyle)
{
margin = new RectOffset(),
padding = new RectOffset(),
alignment = TextAnchor.UpperLeft
};
- this.bodiesButtonStyle = new GUIStyle(HighLogic.Skin.button)
+ bodiesButtonStyle = new GUIStyle(HighLogic.Skin.button)
{
margin = new RectOffset(0, 0, 2, 0),
padding = new RectOffset(5, 5, 5, 5),
@@ -688,10 +753,10 @@
fixedHeight = 20.0f
};
- this.bodiesButtonActiveStyle = new GUIStyle(this.bodiesButtonStyle)
- {
- normal = this.bodiesButtonStyle.onNormal,
- hover = this.bodiesButtonStyle.onHover
+ bodiesButtonActiveStyle = new GUIStyle(bodiesButtonStyle)
+ {
+ normal = bodiesButtonStyle.onNormal,
+ hover = bodiesButtonStyle.onHover
};
}
@@ -702,15 +767,15 @@
{
try
{
- var handler = SettingHandler.Load("BuildAdvanced.xml");
- handler.Get("visible", ref this.visible);
- this.position.x = handler.Get("windowPositionX", this.position.x);
- this.position.y = handler.Get("windowPositionY", this.position.y);
- handler.Get("compactMode", ref this.compactMode);
- handler.Get("compactCollapseRight", ref this.compactCollapseRight);
- handler.Get("showAllStages", ref this.showAllStages);
- handler.Get("showAtmosphericDetails", ref this.showAtmosphericDetails);
- handler.Get("showSettings", ref this.showSettings);
+ SettingHandler handler = SettingHandler.Load("BuildAdvanced.xml");
+ handler.Get("visible", ref visible);
+ position.x = handler.Get("windowPositionX", position.x);
+ position.y = handler.Get("windowPositionY", position.y);
+ handler.Get("compactMode", ref compactMode);
+ handler.Get("compactCollapseRight", ref compactCollapseRight);
+ handler.Get("showAllStages", ref showAllStages);
+ handler.Get("showAtmosphericDetails", ref showAtmosphericDetails);
+ handler.Get("showSettings", ref showSettings);
CelestialBodies.SetSelectedBody(handler.Get("selectedBodyName", CelestialBodies.SelectedBody.Name));
}
catch (Exception ex)
@@ -721,8 +786,8 @@
private void OnSizeChanged()
{
- this.InitialiseStyles();
- this.hasChanged = true;
+ InitialiseStyles();
+ hasChanged = true;
}
/// <summary>
@@ -732,77 +797,87 @@
{
try
{
+ compactModeRect = new Rect(position.width - 70.0f * GuiDisplaySize.Offset, 5.0f, 65.0f * GuiDisplaySize.Offset, 20.0f);
+
// Draw the compact mode toggle.
- if (GUI.Toggle(new Rect(this.position.width - 70.0f * GuiDisplaySize.Offset, 5.0f, 65.0f * GuiDisplaySize.Offset, 20.0f), this.compactMode, "COMPACT", this.buttonStyle) != this.compactMode)
- {
- this.hasChanged = true;
- this.compactCheck = 2;
- this.compactRight = this.position.xMax;
- this.compactMode = !this.compactMode;
+ if (GUI.Toggle(compactModeRect, compactMode, "COMPACT", buttonStyle) != compactMode)
+ {
+ hasChanged = true;
+ compactCheck = 2;
+ compactRight = position.xMax;
+ compactMode = !compactMode;
}
// When not in compact mode draw the 'All Stages' and 'Atmospheric' toggles.
- if (!this.compactMode)
- {
- if (GUI.Toggle(new Rect(this.position.width - 143.0f * GuiDisplaySize.Offset, 5.0f, 70.0f * GuiDisplaySize.Offset, 20.0f), this.showSettings, "SETTINGS", this.buttonStyle) != this.showSettings)
+ if (!compactMode)
+ {
+ if (GUI.Toggle(new Rect(position.width - 143.0f * GuiDisplaySize.Offset, 5.0f, 70.0f * GuiDisplaySize.Offset, 20.0f), showSettings, "SETTINGS", buttonStyle) != showSettings)
{
- this.hasChanged = true;
- this.showSettings = !this.showSettings;
+ hasChanged = true;
+ showSettings = !showSettings;
}
- if (GUI.Toggle(new Rect(this.position.width - 226.0f * GuiDisplaySize.Offset, 5.0f, 80.0f * GuiDisplaySize.Offset, 20.0f), this.showAllStages, "ALL STAGES", this.buttonStyle) != this.showAllStages)
+ if (GUI.Toggle(new Rect(position.width - 226.0f * GuiDisplaySize.Offset, 5.0f, 80.0f * GuiDisplaySize.Offset, 20.0f), showAllStages, "ALL STAGES", buttonStyle) != showAllStages)
{
- this.hasChanged = true;
- this.showAllStages = !this.showAllStages;
+ hasChanged = true;
+ showAllStages = !showAllStages;
}
- if (GUI.Toggle(new Rect(this.position.width - 324.0f * GuiDisplaySize.Offset, 5.0f, 95.0f * GuiDisplaySize.Offset, 20.0f), this.showAtmosphericDetails, "ATMOSPHERIC", this.buttonStyle) != this.showAtmosphericDetails)
+ if (GUI.Toggle(new Rect(position.width - 324.0f * GuiDisplaySize.Offset, 5.0f, 95.0f * GuiDisplaySize.Offset, 20.0f), showAtmosphericDetails, "ATMOSPHERIC", buttonStyle) != showAtmosphericDetails)
{
- this.hasChanged = true;
- this.showAtmosphericDetails = !this.showAtmosphericDetails;
+ hasChanged = true;
+ showAtmosphericDetails = !showAtmosphericDetails;
}
- this.bodiesListPosition = new Rect(this.position.width - 452.0f * GuiDisplaySize.Offset, 5.0f, 125.0f * GuiDisplaySize.Offset, 20.0f);
- this.bodiesList.enabled = GUI.Toggle(this.bodiesListPosition, this.bodiesList.enabled, "BODY: " + CelestialBodies.SelectedBody.Name.ToUpper(), this.buttonStyle);
- this.bodiesList.SetPosition(this.bodiesListPosition.Translate(this.position));
+ bodiesListPosition = new Rect(position.width - 452.0f * GuiDisplaySize.Offset, 5.0f, 125.0f * GuiDisplaySize.Offset, 20.0f);
+ bodiesList.enabled = GUI.Toggle(bodiesListPosition, bodiesList.enabled, "BODY: " + CelestialBodies.SelectedBody.Name.ToUpper(), buttonStyle);
+ bodiesList.SetPosition(bodiesListPosition.Translate(position));
+ }
+ else
+ {
+ if (GUI.Toggle(new Rect(position.width - 133.0f * GuiDisplaySize.Offset, 5.0f, 60.0f * GuiDisplaySize.Offset, 20.0f), showAtmosphericDetails, "ATMO", buttonStyle) != showAtmosphericDetails)
+ {
+ hasChanged = true;
+ showAtmosphericDetails = !showAtmosphericDetails;
+ }
}
// Draw the main informational display box.
- if (!this.compactMode)
- {
- GUILayout.BeginHorizontal(this.areaStyle);
- this.DrawStageNumbers();
- this.DrawPartCount();
- this.DrawCost();
- this.DrawMass();
- this.DrawIsp();
- this.DrawThrust();
- this.DrawTorque();
- this.DrawTwr();
- this.DrawDeltaV();
- this.DrawBurnTime();
+ if (!compactMode)
+ {
+ GUILayout.BeginHorizontal(areaStyle);
+ DrawStageNumbers();
+ DrawPartCount();
+ DrawCost();
+ DrawMass();
+ DrawIsp();
+ DrawThrust();
+ DrawTorque();
+ DrawTwr();
+ DrawDeltaV();
+ DrawBurnTime();
GUILayout.EndHorizontal();
- if (this.showAtmosphericDetails)
+ if (showAtmosphericDetails && !compactMode)
{
- GUILayout.BeginVertical(this.areaSettingStyle);
- this.DrawAtmosphericDetails();
+ GUILayout.BeginVertical(areaSettingStyle);
+ DrawAtmosphericDetails();
GUILayout.EndVertical();
}
- if (this.showSettings)
+ if (showSettings)
{
- GUILayout.BeginVertical(this.areaSettingStyle);
- this.DrawSettings();
+ GUILayout.BeginVertical(areaSettingStyle);
+ DrawSettings();
GUILayout.EndVertical();
}
}
else // Draw only a few details when in compact mode.
{
- GUILayout.BeginHorizontal(this.areaStyle);
- this.DrawStageNumbers();
- this.DrawTwr();
- this.DrawDeltaV();
+ GUILayout.BeginHorizontal(areaStyle);
+ DrawStageNumbers();
+ DrawTwr();
+ DrawDeltaV();
GUILayout.EndHorizontal();
}
@@ -813,7 +888,5 @@
Logger.Exception(ex, "BuildAdvanced.Window()");
}
}
-
- #endregion
}
}
--- /dev/null
+++ b/KerbalEngineer/Editor/BuildAppLauncher.cs
@@ -1,1 +1,59 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2016 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Editor
+{
+ [KSPAddon(KSPAddon.Startup.EditorAny, false)]
+ public class BuildAppLauncher : AppLauncherButton
+ {
+ protected override void OnFalse()
+ {
+ if (BuildAdvanced.Instance != null)
+ {
+ BuildAdvanced.Instance.Visible = false;
+ }
+ }
+
+ protected override void OnTrue()
+ {
+ if (BuildAdvanced.Instance != null)
+ {
+ BuildAdvanced.Instance.Visible = true;
+ }
+ }
+
+ protected virtual void Update()
+ {
+ if (BuildAdvanced.Instance == null)
+ {
+ return;
+ }
+
+ // check if vessel is currently under construction with the presence of a root part
+ if (EditorLogic.RootPart != null)
+ {
+ // set button state based on existing visibility
+ isOn = BuildAdvanced.Instance.Visible;
+ }
+ else
+ {
+ Disable();
+ }
+ }
+ }
+}
--- a/KerbalEngineer/Editor/BuildOverlayPartInfo.cs
+++ b/KerbalEngineer/Editor/BuildOverlayPartInfo.cs
@@ -28,7 +28,7 @@
public class BuildOverlayPartInfo : MonoBehaviour
{
private static bool clickToOpen = true;
- private static ModuleGenerator.GeneratorResource generatorResource;
+ private static ModuleResource generatorResource;
private static ModuleAlternator moduleAlternator;
private static ModuleDataTransmitter moduleDataTransmitter;
private static ModuleDeployableSolarPanel moduleDeployableSolarPanel;
@@ -131,7 +131,7 @@
position.x = Input.mousePosition.x - 3 - position.width;
}
- part = EditorLogic.fetch.ship.parts.Find(p => p.stackIcon.highlightIcon) ?? EditorLogic.SelectedPart;
+ part = EditorLogic.fetch.ship.parts.Find(p => p.stackIcon.Highlighted) ?? EditorLogic.SelectedPart;
if (part != null)
{
if (!part.Equals(selectedPart))
--- a/KerbalEngineer/Editor/BuildToolbar.cs
+++ /dev/null
@@ -1,120 +1,1 @@
-//
-// Kerbal Engineer Redux
-//
-// Copyright (C) 2014 CYBUTEK
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-#region Using Directives
-
-using System;
-
-using UnityEngine;
-
-#endregion
-
-namespace KerbalEngineer.Editor
-{
- [KSPAddon(KSPAddon.Startup.EditorAny, false)]
- public class BuildToolbar : MonoBehaviour
- {
- #region Fields
-
- private ApplicationLauncherButton button;
-
- #endregion
-
- #region Methods: private
-
- private void Awake()
- {
- GameEvents.onGUIApplicationLauncherReady.Add(this.OnGuiAppLauncherReady);
- Logger.Log("BuildToolbar->Awake");
- }
-
- private void Start()
- {
- if (button == null)
- {
- OnGuiAppLauncherReady();
- }
- }
-
- private void OnDestroy()
- {
- GameEvents.onGUIApplicationLauncherReady.Remove(this.OnGuiAppLauncherReady);
- if (this.button != null)
- {
- ApplicationLauncher.Instance.RemoveModApplication(this.button);
- }
- Logger.Log("BuildToolbar->OnDestroy");
- }
-
- private void OnGuiAppLauncherReady()
- {
- try
- {
- this.button = ApplicationLauncher.Instance.AddModApplication(
- () => BuildAdvanced.Instance.Visible = true,
- () => BuildAdvanced.Instance.Visible = false,
- null,
- null,
- null,
- null,
- ApplicationLauncher.AppScenes.ALWAYS,
- GameDatabase.Instance.GetTexture("KerbalEngineer/Textures/ToolbarIcon", false)
- );
- Logger.Log("BuildToolbar->OnGuiAppLauncherReady");
- }
- catch (Exception ex)
- {
- Logger.Exception(ex, "BuildToolbar->OnGuiAppLauncherReady");
- }
- }
-
- private void Update()
- {
- try
- {
- if (this.button == null)
- {
- return;
- }
-
- if (EditorLogic.fetch != null && EditorLogic.fetch.ship.parts.Count > 0)
- {
- if (BuildAdvanced.Instance.Visible && this.button.State != RUIToggleButton.ButtonState.TRUE)
- {
- this.button.SetTrue();
- }
- else if (!BuildAdvanced.Instance.Visible && this.button.State != RUIToggleButton.ButtonState.FALSE)
- {
- this.button.SetFalse();
- }
- }
- else if (this.button.State != RUIToggleButton.ButtonState.DISABLED)
- {
- this.button.Disable();
- }
- }
- catch (Exception ex)
- {
- Logger.Exception(ex, "BuildToolbar->Update");
- }
- }
-
- #endregion
- }
-}
--- a/KerbalEngineer/Editor/PartInfoItem.cs
+++ b/KerbalEngineer/Editor/PartInfoItem.cs
@@ -19,38 +19,69 @@
namespace KerbalEngineer.Editor
{
+ using System.Collections.Generic;
using VesselSimulator;
- public class PartInfoItem : Pool<PartInfoItem>
+ public class PartInfoItem
{
+ private static readonly Pool<PartInfoItem> pool = new Pool<PartInfoItem>(Create, Reset);
+
public string Name { get; set; }
public string Value { get; set; }
+ private static PartInfoItem Create()
+ {
+ return new PartInfoItem();
+ }
+
+ public void Release()
+ {
+ pool.Release(this);
+ }
+
+ public static void Release(List<PartInfoItem> objList)
+ {
+ for (int i = 0; i < objList.Count; ++i)
+ {
+ objList[i].Release();
+ }
+ }
+
+ private static void Reset(PartInfoItem obj)
+ {
+ obj.Name = string.Empty;
+ obj.Value = string.Empty;
+ }
+
public static PartInfoItem Create(string name)
{
- return GetPoolObject().Initialise(name);
+ return New(name);
}
public static PartInfoItem Create(string name, string value)
{
- return GetPoolObject().Initialise(name, value);
+ return New(name, value);
}
- public PartInfoItem Initialise(string name)
+ public static PartInfoItem New(string name)
{
- Name = name;
- Value = string.Empty;
+ PartInfoItem obj = pool.Borrow();
+
+ obj.Name = name;
+ obj.Value = string.Empty;
- return this;
+ return obj;
}
- public PartInfoItem Initialise(string name, string value)
+ public static PartInfoItem New(string name, string value)
{
- Name = name;
- Value = value;
+ PartInfoItem obj = pool.Borrow();
- return this;
+ obj.Name = name;
+ obj.Value = value;
+
+ return obj;
}
}
}
--- a/KerbalEngineer/EngineerGlobals.cs
+++ b/KerbalEngineer/EngineerGlobals.cs
@@ -1,7 +1,5 @@
//
-// Kerbal Engineer Redux
-//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -17,42 +15,32 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using System.IO;
-using System.Reflection;
-
-#endregion
-
namespace KerbalEngineer
{
- public class EngineerGlobals
+ using System.IO;
+ using System.Reflection;
+
+ public static class EngineerGlobals
{
- #region Constants
-
/// <summary>
/// Current version of the Kerbal Engineer assembly.
/// </summary>
- public const string AssemblyVersion = "1.0.16.3";
-
- #endregion
-
- #region Fields
+ public const string ASSEMBLY_VERSION = "1.0.19.4";
private static string assemblyFile;
private static string assemblyName;
private static string assemblyPath;
-
- #endregion
-
- #region Properties
+ private static string settingsPath;
/// <summary>
/// Gets the Kerbal Engineer assembly's path including the file name.
/// </summary>
public static string AssemblyFile
{
- get { return assemblyFile ?? (assemblyFile = Assembly.GetExecutingAssembly().Location); }
+ get
+ {
+ return assemblyFile ?? (assemblyFile = Assembly.GetExecutingAssembly().Location);
+ }
}
/// <summary>
@@ -60,7 +48,10 @@
/// </summary>
public static string AssemblyName
{
- get { return assemblyName ?? (assemblyName = new FileInfo(AssemblyFile).Name); }
+ get
+ {
+ return assemblyName ?? (assemblyName = new FileInfo(AssemblyFile).Name);
+ }
}
/// <summary>
@@ -68,9 +59,25 @@
/// </summary>
public static string AssemblyPath
{
- get { return assemblyPath ?? (assemblyPath = AssemblyFile.Replace(new FileInfo(AssemblyFile).Name, "")); }
+ get
+ {
+ return assemblyPath ?? (assemblyPath = AssemblyFile.Replace(new FileInfo(AssemblyFile).Name, ""));
+ }
}
- #endregion
+ /// <summary>
+ /// Gets the settings directory path.
+ /// </summary>
+ public static string SettingsPath
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(settingsPath))
+ {
+ settingsPath = Path.Combine(AssemblyPath, "Settings");
+ }
+ return settingsPath;
+ }
+ }
}
}
--- a/KerbalEngineer/Extensions/DoubleExtensions.cs
+++ b/KerbalEngineer/Extensions/DoubleExtensions.cs
@@ -1,7 +1,7 @@
//
// Kerbal Engineer Redux
//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -17,18 +17,12 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using KerbalEngineer.Helpers;
-
-#endregion
-
namespace KerbalEngineer.Extensions
{
+ using Helpers;
+
public static class DoubleExtensions
{
- #region Methods: public
-
public static double Clamp(this double value, double lower, double higher)
{
return value < lower ? lower : value > higher ? higher : value;
@@ -49,14 +43,19 @@
return Units.ToDistance(value);
}
- public static string ToTorque(this double value)
+ public static string ToFlux(this double value)
{
- return Units.ToTorque(value);
+ return Units.ToFlux(value);
}
public static string ToForce(this double value)
{
return Units.ToForce(value);
+ }
+
+ public static string ToMach(this double value)
+ {
+ return Units.ToMach(value);
}
public static string ToMass(this double value)
@@ -79,6 +78,14 @@
return Units.ToSpeed(value);
}
- #endregion
+ public static string ToTemperature(this double value)
+ {
+ return Units.ToTemperature(value);
+ }
+
+ public static string ToTorque(this double value)
+ {
+ return Units.ToTorque(value);
+ }
}
}
--- a/KerbalEngineer/Extensions/FloatExtensions.cs
+++ b/KerbalEngineer/Extensions/FloatExtensions.cs
@@ -1,7 +1,7 @@
//
// Kerbal Engineer Redux
//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -17,18 +17,12 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using KerbalEngineer.Helpers;
-
-#endregion
-
namespace KerbalEngineer.Extensions
{
+ using Helpers;
+
public static class FloatExtensions
{
- #region Methods: public
-
public static string ToAcceleration(this float value)
{
return Units.ToAcceleration(value);
@@ -44,14 +38,19 @@
return Units.ToDistance(value);
}
+ public static string ToFlux(this float value)
+ {
+ return Units.ToFlux(value);
+ }
+
public static string ToForce(this float value)
{
return Units.ToForce(value);
}
- public static string ToTorque(this float value)
+ public static string ToMach(this float value)
{
- return Units.ToTorque(value);
+ return Units.ToMach(value);
}
public static string ToMass(this float value)
@@ -74,6 +73,14 @@
return Units.ToSpeed(value);
}
- #endregion
+ public static string ToTemperature(this float value)
+ {
+ return Units.ToTemperature(value);
+ }
+
+ public static string ToTorque(this float value)
+ {
+ return Units.ToTorque(value);
+ }
}
}
--- a/KerbalEngineer/Extensions/OrbitExtensions.cs
+++ b/KerbalEngineer/Extensions/OrbitExtensions.cs
@@ -61,12 +61,15 @@
return 0.0;
}
- var angle = AngleHelper.GetAngleBetweenVectors(orbit.getRelativePositionAtUT(universalTime),
- Vector3d.Exclude(orbit.GetOrbitNormal(), orbit.referenceBody.orbit.getRelativePositionAtUT(universalTime)));
+ Vector3d orbitVector = orbit.getRelativePositionAtUT(universalTime);
+ orbitVector.z = 0.0;
- angle = AngleHelper.Clamp360(angle - 90.0);
+ Vector3d bodyVector = orbit.referenceBody.orbit.getOrbitalVelocityAtUT(universalTime);
+ bodyVector.z = 0.0;
- return orbit.inclination > 90.0 ? angle : 360.0 - angle;
+ double angle = AngleHelper.GetAngleBetweenVectors(bodyVector, orbitVector);
+
+ return AngleHelper.Clamp360(orbit.inclination < 90.0 ? angle : 360.0 - angle);
}
public static double GetAngleToRetrograde(this Orbit orbit)
@@ -81,12 +84,15 @@
return 0.0;
}
- var angle = AngleHelper.GetAngleBetweenVectors(orbit.getRelativePositionAtUT(universalTime),
- Vector3d.Exclude(orbit.GetOrbitNormal(), orbit.referenceBody.orbit.getRelativePositionAtUT(universalTime)));
+ Vector3d orbitVector = orbit.getRelativePositionAtUT(universalTime);
+ orbitVector.z = 0.0;
- angle = AngleHelper.Clamp360(angle + 90.0);
+ Vector3d bodyVector = orbit.referenceBody.orbit.getOrbitalVelocityAtUT(universalTime);
+ bodyVector.z = 0.0;
- return orbit.inclination > 90.0 ? angle : 360.0 - angle;
+ double angle = AngleHelper.GetAngleBetweenVectors(-bodyVector, orbitVector);
+
+ return AngleHelper.Clamp360(orbit.inclination < 90.0 ? angle : 360.0 - angle);
}
public static double GetAngleToTrueAnomaly(this Orbit orbit, double trueAnomaly)
--- a/KerbalEngineer/Extensions/PartExtensions.cs
+++ b/KerbalEngineer/Extensions/PartExtensions.cs
@@ -25,9 +25,9 @@
public static class PartExtensions
{
- private static Part cachePart;
- private static PartModule cachePartModule;
- private static PartResource cachePartResource;
+ //private static Part cachePart;
+ //private static PartModule cachePartModule;
+ //private static PartResource cachePartResource;
/// <summary>
/// Gets whether the part contains a specific resource.
@@ -55,9 +55,10 @@
/// <summary>
/// Gets whether the part has fuel.
/// </summary>
+ /* not used
public static bool EngineHasFuel(this Part part)
{
- cachePartModule = GetModule<ModuleEngines>(part);
+ PartModule cachePartModule = GetModule<ModuleEngines>(part);
if (cachePartModule != null)
{
return (cachePartModule as ModuleEngines).getFlameoutState;
@@ -71,7 +72,7 @@
return false;
}
-
+ */
/// <summary>
/// Gets the cost of the part excluding resources.
/// </summary>
@@ -89,11 +90,27 @@
}
/// <summary>
+ /// Gets the cost of the part modules
+ /// Same as stock but without mem allocation
+ /// </summary>
+ public static double GetModuleCostsNoAlloc(this Part part, float defaultCost)
+ {
+ float cost = 0f;
+ for (int i = 0; i < part.Modules.Count; i++)
+ {
+ PartModule pm = part.Modules[i];
+ if (pm is IPartCostModifier)
+ cost += (pm as IPartCostModifier).GetModuleCost(defaultCost);
+ }
+ return cost;
+ }
+
+ /// <summary>
/// Gets the cost of the part including resources.
/// </summary>
public static double GetCostWet(this Part part)
{
- return part.partInfo.cost - GetResourceCostInverted(part) + part.GetModuleCosts(0.0f);
+ return part.partInfo.cost - GetResourceCostInverted(part) + part.GetModuleCostsNoAlloc(0.0f); // part.GetModuleCosts allocate 44B per call.
}
/// <summary>
@@ -107,9 +124,10 @@
/// <summary>
/// Gets the maximum thrust of the part if it's an engine.
/// </summary>
+ /* not used
public static double GetMaxThrust(this Part part)
{
- cachePartModule = GetModule<ModuleEngines>(part);
+ PartModule cachePartModule = GetModule<ModuleEngines>(part);
if (cachePartModule != null)
{
return (cachePartModule as ModuleEngines).maxThrust;
@@ -123,20 +141,18 @@
return 0.0;
}
+ */
/// <summary>
/// Gets the first typed PartModule in the part's module list.
/// </summary>
public static T GetModule<T>(this Part part) where T : PartModule
{
- PartModule partModule;
- for (int i = 0; i < part.Modules.Count; ++i)
- {
- partModule = part.Modules[i];
- if (partModule is T)
- {
- return partModule as T;
- }
+ for (int i = 0; i < part.Modules.Count; i++)
+ {
+ PartModule pm = part.Modules[i];
+ if (pm is T)
+ return (T)pm;
}
return null;
}
@@ -181,10 +197,10 @@
return GetModule<ModuleEngines>(part);
}
- public static ModuleEnginesFX GetModuleEnginesFx(this Part part)
+/* public static ModuleEnginesFX GetModuleEnginesFx(this Part part)
{
return GetModule<ModuleEnginesFX>(part);
- }
+ }*/
/// <summary>
/// Gets a ModuleGenerator typed PartModule.
@@ -205,16 +221,20 @@
/// <summary>
/// Gets the current selected ModuleEnginesFX.
/// </summary>
- public static ModuleEnginesFX GetModuleMultiModeEngine(this Part part)
- {
- ModuleEnginesFX moduleEngineFx;
- string mode = GetModule<MultiModeEngine>(part).mode;
- for (int i = 0; i < part.Modules.Count; ++i)
- {
- moduleEngineFx = part.Modules[i] as ModuleEnginesFX;
- if (moduleEngineFx != null && moduleEngineFx.engineID == mode)
- {
- return moduleEngineFx;
+ public static ModuleEngines GetModuleMultiModeEngine(this Part part)
+ {
+ ModuleEngines moduleEngines;
+ MultiModeEngine multiMod = GetModule<MultiModeEngine>(part);
+ if (multiMod != null)
+ {
+ string mode = multiMod.mode;
+ for (int i = 0; i < part.Modules.Count; ++i)
+ {
+ moduleEngines = part.Modules[i] as ModuleEngines;
+ if (moduleEngines != null && moduleEngines.engineID == mode)
+ {
+ return moduleEngines;
+ }
}
}
return null;
@@ -252,7 +272,7 @@
public static ProtoModuleDecoupler GetProtoModuleDecoupler(this Part part)
{
- cachePartModule = GetModule<ModuleDecouple>(part);
+ PartModule cachePartModule = GetModule<ModuleDecouple>(part);
if (cachePartModule == null)
{
cachePartModule = GetModule<ModuleAnchoredDecoupler>(part);
@@ -270,7 +290,7 @@
/// </summary>
public static ProtoModuleEngine GetProtoModuleEngine(this Part part)
{
- cachePartModule = GetModule<ModuleEngines>(part);
+ PartModule cachePartModule = GetModule<ModuleEngines>(part);
if (cachePartModule != null)
{
return new ProtoModuleEngine(cachePartModule);
@@ -293,7 +313,7 @@
double cost = 0.0;
for (int i = 0; i < part.Resources.list.Count; ++i)
{
- cachePartResource = part.Resources.list[i];
+ PartResource cachePartResource = part.Resources.list[i];
cost = cost + (cachePartResource.amount * cachePartResource.info.unitCost);
}
return cost;
@@ -303,36 +323,37 @@
/// Gets the cost of the part's contained resources, inverted.
/// </summary>
public static double GetResourceCostInverted(this Part part)
+ {
+ double sum = 0;
+ for (int i = 0; i < part.Resources.list.Count; i++)
+ {
+ PartResource r = part.Resources.list[i];
+ sum += (r.maxAmount - r.amount) * r.info.unitCost;
+ }
+ return sum;
+ }
+
+ /// <summary>
+ /// Gets the cost of the part's maximum contained resources.
+ /// </summary>
+ public static double GetResourceCostMax(this Part part)
{
double cost = 0.0;
for (int i = 0; i < part.Resources.list.Count; ++i)
{
- cachePartResource = part.Resources.list[i];
- cost = cost + ((cachePartResource.maxAmount - cachePartResource.amount) * cachePartResource.info.unitCost);
+ PartResource cachePartResource = part.Resources.list[i];
+ cost = cost + (cachePartResource.maxAmount * cachePartResource.info.unitCost);
}
return cost;
}
/// <summary>
- /// Gets the cost of the part's maximum contained resources.
- /// </summary>
- public static double GetResourceCostMax(this Part part)
- {
- double cost = 0.0;
- for (int i = 0; i < part.Resources.list.Count; ++i)
- {
- cachePartResource = part.Resources.list[i];
- cost = cost + (cachePartResource.maxAmount * cachePartResource.info.unitCost);
- }
- return cost;
- }
-
- /// <summary>
/// Gets the current specific impulse for the engine.
/// </summary>
+ /* not used
public static double GetSpecificImpulse(this Part part, float atmosphere)
{
- cachePartModule = GetModule<ModuleEngines>(part);
+ PartModule cachePartModule = GetModule<ModuleEngines>(part);
if (cachePartModule != null)
{
return (cachePartModule as ModuleEngines).atmosphereCurve.Evaluate(atmosphere);
@@ -346,6 +367,7 @@
return 0.0;
}
+ */
/// <summary>
/// Gets the total mass of the part including resources.
@@ -360,12 +382,10 @@
/// </summary>
public static bool HasModule<T>(this Part part) where T : PartModule
{
- for (int i = 0; i < part.Modules.Count; ++i)
+ for (int i = 0; i < part.Modules.Count; i++)
{
if (part.Modules[i] is T)
- {
return true;
- }
}
return false;
}
@@ -375,13 +395,11 @@
/// </summary>
public static bool HasModule<T>(this Part part, Func<T, bool> predicate) where T : PartModule
{
- for (int i = 0; i < part.Modules.Count; ++i)
- {
- cachePartModule = part.Modules[i] as T;
- if (cachePartModule != null && predicate(cachePartModule as T))
- {
+ for (int i = 0; i < part.Modules.Count; i++)
+ {
+ PartModule pm = part.Modules[i];
+ if (pm is T && predicate(pm as T))
return true;
- }
}
return false;
}
@@ -407,7 +425,7 @@
/// </summary>
public static bool HasOneShotAnimation(this Part part)
{
- cachePartModule = GetModule<ModuleAnimateGeneric>(part);
+ PartModule cachePartModule = GetModule<ModuleAnimateGeneric>(part);
return cachePartModule != null && (cachePartModule as ModuleAnimateGeneric).isOneShot;
}
@@ -448,7 +466,7 @@
/// </summary>
public static bool IsEngine(this Part part)
{
- return HasModule<ModuleEngines>(part) || HasModule<ModuleEnginesFX>(part);
+ return HasModule<ModuleEngines>(part);
}
/// <summary>
@@ -488,15 +506,14 @@
/// </summary>
public static bool IsPrimary(this Part part, List<Part> partsList, PartModule module)
{
- for (int i = 0; i < partsList.Count; ++i)
- {
- cachePart = partsList[i];
-
- if (HasModule(cachePart, module.ClassID) == false)
+ for (int i = 0; i < partsList.Count; i++)
+ {
+ var vesselPart = partsList[i];
+ if (!vesselPart.HasModule(module.ClassID))
{
continue;
}
- if (cachePart == part)
+ if (vesselPart == part)
{
return true;
}
@@ -532,7 +549,7 @@
/// </summary>
public static bool IsSolidRocket(this Part part)
{
- return (HasModule<ModuleEngines>(part) && GetModuleEngines(part).throttleLocked) || (HasModule<ModuleEnginesFX>(part) && GetModuleEnginesFx(part).throttleLocked);
+ return (part.HasModule<ModuleEngines>() && part.GetModuleEngines().throttleLocked);
}
public class ProtoModuleDecoupler
@@ -580,6 +597,12 @@
}
}
+ // This needs updating to handle multi-mode engines and engines with multiple ModuleEngines correctly.
+ // It currently just shows the stats of the currently active module for multi-mode engines and just
+ // the first ModuleEngines for engines with multiple modules.
+ // It should really show all the modes for multi-mode engines as separate sections.
+ // For other engines with multiple ModuleEngines it should combine the separate modules into a single set of data
+ // The constructor should be changed to take the Part itself. It can be called if HasModule<ModuleEngines>() is true.
public class ProtoModuleEngine
{
private readonly PartModule module;
@@ -619,19 +642,6 @@
MinimumThrust = engine.minThrust;
Propellants = engine.propellants;
}
-
- private void SetModuleEnginesFx()
- {
- ModuleEnginesFX engine = module as ModuleEnginesFX;
- if (engine == null)
- {
- return;
- }
-
- MaximumThrust = engine.maxThrust * (engine.thrustPercentage * 0.01);
- MinimumThrust = engine.minThrust;
- Propellants = engine.propellants;
- }
}
}
}
--- /dev/null
+++ b/KerbalEngineer/Extensions/StringExtensions.cs
@@ -1,1 +1,33 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Extensions
+{
+ public static class StringExtensions
+ {
+ public static string ToLength(this string value, int length)
+ {
+ if (value != null && value.Length > length)
+ {
+ value = value.Substring(0, length) + "...";
+ }
+ return value;
+ }
+ }
+}
--- a/KerbalEngineer/Flight/ActionMenu.cs
+++ b/KerbalEngineer/Flight/ActionMenu.cs
@@ -27,10 +27,12 @@
namespace KerbalEngineer.Flight
{
+ using KSP.UI.Screens;
+
/// <summary>
/// Graphical controller for section interaction in the form of a menu system.
/// </summary>
- [KSPAddon(KSPAddon.Startup.Flight, false)]
+ //[KSPAddon(KSPAddon.Startup.Flight, false)]
public class ActionMenu : MonoBehaviour
{
#region Fields
@@ -90,11 +92,11 @@
{
return;
}
- if (FlightEngineerCore.IsDisplayable && this.button.State == RUIToggleButton.ButtonState.DISABLED)
+ if (FlightEngineerCore.IsDisplayable && this.button.toggleButton.Interactable == false)
{
this.button.Enable();
}
- else if (!FlightEngineerCore.IsDisplayable && this.button.State != RUIToggleButton.ButtonState.DISABLED)
+ else if (!FlightEngineerCore.IsDisplayable && this.button.toggleButton.Interactable)
{
this.button.Disable();
}
--- a/KerbalEngineer/Flight/DisplayStack.cs
+++ b/KerbalEngineer/Flight/DisplayStack.cs
@@ -33,6 +33,7 @@
namespace KerbalEngineer.Flight
{
+ using KeyBinding;
using Upgradeables;
/// <summary>
@@ -69,7 +70,14 @@
public bool ShowControlBar
{
get { return this.showControlBar; }
- set { this.showControlBar = value; }
+ set
+ {
+ if (showControlBar != value)
+ {
+ this.showControlBar = value;
+ RequestResize();
+ }
+ }
}
#endregion
@@ -120,7 +128,6 @@
try
{
this.Save();
- RenderingManager.RemoveFromPostDrawQueue(0, this.Draw);
}
catch (Exception ex)
{
@@ -139,7 +146,6 @@
this.windowId = this.GetHashCode();
this.InitialiseStyles();
this.Load();
- RenderingManager.AddToPostDrawQueue(0, this.Draw);
Logger.Log("ActionMenu->Start");
}
catch (Exception ex)
@@ -175,7 +181,7 @@
/// <summary>
/// Called to draw the display stack when the UI is enabled.
/// </summary>
- private void Draw()
+ private void OnGUI()
{
try
{
@@ -214,7 +220,7 @@
/// </summary>
private void DrawControlBar()
{
- GUILayout.Label("FLIGHT ENGINEER " + EngineerGlobals.AssemblyVersion, this.titleStyle);
+ GUILayout.Label("FLIGHT ENGINEER " + EngineerGlobals.ASSEMBLY_VERSION, this.titleStyle);
this.DrawControlBarButtons(SectionLibrary.StockSections);
this.DrawControlBarButtons(SectionLibrary.CustomSections);
--- /dev/null
+++ b/KerbalEngineer/Flight/FlightAppLauncher.cs
@@ -1,1 +1,176 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2016 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight
+{
+ using Unity.Flight;
+ using UnityEngine;
+
+ [KSPAddon(KSPAddon.Startup.Flight, false)]
+ public class FlightAppLauncher : AppLauncherButton, IFlightAppLauncher
+ {
+ private static FlightAppLauncher m_Instance;
+ private FlightMenu m_FlightMenu;
+ private GameObject m_MenuObject;
+ private GameObject m_MenuPrefab;
+
+ /// <summary>
+ /// Gets the current instance of the FlightAppLauncher object.
+ /// </summary>
+ public static FlightAppLauncher instance
+ {
+ get
+ {
+ return m_Instance;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the control bar's visibility.
+ /// </summary>
+ public bool controlBar
+ {
+ get
+ {
+ if (DisplayStack.Instance != null)
+ {
+ return DisplayStack.Instance.ShowControlBar;
+ }
+
+ return false;
+ }
+ set
+ {
+ if (DisplayStack.Instance != null)
+ {
+ DisplayStack.Instance.ShowControlBar = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the display stack's visibility.
+ /// </summary>
+ public bool showEngineer
+ {
+ get
+ {
+ if (DisplayStack.Instance != null)
+ {
+ return DisplayStack.Instance.Hidden == false;
+ }
+
+ return false;
+ }
+ set
+ {
+ if (DisplayStack.Instance != null)
+ {
+ DisplayStack.Instance.Hidden = !value;
+ }
+ }
+ }
+
+ protected override void Awake()
+ {
+ base.Awake();
+
+ // set singleton instance
+ m_Instance = this;
+
+ // cache menu prefab
+ if (m_MenuPrefab == null && AssetBundleLoader.prefabs != null)
+ {
+ m_MenuPrefab = AssetBundleLoader.prefabs.LoadAsset<GameObject>("FlightMenu");
+ }
+ }
+
+ protected override void OnFalse()
+ {
+ Close();
+ }
+
+ protected override void OnHover()
+ {
+ Open();
+ }
+
+ protected override void OnHoverOut()
+ {
+ if (isOn == false)
+ {
+ Close();
+ }
+ }
+
+ protected override void OnTrue()
+ {
+ Open();
+ }
+
+ /// <summary>
+ /// Closes the menu.
+ /// </summary>
+ private void Close()
+ {
+ if (m_FlightMenu != null)
+ {
+ m_FlightMenu.Close();
+ }
+ else
+ {
+ Destroy(m_MenuObject);
+ }
+ }
+
+ /// <summary>
+ /// Opens the menu.
+ /// </summary>
+ private void Open()
+ {
+ // fade menu in if already open
+ if (m_FlightMenu != null)
+ {
+ m_FlightMenu.FadeIn();
+ return;
+ }
+
+ if (m_MenuPrefab == null || m_MenuObject != null)
+ {
+ return;
+ }
+
+ // create object
+ m_MenuObject = Instantiate(m_MenuPrefab, GetAnchor(), Quaternion.identity) as GameObject;
+ if (m_MenuObject == null)
+ {
+ return;
+ }
+
+ // set object as a child of the main canvas
+ m_MenuObject.transform.SetParent(MainCanvasUtil.MainCanvas.transform);
+
+ // set menu's reference to this object for cross-communication
+ m_FlightMenu = m_MenuObject.GetComponent<FlightMenu>();
+ if (m_FlightMenu != null)
+ {
+ m_FlightMenu.SetFlightAppLauncher(this);
+ }
+ }
+ }
+}
--- a/KerbalEngineer/Flight/FlightEngineerCore.cs
+++ b/KerbalEngineer/Flight/FlightEngineerCore.cs
@@ -113,6 +113,11 @@
{
get
{
+ if (MainCanvasUtil.MainCanvas.enabled == false)
+ {
+ return false;
+ }
+
if (isCareerMode)
{
if (isKerbalLimited && FlightGlobals.ActiveVessel.GetVesselCrew().Exists(c => c.experienceTrait.TypeName == "Engineer"))
--- a/KerbalEngineer/Flight/Readouts/Miscellaneous/Separator.cs
+++ b/KerbalEngineer/Flight/Readouts/Miscellaneous/Separator.cs
@@ -45,7 +45,7 @@
{
this.Name = "Separator";
this.Category = ReadoutCategory.GetCategory("Miscellaneous");
- this.HelpString = String.Empty;
+ this.HelpString = "Creats a line to help seperate subsections in a module.";
this.IsDefault = false;
this.Cloneable = true;
--- a/KerbalEngineer/Flight/Readouts/Miscellaneous/SimulationDelay.cs
+++ b/KerbalEngineer/Flight/Readouts/Miscellaneous/SimulationDelay.cs
@@ -51,7 +51,7 @@
GUILayout.BeginHorizontal();
GUILayout.Label("Sim Delay", this.NameStyle);
GUI.skin = HighLogic.Skin;
- SimManager.minSimTime = new TimeSpan(0, 0, 0, 0, (int)GUILayout.HorizontalSlider(SimManager.minSimTime.Milliseconds, 0, 1000.0f));
+ SimManager.minSimTime = TimeSpan.FromMilliseconds(GUILayout.HorizontalSlider((float)SimManager.minSimTime.TotalMilliseconds, 0, 2000.0f));
GUI.skin = null;
GUILayout.EndHorizontal();
}
--- a/KerbalEngineer/Flight/Readouts/Miscellaneous/SystemTime.cs
+++ b/KerbalEngineer/Flight/Readouts/Miscellaneous/SystemTime.cs
@@ -40,7 +40,7 @@
{
this.Name = "System Time";
this.Category = ReadoutCategory.GetCategory("Miscellaneous");
- this.HelpString = String.Empty;
+ this.HelpString = "Shows the System Time in 12 hour format (AM/PM)";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Miscellaneous/TimeReference.cs
+++ /dev/null
@@ -1,66 +1,1 @@
-//
-// Kerbal Engineer Redux
-//
-// Copyright (C) 2014 CYBUTEK
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Flight.Sections;
-using KerbalEngineer.Helpers;
-
-using UnityEngine;
-
-#endregion
-
-namespace KerbalEngineer.Flight.Readouts.Miscellaneous
-{
- public class TimeReference : ReadoutModule
- {
- #region Constructors
-
- public TimeReference()
- {
- this.Name = "Time Reference Adjuster";
- this.Category = ReadoutCategory.GetCategory("Miscellaneous");
- this.HelpString = String.Empty;
- this.IsDefault = false;
- }
-
- #endregion
-
- #region Methods: public
-
- public override void Draw(SectionModule section)
- {
- GUILayout.BeginHorizontal();
- GUILayout.Label("Time Ref.: " + TimeFormatter.Reference, this.NameStyle);
- if (GUILayout.Button("Earth", this.ButtonStyle))
- {
- TimeFormatter.SetReference();
- }
- if (GUILayout.Button("Kerbin", this.ButtonStyle))
- {
- TimeFormatter.SetReference(PSystemManager.Instance.localBodies.Find(body => body.bodyName.Equals("Kerbin")));
- }
- GUILayout.EndHorizontal();
- }
-
- #endregion
- }
-}
--- a/KerbalEngineer/Flight/Readouts/Orbital/AngleToEquatorialAscendingNode.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/AngleToEquatorialAscendingNode.cs
@@ -34,7 +34,7 @@
{
this.Name = "Angle to Equ. AN";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = string.Empty;
+ this.HelpString = "Angular Distance from the vessel to crossing the Equator of the central body, going north of it.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/AngleToEquatorialDescendingNode.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/AngleToEquatorialDescendingNode.cs
@@ -34,7 +34,7 @@
{
this.Name = "Angle to Equ. DN";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = string.Empty;
+ this.HelpString = "Angular Distance from the vessel to crossing the Equator of the central body, going south of it.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/AngleToPrograde.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/AngleToPrograde.cs
@@ -36,7 +36,7 @@
{
this.Name = "Angle to Prograde";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "Angular Distance from the vessel to crossing the Orbit of the central body on it's retrograde side.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/AngleToRetrograde.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/AngleToRetrograde.cs
@@ -36,7 +36,7 @@
{
this.Name = "Angle to Retrograde";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "Angular Distance from the vessel to crossing the Orbit of the central body on it's retrograde side.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ApoapsisHeight.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ApoapsisHeight.cs
@@ -34,7 +34,7 @@
{
this.Name = "Apoapsis Height";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = "Shows the vessel's apoapsis height relative to sea level. (Apoapsis is the highest point of an orbit.)";
+ this.HelpString = "Shows the vessel's apoapsis height relative to sea level. (Apoapsis is the highest point of an orbit.)";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/EccentricAnomaly.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/EccentricAnomaly.cs
@@ -1,7 +1,7 @@
//
// Kerbal Engineer Redux
//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -17,38 +17,25 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Extensions;
-using KerbalEngineer.Flight.Sections;
-
-#endregion
-
namespace KerbalEngineer.Flight.Readouts.Orbital
{
+ using Extensions;
+ using Helpers;
+ using Sections;
+
public class EccentricAnomaly : ReadoutModule
{
- #region Constructors
-
public EccentricAnomaly()
{
- this.Name = "Eccentric Anomaly";
- this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
- this.IsDefault = false;
+ Name = "Eccentric Anomaly";
+ Category = ReadoutCategory.GetCategory("Orbital");
+ HelpString = string.Empty;
+ IsDefault = false;
}
-
- #endregion
-
- #region Methods: public
public override void Draw(SectionModule section)
{
- this.DrawLine(FlightGlobals.ship_orbit.eccentricAnomaly.ToAngle(), section.IsHud);
+ DrawLine((FlightGlobals.ship_orbit.eccentricAnomaly * Units.RAD_TO_DEG).ToAngle(), section.IsHud);
}
-
- #endregion
}
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/Eccentricity.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/Eccentricity.cs
@@ -43,7 +43,7 @@
public override void Draw(SectionModule section)
{
- this.DrawLine(FlightGlobals.ship_orbit.eccentricity.ToString("F3"), section.IsHud);
+ this.DrawLine(FlightGlobals.ship_orbit.eccentricity.ToString("F5"), section.IsHud);
}
#endregion
--- a/KerbalEngineer/Flight/Readouts/Orbital/Inclination.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/Inclination.cs
@@ -34,7 +34,7 @@
{
this.Name = "Inclination";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = "Shows the vessel's orbital inclination.";
+ this.HelpString = "Shows the vessel's orbital inclination relative to the Equator.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/ManoeuvreProcessor.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/ManoeuvreProcessor.cs
@@ -30,6 +30,8 @@
namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
{
+ using Helpers;
+
public class ManoeuvreProcessor : IUpdatable, IUpdateRequest
{
#region Fields
@@ -60,6 +62,10 @@
}
public static double NormalDeltaV { get; private set; }
+
+ public static double PostBurnAp { get; private set; }
+
+ public static double PostBurnPe { get; private set; }
public static double ProgradeDeltaV { get; private set; }
@@ -108,6 +114,8 @@
NormalDeltaV = deltaV.y;
RadialDeltaV = deltaV.x;
TotalDeltaV = node.GetBurnVector(FlightGlobals.ship_orbit).magnitude;
+ PostBurnAp = node.nextPatch != null ? node.nextPatch.ApA : 0;
+ PostBurnPe = node.nextPatch != null ? node.nextPatch.PeA : 0;
UniversalTime = FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes[0].UT;
AngleToPrograde = FlightGlobals.ActiveVessel.patchedConicSolver.maneuverNodes[0].patch.GetAngleToPrograde(UniversalTime);
@@ -163,7 +171,7 @@
deltaVDrain = deltaV.Clamp(0.0, stageDeltaV);
}
- var exhaustVelocity = stage.isp * 9.82;
+ var exhaustVelocity = stage.isp * Units.GRAVITY;
var flowRate = stage.thrust / exhaustVelocity;
var endMass = Math.Exp(Math.Log(startMass) - deltaVDrain / exhaustVelocity);
var deltaMass = (startMass - endMass) * Math.Exp(-(deltaVDrain * 0.001) / exhaustVelocity);
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeAngleToPrograde.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeAngleToPrograde.cs
@@ -36,7 +36,7 @@
{
this.Name = "Manoeuvre Node Angle to Prograde";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "Angular Distance from the Node to crossing the Orbit of the central body on it's prograde side.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeAngleToRetrograde.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeAngleToRetrograde.cs
@@ -36,7 +36,7 @@
{
this.Name = "Manoeuvre Node Angle to Retrograde";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "Angular Distance from the Node to crossing the Orbit of the central body on it's retrograde side.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeBurnTime.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeBurnTime.cs
@@ -36,7 +36,7 @@
{
this.Name = "Manoeuvre Node Burn Time";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "The burn's total duration.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeHalfBurnTime.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeHalfBurnTime.cs
@@ -36,7 +36,7 @@
{
this.Name = "Manoeuvre Node Half Burn Time";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "Half of the burn's total duration.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeNormalDeltaV.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeNormalDeltaV.cs
@@ -36,7 +36,7 @@
{
this.Name = "Manoeuvre Node DeltaV (Normal)";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "Normal component of the total change in velocity.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeProgradeDeltaV.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeProgradeDeltaV.cs
@@ -36,7 +36,7 @@
{
this.Name = "Manoeuvre Node DeltaV (Prograde)";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "Prograde/Retrograde component of the total change in velocity.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeRadialDeltaV.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeRadialDeltaV.cs
@@ -36,7 +36,7 @@
{
this.Name = "Manoeuvre Node DeltaV (Radial)";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "Radial component of the total change in velocity.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeTimeToHalfBurn.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeTimeToHalfBurn.cs
@@ -36,7 +36,7 @@
{
this.Name = "Time to Manoeuvre Burn";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "Time until the Manoeuvre should be started.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeTimeToManoeuvre.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeTimeToManoeuvre.cs
@@ -36,7 +36,7 @@
{
this.Name = "Time to Manoeuvre Node";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "Time until the vessel reaches the position of the Manoeuvre Node.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeTotalDeltaV.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/NodeTotalDeltaV.cs
@@ -36,7 +36,7 @@
{
this.Name = "Manoeuvre Node DeltaV (Total)";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
+ this.HelpString = "Total change in velocity during the burn.";
this.IsDefault = true;
}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/PostBurnApoapsis.cs
@@ -1,1 +1,69 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2014 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+#region Using Directives
+
+using System;
+
+using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Sections;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class PostBurnApoapsis : ReadoutModule
+ {
+ #region Constructors
+
+ public PostBurnApoapsis()
+ {
+ this.Name = "Post-burn Apoapsis";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = "Farthest point of the vessel's ofbit after the burn.";
+ this.IsDefault = false;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Post-burn Apoapsis", ManoeuvreProcessor.PostBurnAp.ToDistance(), section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/ManoeuvreNode/PostBurnPeriapsis.cs
@@ -1,1 +1,69 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2014 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+#region Using Directives
+
+using System;
+
+using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Sections;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode
+{
+ public class PostBurnPeriapsis : ReadoutModule
+ {
+ #region Constructors
+
+ public PostBurnPeriapsis()
+ {
+ this.Name = "Post-burn Periapsis";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = "Closest point of the vessel's ofbit after the burn.";
+ this.IsDefault = false;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (!ManoeuvreProcessor.ShowDetails)
+ {
+ return;
+ }
+
+ this.DrawLine("Post-burn Periapsis", ManoeuvreProcessor.PostBurnPe.ToDistance(), section.IsHud);
+ }
+
+ public override void Reset()
+ {
+ ManoeuvreProcessor.Reset();
+ }
+
+ public override void Update()
+ {
+ ManoeuvreProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- a/KerbalEngineer/Flight/Readouts/Orbital/MeanAnomaly.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/MeanAnomaly.cs
@@ -1,7 +1,7 @@
//
// Kerbal Engineer Redux
//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -17,38 +17,25 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Extensions;
-using KerbalEngineer.Flight.Sections;
-
-#endregion
-
namespace KerbalEngineer.Flight.Readouts.Orbital
{
+ using Extensions;
+ using Helpers;
+ using Sections;
+
public class MeanAnomaly : ReadoutModule
{
- #region Constructors
-
public MeanAnomaly()
{
- this.Name = "Mean Anomaly";
- this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
- this.IsDefault = false;
+ Name = "Mean Anomaly";
+ Category = ReadoutCategory.GetCategory("Orbital");
+ HelpString = string.Empty;
+ IsDefault = false;
}
-
- #endregion
-
- #region Methods: public
public override void Draw(SectionModule section)
{
- this.DrawLine(FlightGlobals.ship_orbit.meanAnomaly.ToAngle(), section.IsHud);
+ DrawLine((FlightGlobals.ship_orbit.meanAnomaly * Units.RAD_TO_DEG).ToAngle(), section.IsHud);
}
-
- #endregion
}
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/MeanAnomalyAtEpoc.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/MeanAnomalyAtEpoc.cs
@@ -1,7 +1,7 @@
//
// Kerbal Engineer Redux
//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -17,38 +17,25 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Extensions;
-using KerbalEngineer.Flight.Sections;
-
-#endregion
-
namespace KerbalEngineer.Flight.Readouts.Orbital
{
+ using Extensions;
+ using Helpers;
+ using Sections;
+
public class MeanAnomalyAtEpoc : ReadoutModule
{
- #region Constructors
-
public MeanAnomalyAtEpoc()
{
- this.Name = "Mean Anomaly at Epoc";
- this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = String.Empty;
- this.IsDefault = false;
+ Name = "Mean Anomaly at Epoc";
+ Category = ReadoutCategory.GetCategory("Orbital");
+ HelpString = string.Empty;
+ IsDefault = false;
}
-
- #endregion
-
- #region Methods: public
public override void Draw(SectionModule section)
{
- this.DrawLine(FlightGlobals.ship_orbit.meanAnomalyAtEpoch.ToAngle(), section.IsHud);
+ DrawLine((FlightGlobals.ship_orbit.meanAnomalyAtEpoch * Units.RAD_TO_DEG).ToAngle(), section.IsHud);
}
-
- #endregion
}
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/PeriapsisHeight.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/PeriapsisHeight.cs
@@ -34,7 +34,7 @@
{
this.Name = "Periapsis Height";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = "Shows the vessel's periapsis height relative to sea level. (Periapsis is the lowest point of an orbit.";
+ this.HelpString = "Shows the vessel's periapsis height relative to sea level. (Periapsis is the lowest point of an orbit.)";
this.IsDefault = true;
}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/SpeedAtApoapsis.cs
@@ -1,1 +1,68 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2014 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+#region Using Directives
+
+using System;
+using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
+using KerbalEngineer.Extensions;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital
+{
+ public class SpeedAtApoapsis : ReadoutModule
+ {
+ #region Constructors
+
+ public SpeedAtApoapsis()
+ {
+ this.Name = "Speed at Apoapsis";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = "Shows the orbital speed of the vessel when at apoapsis, the highest point of the orbit.";
+ this.IsDefault = false;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ // Vis-viva: v^2 = GM(2/r - 1/a)
+ // All this is easily got from the ships orbit (and reference body)
+ String str;
+ Orbit orbit = FlightGlobals.ship_orbit;
+ if (orbit.eccentricity > 1.0)
+ str = "---m/s";
+ else
+ {
+ double speedsqr = orbit.referenceBody.gravParameter * ((2 / orbit.ApR) - (1 / orbit.semiMajorAxis));
+ if (Double.IsNaN(speedsqr) || speedsqr < 0)
+ str = "---m/s"; // Don't think this is possible barring bugs in the Orbit class
+ else
+ str = Math.Sqrt(speedsqr).ToSpeed();
+ }
+ this.DrawLine(str, section.IsHud);
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/SpeedAtPeriapsis.cs
@@ -1,1 +1,64 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2014 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+#region Using Directives
+
+using System;
+using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
+using KerbalEngineer.Extensions;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital
+{
+ public class SpeedAtPeriapsis : ReadoutModule
+ {
+ #region Constructors
+
+ public SpeedAtPeriapsis()
+ {
+ this.Name = "Speed at Periapsis";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = "Shows the orbital speed of the vessel when at periapsis, the lowest point of the orbit.";
+ this.IsDefault = false;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ // Vis-viva: v^2 = GM(2/r - 1/a)
+ // All this is easily got from the ships orbit (and reference body)
+ String str;
+ Orbit orbit = FlightGlobals.ship_orbit;
+ double oneovera = (orbit.eccentricity == 1) ? 0 : (1 / orbit.semiMajorAxis);
+ double speedsqr = orbit.referenceBody.gravParameter * ((2 / orbit.PeR) - oneovera);
+ if (Double.IsNaN(speedsqr) || speedsqr < 0)
+ str = "---m/s";
+ else
+ str = Math.Sqrt(speedsqr).ToSpeed();
+ this.DrawLine(str, section.IsHud);
+ }
+
+ #endregion
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Orbital/TimeToAtmosphere.cs
@@ -1,1 +1,99 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2014 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+#region Using Directives
+
+using System;
+using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Orbital
+{
+ public class TimeToAtmosphere : ReadoutModule
+ {
+ //private LogMsg log = new LogMsg();
+
+ #region Constructors
+
+ public TimeToAtmosphere()
+ {
+ this.Name = "Time to Atmosphere";
+ this.Category = ReadoutCategory.GetCategory("Orbital");
+ this.HelpString = "Shows the time until the vessel enters or leaves the atmosphere.";
+ this.IsDefault = false;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ String str;
+ Orbit orbit = FlightGlobals.ship_orbit;
+
+ if (orbit.referenceBody.atmosphere && orbit.PeA < orbit.referenceBody.atmosphereDepth && orbit.ApA > orbit.referenceBody.atmosphereDepth)
+ {
+ double tA = orbit.TrueAnomalyAtRadius(orbit.referenceBody.atmosphereDepth + orbit.referenceBody.Radius);
+ //log.buf.AppendFormat("tA = {0}\n", tA);
+ double utTime = Planetarium.GetUniversalTime();
+ //log.buf.AppendFormat("utTime = {0}\n", utTime);
+ double timeAtRad1 = orbit.GetUTforTrueAnomaly(tA, orbit.period * 0.5);
+ //log.buf.AppendFormat("timeAtRad1 = {0}\n", timeAtRad1);
+ if (timeAtRad1 < utTime)
+ {
+ timeAtRad1 += orbit.period;
+ //log.buf.AppendFormat("timeAtRad1 = {0}\n", timeAtRad1);
+ }
+ double timeAtRad2 = orbit.GetUTforTrueAnomaly(-tA, orbit.period * 0.5);
+ //log.buf.AppendFormat("timeAtRad2 = {0}\n", timeAtRad2);
+ if (timeAtRad2 < utTime)
+ {
+ timeAtRad2 += orbit.period;
+ //log.buf.AppendFormat("timeAtRad2 = {0}\n", timeAtRad2);
+ }
+ double time = Math.Min(timeAtRad1, timeAtRad2) - utTime;
+ //log.buf.AppendFormat("time = {0}\n", time);
+
+ if (Double.IsNaN(time))
+ {
+ str = "---s";
+ //log.buf.AppendLine("time is NaN");
+ }
+ else
+ {
+ str = TimeFormatter.ConvertToString(time);
+ //log.buf.AppendFormat("str = {0}\n", str);
+ }
+ }
+ else
+ {
+ str = "---s";
+ //log.buf.AppendLine("no atmosphere, pe > atmosphere, or ap < atmosphere");
+ }
+
+ //log.Flush();
+ this.DrawLine(str, section.IsHud);
+ }
+
+ #endregion
+ }
+}
--- a/KerbalEngineer/Flight/Readouts/Orbital/TimeToEquatorialAscendingNode.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/TimeToEquatorialAscendingNode.cs
@@ -35,7 +35,7 @@
{
this.Name = "Time to Equ. AN";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the time until the vessel corsses the Equator, going north of it.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Orbital/TimeToEquatorialDescendingNode.cs
+++ b/KerbalEngineer/Flight/Readouts/Orbital/TimeToEquatorialDescendingNode.cs
@@ -35,7 +35,7 @@
{
this.Name = "Time to Equ. DN";
this.Category = ReadoutCategory.GetCategory("Orbital");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the time until the vessel corsses the Equator, going south of it.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutLibrary.cs
@@ -1,7 +1,5 @@
//
-// Kerbal Engineer Redux
-//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -19,8 +17,6 @@
namespace KerbalEngineer.Flight.Readouts
{
- #region Using Directives
-
using System;
using System.Collections.Generic;
using System.Linq;
@@ -30,6 +26,7 @@
using Rendezvous;
using Settings;
using Surface;
+ using Thermal;
using Vessel;
using AltitudeSeaLevel = Surface.AltitudeSeaLevel;
using ApoapsisHeight = Orbital.ApoapsisHeight;
@@ -40,17 +37,9 @@
using TimeToApoapsis = Orbital.TimeToApoapsis;
using TimeToPeriapsis = Orbital.TimeToPeriapsis;
- #endregion
-
public static class ReadoutLibrary
{
- #region Fields
-
private static List<ReadoutModule> readouts = new List<ReadoutModule>();
-
- #endregion
-
- #region Constructors
/// <summary>
/// Sets up and populates the readout library with the stock readouts.
@@ -63,6 +52,7 @@
ReadoutCategory.SetCategory("Surface", "Surface and atmospheric readouts.");
ReadoutCategory.SetCategory("Vessel", "Vessel performance statistics.");
ReadoutCategory.SetCategory("Rendezvous", "Readouts for rendezvous manovoeures.");
+ ReadoutCategory.SetCategory("Thermal", "Thermal characteristics readouts.");
ReadoutCategory.SetCategory("Miscellaneous", "Miscellaneous readouts.");
ReadoutCategory.Selected = ReadoutCategory.GetCategory("Orbital");
@@ -101,6 +91,11 @@
readouts.Add(new NodeTimeToHalfBurn());
readouts.Add(new NodeAngleToPrograde());
readouts.Add(new NodeAngleToRetrograde());
+ readouts.Add(new PostBurnApoapsis());
+ readouts.Add(new PostBurnPeriapsis());
+ readouts.Add(new SpeedAtApoapsis());
+ readouts.Add(new SpeedAtPeriapsis());
+ readouts.Add(new TimeToAtmosphere());
// Surface
readouts.Add(new AltitudeSeaLevel());
@@ -109,6 +104,7 @@
readouts.Add(new VerticalAcceleration());
readouts.Add(new HorizontalSpeed());
readouts.Add(new HorizontalAcceleration());
+ readouts.Add(new MachNumber());
readouts.Add(new Latitude());
readouts.Add(new Longitude());
readouts.Add(new GeeForce());
@@ -124,6 +120,7 @@
readouts.Add(new ImpactBiome());
// Vessel
+ readouts.Add(new Name());
readouts.Add(new DeltaVStaged());
readouts.Add(new DeltaVCurrent());
readouts.Add(new DeltaVTotal());
@@ -171,12 +168,28 @@
readouts.Add(new Rendezvous.OrbitalPeriod());
readouts.Add(new Rendezvous.SemiMajorAxis());
readouts.Add(new Rendezvous.SemiMinorAxis());
-
+ readouts.Add(new Rendezvous.RelativeRadialVelocity());
+ readouts.Add(new Rendezvous.TimeToRendezvous());
+
+ // Thermal
+ readouts.Add(new InternalFlux());
+ readouts.Add(new ConvectionFlux());
+ readouts.Add(new RadiationFlux());
+ readouts.Add(new CriticalPart());
+ readouts.Add(new CriticalTemperature());
+ readouts.Add(new CriticalSkinTemperature());
+ readouts.Add(new CriticalThermalPercentage());
+ readouts.Add(new HottestPart());
+ readouts.Add(new HottestTemperature());
+ readouts.Add(new HottestSkinTemperature());
+ readouts.Add(new CoolestPart());
+ readouts.Add(new CoolestTemperature());
+ readouts.Add(new CoolestSkinTemperature());
+
// Misc
readouts.Add(new Separator());
readouts.Add(new GuiSizeAdjustor());
readouts.Add(new SimulationDelay());
- readouts.Add(new TimeReference());
readouts.Add(new VectoredThrustToggle());
readouts.Add(new SystemTime());
@@ -188,22 +201,20 @@
}
}
- #endregion
-
- #region Properties
-
/// <summary>
/// Gets and sets the available readout modules.
/// </summary>
public static List<ReadoutModule> Readouts
{
- get { return readouts; }
- set { readouts = value; }
- }
-
- #endregion
-
- #region Methods
+ get
+ {
+ return readouts;
+ }
+ set
+ {
+ readouts = value;
+ }
+ }
/// <summary>
/// Gets a list of readout modules which are associated with the specified category.
@@ -226,7 +237,7 @@
/// </summary>
public static void Reset()
{
- foreach (var readout in readouts)
+ foreach (ReadoutModule readout in readouts)
{
readout.Reset();
}
@@ -239,8 +250,8 @@
{
try
{
- var handler = SettingHandler.Load("HelpStrings.xml");
- foreach (var readout in readouts)
+ SettingHandler handler = SettingHandler.Load("HelpStrings.xml");
+ foreach (ReadoutModule readout in readouts)
{
readout.HelpString = handler.GetSet(readout.Category + "." + readout.GetType().Name, readout.HelpString);
}
@@ -251,7 +262,5 @@
Logger.Exception(ex);
}
}
-
- #endregion
}
}
--- a/KerbalEngineer/Flight/Readouts/ReadoutModule.cs
+++ b/KerbalEngineer/Flight/Readouts/ReadoutModule.cs
@@ -29,6 +29,8 @@
namespace KerbalEngineer.Flight.Readouts
{
+ using Extensions;
+
public abstract class ReadoutModule
{
#region Fields
@@ -178,13 +180,13 @@
{
GUILayout.Label(this.Name, this.NameStyle);
GUILayout.FlexibleSpace();
- GUILayout.Label(value, this.ValueStyle);
+ GUILayout.Label(value.ToLength(20), this.ValueStyle);
}
else
{
GUILayout.Label(this.Name, this.NameStyle, GUILayout.Height(this.NameStyle.fontSize * 1.2f));
GUILayout.FlexibleSpace();
- GUILayout.Label(value, this.ValueStyle, GUILayout.Height(this.ValueStyle.fontSize * 1.2f));
+ GUILayout.Label(value.ToLength(20), this.ValueStyle, GUILayout.Height(this.ValueStyle.fontSize * 1.2f));
}
GUILayout.EndHorizontal();
@@ -198,13 +200,13 @@
{
GUILayout.Label(name, this.NameStyle);
GUILayout.FlexibleSpace();
- GUILayout.Label(value, this.ValueStyle);
+ GUILayout.Label(value.ToLength(20), this.ValueStyle);
}
else
{
GUILayout.Label(name, this.NameStyle, GUILayout.Height(this.NameStyle.fontSize * 1.2f));
GUILayout.FlexibleSpace();
- GUILayout.Label(value, this.ValueStyle, GUILayout.Height(this.ValueStyle.fontSize * 1.2f));
+ GUILayout.Label(value.ToLength(20), this.ValueStyle, GUILayout.Height(this.ValueStyle.fontSize * 1.2f));
}
GUILayout.EndHorizontal();
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/AltitudeSeaLevel.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/AltitudeSeaLevel.cs
@@ -34,7 +34,7 @@
{
this.Name = "Altitude (Sea Level)";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the target's altitude above sea level.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/AngleToRelativeAscendingNode.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/AngleToRelativeAscendingNode.cs
@@ -34,7 +34,7 @@
{
this.Name = "Angle to Rel. AN";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Angular Distance from the vessel to crossing the orbit of the target object, going north of it.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/AngleToRelativeDescendingNode.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/AngleToRelativeDescendingNode.cs
@@ -34,7 +34,7 @@
{
this.Name = "Angle to Rel. DN";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Angular Distance from the vessel to crossing the orbit of the target object, going south of it.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/ApoapsisHeight.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/ApoapsisHeight.cs
@@ -34,7 +34,7 @@
{
this.Name = "Apoapsis Height";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the targets's apoapsis height relative to sea level. (Apoapsis is the highest point of an orbit.)";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/Distance.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/Distance.cs
@@ -34,7 +34,7 @@
{
this.Name = "Distance";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Current distance between the vessel and the target object.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/OrbitalPeriod.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/OrbitalPeriod.cs
@@ -34,7 +34,7 @@
{
this.Name = "Orbital Period";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the amount of time it will take the target object to complete a full orbit.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/PeriapsisHeight.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/PeriapsisHeight.cs
@@ -34,7 +34,7 @@
{
this.Name = "Periapsis Height";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the targets's periapsis height relative to sea level. (Periapsis is the lowest point of an orbit.)";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/PhaseAngle.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/PhaseAngle.cs
@@ -34,7 +34,7 @@
{
this.Name = "Phase Angle";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Angular distance of the vessel relative to the target object.";
this.IsDefault = true;
}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/RelativeRadialVelocity.cs
@@ -1,1 +1,66 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2014 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+#region Using Directives
+
+using KerbalEngineer.Extensions;
+using KerbalEngineer.Flight.Sections;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Rendezvous
+{
+ public class RelativeRadialVelocity : ReadoutModule
+ {
+ #region Constructors
+
+ public RelativeRadialVelocity()
+ {
+ this.Name = "Relative Radial Velocity";
+ this.Category = ReadoutCategory.GetCategory("Rendezvous");
+ this.HelpString = "Relative radial velocity between your vessel and the target object";
+ this.IsDefault = false;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (RendezvousProcessor.ShowDetails)
+ {
+ this.DrawLine(RendezvousProcessor.RelativeRadialVelocity.ToSpeed(), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(RendezvousProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ RendezvousProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
+
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/RendezvousProcessor.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/RendezvousProcessor.cs
@@ -1,7 +1,7 @@
//
// Kerbal Engineer Redux
//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -17,30 +17,19 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Extensions;
-using KerbalEngineer.Helpers;
-
-#endregion
-
namespace KerbalEngineer.Flight.Readouts.Rendezvous
{
+ using System;
+ using Extensions;
+ using Helpers;
+
public class RendezvousProcessor : IUpdatable, IUpdateRequest
{
- #region Fields
-
private static readonly RendezvousProcessor instance = new RendezvousProcessor();
private Orbit originOrbit;
private Orbit targetOrbit;
- #endregion
-
- #region Properties
-
/// <summary>
/// Gets the target's altitude above its reference body.
/// </summary>
@@ -71,7 +60,10 @@
/// </summary>
public static RendezvousProcessor Instance
{
- get { return instance; }
+ get
+ {
+ return instance;
+ }
}
/// <summary>
@@ -145,14 +137,20 @@
public static double TimeToPeriapsis { get; private set; }
/// <summary>
+ /// Gets the relative radial velocity.
+ /// </summary>
+ public static double RelativeRadialVelocity { get; private set; }
+
+ /// <summary>
+ /// Gets approximate (linearly) time to the minimum distance between objects.
+ /// </summary>
+ public static double TimeToRendezvous { get; private set; }
+
+ /// <summary>
/// Gets and sets whether the updatable object should be updated.
/// </summary>
public bool UpdateRequested { get; set; }
- #endregion
-
- #region Methods: public
-
/// <summary>
/// Request and update to calculate the details.
/// </summary>
@@ -166,7 +164,13 @@
/// </summary>
public void Update()
{
- if (FlightGlobals.fetch.VesselTarget == null)
+ if (FlightGlobals.fetch == null ||
+ FlightGlobals.fetch.VesselTarget == null ||
+ FlightGlobals.ActiveVessel == null ||
+ FlightGlobals.ActiveVessel.targetObject == null ||
+ FlightGlobals.ActiveVessel.targetObject.GetOrbit() == null ||
+ FlightGlobals.ship_orbit == null ||
+ FlightGlobals.ship_orbit.referenceBody == null)
{
ShowDetails = false;
return;
@@ -174,55 +178,58 @@
ShowDetails = true;
- this.targetOrbit = FlightGlobals.fetch.VesselTarget.GetOrbit();
- this.originOrbit = (FlightGlobals.ship_orbit.referenceBody == Planetarium.fetch.Sun || FlightGlobals.ship_orbit.referenceBody == FlightGlobals.ActiveVessel.targetObject.GetOrbit().referenceBody)
+ targetOrbit = FlightGlobals.fetch.VesselTarget.GetOrbit();
+ originOrbit = (FlightGlobals.ship_orbit.referenceBody == Planetarium.fetch.Sun ||
+ FlightGlobals.ship_orbit.referenceBody == FlightGlobals.ActiveVessel.targetObject.GetOrbit().referenceBody)
? FlightGlobals.ship_orbit
: FlightGlobals.ship_orbit.referenceBody.orbit;
- RelativeInclination = this.originOrbit.GetRelativeInclination(this.targetOrbit);
+ RelativeInclination = originOrbit.GetRelativeInclination(targetOrbit);
RelativeVelocity = FlightGlobals.ship_tgtSpeed;
- RelativeSpeed = FlightGlobals.ship_obtSpeed - this.targetOrbit.orbitalSpeed;
- PhaseAngle = this.originOrbit.GetPhaseAngle(this.targetOrbit);
- InterceptAngle = this.CalcInterceptAngle();
- TimeToAscendingNode = this.originOrbit.GetTimeToVector(this.GetAscendingNode());
- TimeToDescendingNode = this.originOrbit.GetTimeToVector(this.GetDescendingNode());
- AngleToAscendingNode = this.originOrbit.GetAngleToVector(this.GetAscendingNode());
- AngleToDescendingNode = this.originOrbit.GetAngleToVector(this.GetDescendingNode());
- AltitudeSeaLevel = this.targetOrbit.altitude;
- ApoapsisHeight = this.targetOrbit.ApA;
- PeriapsisHeight = this.targetOrbit.PeA;
- TimeToApoapsis = this.targetOrbit.timeToAp;
- TimeToPeriapsis = this.targetOrbit.timeToPe;
- SemiMajorAxis = this.targetOrbit.semiMajorAxis;
- SemiMinorAxis = this.targetOrbit.semiMinorAxis;
-
- Distance = Vector3d.Distance(this.targetOrbit.pos, this.originOrbit.pos);
- OrbitalPeriod = this.targetOrbit.period;
- }
-
- #endregion
-
- #region Methods: private
+ RelativeSpeed = FlightGlobals.ship_obtSpeed - targetOrbit.orbitalSpeed;
+ PhaseAngle = originOrbit.GetPhaseAngle(targetOrbit);
+ InterceptAngle = CalcInterceptAngle();
+ TimeToAscendingNode = originOrbit.GetTimeToVector(GetAscendingNode());
+ TimeToDescendingNode = originOrbit.GetTimeToVector(GetDescendingNode());
+ AngleToAscendingNode = originOrbit.GetAngleToVector(GetAscendingNode());
+ AngleToDescendingNode = originOrbit.GetAngleToVector(GetDescendingNode());
+ AltitudeSeaLevel = targetOrbit.altitude;
+ ApoapsisHeight = targetOrbit.ApA;
+ PeriapsisHeight = targetOrbit.PeA;
+ TimeToApoapsis = targetOrbit.timeToAp;
+ TimeToPeriapsis = targetOrbit.timeToPe;
+ SemiMajorAxis = targetOrbit.semiMajorAxis;
+ SemiMinorAxis = targetOrbit.semiMinorAxis;
+
+ Distance = Vector3d.Distance(targetOrbit.pos, originOrbit.pos);
+ OrbitalPeriod = targetOrbit.period;
+
+ // beware that the order/sign of coordinates is inconsistent across different exposed variables
+ // in particular, v below does not equal to FlightGlobals.ship_tgtVelocity
+ Vector3d x = targetOrbit.pos - originOrbit.pos;
+ Vector3d v = targetOrbit.vel - originOrbit.vel;
+ double xv = Vector3d.Dot(x, v);
+ TimeToRendezvous = - xv / Vector3d.SqrMagnitude(v);
+ RelativeRadialVelocity = xv / Vector3d.Magnitude(x);
+ }
private double CalcInterceptAngle()
{
- var originRadius = (this.originOrbit.semiMinorAxis + this.originOrbit.semiMajorAxis) * 0.5;
- var targetRadius = (this.targetOrbit.semiMinorAxis + this.targetOrbit.semiMajorAxis) * 0.5;
- var angle = 180.0 * (1.0 - Math.Pow((originRadius + targetRadius) / (2.0 * targetRadius), 1.5));
+ double originRadius = (originOrbit.semiMinorAxis + originOrbit.semiMajorAxis) * 0.5;
+ double targetRadius = (targetOrbit.semiMinorAxis + targetOrbit.semiMajorAxis) * 0.5;
+ double angle = 180.0 * (1.0 - Math.Pow((originRadius + targetRadius) / (2.0 * targetRadius), 1.5));
angle = PhaseAngle - angle;
return RelativeInclination < 90.0 ? AngleHelper.Clamp360(angle) : AngleHelper.Clamp360(360.0 - (180.0 - angle));
}
private Vector3d GetAscendingNode()
{
- return Vector3d.Cross(this.targetOrbit.GetOrbitNormal(), this.originOrbit.GetOrbitNormal());
+ return Vector3d.Cross(targetOrbit.GetOrbitNormal(), originOrbit.GetOrbitNormal());
}
private Vector3d GetDescendingNode()
{
- return Vector3d.Cross(this.originOrbit.GetOrbitNormal(), this.targetOrbit.GetOrbitNormal());
- }
-
- #endregion
+ return Vector3d.Cross(originOrbit.GetOrbitNormal(), targetOrbit.GetOrbitNormal());
+ }
}
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/SemiMajorAxis.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/SemiMajorAxis.cs
@@ -36,7 +36,7 @@
{
this.Name = "Semi-major Axis";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = String.Empty;
+ this.HelpString = "Shows the distance from the centre of the target's orbit to the farthest edge.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/SemiMinorAxis.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/SemiMinorAxis.cs
@@ -36,7 +36,7 @@
{
this.Name = "Semi-minor Axis";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = String.Empty;
+ this.HelpString = "Shows the distance from the centre of the target's orbit to the nearest edge.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/TimeToApoapsis.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/TimeToApoapsis.cs
@@ -34,7 +34,7 @@
{
this.Name = "Time to Apoapsis";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the time until the target reaches apoapsis, the highest point of the orbit.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/TimeToPeriapsis.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/TimeToPeriapsis.cs
@@ -34,7 +34,7 @@
{
this.Name = "Time to Periapsis";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the time until the target reaches periapsis, the lowest point of the orbit.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/TimeToRelativeAscendingNode.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/TimeToRelativeAscendingNode.cs
@@ -34,7 +34,7 @@
{
this.Name = "Time to Rel. AN";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Time until the vessel crosses the target's orbit, going north.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Rendezvous/TimeToRelativeDescendingNode.cs
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/TimeToRelativeDescendingNode.cs
@@ -34,7 +34,7 @@
{
this.Name = "Time to Rel. DN";
this.Category = ReadoutCategory.GetCategory("Rendezvous");
- this.HelpString = string.Empty;
+ this.HelpString = "Time until the vessel crosses the target's orbit, going south.";
this.IsDefault = true;
}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Rendezvous/TimeToRendezvous.cs
@@ -1,1 +1,65 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2014 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+#region Using Directives
+
+using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Rendezvous
+{
+ public class TimeToRendezvous : ReadoutModule
+ {
+ #region Constructors
+
+ public TimeToRendezvous()
+ {
+ this.Name = "Time to Rendezvous";
+ this.Category = ReadoutCategory.GetCategory("Rendezvous");
+ this.HelpString = "Approximate (linearly) time to the minimum distance between objects.";
+ this.IsDefault = false;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (RendezvousProcessor.ShowDetails)
+ {
+ this.DrawLine(TimeFormatter.ConvertToString(RendezvousProcessor.TimeToRendezvous), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(RendezvousProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ RendezvousProcessor.RequestUpdate();
+ }
+
+ #endregion
+ }
+}
--- a/KerbalEngineer/Flight/Readouts/Surface/AtmosphericEfficiency.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/AtmosphericEfficiency.cs
@@ -1,7 +1,7 @@
//
// Kerbal Engineer Redux
//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -17,36 +17,26 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using KerbalEngineer.Extensions;
-using KerbalEngineer.Flight.Sections;
-
-#endregion
-
namespace KerbalEngineer.Flight.Readouts.Surface
{
+ using Extensions;
+ using Sections;
+
public class AtmosphericEfficiency : ReadoutModule
{
- #region Constructors
-
public AtmosphericEfficiency()
{
- this.Name = "Atmos. Efficiency";
- this.Category = ReadoutCategory.GetCategory("Surface");
- this.HelpString = "Shows you vessel's efficiency as a ratio of the current velocity and terminal velocity. Less than 1 means that you are losing efficiency due to gravity and greater than 1 is due to drag.";
- this.IsDefault = true;
+ Name = "Atmos. Efficiency";
+ Category = ReadoutCategory.GetCategory("Surface");
+ HelpString = "Shows you vessel's efficiency as a ratio of the current velocity and terminal velocity. Less than 100% means that you are losing efficiency due to gravity and greater than 100% is due to drag.";
+ IsDefault = false;
}
-
- #endregion
-
- #region Methods: public
public override void Draw(SectionModule section)
{
if (AtmosphericProcessor.ShowDetails)
{
- this.DrawLine(AtmosphericProcessor.Efficiency.ToPercent(), section.IsHud);
+ DrawLine(AtmosphericProcessor.Efficiency.ToPercent(), section.IsHud);
}
}
@@ -59,7 +49,5 @@
{
AtmosphericProcessor.RequestUpdate();
}
-
- #endregion
}
}
--- a/KerbalEngineer/Flight/Readouts/Surface/HorizontalSpeed.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/HorizontalSpeed.cs
@@ -21,6 +21,7 @@
using KerbalEngineer.Extensions;
using KerbalEngineer.Flight.Sections;
+using System;
#endregion
@@ -44,7 +45,11 @@
public override void Draw(SectionModule section)
{
- this.DrawLine(FlightGlobals.ActiveVessel.horizontalSrfSpeed.ToSpeed(), section.IsHud);
+ // Used to do this but the bug-fix to horizontalSrfSpeed in KSP 1.0.3 actually made it worse so workaround
+ //this.DrawLine(FlightGlobals.ActiveVessel.horizontalSrfSpeed.ToSpeed(), section.IsHud);
+ var ves = FlightGlobals.ActiveVessel;
+ double horizSpeed = Math.Sqrt(ves.srfSpeed * ves.srfSpeed - ves.verticalSpeed * ves.verticalSpeed);
+ this.DrawLine(horizSpeed.ToSpeed(), section.IsHud);
}
#endregion
--- a/KerbalEngineer/Flight/Readouts/Surface/ImpactAltitude.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/ImpactAltitude.cs
@@ -34,7 +34,7 @@
{
this.Name = "Impact Altitude";
this.Category = ReadoutCategory.GetCategory("Surface");
- this.HelpString = string.Empty;
+ this.HelpString = "Altitude at which the Vessel will impact.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Surface/ImpactBiome.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/ImpactBiome.cs
@@ -33,7 +33,7 @@
{
this.Name = "Impact Biome";
this.Category = ReadoutCategory.GetCategory("Surface");
- this.HelpString = string.Empty;
+ this.HelpString = "Biome the Vessel will impact in.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Surface/ImpactLatitude.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/ImpactLatitude.cs
@@ -34,7 +34,7 @@
{
this.Name = "Impact Latitude";
this.Category = ReadoutCategory.GetCategory("Surface");
- this.HelpString = string.Empty;
+ this.HelpString = "Latitude of the impact position.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Surface/ImpactLongitude.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/ImpactLongitude.cs
@@ -34,7 +34,7 @@
{
this.Name = "Impact Longitude";
this.Category = ReadoutCategory.GetCategory("Surface");
- this.HelpString = string.Empty;
+ this.HelpString = "Longditude of the impact position.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Surface/ImpactTime.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/ImpactTime.cs
@@ -34,7 +34,7 @@
{
this.Name = "Impact Time";
this.Category = ReadoutCategory.GetCategory("Surface");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows time until the vessel impacts the central object.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Surface/Latitude.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/Latitude.cs
@@ -20,6 +20,7 @@
#region Using Directives
using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
#endregion
@@ -33,7 +34,7 @@
{
this.Name = "Latitude";
this.Category = ReadoutCategory.GetCategory("Surface");
- this.HelpString = "Shows the vessel's latitude position around the celestial body. Latitude is the angle from the equator to poles.";
+ this.HelpString = "Shows the vessel's latitude position around the celestial body. Latitude is the angle from the equator to poles.";
this.IsDefault = true;
}
@@ -43,7 +44,7 @@
public override void Draw(SectionModule section)
{
- this.DrawLine(KSPUtil.PrintLatitude(FlightGlobals.ship_latitude), section.IsHud);
+ this.DrawLine(Units.ToAngleDMS(FlightGlobals.ship_latitude) + (FlightGlobals.ship_latitude < 0 ? " S" : " N"), section.IsHud);
}
#endregion
--- a/KerbalEngineer/Flight/Readouts/Surface/Longitude.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/Longitude.cs
@@ -17,35 +17,25 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using KerbalEngineer.Flight.Sections;
-
-#endregion
-
namespace KerbalEngineer.Flight.Readouts.Surface
{
+ using Helpers;
+ using Sections;
+
public class Longitude : ReadoutModule
{
- #region Constructors
-
public Longitude()
{
- this.Name = "Longitude";
- this.Category = ReadoutCategory.GetCategory("Surface");
- this.HelpString = "Shows the vessel's longitude around a celestial body. Longitude is the angle from the bodies prime meridian.";
- this.IsDefault = true;
+ Name = "Longitude";
+ Category = ReadoutCategory.GetCategory("Surface");
+ HelpString = "Shows the vessel's longitude around a celestial body. Longitude is the angle from the bodies prime meridian.";
+ IsDefault = true;
}
-
- #endregion
-
- #region Methods: public
public override void Draw(SectionModule section)
{
- this.DrawLine(KSPUtil.PrintLongitude(FlightGlobals.ship_longitude), section.IsHud);
+ double angle = AngleHelper.Clamp180(FlightGlobals.ship_longitude);
+ DrawLine(Units.ToAngleDMS(angle) + (angle < 0.0 ? "W" : " E"), section.IsHud);
}
-
- #endregion
}
}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Surface/MachNumber.cs
@@ -1,1 +1,43 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Surface
+{
+ using Extensions;
+ using Sections;
+
+ public class MachNumber : ReadoutModule
+ {
+ public MachNumber()
+ {
+ Name = "Mach Number";
+ Category = ReadoutCategory.GetCategory("Surface");
+ HelpString = "Shows the vessel's mach number.";
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (FlightGlobals.ActiveVessel.atmDensity > 0.0)
+ {
+ DrawLine(FlightGlobals.ActiveVessel.mach.ToMach(), section.IsHud);
+ }
+ }
+ }
+}
--- a/KerbalEngineer/Flight/Readouts/Surface/Situation.cs
+++ b/KerbalEngineer/Flight/Readouts/Surface/Situation.cs
@@ -33,7 +33,7 @@
{
this.Name = "Situation";
this.Category = ReadoutCategory.GetCategory("Surface");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the vessel's current scientific situation. (Landed, Splashed, Flying Low/High, In Space Low/High)";
this.IsDefault = true;
}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/ConvectionFlux.cs
@@ -1,1 +1,53 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Extensions;
+ using Sections;
+
+ public class ConvectionFlux : ReadoutModule
+ {
+ public ConvectionFlux()
+ {
+ Name = "Convection Flux";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = string.Empty;
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails && FlightGlobals.ActiveVessel.atmDensity > 0.0)
+ {
+ DrawLine(ThermalProcessor.ConvectionFlux.ToFlux(), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/CoolestPart.cs
@@ -1,1 +1,52 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Sections;
+
+ public class CoolestPart : ReadoutModule
+ {
+ public CoolestPart()
+ {
+ Name = "Coolest Part";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = "The part of the vessel that is enduring the lowest temperature.";
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(ThermalProcessor.CoolestPartName, section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/CoolestSkinTemperature.cs
@@ -1,1 +1,53 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Helpers;
+ using Sections;
+
+ public class CoolestSkinTemperature : ReadoutModule
+ {
+ public CoolestSkinTemperature()
+ {
+ Name = "Coolest Skin Temperature";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = "Lowest external Temperature on the Vessel.";
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(Units.ToTemperature(ThermalProcessor.CoolestSkinTemperature, ThermalProcessor.CoolestSkinTemperatureMax), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/CoolestTemperature.cs
@@ -1,1 +1,53 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Helpers;
+ using Sections;
+
+ public class CoolestTemperature : ReadoutModule
+ {
+ public CoolestTemperature()
+ {
+ Name = "Coolest Temperature";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = "Lowest internal Temperature on the Vessel.";
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(Units.ToTemperature(ThermalProcessor.CoolestTemperature, ThermalProcessor.CoolestTemperatureMax), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/CriticalPart.cs
@@ -1,1 +1,52 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Sections;
+
+ public class CriticalPart : ReadoutModule
+ {
+ public CriticalPart()
+ {
+ Name = "Critical Part";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = "This part is structually most critical. If it endures too high temperature there is a high chance for major structual failure!";
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(ThermalProcessor.CriticalPartName, section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/CriticalSkinTemperature.cs
@@ -1,1 +1,53 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Helpers;
+ using Sections;
+
+ public class CriticalSkinTemperature : ReadoutModule
+ {
+ public CriticalSkinTemperature()
+ {
+ Name = "Critical Skin Temperature";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = "Highest external Temperature on the part of the Vessel that is structually most critical.";
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(Units.ToTemperature(ThermalProcessor.CriticalSkinTemperature, ThermalProcessor.CriticalSkinTemperatureMax), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/CriticalTemperature.cs
@@ -1,1 +1,53 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Helpers;
+ using Sections;
+
+ public class CriticalTemperature : ReadoutModule
+ {
+ public CriticalTemperature()
+ {
+ Name = "Critical Temperature";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = "Internal Temperature on the part of the Vessel that is structually most critical.";
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(Units.ToTemperature(ThermalProcessor.CriticalTemperature, ThermalProcessor.CriticalTemperatureMax), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/CriticalThermalPercentage.cs
@@ -1,1 +1,53 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Extensions;
+ using Sections;
+
+ public class CriticalThermalPercentage : ReadoutModule
+ {
+ public CriticalThermalPercentage()
+ {
+ Name = "Critical Thermal Percentage";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = "Shows how high a temperature the critical Part is enduring relative to it's maximal temperature.";
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(ThermalProcessor.CriticalTemperaturePercentage.ToPercent(), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/HottestPart.cs
@@ -1,1 +1,52 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Sections;
+
+ public class HottestPart : ReadoutModule
+ {
+ public HottestPart()
+ {
+ Name = "Hottest Part";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = "The part of the vessel that is enduring the highest temperature.";
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(ThermalProcessor.HottestPartName, section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/HottestSkinTemperature.cs
@@ -1,1 +1,53 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Helpers;
+ using Sections;
+
+ public class HottestSkinTemperature : ReadoutModule
+ {
+ public HottestSkinTemperature()
+ {
+ Name = "Hottest Skin Temperature";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = "Highest external Temperature on the Vessel.";
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(Units.ToTemperature(ThermalProcessor.HottestSkinTemperature, ThermalProcessor.HottestSkinTemperatureMax), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/HottestTemperature.cs
@@ -1,1 +1,53 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Helpers;
+ using Sections;
+
+ public class HottestTemperature : ReadoutModule
+ {
+ public HottestTemperature()
+ {
+ Name = "Hottest Temperature";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = "Highest internal Temperature on the Vessel.";
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(Units.ToTemperature(ThermalProcessor.HottestTemperature, ThermalProcessor.HottestTemperatureMax), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/InternalFlux.cs
@@ -1,1 +1,53 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Extensions;
+ using Sections;
+
+ public class InternalFlux : ReadoutModule
+ {
+ public InternalFlux()
+ {
+ Name = "Internal Flux";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = string.Empty;
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(ThermalProcessor.InternalFlux.ToFlux(), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/RadiationFlux.cs
@@ -1,1 +1,53 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using Extensions;
+ using Sections;
+
+ public class RadiationFlux : ReadoutModule
+ {
+ public RadiationFlux()
+ {
+ Name = "Radiation Flux";
+ Category = ReadoutCategory.GetCategory("Thermal");
+ HelpString = string.Empty;
+ IsDefault = true;
+ }
+
+ public override void Draw(SectionModule section)
+ {
+ if (ThermalProcessor.ShowDetails)
+ {
+ DrawLine(ThermalProcessor.RadiationFlux.ToFlux(), section.IsHud);
+ }
+ }
+
+ public override void Reset()
+ {
+ FlightEngineerCore.Instance.AddUpdatable(ThermalProcessor.Instance);
+ }
+
+ public override void Update()
+ {
+ ThermalProcessor.RequestUpdate();
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Thermal/ThermalProcessor.cs
@@ -1,1 +1,161 @@
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.Flight.Readouts.Thermal
+{
+ using System;
+
+ public class ThermalProcessor : IUpdatable, IUpdateRequest
+ {
+ private static readonly ThermalProcessor instance = new ThermalProcessor();
+
+ static ThermalProcessor()
+ {
+ HottestTemperature = 0.0;
+ HottestTemperatureMax = 0.0;
+ HottestSkinTemperature = 0.0;
+ HottestSkinTemperatureMax = 0.0;
+ CoolestTemperature = 0.0;
+ CoolestTemperatureMax = 0.0;
+ CoolestSkinTemperature = 0.0;
+ CoolestSkinTemperatureMax = 0.0;
+ CriticalTemperature = 0.0;
+ CriticalTemperatureMax = 0.0;
+ CriticalSkinTemperature = 0.0;
+ CriticalSkinTemperatureMax = 0.0;
+ HottestPartName = string.Empty;
+ CoolestPartName = string.Empty;
+ CriticalPartName = string.Empty;
+ }
+
+ public static double ConvectionFlux { get; private set; }
+
+ public static string CoolestPartName { get; private set; }
+
+ public static double CoolestSkinTemperature { get; private set; }
+
+ public static double CoolestSkinTemperatureMax { get; private set; }
+
+ public static double CoolestTemperature { get; private set; }
+
+ public static double CoolestTemperatureMax { get; private set; }
+
+ public static string CriticalPartName { get; private set; }
+
+ public static double CriticalSkinTemperature { get; private set; }
+
+ public static double CriticalSkinTemperatureMax { get; private set; }
+
+ public static double CriticalTemperature { get; private set; }
+
+ public static double CriticalTemperatureMax { get; private set; }
+
+ public static double CriticalTemperaturePercentage { get; private set; }
+
+ public static string HottestPartName { get; private set; }
+
+ public static double HottestSkinTemperature { get; private set; }
+
+ public static double HottestSkinTemperatureMax { get; private set; }
+
+ public static double HottestTemperature { get; private set; }
+
+ public static double HottestTemperatureMax { get; private set; }
+
+ public static ThermalProcessor Instance
+ {
+ get
+ {
+ return instance;
+ }
+ }
+
+ public static double InternalFlux { get; private set; }
+
+ public static double RadiationFlux { get; private set; }
+
+ public static bool ShowDetails { get; private set; }
+
+ public void Update()
+ {
+ if (FlightGlobals.ActiveVessel.parts.Count == 0)
+ {
+ ShowDetails = false;
+ return;
+ }
+
+ ShowDetails = true;
+
+ ConvectionFlux = 0.0;
+ RadiationFlux = 0.0;
+ InternalFlux = 0.0;
+ HottestTemperature = 0.0;
+ HottestSkinTemperature = 0.0;
+ CoolestTemperature = double.MaxValue;
+ CoolestSkinTemperature = double.MaxValue;
+ CriticalTemperature = double.MaxValue;
+ CriticalSkinTemperature = double.MaxValue;
+ CriticalTemperaturePercentage = 0.0;
+ HottestPartName = string.Empty;
+ CoolestPartName = string.Empty;
+ CriticalPartName = string.Empty;
+
+ for (int i = 0; i < FlightGlobals.ActiveVessel.parts.Count; ++i)
+ {
+ Part part = FlightGlobals.ActiveVessel.parts[i];
+
+ ConvectionFlux = ConvectionFlux + part.thermalConvectionFlux;
+ RadiationFlux = RadiationFlux + part.thermalRadiationFlux;
+ InternalFlux = InternalFlux + part.thermalInternalFluxPrevious;
+
+ if (part.temperature > HottestTemperature || part.skinTemperature > HottestSkinTemperature)
+ {
+ HottestTemperature = part.temperature;
+ HottestTemperatureMax = part.maxTemp;
+ HottestSkinTemperature = part.skinTemperature;
+ HottestSkinTemperatureMax = part.skinMaxTemp;
+ HottestPartName = part.partInfo.title;
+ }
+ if (part.temperature < CoolestTemperature || part.skinTemperature < CoolestSkinTemperature)
+ {
+ CoolestTemperature = part.temperature;
+ CoolestTemperatureMax = part.maxTemp;
+ CoolestSkinTemperature = part.skinTemperature;
+ CoolestSkinTemperatureMax = part.skinMaxTemp;
+ CoolestPartName = part.partInfo.title;
+ }
+
+ if (part.temperature / part.maxTemp > CriticalTemperaturePercentage || part.skinTemperature / part.skinMaxTemp > CriticalTemperaturePercentage)
+ {
+ CriticalTemperature = part.temperature;
+ CriticalTemperatureMax = part.maxTemp;
+ CriticalSkinTemperature = part.skinTemperature;
+ CriticalSkinTemperatureMax = part.skinMaxTemp;
+ CriticalTemperaturePercentage = Math.Max(part.temperature / part.maxTemp, part.skinTemperature / part.skinMaxTemp);
+ CriticalPartName = part.partInfo.title;
+ }
+ }
+ }
+
+ public bool UpdateRequested { get; set; }
+
+ public static void RequestUpdate()
+ {
+ instance.UpdateRequested = true;
+ }
+ }
+}
--- a/KerbalEngineer/Flight/Readouts/Vessel/Acceleration.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/Acceleration.cs
@@ -34,7 +34,7 @@
{
this.Name = "Acceleration";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the current and maximum acceleration of the craft.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/AttitudeProcessor.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/AttitudeProcessor.cs
@@ -110,8 +110,8 @@
? 360.0f - this.surfaceRotation.eulerAngles.x
: -this.surfaceRotation.eulerAngles.x;
this.roll = this.surfaceRotation.eulerAngles.z > 180.0f
- ? this.surfaceRotation.eulerAngles.z - 360.0f
- : this.surfaceRotation.eulerAngles.z;
+ ? 360.0f - this.surfaceRotation.eulerAngles.z
+ : -this.surfaceRotation.eulerAngles.z;
this.headingRate = this.heading - this.previousHeading;
this.pitchRate = this.pitch - this.previousPitch;
--- a/KerbalEngineer/Flight/Readouts/Vessel/DeltaVStaged.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/DeltaVStaged.cs
@@ -30,13 +30,6 @@
{
public class DeltaVStaged : ReadoutModule
{
- #region Fields
-
- private int numberOfStages;
- private bool showing;
-
- #endregion
-
#region Constructors
public DeltaVStaged()
--- a/KerbalEngineer/Flight/Readouts/Vessel/Heading.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/Heading.cs
@@ -34,7 +34,7 @@
{
this.Name = "Heading";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the current Heading.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/HeadingRate.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/HeadingRate.cs
@@ -34,7 +34,7 @@
{
this.Name = "Heading Rate";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the current change in Heading.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/IntakeAirDemand.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/IntakeAirDemand.cs
@@ -39,7 +39,7 @@
{
this.Name = "Intake Air (Demand)";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Displays the Amount of Intake Air required.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/IntakeAirDemandSupply.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/IntakeAirDemandSupply.cs
@@ -42,7 +42,7 @@
{
this.Name = "Intake Air (D/S)";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Displays the Ration between required and available Intake Air.";
this.IsDefault = false;
}
@@ -55,20 +55,11 @@
var demand = 0.0;
foreach (var part in FlightGlobals.ActiveVessel.Parts)
{
- if (part.Modules.Contains("ModuleEngines"))
+ for (int i = 0; i < part.Modules.Count; i++)
{
- var engine = part.Modules["ModuleEngines"] as ModuleEngines;
- if (engine.isOperational)
- {
- demand += engine.propellants
- .Where(p => p.name == "IntakeAir")
- .Sum(p => p.currentRequirement);
- }
- }
- if (part.Modules.Contains("ModuleEnginesFX"))
- {
- var engine = part.Modules["ModuleEnginesFX"] as ModuleEnginesFX;
- if (engine.isOperational)
+ PartModule partmod = part.Modules[i];
+ var engine = partmod as ModuleEngines;
+ if (engine != null && engine.isOperational)
{
demand += engine.propellants
.Where(p => p.name == "IntakeAir")
--- a/KerbalEngineer/Flight/Readouts/Vessel/IntakeAirSupply.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/IntakeAirSupply.cs
@@ -39,7 +39,7 @@
{
this.Name = "Intake Air (Supply)";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Displays the available Intake Air.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/IntakeAirUsage.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/IntakeAirUsage.cs
@@ -42,7 +42,7 @@
{
this.Name = "Intake Air (Usage)";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Displays the consumption of Intake Air.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/Mass.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/Mass.cs
@@ -28,19 +28,13 @@
{
public class Mass : ReadoutModule
{
- #region Fields
-
- private bool showing;
-
- #endregion
-
#region Constructors
public Mass()
{
this.Name = "Mass";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Displays the total Mass of the Vessel.";
this.IsDefault = true;
}
--- /dev/null
+++ b/KerbalEngineer/Flight/Readouts/Vessel/Name.cs
@@ -1,1 +1,55 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2014 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+#region Using Directives
+
+using KerbalEngineer.Flight.Sections;
+using KerbalEngineer.Helpers;
+
+#endregion
+
+namespace KerbalEngineer.Flight.Readouts.Vessel
+{
+ public class Name : ReadoutModule
+ {
+ #region Constructors
+
+ public Name()
+ {
+ Name = "Name";
+ Category = ReadoutCategory.GetCategory("Vessel");
+ HelpString = "Displays the name of the current vessel.";
+ IsDefault = true;
+ }
+
+ #endregion
+
+ #region Methods: public
+
+ public override void Draw(SectionModule section)
+ {
+ if (SimulationProcessor.ShowDetails)
+ {
+ DrawLine(FlightGlobals.ActiveVessel.vesselName);
+ }
+ }
+
+ #endregion
+ }
+}
--- a/KerbalEngineer/Flight/Readouts/Vessel/PartCount.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/PartCount.cs
@@ -34,7 +34,7 @@
{
this.Name = "Part Count";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the total number of Parts the current and next stage.";
this.IsDefault = true;
}
@@ -46,7 +46,7 @@
{
if (SimulationProcessor.ShowDetails)
{
- this.DrawLine(Units.ConcatF(SimulationProcessor.LastStage.partCount, SimulationProcessor.LastStage.totalPartCount), section.IsHud);
+ this.DrawLine(Units.ConcatF(SimulationProcessor.LastStage.partCount, SimulationProcessor.LastStage.totalPartCount, 0), section.IsHud);
}
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/Pitch.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/Pitch.cs
@@ -34,7 +34,7 @@
{
this.Name = "Pitch";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the current Pitch angle.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/PitchRate.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/PitchRate.cs
@@ -34,7 +34,7 @@
{
this.Name = "Pitch Rate";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the current Pitch speed.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/Roll.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/Roll.cs
@@ -34,7 +34,7 @@
{
this.Name = "Roll";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the current Roll angle.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/RollRate.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/RollRate.cs
@@ -34,7 +34,7 @@
{
this.Name = "Roll Rate";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the current Roll speed.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/SpecificImpulse.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/SpecificImpulse.cs
@@ -33,7 +33,7 @@
{
this.Name = "Specific Impulse";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the average Specific Impulse of all engines in the current stage.";
this.IsDefault = false;
}
--- a/KerbalEngineer/Flight/Readouts/Vessel/Thrust.cs
+++ b/KerbalEngineer/Flight/Readouts/Vessel/Thrust.cs
@@ -34,7 +34,7 @@
{
this.Name = "Thrust";
this.Category = ReadoutCategory.GetCategory("Vessel");
- this.HelpString = string.Empty;
+ this.HelpString = "Shows the current and maximum thrust the vessel can put out.";
this.IsDefault = true;
}
--- a/KerbalEngineer/Flight/Sections/SectionEditor.cs
+++ b/KerbalEngineer/Flight/Sections/SectionEditor.cs
@@ -103,7 +103,6 @@
{
try
{
- RenderingManager.RemoveFromPostDrawQueue(0, this.Draw);
}
catch (Exception ex)
{
@@ -120,7 +119,6 @@
{
this.InitialiseStyles();
//ReadoutCategory.Selected = ReadoutCategory.GetCategory("Orbital");
- RenderingManager.AddToPostDrawQueue(0, this.Draw);
}
catch (Exception ex)
{
@@ -135,8 +133,13 @@
/// <summary>
/// Called to draw the editor when the UI is enabled.
/// </summary>
- private void Draw()
- {
+ private void OnGUI()
+ {
+ if (FlightEngineerCore.IsDisplayable == false)
+ {
+ return;
+ }
+
this.position = GUILayout.Window(this.GetInstanceID(), this.position, this.Window, "EDIT SECTION - " + this.ParentSection.Name.ToUpper(), this.windowStyle).ClampToScreen();
this.ParentSection.EditorPositionX = this.position.x;
this.ParentSection.EditorPositionY = this.position.y;
@@ -215,15 +218,18 @@
this.ParentSection.Name = GUILayout.TextField(this.ParentSection.Name, this.textStyle);
var isShowingInControlBar = !string.IsNullOrEmpty(this.ParentSection.Abbreviation);
this.ParentSection.Abbreviation = GUILayout.TextField(this.ParentSection.Abbreviation, this.textStyle, GUILayout.Width(75.0f));
+
+ ParentSection.IsHud = GUILayout.Toggle(this.ParentSection.IsHud, "HUD", this.readoutButtonStyle, GUILayout.Width(50.0f));
+ if (ParentSection.IsHud)
+ {
+ this.ParentSection.IsHudBackground = GUILayout.Toggle(this.ParentSection.IsHudBackground, "BG", this.readoutButtonStyle, GUILayout.Width(50.0f));
+ }
+
if (this.ParentSection.IsCustom)
{
if (isShowingInControlBar && string.IsNullOrEmpty(this.ParentSection.Abbreviation))
{
DisplayStack.Instance.RequestResize();
- }
- if (this.ParentSection.IsHud = GUILayout.Toggle(this.ParentSection.IsHud, "HUD", this.readoutButtonStyle, GUILayout.Width(50.0f)))
- {
- this.ParentSection.IsHudBackground = GUILayout.Toggle(this.ParentSection.IsHudBackground, "BG", this.readoutButtonStyle, GUILayout.Width(50.0f));
}
if (GUILayout.Button("DELETE SECTION", this.readoutButtonStyle, GUILayout.Width(150.0f)))
--- a/KerbalEngineer/Flight/Sections/SectionLibrary.cs
+++ b/KerbalEngineer/Flight/Sections/SectionLibrary.cs
@@ -1,7 +1,7 @@
//
// Kerbal Engineer Redux
//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -19,22 +19,19 @@
#region Using Directives
-using System.Collections.Generic;
-using System.Linq;
-
-using KerbalEngineer.Flight.Readouts;
-using KerbalEngineer.Settings;
-
-using UnityEngine;
-
#endregion
namespace KerbalEngineer.Flight.Sections
{
+ using System.Collections.Generic;
+ using System.Linq;
+ using Readouts;
+ using Settings;
+ using UnityEngine;
+
public static class SectionLibrary
{
#region Constructors
-
/// <summary>
/// Sets up and populates the library with the stock sections on creation.
/// </summary>
@@ -71,7 +68,15 @@
ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Rendezvous")).Where(r => r.IsDefault).ToList()
});
- var hud1 = new SectionModule
+ CustomSections.Add(new SectionModule
+ {
+ Name = "THERMAL",
+ Abbreviation = "HEAT",
+ ReadoutModules = ReadoutLibrary.GetCategory(ReadoutCategory.GetCategory("Thermal")).Where(r => r.IsDefault).ToList(),
+ IsCustom = true
+ });
+
+ SectionModule hud1 = new SectionModule
{
Name = "HUD 1",
Abbreviation = "HUD 1",
@@ -90,7 +95,7 @@
hud1.IsHud = true;
CustomSections.Add(hud1);
- var hud2 = new SectionModule
+ SectionModule hud2 = new SectionModule
{
Name = "HUD 2",
Abbreviation = "HUD 2",
@@ -101,7 +106,8 @@
ReadoutLibrary.GetReadout("AltitudeTerrain"),
ReadoutLibrary.GetReadout("VerticalSpeed"),
ReadoutLibrary.GetReadout("HorizontalSpeed"),
- ReadoutLibrary.GetReadout("Biome")
+ ReadoutLibrary.GetReadout("Biome"),
+ ReadoutLibrary.GetReadout("MachNumber")
},
};
hud2.FloatingPositionX = Screen.width * 0.75f - (hud2.ReadoutModules.First().ContentWidth * 0.5f);
@@ -109,11 +115,9 @@
hud2.IsHud = true;
CustomSections.Add(hud2);
}
-
#endregion
#region Properties
-
/// <summary>
/// Gets and sets a list of custom sections.
/// </summary>
@@ -133,13 +137,11 @@
/// Gets and sets a list of stock sections
/// </summary>
public static List<SectionModule> StockSections { get; set; }
-
#endregion
#region Updating
#region Methods: public
-
/// <summary>
/// Fixed update all of the sections.
/// </summary>
@@ -160,17 +162,15 @@
UpdateSections(StockSections);
UpdateSections(CustomSections);
}
-
#endregion
#region Methods: private
-
/// <summary>
/// Fixed updates a list of sections.
/// </summary>
private static void FixedUpdateSections(IEnumerable<SectionModule> sections)
{
- foreach (var section in sections)
+ foreach (SectionModule section in sections)
{
if (section.IsVisible)
{
@@ -184,13 +184,13 @@
/// </summary>
private static void UpdateSections(IEnumerable<SectionModule> sections)
{
- foreach (var section in sections)
+ foreach (SectionModule section in sections)
{
if (section.IsVisible)
{
if (!section.IsFloating)
{
- foreach (var readout in section.ReadoutModules)
+ foreach (ReadoutModule readout in section.ReadoutModules)
{
if (readout.ResizeRequested)
{
@@ -203,7 +203,7 @@
}
else
{
- foreach (var readout in section.ReadoutModules)
+ foreach (ReadoutModule readout in section.ReadoutModules)
{
if (readout.ResizeRequested)
{
@@ -218,13 +218,11 @@
NumberOfSections++;
}
}
-
#endregion
#endregion
#region Saving and Loading
-
/// <summary>
/// Loads the state of all stored sections.
/// </summary>
@@ -243,11 +241,11 @@
}
});
- var handler = SettingHandler.Load("SectionLibrary.xml", new[] {typeof(List<SectionModule>)});
+ SettingHandler handler = SettingHandler.Load("SectionLibrary.xml", new[] { typeof(List<SectionModule>) });
StockSections = handler.Get("StockSections", StockSections);
CustomSections = handler.Get("CustomSections", CustomSections);
- foreach (var section in GetAllSections())
+ foreach (SectionModule section in GetAllSections())
{
section.ClearNullReadouts();
}
@@ -258,22 +256,20 @@
/// </summary>
public static void Save()
{
- var handler = new SettingHandler();
+ SettingHandler handler = new SettingHandler();
handler.Set("StockSections", StockSections);
handler.Set("CustomSections", CustomSections);
handler.Save("SectionLibrary.xml");
}
-
#endregion
#region Methods
-
/// <summary>
/// Gets a list containing all section modules.
/// </summary>
public static List<SectionModule> GetAllSections()
{
- var sections = new List<SectionModule>();
+ List<SectionModule> sections = new List<SectionModule>();
sections.AddRange(StockSections);
sections.AddRange(CustomSections);
return sections;
@@ -326,7 +322,6 @@
{
return StockSections.Remove(GetStockSection(name));
}
-
#endregion
}
}
--- a/KerbalEngineer/Flight/Sections/SectionWindow.cs
+++ b/KerbalEngineer/Flight/Sections/SectionWindow.cs
@@ -116,7 +116,7 @@
/// <summary>
/// Called to draw the floating section window when the UI is enabled.
/// </summary>
- private void Draw()
+ private void OnGUI()
{
if (this.ParentSection == null || !this.ParentSection.IsVisible || (DisplayStack.Instance.Hidden && !this.ParentSection.IsHud) || !FlightEngineerCore.IsDisplayable)
{
@@ -134,7 +134,11 @@
(!this.ParentSection.IsHud || this.ParentSection.IsEditorVisible) ? this.windowStyle
: this.ParentSection.IsHudBackground && this.ParentSection.LineCount > 0
? this.hudWindowBgStyle
- : this.hudWindowStyle).ClampToScreen();
+ : this.hudWindowStyle);
+
+ windowPosition = (ParentSection.IsHud) ? windowPosition.ClampInsideScreen() : windowPosition.ClampToScreen();
+
+
this.ParentSection.FloatingPositionX = this.windowPosition.x;
this.ParentSection.FloatingPositionY = this.windowPosition.y;
}
@@ -161,7 +165,6 @@
/// </summary>
private void OnDestroy()
{
- RenderingManager.RemoveFromPostDrawQueue(0, this.Draw);
GuiDisplaySize.OnSizeChanged -= this.OnSizeChanged;
}
@@ -188,7 +191,7 @@
{
this.windowId = this.GetHashCode();
this.InitialiseStyles();
- RenderingManager.AddToPostDrawQueue(0, this.Draw);
+
GuiDisplaySize.OnSizeChanged += this.OnSizeChanged;
}
--- a/KerbalEngineer/Helpers/AngleHelper.cs
+++ b/KerbalEngineer/Helpers/AngleHelper.cs
@@ -17,21 +17,30 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using UnityEngine;
-
-#endregion
-
namespace KerbalEngineer.Helpers
{
+ using UnityEngine;
+
public static class AngleHelper
{
- #region Methods: public
+ public static double Clamp180(double angle)
+ {
+ angle = Clamp360(angle);
+ if (angle > 180.0)
+ {
+ angle = angle - 360.0;
+ }
+ return angle;
+ }
- public static double Clamp360(double value)
+ public static double Clamp360(double angle)
{
- return ClampBetween(value, 0.0, 360.0);
+ angle = angle % 360.0;
+ if (angle < 0.0)
+ {
+ angle = angle + 360.0;
+ }
+ return angle;
}
public static double ClampBetween(double value, double minimum, double maximum)
@@ -51,8 +60,8 @@
public static double GetAngleBetweenVectors(Vector3d left, Vector3d right)
{
- var angle = Vector3d.Angle(left, right);
- var rotated = QuaternionD.AngleAxis(90.0, Vector3d.forward) * right;
+ double angle = Vector3d.Angle(left, right);
+ Vector3d rotated = QuaternionD.AngleAxis(90.0, Vector3d.forward) * right;
if (Vector3d.Angle(rotated, left) > 90.0)
{
@@ -60,7 +69,5 @@
}
return angle;
}
-
- #endregion
}
}
--- a/KerbalEngineer/Helpers/ForceAccumulator.cs
+++ b/KerbalEngineer/Helpers/ForceAccumulator.cs
@@ -19,19 +19,39 @@
using System;
using System.Collections.Generic;
+using KerbalEngineer.VesselSimulator;
namespace KerbalEngineer
{
// a (force, application point) tuple
public class AppliedForce
{
+ private static readonly Pool<AppliedForce> pool = new Pool<AppliedForce>(Create, Reset);
+
public Vector3d vector;
public Vector3d applicationPoint;
- public AppliedForce(Vector3d vector, Vector3d applicationPoint) {
- this.vector = vector;
- this.applicationPoint = applicationPoint;
+ static private AppliedForce Create()
+ {
+ return new AppliedForce();
}
+
+ static private void Reset(AppliedForce appliedForce) { }
+
+ static public AppliedForce New(Vector3d vector, Vector3d applicationPoint)
+ {
+ AppliedForce force = pool.Borrow();
+ force.vector = vector;
+ force.applicationPoint = applicationPoint;
+ return force;
+ }
+
+ public void Release()
+ {
+ pool.Release(this);
+ }
+
+
}
// This class was mostly adapted from FARCenterQuery, part of FAR, by ferram4, GPLv3
@@ -47,7 +67,7 @@
// some amount of residual torque. The line with the least amount of residual torque is chosen.
public class ForceAccumulator
{
- // Total force.
+ // Total force.
private Vector3d totalForce = Vector3d.zero;
// Torque needed to compensate if force were applied at origin.
private Vector3d totalZeroOriginTorque = Vector3d.zero;
--- a/KerbalEngineer/Helpers/Pool.cs
+++ b/KerbalEngineer/Helpers/Pool.cs
@@ -1,61 +1,53 @@
-namespace KerbalEngineer.VesselSimulator
+using System.Collections.Generic;
+
+namespace KerbalEngineer
{
- using System.Collections.Generic;
+ /// <summary>
+ /// Pool of object
+ /// </summary>
+ public class Pool<T> {
+
+ private readonly Stack<T> values = new Stack<T>();
- public class Pool<T> where T : new()
- {
- private static List<T> available = new List<T>();
- private static List<T> inUse = new List<T>();
+ private readonly CreateDelegate<T> create;
+ private readonly ResetDelegate<T> reset;
- public static int PoolCount
- {
- get
- {
- return available.Count + inUse.Count;
+ public delegate R CreateDelegate<out R>();
+ public delegate void ResetDelegate<in T1>(T1 a);
+
+ /// <summary>
+ /// Creates an empty pool with the specified object creation and reset delegates.
+ /// </summary>
+ public Pool(CreateDelegate<T> create, ResetDelegate<T> reset) {
+ this.create = create;
+ this.reset = reset;
+ }
+
+ /// <summary>
+ /// Borrows an object from the pool.
+ /// </summary>
+ public T Borrow() {
+ lock (values) {
+ return values.Count > 0 ? values.Pop() : create();
}
}
-
- public static T GetPoolObject()
- {
- T obj;
- if (available.Count > 0)
- {
- obj = available[0];
- available.RemoveAt(0);
- }
- else
- {
- obj = new T();
- }
-
- inUse.Add(obj);
- return obj;
- }
-
- public static void Release(T obj)
- {
- if (inUse.Contains(obj))
- {
- inUse.Remove(obj);
- available.Add(obj);
+
+ /// <summary>
+ /// Release an object, reset it and returns it to the pool.
+ /// </summary>
+ public void Release(T value) {
+ reset(value);
+ lock (values) {
+ values.Push(value);
}
}
-
- public static void Release(List<T> objList)
+
+ /// <summary>
+ /// Current size of the pool.
+ /// </summary>
+ public int Count()
{
- for (int i = 0; i < objList.Count; ++i)
- {
- Release(objList[i]);
- }
- }
-
- public static void ReleaseAll()
- {
- for (int i = 0; i < inUse.Count; ++i)
- {
- available.Add(inUse[i]);
- }
- inUse.Clear();
+ return values.Count;
}
}
}
--- a/KerbalEngineer/Helpers/TimeFormatter.cs
+++ b/KerbalEngineer/Helpers/TimeFormatter.cs
@@ -1,7 +1,5 @@
//
-// Kerbal Engineer Redux
-//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -17,147 +15,46 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using System;
-
-using KerbalEngineer.Settings;
-
-#endregion
-
namespace KerbalEngineer.Helpers
{
public static class TimeFormatter
{
- #region Constructors
-
- static TimeFormatter()
- {
- SetReference(false);
- Load();
- }
-
- #endregion
-
- #region Properties
-
- public static string Reference { get; set; }
-
- public static double SecondsPerDay { get; set; }
-
- public static double SecondsPerHour { get; set; }
-
- public static double SecondsPerMinute { get; set; }
-
- public static double SecondsPerYear { get; set; }
-
- #endregion
-
- #region Methods: public
-
public static string ConvertToString(double seconds, string format = "F1")
{
- var years = 0;
- while (seconds >= SecondsPerYear)
+ int years = 0;
+ int days = 0;
+ int hours = 0;
+ int minutes = 0;
+
+ if (seconds > 0.0)
{
- years++;
- seconds -= SecondsPerYear;
- }
+ years = (int)(seconds / KSPUtil.dateTimeFormatter.Year);
+ seconds -= years * KSPUtil.dateTimeFormatter.Year;
- var days = 0;
- while (seconds >= SecondsPerDay)
- {
- days++;
- seconds -= SecondsPerDay;
- }
+ days = (int)(seconds / KSPUtil.dateTimeFormatter.Day);
+ seconds -= days * KSPUtil.dateTimeFormatter.Day;
- var hours = 0;
- while (seconds >= SecondsPerHour)
- {
- hours++;
- seconds -= SecondsPerHour;
- }
+ hours = (int)(seconds / 3600.0);
+ seconds -= hours * 3600.0;
- var minutes = 0;
- while (seconds >= SecondsPerMinute)
- {
- minutes++;
- seconds -= SecondsPerMinute;
+ minutes = (int)(seconds / 60.0);
+ seconds -= minutes * 60.0;
}
if (years > 0)
{
- return String.Format("{0}y {1}d {2}h {3}m {4}s", years, days, hours, minutes, seconds.ToString(format));
+ return string.Format("{0}y {1}d {2}h {3}m {4}s", years, days, hours, minutes, seconds.ToString(format));
}
if (days > 0)
{
- return String.Format("{0}d {1}h {2}m {3}s", days, hours, minutes, seconds.ToString(format));
+ return string.Format("{0}d {1}h {2}m {3}s", days, hours, minutes, seconds.ToString(format));
}
if (hours > 0)
{
- return String.Format("{0}h {1}m {2}s", hours, minutes, seconds.ToString(format));
+ return string.Format("{0}h {1}m {2}s", hours, minutes, seconds.ToString(format));
}
- return minutes > 0 ? String.Format("{0}m {1}s", minutes, seconds.ToString(format)) : String.Format("{0}s", seconds.ToString(format));
+ return minutes > 0 ? string.Format("{0}m {1}s", minutes, seconds.ToString(format)) : string.Format("{0}s", seconds.ToString(format));
}
-
- public static void Load()
- {
- var handler = SettingHandler.Load("TimeFormatter.xml");
- SecondsPerMinute = handler.Get("SecondsPerMinute", SecondsPerMinute);
- SecondsPerHour = handler.Get("SecondsPerHour", SecondsPerHour);
- SecondsPerDay = handler.Get("SecondsPerDay", SecondsPerDay);
- SecondsPerYear = handler.Get("SecondsPerYear", SecondsPerYear);
- Reference = handler.Get("Reference", Reference);
- }
-
- public static void Save()
- {
- var handler = SettingHandler.Load("TimeFormatter.xml");
- handler.Set("SecondsPerMinute", SecondsPerMinute);
- handler.Set("SecondsPerHour", SecondsPerHour);
- handler.Set("SecondsPerDay", SecondsPerDay);
- handler.Set("SecondsPerYear", SecondsPerYear);
- handler.Set("Reference", Reference);
- handler.Save("TimeFormatter.xml");
- }
-
- public static void SetReference(bool save = true)
- {
- const double minute = 60.0;
- const double hour = minute * 60.0;
- const double day = hour * 24.0;
- const double year = day * 365.0;
- SetReference(minute, hour, day, year, "Earth", save);
- }
-
- public static void SetReference(CelestialBody body, bool save = true)
- {
- SetReference(SecondsPerMinute, SecondsPerHour, body.rotationPeriod, body.orbit.period, body.bodyName, save);
- }
-
- public static void SetReference(double minute, double hour, double day, double year, string reference, bool save = true)
- {
- SecondsPerMinute = minute;
- SecondsPerHour = hour;
- SecondsPerDay = day;
- SecondsPerYear = year;
- Reference = reference;
-
- if (save)
- {
- Save();
- }
- }
-
- public new static string ToString()
- {
- return String.Format("SecondsPerMinute: {0}", SecondsPerMinute) + Environment.NewLine +
- String.Format("SecondsPerHour: {0}", SecondsPerHour) + Environment.NewLine +
- String.Format("SecondsPerDay: {0}", SecondsPerDay) + Environment.NewLine +
- String.Format("SecondsPerYear: {0}", SecondsPerYear) + Environment.NewLine;
- }
-
- #endregion
}
}
--- a/KerbalEngineer/Helpers/Units.cs
+++ b/KerbalEngineer/Helpers/Units.cs
@@ -1,7 +1,7 @@
//
// Kerbal Engineer Redux
//
-// Copyright (C) 2014 CYBUTEK
+// Copyright (C) 2015 CYBUTEK
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -19,15 +19,13 @@
namespace KerbalEngineer.Helpers
{
- #region Using Directives
using System;
-
- #endregion
public static class Units
{
- #region Methods
public const double GRAVITY = 9.80665;
+ public const double RAD_TO_DEG = 180.0 / Math.PI;
+ public const double DEG_TO_RAD = Math.PI / 180.0;
public static string Concat(int value1, int value2)
{
@@ -85,6 +83,17 @@
public static string ToAngle(double value, int decimals = 5)
{
return value.ToString("F" + decimals) + "°";
+ }
+
+ public static string ToAngleDMS(double value)
+ {
+ double absAngle = Math.Abs(value);
+ int deg = (int)Math.Floor(absAngle);
+ double rem = absAngle - deg;
+ int min = (int)Math.Floor(rem * 60);
+ rem -= ((double)min / 60);
+ int sec = (int)Math.Floor(rem * 3600);
+ return string.Format("{0:0}° {1:00}' {2:00}\"", deg, min, sec);
}
public static string ToDistance(double value, int decimals = 1)
@@ -116,16 +125,26 @@
return value.ToString("N" + decimals) + "Mm";
}
+ public static string ToFlux(double value)
+ {
+ return value.ToString("#,0.00") + "kW";
+ }
+
public static string ToForce(double value)
{
- return value.ToString((value < 100000.0) ? (value < 10000.0) ? (value < 100.0) ? (Math.Abs(value) < Double.Epsilon) ? "N0" : "N3" : "N2" : "N1" : "N0") + "kN";
+ return value.ToString((value < 100000.0) ? (value < 10000.0) ? (value < 100.0) ? (Math.Abs(value) < double.Epsilon) ? "N0" : "N3" : "N2" : "N1" : "N0") + "kN";
}
public static string ToForce(double value1, double value2)
{
- string format1 = (value1 < 100000.0) ? (value1 < 10000.0) ? (value1 < 100.0) ? (Math.Abs(value1) < Double.Epsilon) ? "N0" : "N3" : "N2" : "N1" : "N0";
- string format2 = (value2 < 100000.0) ? (value2 < 10000.0) ? (value2 < 100.0) ? (Math.Abs(value2) < Double.Epsilon) ? "N0" : "N3" : "N2" : "N1" : "N0";
+ string format1 = (value1 < 100000.0) ? (value1 < 10000.0) ? (value1 < 100.0) ? (Math.Abs(value1) < double.Epsilon) ? "N0" : "N3" : "N2" : "N1" : "N0";
+ string format2 = (value2 < 100000.0) ? (value2 < 10000.0) ? (value2 < 100.0) ? (Math.Abs(value2) < double.Epsilon) ? "N0" : "N3" : "N2" : "N1" : "N0";
return value1.ToString(format1) + " / " + value2.ToString(format2) + "kN";
+ }
+
+ public static string ToMach(double value)
+ {
+ return value.ToString("0.00") + "Ma";
}
public static string ToMass(double value, int decimals = 0)
@@ -171,6 +190,16 @@
return value.ToString("N" + decimals) + "m/s";
}
+ public static string ToTemperature(double value)
+ {
+ return value.ToString("#,0") + "K";
+ }
+
+ public static string ToTemperature(double value1, double value2)
+ {
+ return value1.ToString("#,0") + " / " + value2.ToString("#,0") + "K";
+ }
+
public static string ToTime(double value)
{
return TimeFormatter.ConvertToString(value);
@@ -178,8 +207,7 @@
public static string ToTorque(double value)
{
- return value.ToString((value < 100.0) ? (Math.Abs(value) < Double.Epsilon) ? "N0" : "N1" : "N0") + "kNm";
- }
- #endregion
+ return value.ToString((value < 100.0) ? (Math.Abs(value) < double.Epsilon) ? "N0" : "N2" : "N0") + "kNm";
+ }
}
}
--- /dev/null
+++ b/KerbalEngineer/Helpers/XmlHelper.cs
@@ -1,1 +1,67 @@
+namespace KerbalEngineer.Helpers
+{
+ using System;
+ using System.IO;
+ using System.Text;
+ using System.Xml.Serialization;
+ public static class XmlHelper
+ {
+ /// <summary>
+ /// Loads an object from disk.
+ /// </summary>
+ public static T LoadObject<T>(string path)
+ {
+ T obj = default(T);
+
+ if (File.Exists(path))
+ {
+ try
+ {
+ using (StreamReader stream = new StreamReader(path, Encoding.UTF8))
+ {
+ obj = (T)new XmlSerializer(typeof(T)).Deserialize(stream);
+ }
+ }
+ catch (Exception ex)
+ {
+ Logger.Exception(ex);
+ }
+ }
+
+ return obj;
+ }
+
+ /// <summary>
+ /// Loads and object from disk.
+ /// </summary>
+ public static bool LoadObject<T>(string path, out T obj)
+ {
+ obj = LoadObject<T>(path);
+ return (obj != null);
+ }
+
+ /// <summary>
+ /// Saves an object to disk.
+ /// </summary>
+ public static void SaveObject<T>(string path, T obj)
+ {
+ if (obj == null || string.IsNullOrEmpty(path))
+ {
+ return;
+ }
+
+ try
+ {
+ using (StreamWriter stream = new StreamWriter(path, false, Encoding.UTF8))
+ {
+ new XmlSerializer(typeof(T)).Serialize(stream, obj);
+ }
+ }
+ catch (Exception ex)
+ {
+ Logger.Exception(ex);
+ }
+ }
+ }
+}
--- a/KerbalEngineer/KerbalEngineer.csproj
+++ b/KerbalEngineer/KerbalEngineer.csproj
@@ -34,25 +34,28 @@
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
+ <Compile Include="AppLauncherButton.cs" />
+ <Compile Include="AssetBundleLoader.cs" />
<Compile Include="Control\IControlPanel.cs" />
<Compile Include="Control\Panels\BuildOverlayPanel.cs" />
<Compile Include="Control\Panels\BuildEngineerPanel.cs" />
<Compile Include="Editor\BuildAdvanced.cs" />
+ <Compile Include="Editor\BuildAppLauncher.cs" />
<Compile Include="Editor\BuildOverlay.cs" />
<Compile Include="CelestialBodies.cs" />
<Compile Include="Editor\BuildOverlayPartInfo.cs" />
<Compile Include="Editor\BuildOverlayResources.cs" />
<Compile Include="Editor\BuildOverlayVessel.cs" />
- <Compile Include="Editor\BuildToolbar.cs" />
<Compile Include="Editor\PartInfoItem.cs" />
<Compile Include="Editor\ResourceInfoItem.cs" />
<Compile Include="Extensions\FloatExtensions.cs" />
<Compile Include="Extensions\OrbitExtensions.cs" />
+ <Compile Include="Extensions\StringExtensions.cs" />
<Compile Include="Flight\ActionMenuGui.cs" />
+ <Compile Include="Flight\FlightAppLauncher.cs" />
<Compile Include="Flight\Presets\Preset.cs" />
<Compile Include="Flight\Readouts\Miscellaneous\SystemTime.cs" />
<Compile Include="Flight\Readouts\Miscellaneous\VectoredThrustToggle.cs" />
- <Compile Include="Flight\Readouts\Miscellaneous\TimeReference.cs" />
<Compile Include="Flight\Readouts\Miscellaneous\Separator.cs" />
<Compile Include="Flight\Readouts\Miscellaneous\GuiSizeAdjustor.cs" />
<Compile Include="Flight\Readouts\Orbital\AngleToEquatorialDescendingNode.cs" />
@@ -70,11 +73,21 @@
<Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeAngleToPrograde.cs" />
<Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeTotalDeltaV.cs" />
<Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\NodeProgradeDeltaV.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\PostBurnApoapsis.cs" />
+ <Compile Include="Flight\Readouts\Orbital\ManoeuvreNode\PostBurnPeriapsis.cs" />
<Compile Include="Flight\Readouts\Orbital\MeanAnomalyAtEpoc.cs" />
<Compile Include="Flight\Readouts\Orbital\MeanAnomaly.cs" />
<Compile Include="Flight\Readouts\Orbital\EccentricAnomaly.cs" />
<Compile Include="Flight\Readouts\Orbital\ArgumentOfPeriapsis.cs" />
<Compile Include="Flight\Readouts\Orbital\CurrentSoi.cs" />
+ <Compile Include="Flight\Readouts\Orbital\SemiMajorAxis.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Flight\Readouts\Orbital\SpeedAtApoapsis.cs" />
+ <Compile Include="Flight\Readouts\Orbital\SpeedAtPeriapsis.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Flight\Readouts\Orbital\TimeToAtmosphere.cs" />
<Compile Include="Flight\Readouts\Orbital\TrueAnomaly.cs" />
<Compile Include="Flight\Readouts\Orbital\TimeToEquatorialAscendingNode.cs" />
<Compile Include="Flight\Readouts\Orbital\TimeToEquatorialDescendingNode.cs" />
@@ -89,6 +102,22 @@
<Compile Include="Flight\Readouts\Surface\Biome.cs" />
<Compile Include="Flight\Readouts\Surface\HorizontalAcceleration.cs" />
<Compile Include="Flight\Readouts\Surface\VerticalAcceleration.cs" />
+ <Compile Include="Flight\Readouts\Surface\MachNumber.cs" />
+ <Compile Include="Flight\Readouts\Thermal\CoolestSkinTemperature.cs" />
+ <Compile Include="Flight\Readouts\Thermal\CriticalPart.cs" />
+ <Compile Include="Flight\Readouts\Thermal\CoolestPart.cs" />
+ <Compile Include="Flight\Readouts\Thermal\CoolestTemperature.cs" />
+ <Compile Include="Flight\Readouts\Thermal\CriticalThermalPercentage.cs" />
+ <Compile Include="Flight\Readouts\Thermal\CriticalSkinTemperature.cs" />
+ <Compile Include="Flight\Readouts\Thermal\CriticalTemperature.cs" />
+ <Compile Include="Flight\Readouts\Thermal\HottestSkinTemperature.cs" />
+ <Compile Include="Flight\Readouts\Thermal\InternalFlux.cs" />
+ <Compile Include="Flight\Readouts\Thermal\RadiationFlux.cs" />
+ <Compile Include="Flight\Readouts\Thermal\ConvectionFlux.cs" />
+ <Compile Include="Flight\Readouts\Thermal\HottestTemperature.cs" />
+ <Compile Include="Flight\Readouts\Thermal\HottestPart.cs" />
+ <Compile Include="Flight\Readouts\Thermal\ThermalProcessor.cs" />
+ <Compile Include="Flight\Readouts\Vessel\Name.cs" />
<Compile Include="Flight\Readouts\Vessel\AttitudeProcessor.cs" />
<Compile Include="Flight\Readouts\Vessel\DeltaVCurrentTotal.cs" />
<Compile Include="Flight\Readouts\Vessel\PitchRate.cs" />
@@ -122,8 +151,10 @@
<Compile Include="Helpers\TextureHelper.cs" />
<Compile Include="Helpers\Units.cs" />
<Compile Include="Helpers\TimeFormatter.cs" />
- <Compile Include="KeyBinder.cs" />
+ <Compile Include="Helpers\XmlHelper.cs" />
+ <Compile Include="KeyBinding\KeyBinder.cs" />
<Compile Include="Control\ControlCentre.cs" />
+ <Compile Include="KeyBinding\KeyBindingsObject.cs" />
<Compile Include="UIControls\DropDown.cs" />
<Compile Include="Logger.cs" />
<Compile Include="EngineerGlobals.cs" />
@@ -145,7 +176,6 @@
<Compile Include="Flight\Readouts\Orbital\OrbitalPeriod.cs" />
<Compile Include="Flight\Readouts\Orbital\OrbitalSpeed.cs" />
<Compile Include="Flight\Readouts\Orbital\PeriapsisHeight.cs" />
- <Compile Include="Flight\Readouts\Orbital\SemiMajorAxis.cs" />
<Compile Include="Flight\Readouts\Orbital\SemiMinorAxis.cs" />
<Compile Include="Flight\Readouts\Orbital\TimeToApoapsis.cs" />
<Compile Include="Flight\Readouts\Orbital\TimeToPeriapsis.cs" />
@@ -196,6 +226,7 @@
<Compile Include="Settings\SettingHandler.cs" />
<Compile Include="Settings\SettingItem.cs" />
<Compile Include="TapeDriveAnimator.cs" />
+ <Compile Include="KeyBinding\KeyBindPopup.cs" />
<Compile Include="UIControls\WindowObject.cs" />
<Compile Include="VesselSimulator\AttachNodeSim.cs" />
<Compile Include="VesselSimulator\EngineSim.cs" />
@@ -205,10 +236,28 @@
<Compile Include="VesselSimulator\SimManager.cs" />
<Compile Include="VesselSimulator\Simulation.cs" />
<Compile Include="VesselSimulator\Stage.cs" />
+ <Compile Include="Flight\Readouts\Rendezvous\RelativeRadialVelocity.cs" />
+ <Compile Include="Flight\Readouts\Rendezvous\TimeToRendezvous.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
- <HintPath>..\Game\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
+ <HintPath>..\..\Game\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Assembly-CSharp-firstpass">
+ <HintPath>..\..\game\KSP_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="KSPAssets">
+ <HintPath>..\..\game\KSP_Data\Managed\KSPAssets.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="KSPCore">
+ <HintPath>..\..\game\KSP_Data\Managed\KSPCore.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="KSPUtil">
+ <HintPath>..\..\game\KSP_Data\Managed\KSPUtil.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System">
@@ -220,9 +269,20 @@
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine">
- <HintPath>..\Game\KSP_Data\Managed\UnityEngine.dll</HintPath>
- <Private>False</Private>
- </Reference>
+ <HintPath>..\..\Game\KSP_Data\Managed\UnityEngine.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="UnityEngine.UI">
+ <HintPath>..\..\game\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\KerbalEngineer.Unity\KerbalEngineer.Unity.csproj">
+ <Project>{5387bb1e-32b1-4bac-b03f-100570b9554c}</Project>
+ <Name>KerbalEngineer.Unity</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="PostBuildMacros">
@@ -238,7 +298,7 @@
$(PostBuildEventDependsOn);
PostBuildMacros;
</PostBuildEventDependsOn>
- <PostBuildEvent>xcopy "$(SolutionDir)Output\*" "$(SolutionDir)Game\GameData\*" /E /Y
+ <PostBuildEvent>xcopy "$(SolutionDir)Output\*" "$(SolutionDir)..\Game\GameData\*" /E /Y
del "$(SolutionDir)Release\*" /Q
xcopy "$(SolutionDir)Documents\*" "$(SolutionDir)Release\Documents\*" /E /Y
7z.exe a -tzip -mx3 "$(SolutionDir)Release\$(ProjectName)-@(VersionNumber).zip" "$(SolutionDir)Output\*"
--- a/KerbalEngineer/KeyBinder.cs
+++ /dev/null
@@ -1,35 +1,1 @@
-//
-// Kerbal Engineer Redux
-//
-// Copyright (C) 2014 CYBUTEK
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-using UnityEngine;
-
-namespace KerbalEngineer
-{
- public class KeyBinder
- {
- public static KeyCode EditorShowHide { get; set; }
-
- public static KeyCode FlightShowHide { get; set; }
-
- static KeyBinder()
- {
- EditorShowHide = FlightShowHide = KeyCode.Backslash;
- }
- }
-}
--- /dev/null
+++ b/KerbalEngineer/KeyBinding/KeyBindPopup.cs
@@ -1,1 +1,247 @@
-
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+namespace KerbalEngineer.KeyBinding
+{
+ using System;
+ using Extensions;
+ using UnityEngine;
+
+ public class KeyBindPopup : MonoBehaviour
+ {
+ private const string LOCK_ID = "KER_KeyBindPopup";
+ private static Rect position = new Rect(Screen.width, Screen.height, 250.0f, 0.0f);
+ private static bool hasCentred;
+ private static KeyBindPopup instance;
+ private readonly Array availableBindings = Enum.GetValues(typeof(KeyCode));
+
+ /// <summary>
+ /// Gets the delegate to be invoked when accepted button is clicked.
+ /// </summary>
+ public Action<KeyCode> AcceptClicked { get; private set; }
+
+ /// <summary>
+ /// Gets the name of the binding to change.
+ /// </summary>
+ public string Name { get; private set; }
+
+ /// <summary>
+ /// Gets the selected binding.
+ /// </summary>
+ public KeyCode Binding { get; private set; }
+
+ /// <summary>
+ /// Gets whether a key bind popup is already open.
+ /// </summary>
+ public static bool IsOpen
+ {
+ get
+ {
+ return (instance != null);
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets the input lock state.
+ /// </summary>
+ public bool InputLock
+ {
+ get
+ {
+ return InputLockManager.GetControlLock(LOCK_ID) != ControlTypes.None;
+ }
+ set
+ {
+ if (value)
+ {
+ InputLockManager.SetControlLock(ControlTypes.All, LOCK_ID);
+ }
+ else
+ {
+ InputLockManager.SetControlLock(ControlTypes.None, LOCK_ID);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Shows a key bind popup allowing the user to select a key for binding.
+ /// </summary>
+ public static void Show(string name, KeyCode currentBinding, Action<KeyCode> acceptClicked)
+ {
+ if (instance == null)
+ {
+ instance = new GameObject("SelectKeyBind").AddComponent<KeyBindPopup>();
+ }
+
+ instance.Name = name;
+ instance.Binding = currentBinding;
+ instance.AcceptClicked = acceptClicked;
+ }
+
+ /// <summary>
+ /// Handles the accept button click event.
+ /// </summary>
+ public void OnAccept()
+ {
+ if (AcceptClicked != null)
+ {
+ AcceptClicked.Invoke(Binding);
+ }
+ Destroy(gameObject);
+ }
+
+ /// <summary>
+ /// Handles the cancel button click event.
+ /// </summary>
+ public void OnCancel()
+ {
+ Destroy(gameObject);
+ }
+
+ /// <summary>
+ /// Called by unity when the component is created.
+ /// </summary>
+ protected virtual void Awake()
+ {
+ if (instance == null)
+ {
+ instance = this;
+ }
+ else if (instance != this)
+ {
+ OnCancel();
+ }
+ }
+
+ /// <summary>
+ /// Called by unity when the component is destroyed.
+ /// </summary>
+ protected virtual void OnDestroy()
+ {
+ InputLock = false;
+ }
+
+ /// <summary>
+ /// Called by unity each frame to render the GUI.
+ /// </summary>
+ protected virtual void OnGUI()
+ {
+ position = GUILayout.Window(GetInstanceID(), position, RenderWindow, "Select Key Bind", HighLogic.Skin.window).ClampToScreen();
+ CentreWindow();
+ }
+
+ /// <summary>
+ /// Called by unity every frame.
+ /// </summary>
+ protected virtual void Update()
+ {
+ CentreWindow();
+ UpdateBinding();
+ UpdateInputLock();
+ }
+
+ /// <summary>
+ /// Centres the window on the screen.
+ /// </summary>
+ private static void CentreWindow()
+ {
+ if (hasCentred == false && position.width > 0.0f && position.height > 0.0f)
+ {
+ hasCentred = true;
+ position.center = new Vector2(Screen.width * 0.5f, Screen.height * 0.5f);
+ }
+ }
+
+ /// <summary>
+ /// Renders the window content.
+ /// </summary>
+ private void RenderWindow(int id)
+ {
+ GUILayout.Label("Press the desired key to change it.");
+
+ // Binding labels.
+ GUILayout.BeginVertical(HighLogic.Skin.textArea);
+ GUILayout.Label("Key Bind: " + Name);
+ GUILayout.Label("Selected: " + Binding);
+ if (GUILayout.Button("Clear", HighLogic.Skin.button))
+ {
+ Binding = KeyCode.None;
+ }
+ GUILayout.EndVertical();
+
+ // Window buttons.
+ GUILayout.BeginHorizontal();
+ if (GUILayout.Button("Cancel", HighLogic.Skin.button))
+ {
+ OnCancel();
+ }
+
+ if (GUILayout.Button("Accept", HighLogic.Skin.button))
+ {
+ OnAccept();
+ }
+ GUILayout.EndHorizontal();
+
+ // Make the window to be draggable.
+ GUI.DragWindow();
+ }
+
+ /// <summary>
+ /// Updates the binding selected by the user.
+ /// </summary>
+ private void UpdateBinding()
+ {
+ for (int i = 0; i < availableBindings.Length; ++i)
+ {
+ KeyCode keyCode = (KeyCode)availableBindings.GetValue(i);
+
+ if (keyCode == KeyCode.Mouse0)
+ {
+ continue;
+ }
+
+ if (Input.GetKeyDown(keyCode))
+ {
+ if (Input.GetKeyDown(keyCode))
+ {
+ Binding = keyCode;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Updates the input lock.
+ /// </summary>
+ private void UpdateInputLock()
+ {
+ bool mouseOver = position.MouseIsOver();
+ bool inputLock = InputLock;
+
+ if (mouseOver && inputLock == false)
+ {
+ InputLock = true;
+ }
+ else if (mouseOver == false && inputLock)
+ {
+ InputLock = false;
+ }
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/KeyBinding/KeyBinder.cs
@@ -1,1 +1,255 @@
-
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+namespace KerbalEngineer.KeyBinding
+{
+ using System;
+ using System.IO;
+ using Extensions;
+ using Helpers;
+ using UnityEngine;
+
+ public class KeyBinder : MonoBehaviour
+ {
+ private const string LOCK_ID = "KER_KeyBinder";
+ private static readonly string filePath = Path.Combine(EngineerGlobals.SettingsPath, "KeyBinds.xml");
+ private static KeyBindingsObject bindings;
+ private static Rect position = new Rect(Screen.width, Screen.height, 500.0f, 0.0f);
+ private static bool hasCentred;
+
+ static KeyBinder()
+ {
+ Load();
+ }
+
+ /// <summary>
+ /// Gets whether the key binder window is open.
+ /// </summary>
+ public static bool IsOpen { get; private set; }
+
+ /// <summary>
+ /// Gets and sets the key bindings object.
+ /// </summary>
+ public static KeyBindingsObject Bindings
+ {
+ get
+ {
+ if (bindings == null)
+ {
+ bindings = new KeyBindingsObject();
+ }
+ return bindings;
+ }
+ private set
+ {
+ if (value != null)
+ {
+ bindings = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets the editor show/hide binding.
+ /// </summary>
+ public static KeyCode EditorShowHide
+ {
+ get
+ {
+ return Bindings.EditorShowHide;
+ }
+ set
+ {
+ Bindings.EditorShowHide = value;
+ Save();
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets the flight show/hide binding.
+ /// </summary>
+ public static KeyCode FlightShowHide
+ {
+ get
+ {
+ return Bindings.FlightShowHide;
+ }
+ set
+ {
+ Bindings.FlightShowHide = value;
+ Save();
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets the input lock state.
+ /// </summary>
+ public bool InputLock
+ {
+ get
+ {
+ return InputLockManager.GetControlLock(LOCK_ID) != ControlTypes.None;
+ }
+ set
+ {
+ if (value)
+ {
+ InputLockManager.SetControlLock(ControlTypes.All, LOCK_ID);
+ }
+ else
+ {
+ InputLockManager.SetControlLock(ControlTypes.None, LOCK_ID);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Loads the key bindings from disk.
+ /// </summary>
+ public static void Load()
+ {
+ Bindings = XmlHelper.LoadObject<KeyBindingsObject>(filePath);
+ }
+
+ /// <summary>
+ /// Saves the key bindings to disk.
+ /// </summary>
+ public static void Save()
+ {
+ XmlHelper.SaveObject(filePath, Bindings);
+ }
+
+ /// <summary>
+ /// Shows the key binding window.
+ /// </summary>
+ public static void Show()
+ {
+ if (IsOpen)
+ {
+ return;
+ }
+
+ new GameObject("KeyBinder").AddComponent<KeyBinder>();
+ }
+
+ /// <summary>
+ /// Called by unity when component is created.
+ /// </summary>
+ protected virtual void Awake()
+ {
+ if (IsOpen)
+ {
+ Destroy(gameObject);
+ }
+ else
+ {
+ IsOpen = true;
+ position.height = 0.0f;
+ }
+ }
+
+ /// <summary>
+ /// Called by unity when component is destroyed.
+ /// </summary>
+ protected virtual void OnDestroy()
+ {
+ IsOpen = false;
+ InputLock = false;
+ }
+
+ /// <summary>
+ /// Called by unity to draw the GUI.
+ /// </summary>
+ protected virtual void OnGUI()
+ {
+ position = GUILayout.Window(GetInstanceID(), position, RenderWindow, "Kerbal Engineer Redux - Key Bindings", HighLogic.Skin.window).ClampToScreen();
+ CentreWindow();
+ }
+
+ /// <summary>
+ /// Called by unity every frame.
+ /// </summary>
+ protected virtual void Update()
+ {
+ UpdateInputLock();
+ }
+
+ /// <summary>
+ /// Renders a key bind option.
+ /// </summary>
+ private static void RenderKeyBind(string name, KeyCode currentBinding, Action<KeyCode> acceptClicked)
+ {
+ GUILayout.BeginHorizontal();
+ GUILayout.Label(name);
+ if (GUILayout.Button(currentBinding.ToString(), HighLogic.Skin.button, GUILayout.Width(100.0f)))
+ {
+ KeyBindPopup.Show(name, currentBinding, acceptClicked);
+ }
+ GUILayout.EndHorizontal();
+ }
+
+ /// <summary>
+ /// Centres the window on screen.
+ /// </summary>
+ private void CentreWindow()
+ {
+ if (hasCentred == false && position.width > 0.0f && position.height > 0.0f)
+ {
+ hasCentred = true;
+ position.center = new Vector2(Screen.width * 0.5f, Screen.height * 0.5f);
+ }
+ }
+
+ /// <summary>
+ /// Renders the GUI window contents.
+ /// </summary>
+ private void RenderWindow(int id)
+ {
+ GUILayout.BeginVertical(HighLogic.Skin.textArea);
+ RenderKeyBind("Editor Show/Hide", EditorShowHide, binding => EditorShowHide = binding);
+ RenderKeyBind("Flight Show/Hide", FlightShowHide, binding => FlightShowHide = binding);
+ GUILayout.EndVertical();
+
+ if (GUILayout.Button("Close", HighLogic.Skin.button))
+ {
+ Destroy(gameObject);
+ }
+
+ GUI.DragWindow();
+ }
+
+ /// <summary>
+ /// Updates the input lock.
+ /// </summary>
+ private void UpdateInputLock()
+ {
+ bool mouseOver = position.MouseIsOver();
+ bool inputLock = InputLock;
+
+ if (mouseOver && inputLock == false)
+ {
+ InputLock = true;
+ }
+ else if (mouseOver == false && inputLock)
+ {
+ InputLock = false;
+ }
+ }
+ }
+}
--- /dev/null
+++ b/KerbalEngineer/KeyBinding/KeyBindingsObject.cs
@@ -1,1 +1,31 @@
+//
+// Kerbal Engineer Redux
+//
+// Copyright (C) 2015 CYBUTEK
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+namespace KerbalEngineer.KeyBinding
+{
+ using System.Xml.Serialization;
+ using UnityEngine;
+
+ public class KeyBindingsObject
+ {
+ public KeyCode EditorShowHide { get; set; }
+
+ public KeyCode FlightShowHide { get; set; }
+ }
+}
--- a/KerbalEngineer/LogMsg.cs
+++ b/KerbalEngineer/LogMsg.cs
@@ -15,7 +15,8 @@
public void Flush()
{
- MonoBehaviour.print(this.buf);
+ if (this.buf.Length > 0)
+ MonoBehaviour.print(this.buf);
this.buf.Length = 0;
}
}
--- a/KerbalEngineer/Properties/AssemblyInfo.cs
+++ b/KerbalEngineer/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion(KerbalEngineer.EngineerGlobals.AssemblyVersion)]
+[assembly: AssemblyVersion(KerbalEngineer.EngineerGlobals.ASSEMBLY_VERSION)]
--- a/KerbalEngineer/TapeDriveAnimator.cs
+++ b/KerbalEngineer/TapeDriveAnimator.cs
@@ -83,6 +83,8 @@
private bool sceneIsEditor;
private float speed;
private float targetSpeed;
+ private Renderer renderer;
+ private Light light;
#endregion
@@ -120,6 +122,8 @@
public override void OnStart(StartState state)
{
+ renderer = GetComponent<Renderer>();
+
this.random = new Random();
this.StopBakedAnimation();
@@ -167,37 +171,37 @@
if (this.Lights1 != "")
{
this.lights1Transform = this.part.FindModelTransform(this.Lights1);
- this.lights1ShaderOff = this.lights1Transform.renderer.material.shader;
+ this.lights1ShaderOff = renderer.material.shader;
}
if (this.Lights2 != "")
{
this.lights2Transform = this.part.FindModelTransform(this.Lights2);
- this.lights2ShaderOff = this.lights2Transform.renderer.material.shader;
+ this.lights2ShaderOff = renderer.material.shader;
}
if (this.Lights3 != "")
{
this.lights3Transform = this.part.FindModelTransform(this.Lights3);
- this.lights3ShaderOff = this.lights3Transform.renderer.material.shader;
+ this.lights3ShaderOff = renderer.material.shader;
}
if (this.Lights4 != "")
{
this.lights4Transform = this.part.FindModelTransform(this.Lights4);
- this.lights4ShaderOff = this.lights4Transform.renderer.material.shader;
+ this.lights4ShaderOff = renderer.material.shader;
}
if (this.Lights5 != "")
{
this.lights5Transform = this.part.FindModelTransform(this.Lights5);
- this.lights5ShaderOff = this.lights5Transform.renderer.material.shader;
+ this.lights5ShaderOff = renderer.material.shader;
}
if (this.Lights6 != "")
{
this.lights6Transform = this.part.FindModelTransform(this.Lights6);
- this.lights6ShaderOff = this.lights6Transform.renderer.material.shader;
+ this.lights6ShaderOff = renderer.material.shader;
}
this.lightsShaderOn = Shader.Find("Unlit/Texture");
@@ -381,7 +385,7 @@
lightsOn = (this.speed == 0);
}
- lights.renderer.material.shader = lightsOn ? @on : off;
+ lights.GetComponent<Renderer>().material.shader = lightsOn ? @on : off;
}
#endregion
--- a/KerbalEngineer/VesselSimulator/AttachNodeSim.cs
+++ b/KerbalEngineer/VesselSimulator/AttachNodeSim.cs
@@ -26,11 +26,38 @@
using System;
using System.Text;
- internal class AttachNodeSim : Pool<AttachNodeSim>
+ internal class AttachNodeSim
{
+
+ private static readonly Pool<AttachNodeSim> pool = new Pool<AttachNodeSim>(Create, Reset);
+
public PartSim attachedPartSim;
public String id;
public AttachNode.NodeType nodeType;
+
+ private static AttachNodeSim Create()
+ {
+ return new AttachNodeSim();
+ }
+
+ public static AttachNodeSim New(PartSim partSim, String newId, AttachNode.NodeType newNodeType)
+ {
+ AttachNodeSim nodeSim = pool.Borrow();
+
+ nodeSim.attachedPartSim = partSim;
+ nodeSim.nodeType = newNodeType;
+ nodeSim.id = newId;
+
+ return nodeSim;
+ }
+
+ static private void Reset(AttachNodeSim attachNodeSim) { }
+
+
+ public void Release()
+ {
+ pool.Release(this);
+ }
public void DumpToBuffer(StringBuilder buffer)
{
@@ -49,14 +76,5 @@
buffer.Append(":");
buffer.Append(id);
}
-
- public AttachNodeSim Initialise(PartSim partSim, String newId, AttachNode.NodeType newNodeType)
- {
- attachedPartSim = partSim;
- nodeType = newNodeType;
- id = newId;
-
- return this;
- }
}
}
--- a/KerbalEngineer/VesselSimulator/EngineSim.cs
+++ b/KerbalEngineer/VesselSimulator/EngineSim.cs
@@ -26,104 +26,182 @@
using Helpers;
using UnityEngine;
- public class EngineSim : Pool<EngineSim>
+ public class EngineSim
{
- public double actualThrust = 0.0;
- public List<AppliedForce> appliedForces = new List<AppliedForce>();
+ private static readonly Pool<EngineSim> pool = new Pool<EngineSim>(Create, Reset);
+
+ private readonly ResourceContainer resourceConsumptions = new ResourceContainer();
+ private readonly ResourceContainer resourceFlowModes = new ResourceContainer();
+
+ public double actualThrust = 0;
public bool isActive = false;
public double isp = 0;
public PartSim partSim;
+ public List<AppliedForce> appliedForces = new List<AppliedForce>();
public float maxMach;
public double thrust = 0;
// Add thrust vector to account for directional losses
public Vector3 thrustVec;
- private readonly ResourceContainer resourceConsumptions = new ResourceContainer();
-
- public EngineSim Initialise(PartSim theEngine,
- double atmosphere,
- float machNumber,
- float maxFuelFlow,
- float minFuelFlow,
- float thrustPercentage,
- Vector3 vecThrust,
- FloatCurve atmosphereCurve,
- bool atmChangeFlow,
- FloatCurve atmCurve,
- FloatCurve velCurve,
- float currentThrottle,
- bool throttleLocked,
- List<Propellant> propellants,
- bool active,
- float resultingThrust,
- List<Transform> thrustTransforms)
- {
- StringBuilder buffer = null;
-
- isp = 0.0;
- maxMach = 0.0f;
- actualThrust = 0.0;
- partSim = theEngine;
- isActive = active;
- thrustVec = vecThrust;
- resourceConsumptions.Reset();
- appliedForces.Clear();
+
+ private static EngineSim Create()
+ {
+ return new EngineSim();
+ }
+
+ private static void Reset(EngineSim engineSim)
+ {
+ engineSim.resourceConsumptions.Reset();
+ engineSim.resourceFlowModes.Reset();
+ engineSim.actualThrust = 0;
+ engineSim.isActive = false;
+ engineSim.isp = 0;
+ for (int i = 0; i < engineSim.appliedForces.Count; i++)
+ {
+ engineSim.appliedForces[i].Release();
+ }
+ engineSim.appliedForces.Clear();
+ engineSim.thrust = 0;
+ engineSim.maxMach = 0f;
+ }
+
+ public void Release()
+ {
+ pool.Release(this);
+ }
+
+ public static EngineSim New(PartSim theEngine,
+ double atmosphere,
+ float machNumber,
+ float maxFuelFlow,
+ float minFuelFlow,
+ float thrustPercentage,
+ Vector3 vecThrust,
+ FloatCurve atmosphereCurve,
+ bool atmChangeFlow,
+ FloatCurve atmCurve,
+ FloatCurve velCurve,
+ float currentThrottle,
+ float IspG,
+ bool throttleLocked,
+ List<Propellant> propellants,
+ bool active,
+ float resultingThrust,
+ List<Transform> thrustTransforms,
+ LogMsg log)
+ {
+ EngineSim engineSim = pool.Borrow();
+
+ engineSim.isp = 0.0;
+ engineSim.maxMach = 0.0f;
+ engineSim.actualThrust = 0.0;
+ engineSim.partSim = theEngine;
+ engineSim.isActive = active;
+ engineSim.thrustVec = vecThrust;
+ engineSim.resourceConsumptions.Reset();
+ engineSim.resourceFlowModes.Reset();
+ engineSim.appliedForces.Clear();
double flowRate = 0.0;
- if (partSim.hasVessel)
- {
- float flowModifier = GetFlowModifier(atmChangeFlow, atmCurve, partSim.part.atmDensity, velCurve, machNumber, ref maxMach);
- isp = atmosphereCurve.Evaluate((float)atmosphere);
- thrust = GetThrust(Mathf.Lerp(minFuelFlow, maxFuelFlow, GetThrustPercent(thrustPercentage)) * flowModifier, isp);
- actualThrust = isActive ? resultingThrust : 0.0;
+ if (engineSim.partSim.hasVessel)
+ {
+ if (log != null) log.buf.AppendLine("hasVessel is true");
+
+ float flowModifier = GetFlowModifier(atmChangeFlow, atmCurve, engineSim.partSim.part.atmDensity, velCurve, machNumber, ref engineSim.maxMach);
+ engineSim.isp = atmosphereCurve.Evaluate((float)atmosphere);
+ engineSim.thrust = GetThrust(Mathf.Lerp(minFuelFlow, maxFuelFlow, GetThrustPercent(thrustPercentage)) * flowModifier, engineSim.isp);
+ engineSim.actualThrust = engineSim.isActive ? resultingThrust : 0.0;
+ if (log != null)
+ {
+ log.buf.AppendFormat("flowMod = {0:g6}\n", flowModifier);
+ log.buf.AppendFormat("isp = {0:g6}\n", engineSim.isp);
+ log.buf.AppendFormat("thrust = {0:g6}\n", engineSim.thrust);
+ log.buf.AppendFormat("actual = {0:g6}\n", engineSim.actualThrust);
+ }
if (throttleLocked)
{
- flowRate = GetFlowRate(thrust, isp);
+ if (log != null) log.buf.AppendLine("throttleLocked is true, using thrust for flowRate");
+ flowRate = GetFlowRate(engineSim.thrust, engineSim.isp);
}
else
{
- if (currentThrottle > 0.0f && partSim.isLanded == false)
- {
- flowRate = GetFlowRate(actualThrust, isp);
+ if (currentThrottle > 0.0f && engineSim.partSim.isLanded == false)
+ {
+ if (log != null) log.buf.AppendLine("throttled up and not landed, using actualThrust for flowRate");
+ flowRate = GetFlowRate(engineSim.actualThrust, engineSim.isp);
}
else
{
- flowRate = GetFlowRate(thrust, isp);
+ if (log != null) log.buf.AppendLine("throttled down or landed, using thrust for flowRate");
+ flowRate = GetFlowRate(engineSim.thrust, engineSim.isp);
}
}
}
else
{
- float flowModifier = GetFlowModifier(atmChangeFlow, atmCurve, CelestialBodies.SelectedBody.GetDensity(BuildAdvanced.Altitude), velCurve, machNumber, ref maxMach);
- isp = atmosphereCurve.Evaluate((float)atmosphere);
- thrust = GetThrust(Mathf.Lerp(minFuelFlow, maxFuelFlow, GetThrustPercent(thrustPercentage)) * flowModifier, isp);
- flowRate = GetFlowRate(thrust, isp);
- }
-
- float flowMass = 0.0f;
-
+ if (log != null) log.buf.AppendLine("hasVessel is false");
+ float flowModifier = GetFlowModifier(atmChangeFlow, atmCurve, CelestialBodies.SelectedBody.GetDensity(BuildAdvanced.Altitude), velCurve, machNumber, ref engineSim.maxMach);
+ engineSim.isp = atmosphereCurve.Evaluate((float)atmosphere);
+ engineSim.thrust = GetThrust(Mathf.Lerp(minFuelFlow, maxFuelFlow, GetThrustPercent(thrustPercentage)) * flowModifier, engineSim.isp);
+ engineSim.actualThrust = 0d;
+ if (log != null)
+ {
+ log.buf.AppendFormat("flowMod = {0:g6}\n", flowModifier);
+ log.buf.AppendFormat("isp = {0:g6}\n", engineSim.isp);
+ log.buf.AppendFormat("thrust = {0:g6}\n", engineSim.thrust);
+ log.buf.AppendFormat("actual = {0:g6}\n", engineSim.actualThrust);
+ }
+
+ if (log != null) log.buf.AppendLine("no vessel, using thrust for flowRate");
+ flowRate = GetFlowRate(engineSim.thrust, engineSim.isp);
+ }
+
+ if (log != null) log.buf.AppendFormat("flowRate = {0:g6}\n", flowRate);
+
+ float flowMass = 0f;
for (int i = 0; i < propellants.Count; ++i)
{
Propellant propellant = propellants[i];
- flowMass += propellant.ratio * ResourceContainer.GetResourceDensity(propellant.id);
+ if (!propellant.ignoreForIsp)
+ flowMass += propellant.ratio * ResourceContainer.GetResourceDensity(propellant.id);
+ }
+
+ if (log != null) log.buf.AppendFormat("flowMass = {0:g6}\n", flowMass);
+
+ for (int i = 0; i < propellants.Count; ++i)
+ {
+ Propellant propellant = propellants[i];
+
+ if (propellant.name == "ElectricCharge" || propellant.name == "IntakeAir")
+ {
+ continue;
+ }
double consumptionRate = propellant.ratio * flowRate / flowMass;
- resourceConsumptions.Add(propellant.id, consumptionRate);
- }
-
- double thrustPerThrustTransform = thrust / thrustTransforms.Count;
- for (int i = 0; i < thrustTransforms.Count; ++i)
+ if (log != null) log.buf.AppendFormat(
+ "Add consumption({0}, {1}:{2:d}) = {3:g6}\n",
+ ResourceContainer.GetResourceName(propellant.id),
+ theEngine.name,
+ theEngine.partId,
+ consumptionRate);
+ engineSim.resourceConsumptions.Add(propellant.id, consumptionRate);
+ engineSim.resourceFlowModes.Add(propellant.id, (double)propellant.GetFlowMode());
+ }
+
+ double thrustPerThrustTransform = engineSim.thrust / thrustTransforms.Count;
+ for (int i = 0; i < thrustTransforms.Count; i++)
{
Transform thrustTransform = thrustTransforms[i];
-
Vector3d direction = thrustTransform.forward.normalized;
Vector3d position = thrustTransform.position;
- appliedForces.Add(new AppliedForce(direction * thrustPerThrustTransform, position));
- }
-
- return this;
+
+ AppliedForce appliedForce = AppliedForce.New(direction * thrustPerThrustTransform, position);
+ engineSim.appliedForces.Add(appliedForce);
+ }
+
+ return engineSim;
}
public ResourceContainer ResourceConsumptions
@@ -188,53 +266,91 @@
buffer.AppendFormat("[thrust = {0:g6}, actual = {1:g6}, isp = {2:g6}\n", thrust, actualThrust, isp);
}
+ // A dictionary to hold a set of parts for each resource
+ Dictionary<int, HashSet<PartSim>> sourcePartSets = new Dictionary<int, HashSet<PartSim>>();
+
+ Dictionary<int, HashSet<PartSim>> stagePartSets = new Dictionary<int, HashSet<PartSim>>();
+
+ HashSet<PartSim> visited = new HashSet<PartSim>();
+
+ public void DumpSourcePartSets(String msg)
+ {
+ MonoBehaviour.print("DumpSourcePartSets " + msg);
+ foreach (int type in sourcePartSets.Keys)
+ {
+ MonoBehaviour.print("SourcePartSet for " + ResourceContainer.GetResourceName(type));
+ HashSet<PartSim> sourcePartSet = sourcePartSets[type];
+ if (sourcePartSet.Count > 0)
+ {
+ foreach (PartSim partSim in sourcePartSet)
+ {
+ MonoBehaviour.print("Part " + partSim.name + ":" + partSim.partId);
+ }
+ }
+ else
+ {
+ MonoBehaviour.print("No parts");
+ }
+ }
+ }
+
public bool SetResourceDrains(List<PartSim> allParts, List<PartSim> allFuelLines, HashSet<PartSim> drainingParts)
{
LogMsg log = null;
-
- // A dictionary to hold a set of parts for each resource
- Dictionary<int, HashSet<PartSim>> sourcePartSets = new Dictionary<int, HashSet<PartSim>>();
-
- for (int i = 0; i < resourceConsumptions.Types.Count; ++i)
- {
- int type = resourceConsumptions.Types[i];
- HashSet<PartSim> sourcePartSet = null;
- switch (ResourceContainer.GetResourceFlowMode(type))
+ //DumpSourcePartSets("before clear");
+ foreach (HashSet<PartSim> sourcePartSet in sourcePartSets.Values)
+ {
+ sourcePartSet.Clear();
+ }
+ //DumpSourcePartSets("after clear");
+
+ for (int index = 0; index < this.resourceConsumptions.Types.Count; index++)
+ {
+ int type = this.resourceConsumptions.Types[index];
+
+ HashSet<PartSim> sourcePartSet;
+ if (!sourcePartSets.TryGetValue(type, out sourcePartSet))
+ {
+ sourcePartSet = new HashSet<PartSim>();
+ sourcePartSets.Add(type, sourcePartSet);
+ }
+
+ switch ((ResourceFlowMode)this.resourceFlowModes[type])
{
case ResourceFlowMode.NO_FLOW:
if (partSim.resources[type] > SimManager.RESOURCE_MIN && partSim.resourceFlowStates[type] != 0)
{
- sourcePartSet = new HashSet<PartSim>();
+ //sourcePartSet = new HashSet<PartSim>();
//MonoBehaviour.print("SetResourceDrains(" + name + ":" + partId + ") setting sources to just this");
sourcePartSet.Add(partSim);
}
break;
case ResourceFlowMode.ALL_VESSEL:
- for (int j = 0; j < allParts.Count; ++j)
- {
- PartSim aPartSim = allParts[j];
-
+ case ResourceFlowMode.ALL_VESSEL_BALANCE:
+ for (int i = 0; i < allParts.Count; i++)
+ {
+ PartSim aPartSim = allParts[i];
if (aPartSim.resources[type] > SimManager.RESOURCE_MIN && aPartSim.resourceFlowStates[type] != 0)
{
- if (sourcePartSet == null)
- {
- sourcePartSet = new HashSet<PartSim>();
- }
-
sourcePartSet.Add(aPartSim);
}
}
break;
case ResourceFlowMode.STAGE_PRIORITY_FLOW:
- Dictionary<int, HashSet<PartSim>> stagePartSets = new Dictionary<int, HashSet<PartSim>>();
- int maxStage = -1;
-
- for (int j = 0; j < allParts.Count; ++j)
- {
- PartSim aPartSim = allParts[j];
-
+ case ResourceFlowMode.STAGE_PRIORITY_FLOW_BALANCE:
+
+ foreach (HashSet<PartSim> stagePartSet in stagePartSets.Values)
+ {
+ stagePartSet.Clear();
+ }
+ var maxStage = -1;
+
+ //Logger.Log(type);
+ for (int i = 0; i < allParts.Count; i++)
+ {
+ var aPartSim = allParts[i];
if (aPartSim.resources[type] <= SimManager.RESOURCE_MIN || aPartSim.resourceFlowStates[type] == 0)
{
continue;
@@ -246,34 +362,57 @@
maxStage = stage;
}
- if (!stagePartSets.TryGetValue(stage, out sourcePartSet))
+ HashSet<PartSim> tempPartSet;
+ if (!stagePartSets.TryGetValue(stage, out tempPartSet))
{
- sourcePartSet = new HashSet<PartSim>();
- stagePartSets.Add(stage, sourcePartSet);
+ tempPartSet = new HashSet<PartSim>();
+ stagePartSets.Add(stage, tempPartSet);
}
- sourcePartSet.Add(aPartSim);
- }
-
- for (int j = 0; j <= maxStage; j++)
+ tempPartSet.Add(aPartSim);
+ }
+
+ for (int j = maxStage; j >= 0; j--)
{
HashSet<PartSim> stagePartSet;
if (stagePartSets.TryGetValue(j, out stagePartSet) && stagePartSet.Count > 0)
{
- sourcePartSet = stagePartSet;
+ // We have to copy the contents of the set here rather than copying the set reference or
+ // bad things (tm) happen
+ foreach (PartSim aPartSim in stagePartSet)
+ {
+ sourcePartSet.Add(aPartSim);
+ }
+ break;
}
}
break;
case ResourceFlowMode.STACK_PRIORITY_SEARCH:
- HashSet<PartSim> visited = new HashSet<PartSim>();
+ visited.Clear();
if (SimManager.logOutput)
{
log = new LogMsg();
log.buf.AppendLine("Find " + ResourceContainer.GetResourceName(type) + " sources for " + partSim.name + ":" + partSim.partId);
}
- sourcePartSet = partSim.GetSourceSet(type, allParts, visited, log, "");
+ partSim.GetSourceSet(type, PhysicsGlobals.Stack_PriUsesSurf, allParts, visited, sourcePartSet, log, "");
+ if (SimManager.logOutput && log != null)
+ {
+ MonoBehaviour.print(log.buf);
+ }
+ break;
+
+ case ResourceFlowMode.STAGE_STACK_FLOW:
+ case ResourceFlowMode.STAGE_STACK_FLOW_BALANCE:
+ visited.Clear();
+
if (SimManager.logOutput)
+ {
+ log = new LogMsg();
+ log.buf.AppendLine("Find " + ResourceContainer.GetResourceName(type) + " sources for " + partSim.name + ":" + partSim.partId);
+ }
+ partSim.GetSourceSet(type, true, allParts, visited, sourcePartSet, log, "");
+ if (SimManager.logOutput && log != null)
{
MonoBehaviour.print(log.buf);
}
@@ -284,10 +423,9 @@
break;
}
- if (sourcePartSet != null && sourcePartSet.Count > 0)
- {
- sourcePartSets[type] = sourcePartSet;
- if (SimManager.logOutput)
+ if (SimManager.logOutput)
+ {
+ if (sourcePartSet.Count > 0)
{
log = new LogMsg();
log.buf.AppendLine("Source parts for " + ResourceContainer.GetResourceName(type) + ":");
@@ -298,14 +436,16 @@
MonoBehaviour.print(log.buf);
}
}
- }
-
+
+ //DumpSourcePartSets("after " + ResourceContainer.GetResourceName(type));
+ }
+
// If we don't have sources for all the needed resources then return false without setting up any drains
- for(int i = 0; i < resourceConsumptions.Types.Count; ++i)
- {
- int type = resourceConsumptions.Types[i];
-
- if (!sourcePartSets.ContainsKey(type))
+ for (int i = 0; i < this.resourceConsumptions.Types.Count; i++)
+ {
+ int type = this.resourceConsumptions.Types[i];
+ HashSet<PartSim> sourcePartSet;
+ if (!sourcePartSets.TryGetValue(type, out sourcePartSet) || sourcePartSet.Count == 0)
{
if (SimManager.logOutput)
{
@@ -318,10 +458,9 @@
}
// Now we set the drains on the members of the sets and update the draining parts set
- for (int i = 0; i < resourceConsumptions.Types.Count; ++i)
- {
- int type = resourceConsumptions.Types[i];
-
+ for (int i = 0; i < this.resourceConsumptions.Types.Count; i++)
+ {
+ int type = this.resourceConsumptions.Types[i];
HashSet<PartSim> sourcePartSet = sourcePartSets[type];
// Loop through the members of the set
double amount = resourceConsumptions[type] / sourcePartSet.Count;
@@ -329,14 +468,15 @@
{
if (SimManager.logOutput)
{
- MonoBehaviour.print("Adding drain of " + amount + " " + ResourceContainer.GetResourceName(type) + " to " + partSim.name + ":" + partSim.partId);
+ MonoBehaviour.print(
+ "Adding drain of " + amount + " " + ResourceContainer.GetResourceName(type) + " to " + partSim.name + ":" +
+ partSim.partId);
}
partSim.resourceDrains.Add(type, amount);
drainingParts.Add(partSim);
}
}
-
return true;
}
}
--- a/KerbalEngineer/VesselSimulator/PartSim.cs
+++ b/KerbalEngineer/VesselSimulator/PartSim.cs
@@ -17,34 +17,33 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#region Using Directives
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-using KerbalEngineer.Extensions;
-
-using UnityEngine;
-
-#endregion
namespace KerbalEngineer.VesselSimulator
{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Text;
using CompoundParts;
-
- public class PartSim : Pool<PartSim>
+ using Extensions;
+ using UnityEngine;
+
+ public class PartSim
{
+ private static readonly Pool<PartSim> pool = new Pool<PartSim>(Create, Reset);
+
private readonly List<AttachNodeSim> attachNodes = new List<AttachNodeSim>();
+
+ public double realMass;
+ public double baseMass;
+ public double baseMassForCoM;
public Vector3d centerOfMass;
- public double baseMass;
- public double cost;
+ public double baseCost;
public int decoupledInStage;
public bool fuelCrossFeed;
public List<PartSim> fuelTargets = new List<PartSim>();
+ public List<PartSim> surfaceMountFuelTargets = new List<PartSim>();
public bool hasModuleEngines;
- public bool hasModuleEnginesFX;
public bool hasMultiModeEngine;
public bool hasVessel;
@@ -57,7 +56,9 @@
public bool isLanded;
public bool isNoPhysics;
public bool isSepratron;
- public bool localCorrectThrust;
+ public bool isFairing;
+ public float fairingMass;
+ public int stageIndex;
public String name;
public String noCrossFeedNodeKey;
public PartSim parent;
@@ -70,178 +71,173 @@
public double startMass = 0d;
public String vesselName;
public VesselType vesselType;
+
+
+ private static PartSim Create()
+ {
+ return new PartSim();
+ }
private static void Reset(PartSim partSim)
{
+ for (int i = 0; i < partSim.attachNodes.Count; i++)
+ {
+ partSim.attachNodes[i].Release();
+ }
partSim.attachNodes.Clear();
partSim.fuelTargets.Clear();
partSim.resourceDrains.Reset();
partSim.resourceFlowStates.Reset();
partSim.resources.Reset();
- partSim.baseMass = 0.0;
- partSim.startMass = 0.0;
- partSim.centerOfMass = Vector3d.zero;
- partSim.cost = 0.0;
- partSim.decoupledInStage = 0;
- partSim.fuelCrossFeed = false;
- partSim.hasModuleEngines = false;
- partSim.hasModuleEnginesFX = false;
- partSim.hasMultiModeEngine = false;
- partSim.hasVessel = false;
- partSim.initialVesselName = null;
- partSim.inverseStage = 0;
- partSim.isDecoupler = false;
- partSim.isEngine = false;
- partSim.isFuelLine = false;
- partSim.isFuelTank = false;
- partSim.isLanded = false;
- partSim.isNoPhysics = false;
- partSim.isSepratron = false;
- partSim.localCorrectThrust = false;
- partSim.name = null;
- partSim.noCrossFeedNodeKey = null;
+ partSim.baseCost = 0d;
+ partSim.baseMass = 0d;
+ partSim.baseMassForCoM = 0d;
+ partSim.startMass = 0d;
+ }
+
+ public void Release()
+ {
+ pool.Release(this);
+ }
+
+ public static PartSim New(Part thePart, int id, double atmosphere, LogMsg log)
+ {
+ PartSim partSim = pool.Borrow();
+
+ partSim.part = thePart;
+ partSim.centerOfMass = thePart.transform.TransformPoint(thePart.CoMOffset);
+ partSim.partId = id;
+ partSim.name = partSim.part.partInfo.name;
+
+ if (log != null) log.buf.AppendLine("Create PartSim for " + partSim.name);
+
partSim.parent = null;
- partSim.parentAttach = AttachModes.SRF_ATTACH;
- partSim.part = null;
- partSim.partId = 0;
- partSim.vesselName = null;
- partSim.vesselType = VesselType.Base;
- }
-
- public PartSim Initialise(Part thePart, int id, double atmosphere, LogMsg log)
- {
- Reset(this);
-
- this.part = thePart;
- this.centerOfMass = thePart.transform.TransformPoint(thePart.CoMOffset);
- this.partId = id;
- this.name = this.part.partInfo.name;
+ partSim.parentAttach = partSim.part.attachMode;
+ partSim.fuelCrossFeed = partSim.part.fuelCrossFeed;
+ partSim.noCrossFeedNodeKey = partSim.part.NoCrossFeedNodeKey;
+ partSim.decoupledInStage = partSim.DecoupledInStage(partSim.part);
+ partSim.isFuelLine = partSim.part.HasModule<CModuleFuelLine>();
+ partSim.isFuelTank = partSim.part is FuelTank;
+ partSim.isSepratron = partSim.IsSepratron();
+ partSim.isFairing = partSim.IsFairing(partSim.part);
+ partSim.inverseStage = partSim.part.inverseStage;
+ //MonoBehaviour.print("inverseStage = " + inverseStage);
+
+ partSim.baseCost = partSim.part.GetCostDry();
if (log != null)
{
- log.buf.AppendLine("Create PartSim for " + this.name);
- }
-
- this.parent = null;
- this.parentAttach = part.attachMode;
- this.fuelCrossFeed = this.part.fuelCrossFeed;
- this.noCrossFeedNodeKey = this.part.NoCrossFeedNodeKey;
- this.decoupledInStage = this.DecoupledInStage(this.part);
- this.isFuelLine = this.part.HasModule<CModuleFuelLine>();
- this.isFuelTank = this.part is FuelTank;
- this.isSepratron = this.IsSepratron();
- this.inverseStage = this.part.inverseStage;
- //MonoBehaviour.print("inverseStage = " + inverseStage);
-
- this.cost = this.part.GetCostWet();
+ log.buf.AppendLine("Parent part = " + (partSim.part.parent == null ? "null" : partSim.part.parent.partInfo.name));
+ log.buf.AppendLine("physicalSignificance = " + partSim.part.physicalSignificance);
+ log.buf.AppendLine("PhysicsSignificance = " + partSim.part.PhysicsSignificance);
+ }
// Work out if the part should have no physical significance
- this.isNoPhysics = this.part.HasModule<LaunchClamp>();
-
- if (isNoPhysics == false)
- {
- baseMass = part.mass;
- }
-
- if (SimManager.logOutput)
- {
- MonoBehaviour.print((this.isNoPhysics ? "Ignoring" : "Using") + " part.mass of " + this.part.mass);
- }
-
- for (int i = 0; i < part.Resources.Count; ++i)
- {
- PartResource resource = part.Resources[i];
+ // The root part is never "no physics"
+ partSim.isNoPhysics = partSim.part.physicalSignificance == Part.PhysicalSignificance.NONE ||
+ partSim.part.PhysicsSignificance == 1;
+
+ if (partSim.part.HasModule<LaunchClamp>())
+ {
+ partSim.realMass = 0d;
+ if (log != null) log.buf.AppendLine("Ignoring mass of launch clamp");
+ }
+ else
+ {
+ partSim.realMass = partSim.part.mass;
+ if (log != null) log.buf.AppendLine("Using part.mass of " + partSim.part.mass);
+ }
+
+ if (partSim.isFairing)
+ {
+ partSim.fairingMass = partSim.part.GetModuleMass((float)partSim.realMass);
+ }
+
+ for (int i = 0; i < partSim.part.Resources.Count; i++)
+ {
+ PartResource resource = partSim.part.Resources[i];
// Make sure it isn't NaN as this messes up the part mass and hence most of the values
// This can happen if a resource capacity is 0 and tweakable
if (!Double.IsNaN(resource.amount))
{
- if (SimManager.logOutput)
- {
- MonoBehaviour.print(resource.resourceName + " = " + resource.amount);
- }
-
- this.resources.Add(resource.info.id, resource.amount);
- this.resourceFlowStates.Add(resource.info.id, resource.flowState ? 1 : 0);
+ if (log != null)
+ log.buf.AppendLine(resource.resourceName + " = " + resource.amount);
+
+ partSim.resources.Add(resource.info.id, resource.amount);
+ partSim.resourceFlowStates.Add(resource.info.id, resource.flowState ? 1 : 0);
}
else
{
- MonoBehaviour.print(resource.resourceName + " is NaN. Skipping.");
- }
- }
-
- this.startMass = this.GetMass();
-
- this.hasVessel = (this.part.vessel != null);
- this.isLanded = this.hasVessel && this.part.vessel.Landed;
- if (this.hasVessel)
- {
- this.vesselName = this.part.vessel.vesselName;
- this.vesselType = this.part.vesselType;
- }
- this.initialVesselName = this.part.initialVesselName;
-
- this.hasMultiModeEngine = this.part.HasModule<MultiModeEngine>();
- this.hasModuleEnginesFX = this.part.HasModule<ModuleEnginesFX>();
- this.hasModuleEngines = this.part.HasModule<ModuleEngines>();
-
- this.isEngine = this.hasMultiModeEngine || this.hasModuleEnginesFX || this.hasModuleEngines;
-
- if (SimManager.logOutput)
- {
- MonoBehaviour.print("Created " + this.name + ". Decoupled in stage " + this.decoupledInStage);
- }
-
- return this;
+ if (log != null) log.buf.AppendLine(resource.resourceName + " is NaN. Skipping.");
+ }
+ }
+
+ partSim.hasVessel = (partSim.part.vessel != null);
+ partSim.isLanded = partSim.hasVessel && partSim.part.vessel.Landed;
+ if (partSim.hasVessel)
+ {
+ partSim.vesselName = partSim.part.vessel.vesselName;
+ partSim.vesselType = partSim.part.vesselType;
+ }
+ partSim.initialVesselName = partSim.part.initialVesselName;
+
+ partSim.hasMultiModeEngine = partSim.part.HasModule<MultiModeEngine>();
+ partSim.hasModuleEngines = partSim.part.HasModule<ModuleEngines>();
+
+ partSim.isEngine = partSim.hasMultiModeEngine || partSim.hasModuleEngines;
+
+ if (log != null) log.buf.AppendLine("Created " + partSim.name + ". Decoupled in stage " + partSim.decoupledInStage);
+
+ return partSim;
+ }
+
+ public ResourceContainer ResourceDrains
+ {
+ get
+ {
+ return resourceDrains;
+ }
}
public ResourceContainer Resources
{
- get { return this.resources; }
- }
-
- public ResourceContainer ResourceDrains
- {
- get { return this.resourceDrains; }
+ get
+ {
+ return resources;
+ }
}
public void CreateEngineSims(List<EngineSim> allEngines, double atmosphere, double mach, bool vectoredThrust, bool fullThrust, LogMsg log)
{
- bool correctThrust = SimManager.DoesEngineUseCorrectedThrust(this.part);
if (log != null)
{
log.buf.AppendLine("CreateEngineSims for " + this.name);
-
- foreach (PartModule partMod in this.part.Modules)
- {
+ for (int i = 0; i < this.part.Modules.Count; i++)
+ {
+ PartModule partMod = this.part.Modules[i];
log.buf.AppendLine("Module: " + partMod.moduleName);
}
-
- log.buf.AppendLine("correctThrust = " + correctThrust);
- }
-
- if (this.hasMultiModeEngine)
- {
- // A multi-mode engine has multiple ModuleEnginesFX but only one is active at any point
- // The mode of the engine is the engineID of the ModuleEnginesFX that is active
- string mode = this.part.GetModule<MultiModeEngine>().mode;
-
- List<ModuleEnginesFX> engines = part.GetModules<ModuleEnginesFX>();
-
+ }
+
+ if (hasMultiModeEngine)
+ {
+ // A multi-mode engine has multiple ModuleEngines but only one is active at any point
+ // The mode of the engine is the engineID of the ModuleEngines that is active
+ string mode = part.GetModule<MultiModeEngine>().mode;
+
+ List<ModuleEngines> engines = part.GetModules<ModuleEngines>();
for (int i = 0; i < engines.Count; ++i)
{
- ModuleEnginesFX engine = engines[i];
-
+ ModuleEngines engine = engines[i];
if (engine.engineID == mode)
{
- if (log != null)
- {
- log.buf.AppendLine("Module: " + engine.moduleName);
- }
+ if (log != null) log.buf.AppendLine("Module: " + engine.moduleName);
Vector3 thrustvec = this.CalculateThrustVector(vectoredThrust ? engine.thrustTransforms : null, log);
- EngineSim engineSim = EngineSim.GetPoolObject().Initialise(this,
+ EngineSim engineSim = EngineSim.New(
+ this,
atmosphere,
(float)mach,
engine.maxFuelFlow,
@@ -253,49 +249,48 @@
engine.useAtmCurve ? engine.atmCurve : null,
engine.useVelCurve ? engine.velCurve : null,
engine.currentThrottle,
+ engine.g,
engine.throttleLocked || fullThrust,
engine.propellants,
engine.isOperational,
engine.resultingThrust,
- engine.thrustTransforms);
+ engine.thrustTransforms,
+ log);
allEngines.Add(engineSim);
}
}
}
- else
- {
- if (this.hasModuleEngines)
- {
- List<ModuleEngines> engines = part.GetModules<ModuleEngines>();
- for (int i = 0; i < engines.Count; ++i)
- {
- ModuleEngines engine = engines[i];
- if (log != null)
- {
- log.buf.AppendLine("Module: " + engine.moduleName);
- }
-
- Vector3 thrustvec = this.CalculateThrustVector(vectoredThrust ? engine.thrustTransforms : null, log);
-
- EngineSim engineSim = EngineSim.GetPoolObject().Initialise(this,
- atmosphere,
- (float)mach,
- engine.maxFuelFlow,
- engine.minFuelFlow,
- engine.thrustPercentage,
- thrustvec,
- engine.atmosphereCurve,
- engine.atmChangeFlow,
- engine.useAtmCurve ? engine.atmCurve : null,
- engine.useVelCurve ? engine.velCurve : null,
- engine.currentThrottle,
- engine.throttleLocked || fullThrust,
- engine.propellants,
- engine.isOperational,
- engine.resultingThrust,
- engine.thrustTransforms);
- allEngines.Add(engineSim);
- }
+ else if (hasModuleEngines)
+ {
+ List<ModuleEngines> engines = part.GetModules<ModuleEngines>();
+ for (int i = 0; i < engines.Count; ++i)
+ {
+ ModuleEngines engine = engines[i];
+ if (log != null) log.buf.AppendLine("Module: " + engine.moduleName);
+
+ Vector3 thrustvec = this.CalculateThrustVector(vectoredThrust ? engine.thrustTransforms : null, log);
+
+ EngineSim engineSim = EngineSim.New(
+ this,
+ atmosphere,
+ (float)mach,
+ engine.maxFuelFlow,
+ engine.minFuelFlow,
+ engine.thrustPercentage,
+ thrustvec,
+ engine.atmosphereCurve,
+ engine.atmChangeFlow,
+ engine.useAtmCurve ? engine.atmCurve : null,
+ engine.useVelCurve ? engine.velCurve : null,
+ engine.currentThrottle,
+ engine.g,
+ engine.throttleLocked || fullThrust,
+ engine.propellants,
+ engine.isOperational,
+ engine.resultingThrust,
+ engine.thrustTransforms,
+ log);
+ allEngines.Add(engineSim);
}
}
@@ -305,184 +300,144 @@
}
}
- private Vector3 CalculateThrustVector(List<Transform> thrustTransforms, LogMsg log)
- {
- if (thrustTransforms == null)
- {
- return Vector3.forward;
- }
-
- Vector3 thrustvec = Vector3.zero;
- for (int i = 0; i < thrustTransforms.Count; ++i)
- {
- Transform trans = thrustTransforms[i];
-
- if (log != null)
- {
- log.buf.AppendFormat("Transform = ({0:g6}, {1:g6}, {2:g6}) length = {3:g6}\n", trans.forward.x, trans.forward.y, trans.forward.z, trans.forward.magnitude);
- }
-
- thrustvec -= trans.forward;
- }
-
- if (log != null)
- {
- log.buf.AppendFormat("ThrustVec = ({0:g6}, {1:g6}, {2:g6}) length = {3:g6}\n", thrustvec.x, thrustvec.y, thrustvec.z, thrustvec.magnitude);
- }
-
- thrustvec.Normalize();
-
- if (log != null)
- {
- log.buf.AppendFormat("ThrustVecN = ({0:g6}, {1:g6}, {2:g6}) length = {3:g6}\n", thrustvec.x, thrustvec.y, thrustvec.z, thrustvec.magnitude);
- }
-
- return thrustvec;
- }
-
- public void SetupParent(Dictionary<Part, PartSim> partSimLookup, LogMsg log)
- {
- if (this.part.parent != null)
- {
- this.parent = null;
- if (partSimLookup.TryGetValue(this.part.parent, out this.parent))
- {
- if (log != null)
- {
- log.buf.AppendLine("Parent part is " + this.parent.name + ":" + this.parent.partId);
- }
- }
- else
- {
- if (log != null)
- {
- log.buf.AppendLine("No PartSim for parent part (" + this.part.parent.partInfo.name + ")");
- }
- }
- }
- }
-
- public void SetupAttachNodes(Dictionary<Part, PartSim> partSimLookup, LogMsg log)
- {
- if (log != null)
- {
- log.buf.AppendLine("SetupAttachNodes for " + this.name + ":" + this.partId + "");
- }
-
- attachNodes.Clear();
-
- for (int i = 0; i < part.attachNodes.Count; ++i)
- {
- AttachNode attachNode = part.attachNodes[i];
-
- if (log != null)
- {
- log.buf.AppendLine("AttachNode " + attachNode.id + " = " + (attachNode.attachedPart != null ? attachNode.attachedPart.partInfo.name : "null"));
- }
-
- if (attachNode.attachedPart != null && attachNode.id != "Strut")
- {
- PartSim attachedSim;
- if (partSimLookup.TryGetValue(attachNode.attachedPart, out attachedSim))
- {
- if (log != null)
- {
- log.buf.AppendLine("Adding attached node " + attachedSim.name + ":" + attachedSim.partId + "");
- }
-
- attachNodes.Add(AttachNodeSim.GetPoolObject().Initialise(attachedSim, attachNode.id, attachNode.nodeType));
- }
- else
- {
- if (log != null)
- {
- log.buf.AppendLine("No PartSim for attached part (" + attachNode.attachedPart.partInfo.name + ")");
- }
- }
- }
- }
-
- for (int i = 0; i < part.fuelLookupTargets.Count; ++i)
- {
- Part p = part.fuelLookupTargets[i];
-
- if (p != null)
- {
- PartSim targetSim;
- if (partSimLookup.TryGetValue(p, out targetSim))
- {
- if (log != null)
- {
- log.buf.AppendLine("Fuel target: " + targetSim.name + ":" + targetSim.partId);
- }
-
- this.fuelTargets.Add(targetSim);
- }
- else
- {
- if (log != null)
- {
- log.buf.AppendLine("No PartSim for fuel target (" + p.name + ")");
- }
- }
- }
- }
- }
-
- private int DecoupledInStage(Part thePart, int stage = -1)
- {
- if (this.IsDecoupler(thePart))
- {
- if (thePart.inverseStage > stage)
- {
- stage = thePart.inverseStage;
- }
- }
-
- if (thePart.parent != null)
- {
- stage = this.DecoupledInStage(thePart.parent, stage);
- }
-
- return stage;
- }
-
- private bool IsDecoupler(Part thePart)
- {
- return thePart.HasModule<ModuleDecouple>() ||
- thePart.HasModule<ModuleAnchoredDecoupler>();
- }
-
- private bool IsActiveDecoupler(Part thePart)
- {
- return thePart.FindModulesImplementing<ModuleDecouple>().Any(mod => !mod.isDecoupled) ||
- thePart.FindModulesImplementing<ModuleAnchoredDecoupler>().Any(mod => !mod.isDecoupled);
- }
-
- private bool IsSepratron()
- {
- if (!this.part.ActivatesEvenIfDisconnected)
- {
- return false;
- }
-
- if (this.part is SolidRocket)
- {
- return true;
- }
-
- var modList = this.part.Modules.OfType<ModuleEngines>();
- if (modList.Count() == 0)
- {
- return false;
- }
-
- if (modList.First().throttleLocked)
- {
- return true;
- }
-
- return false;
+ public int DecouplerCount()
+ {
+ int count = 0;
+ PartSim partSim = this;
+ while (partSim != null)
+ {
+ if (partSim.isDecoupler)
+ {
+ count++;
+ }
+
+ partSim = partSim.parent;
+ }
+ return count;
+ }
+
+ public void DrainResources(double time)
+ {
+ //MonoBehaviour.print("DrainResources(" + name + ":" + partId + ", " + time + ")");
+ for (int i = 0; i < resourceDrains.Types.Count; ++i)
+ {
+ int type = resourceDrains.Types[i];
+
+ //MonoBehaviour.print("draining " + (time * resourceDrains[type]) + " " + ResourceContainer.GetResourceName(type));
+ resources.Add(type, -time * resourceDrains[type]);
+ //MonoBehaviour.print(ResourceContainer.GetResourceName(type) + " left = " + resources[type]);
+ }
+ }
+
+ public String DumpPartAndParentsToBuffer(StringBuilder buffer, String prefix)
+ {
+ if (parent != null)
+ {
+ prefix = parent.DumpPartAndParentsToBuffer(buffer, prefix) + " ";
+ }
+
+ DumpPartToBuffer(buffer, prefix);
+
+ return prefix;
+ }
+
+ public void DumpPartToBuffer(StringBuilder buffer, String prefix, List<PartSim> allParts = null)
+ {
+ buffer.Append(prefix);
+ buffer.Append(name);
+ buffer.AppendFormat(":[id = {0:d}, decouple = {1:d}, invstage = {2:d}", partId, decoupledInStage, inverseStage);
+
+ //buffer.AppendFormat(", vesselName = '{0}'", vesselName);
+ //buffer.AppendFormat(", vesselType = {0}", SimManager.GetVesselTypeString(vesselType));
+ //buffer.AppendFormat(", initialVesselName = '{0}'", initialVesselName);
+
+ buffer.AppendFormat(", isNoPhys = {0}", isNoPhysics);
+ buffer.AppendFormat(", baseMass = {0}", baseMass);
+ buffer.AppendFormat(", baseMassForCoM = {0}", baseMassForCoM);
+
+ buffer.AppendFormat(", fuelCF = {0}", fuelCrossFeed);
+ buffer.AppendFormat(", noCFNKey = '{0}'", noCrossFeedNodeKey);
+
+ buffer.AppendFormat(", isSep = {0}", isSepratron);
+
+ for (int i = 0; i < resources.Types.Count; i++)
+ {
+ int type = resources.Types[i];
+ buffer.AppendFormat(", {0} = {1:g6}", ResourceContainer.GetResourceName(type), resources[type]);
+ }
+
+ if (attachNodes.Count > 0)
+ {
+ buffer.Append(", attached = <");
+ attachNodes[0].DumpToBuffer(buffer);
+ for (int i = 1; i < attachNodes.Count; i++)
+ {
+ buffer.Append(", ");
+ attachNodes[i].DumpToBuffer(buffer);
+ }
+ buffer.Append(">");
+ }
+
+ // Add more info here
+
+ buffer.Append("]\n");
+
+ if (allParts != null)
+ {
+ String newPrefix = prefix + " ";
+ for (int i = 0; i < allParts.Count; i++)
+ {
+ PartSim partSim = allParts[i];
+ if (partSim.parent == this)
+ partSim.DumpPartToBuffer(buffer, newPrefix, allParts);
+ }
+ }
+ }
+
+ public bool EmptyOf(HashSet<int> types)
+ {
+ foreach (int type in types)
+ {
+ if (resources.HasType(type) && resourceFlowStates[type] != 0 && resources[type] > SimManager.RESOURCE_PART_EMPTY_THRESH)
+ return false;
+ }
+
+ return true;
+ }
+
+ public double GetMass(int currentStage, bool forCoM = false)
+ {
+ if (decoupledInStage >= currentStage)
+ return 0d;
+
+ double mass = forCoM ? baseMassForCoM : baseMass;
+
+ for (int i = 0; i < resources.Types.Count; ++i)
+ {
+ mass += resources.GetResourceMass(resources.Types[i]);
+ }
+
+ if (isFairing && currentStage <= inverseStage)
+ {
+ mass -= fairingMass;
+ }
+
+ return mass;
+ }
+
+ public double GetCost(int currentStage)
+ {
+ if (decoupledInStage >= currentStage)
+ return 0d;
+
+ double cost = baseCost;
+
+ for (int i = 0; i < resources.Types.Count; ++i)
+ {
+ cost += resources.GetResourceCost(resources.Types[i]);
+ }
+
+ return cost;
}
public void ReleasePart()
@@ -493,68 +448,77 @@
// All functions below this point must not rely on the part member (it may be null)
//
- public HashSet<PartSim> GetSourceSet(int type, List<PartSim> allParts, HashSet<PartSim> visited, LogMsg log, String indent)
+ public void GetSourceSet(int type, bool includeSurfaceMountedParts, List<PartSim> allParts, HashSet<PartSim> visited, HashSet<PartSim> allSources, LogMsg log, String indent)
{
if (log != null)
{
- log.buf.AppendLine(indent + "GetSourceSet(" + ResourceContainer.GetResourceName(type) + ") for " + this.name + ":" + this.partId);
+ log.buf.AppendLine(indent + "GetSourceSet(" + ResourceContainer.GetResourceName(type) + ") for " + name + ":" + partId);
indent += " ";
}
- HashSet<PartSim> allSources = new HashSet<PartSim>();
- HashSet<PartSim> partSources = null;
-
- // Rule 1: Each part can be only visited once, If it is visited for second time in particular search it returns empty list.
+ // Rule 1: Each part can be only visited once, If it is visited for second time in particular search it returns as is.
if (visited.Contains(this))
{
- if (log != null)
- {
- log.buf.AppendLine(indent + "Returning empty set, already visited (" + this.name + ":" + this.partId + ")");
- }
-
- return allSources;
- }
-
- //if (log != null)
- // log.buf.AppendLine(indent + "Adding this to visited");
+ if (log != null) log.buf.AppendLine(indent + "Returning empty set, already visited (" + name + ":" + partId + ")");
+ return;
+ }
+
+ if (log != null) log.buf.AppendLine(indent + "Adding this to visited");
visited.Add(this);
// Rule 2: Part performs scan on start of every fuel pipe ending in it. This scan is done in order in which pipes were installed.
// Then it makes an union of fuel tank sets each pipe scan returned. If the resulting list is not empty, it is returned as result.
- //MonoBehaviour.print("foreach fuel line");
- for (int i = 0; i < fuelTargets.Count; ++i)
- {
- PartSim partSim = fuelTargets[i];
-
- if (visited.Contains(partSim))
- {
- //if (log != null)
- // log.buf.AppendLine(indent + "Fuel target already visited, skipping (" + partSim.name + ":" + partSim.partId + ")");
- }
- else
- {
- //if (log != null)
- // log.buf.AppendLine(indent + "Adding fuel target as source (" + partSim.name + ":" + partSim.partId + ")");
-
- partSources = partSim.GetSourceSet(type, allParts, visited, log, indent);
- if (partSources.Count > 0)
- {
- allSources.UnionWith(partSources);
- partSources.Clear();
- }
- }
- }
-
- if (allSources.Count > 0)
- {
- if (log != null)
- {
- log.buf.AppendLine(indent + "Returning " + allSources.Count + " fuel target sources (" + this.name + ":" + this.partId + ")");
- }
-
- return allSources;
- }
+ //MonoBehaviour.print("for each fuel line");
+
+ int lastCount = allSources.Count;
+
+ for (int i = 0; i < this.fuelTargets.Count; i++)
+ {
+ PartSim partSim = this.fuelTargets[i];
+ if (partSim != null)
+ {
+ if (visited.Contains(partSim))
+ {
+ if (log != null) log.buf.AppendLine(indent + "Fuel target already visited, skipping (" + partSim.name + ":" + partSim.partId + ")");
+ }
+ else
+ {
+ if (log != null) log.buf.AppendLine(indent + "Adding fuel target as source (" + partSim.name + ":" + partSim.partId + ")");
+
+ partSim.GetSourceSet(type, includeSurfaceMountedParts, allParts, visited, allSources, log, indent);
+ }
+ }
+ }
+
+ // check surface mounted fuel targets
+ if (includeSurfaceMountedParts)
+ {
+ for (int i = 0; i < surfaceMountFuelTargets.Count; i++)
+ {
+ PartSim partSim = this.surfaceMountFuelTargets[i];
+ if (partSim != null)
+ {
+ if (visited.Contains(partSim))
+ {
+ if (log != null) log.buf.AppendLine(indent + "Fuel target already visited, skipping (" + partSim.name + ":" + partSim.partId + ")");
+ }
+ else
+ {
+ if (log != null) log.buf.AppendLine(indent + "Adding fuel target as source (" + partSim.name + ":" + partSim.partId + ")");
+
+ partSim.GetSourceSet(type, true, allParts, visited, allSources, log, indent);
+ }
+ }
+ }
+ }
+
+ if (allSources.Count > lastCount)
+ {
+ if (log != null) log.buf.AppendLine(indent + "Returning " + (allSources.Count - lastCount) + " fuel target sources (" + this.name + ":" + this.partId + ")");
+ return;
+ }
+
// Rule 3: This rule has been removed and merged with rules 4 and 7 to fix issue with fuel tanks with disabled crossfeed
@@ -563,49 +527,38 @@
// skip the points on the side where multiple points are. [Experiment]
// Again, the part creates union of scan lists from each of its neighbor and if it is not empty, returns this list.
// The order in which mount points of a part are scanned appears to be fixed and defined by the part specification file. [Experiment]
- if (this.fuelCrossFeed)
- {
- //MonoBehaviour.print("foreach attach node");
- for (int i = 0; i < attachNodes.Count; ++i)
- {
- AttachNodeSim attachSim = attachNodes[i];
-
+ if (fuelCrossFeed)
+ {
+ lastCount = allSources.Count;
+ //MonoBehaviour.print("for each attach node");
+ for (int i = 0; i < this.attachNodes.Count; i++)
+ {
+ AttachNodeSim attachSim = this.attachNodes[i];
if (attachSim.attachedPartSim != null)
{
if (attachSim.nodeType == AttachNode.NodeType.Stack)
{
- if (!(this.noCrossFeedNodeKey != null && this.noCrossFeedNodeKey.Length > 0 && attachSim.id.Contains(this.noCrossFeedNodeKey)))
+ if ((string.IsNullOrEmpty(noCrossFeedNodeKey) == false && attachSim.id.Contains(noCrossFeedNodeKey)) == false)
{
if (visited.Contains(attachSim.attachedPartSim))
{
- //if (log != null)
- // log.buf.AppendLine(indent + "Attached part already visited, skipping (" + attachSim.attachedPartSim.name + ":" + attachSim.attachedPartSim.partId + ")");
+ if (log != null) log.buf.AppendLine(indent + "Attached part already visited, skipping (" + attachSim.attachedPartSim.name + ":" + attachSim.attachedPartSim.partId + ")");
}
else
{
- //if (log != null)
- // log.buf.AppendLine(indent + "Adding attached part as source (" + attachSim.attachedPartSim.name + ":" + attachSim.attachedPartSim.partId + ")");
-
- partSources = attachSim.attachedPartSim.GetSourceSet(type, allParts, visited, log, indent);
- if (partSources.Count > 0)
- {
- allSources.UnionWith(partSources);
- partSources.Clear();
- }
+ if (log != null) log.buf.AppendLine(indent + "Adding attached part as source (" + attachSim.attachedPartSim.name + ":" + attachSim.attachedPartSim.partId + ")");
+
+ attachSim.attachedPartSim.GetSourceSet(type, includeSurfaceMountedParts, allParts, visited, allSources, log, indent);
}
}
}
}
}
- if (allSources.Count > 0)
- {
- if (log != null)
- {
- log.buf.AppendLine(indent + "Returning " + allSources.Count + " attached sources (" + this.name + ":" + this.partId + ")");
- }
-
- return allSources;
+ if (allSources.Count > lastCount)
+ {
+ if (log != null) log.buf.AppendLine(indent + "Returning " + (allSources.Count - lastCount) + " attached sources (" + this.name + ":" + this.partId + ")");
+ return;
}
}
@@ -613,80 +566,148 @@
// type was not disabled [Experiment]) and it contains fuel, it returns itself.
// Rule 6: If the part is fuel container for searched type of fuel (i.e. it has capability to contain that type of fuel and the fuel
// type was not disabled) but it does not contain the requested fuel, it returns empty list. [Experiment]
- if (this.resources.HasType(type) && this.resourceFlowStates[type] != 0)
- {
- if (this.resources[type] > SimManager.RESOURCE_MIN)
+ if (resources.HasType(type) && resourceFlowStates[type] > 0.0)
+ {
+ if (resources[type] > SimManager.RESOURCE_MIN)
{
allSources.Add(this);
- if (log != null)
- {
- log.buf.AppendLine(indent + "Returning enabled tank as only source (" + this.name + ":" + this.partId + ")");
- }
- }
-
- return allSources;
+ if (log != null) log.buf.AppendLine(indent + "Returning enabled tank as only source (" + name + ":" + partId + ")");
+ }
+
+ return;
+ }
+ else
+ {
+ if (log != null) log.buf.AppendLine(indent + "Not fuel tank or disabled. HasType = " + resources.HasType(type) + " FlowState = " + resourceFlowStates[type]);
}
// Rule 7: If the part is radially attached to another part and it is child of that part in the ship's tree structure, it scans its
// parent and returns whatever the parent scan returned. [Experiment] [Experiment]
- if (this.parent != null && this.parentAttach == AttachModes.SRF_ATTACH)
- {
- if (this.fuelCrossFeed)
- {
- if (visited.Contains(this.parent))
- {
- //if (log != null)
- // log.buf.AppendLine(indent + "Parent part already visited, skipping (" + parent.name + ":" + parent.partId + ")");
+ if (parent != null && parentAttach == AttachModes.SRF_ATTACH)
+ {
+ if (fuelCrossFeed)
+ {
+ if (visited.Contains(parent))
+ {
+ if (log != null) log.buf.AppendLine(indent + "Parent part already visited, skipping (" + parent.name + ":" + parent.partId + ")");
}
else
{
- allSources = this.parent.GetSourceSet(type, allParts, visited, log, indent);
- if (allSources.Count > 0)
+ lastCount = allSources.Count;
+ this.parent.GetSourceSet(type, includeSurfaceMountedParts, allParts, visited, allSources, log, indent);
+ if (allSources.Count > lastCount)
{
- if (log != null)
- {
- log.buf.AppendLine(indent + "Returning " + allSources.Count + " parent sources (" + this.name + ":" + this.partId + ")");
- }
-
- return allSources;
+ if (log != null) log.buf.AppendLine(indent + "Returning " + (allSources.Count - lastCount) + " parent sources (" + this.name + ":" + this.partId + ")");
+ return;
}
}
}
}
// Rule 8: If all preceding rules failed, part returns empty list.
- //if (log != null)
- // log.buf.AppendLine(indent + "Returning empty set, no sources found (" + name + ":" + partId + ")");
-
- return allSources;
+ if (log != null) log.buf.AppendLine(indent + "Returning empty set, no sources found (" + name + ":" + partId + ")");
+
+ return;
+ }
+
+ public double GetStartMass()
+ {
+ return startMass;
}
public void RemoveAttachedParts(HashSet<PartSim> partSims)
{
// Loop through the attached parts
- for (int i = 0; i < attachNodes.Count; ++i)
- {
- AttachNodeSim attachSim = attachNodes[i];
-
+ for (int i = 0; i < this.attachNodes.Count; i++)
+ {
+ AttachNodeSim attachSim = this.attachNodes[i];
// If the part is in the set then "remove" it by clearing the PartSim reference
if (partSims.Contains(attachSim.attachedPartSim))
{
attachSim.attachedPartSim = null;
}
}
- }
-
- public void DrainResources(double time)
- {
- //MonoBehaviour.print("DrainResources(" + name + ":" + partId + ", " + time + ")");
- for (int i = 0; i < resourceDrains.Types.Count; ++i)
- {
- int type = resourceDrains.Types[i];
-
- //MonoBehaviour.print("draining " + (time * resourceDrains[type]) + " " + ResourceContainer.GetResourceName(type));
- this.resources.Add(type, -time * this.resourceDrains[type]);
- //MonoBehaviour.print(ResourceContainer.GetResourceName(type) + " left = " + resources[type]);
+
+ // Loop through the fuel targets (fuel line sources)
+ for (int i = 0; i < this.fuelTargets.Count; i++)
+ {
+ PartSim fuelTargetSim = this.fuelTargets[i];
+ // If the part is in the set then "remove" it by clearing the PartSim reference
+ if (fuelTargetSim != null && partSims.Contains(fuelTargetSim))
+ {
+ this.fuelTargets[i] = null;
+ }
+ }
+ }
+
+ public void SetupAttachNodes(Dictionary<Part, PartSim> partSimLookup, LogMsg log)
+ {
+ if (log != null) log.buf.AppendLine("SetupAttachNodes for " + name + ":" + partId + "");
+
+ attachNodes.Clear();
+
+ for (int i = 0; i < part.attachNodes.Count; ++i)
+ {
+ AttachNode attachNode = part.attachNodes[i];
+
+ if (log != null) log.buf.AppendLine("AttachNode " + attachNode.id + " = " + (attachNode.attachedPart != null ? attachNode.attachedPart.partInfo.name : "null"));
+
+ if (attachNode.attachedPart != null && attachNode.id != "Strut")
+ {
+ PartSim attachedSim;
+ if (partSimLookup.TryGetValue(attachNode.attachedPart, out attachedSim))
+ {
+ if (log != null) log.buf.AppendLine("Adding attached node " + attachedSim.name + ":" + attachedSim.partId + "");
+
+ attachNodes.Add(AttachNodeSim.New(attachedSim, attachNode.id, attachNode.nodeType));
+ }
+ else
+ {
+ if (log != null) log.buf.AppendLine("No PartSim for attached part (" + attachNode.attachedPart.partInfo.name + ")");
+ }
+ }
+ }
+
+ for (int i = 0; i < part.fuelLookupTargets.Count; ++i)
+ {
+ Part p = part.fuelLookupTargets[i];
+
+ if (p != null)
+ {
+ PartSim targetSim;
+ if (partSimLookup.TryGetValue(p, out targetSim))
+ {
+ if (log != null) log.buf.AppendLine("Fuel target: " + targetSim.name + ":" + targetSim.partId);
+
+ fuelTargets.Add(targetSim);
+ }
+ else
+ {
+ if (log != null) log.buf.AppendLine("No PartSim for fuel target (" + p.name + ")");
+ }
+ }
+ }
+ }
+
+ public void SetupParent(Dictionary<Part, PartSim> partSimLookup, LogMsg log)
+ {
+ if (part.parent != null)
+ {
+ parent = null;
+ if (partSimLookup.TryGetValue(part.parent, out parent))
+ {
+ if (log != null) log.buf.AppendLine("Parent part is " + parent.name + ":" + parent.partId);
+ if (part.attachMode == AttachModes.SRF_ATTACH && part.attachRules.srfAttach && part.fuelCrossFeed && part.parent.fuelCrossFeed)
+ {
+ if (log != null) log.buf.AppendLine("Added " + name + " to " + parent.name + " surface mounted fuel targets.");
+ parent.surfaceMountFuelTargets.Add(this);
+ }
+ }
+ else
+ {
+ if (log != null) log.buf.AppendLine("No PartSim for parent part (" + part.parent.partInfo.name + ")");
+ }
}
}
@@ -699,9 +720,9 @@
{
int type = resourceDrains.Types[i];
- if (this.resourceDrains[type] > 0)
- {
- time = Math.Min(time, this.resources[type] / this.resourceDrains[type]);
+ if (resourceDrains[type] > 0)
+ {
+ time = Math.Min(time, resources[type] / resourceDrains[type]);
//MonoBehaviour.print("type = " + ResourceContainer.GetResourceName(type) + " amount = " + resources[type] + " rate = " + resourceDrains[type] + " time = " + time);
}
}
@@ -711,111 +732,84 @@
return time;
}
- public bool EmptyOf(HashSet<int> types)
- {
- foreach (int type in types)
- {
- if (this.resources.HasType(type) && this.resourceFlowStates[type] != 0 && (double)this.resources[type] > SimManager.RESOURCE_MIN)
- {
- return false;
- }
- }
-
- return true;
- }
-
- public int DecouplerCount()
- {
- int count = 0;
- PartSim partSim = this;
- while (partSim != null)
- {
- if (partSim.isDecoupler)
- {
- count++;
- }
-
- partSim = partSim.parent;
- }
- return count;
- }
-
- public double GetStartMass()
- {
- return this.startMass;
- }
-
- public double GetMass()
- {
- double mass = this.baseMass;
-
- for (int i = 0; i < resources.Types.Count; ++i)
- {
- mass += this.resources.GetResourceMass(resources.Types[i]);
- }
-
- return mass;
- }
-
- public String DumpPartAndParentsToBuffer(StringBuilder buffer, String prefix)
- {
- if (this.parent != null)
- {
- prefix = this.parent.DumpPartAndParentsToBuffer(buffer, prefix) + " ";
- }
-
- this.DumpPartToBuffer(buffer, prefix);
-
- return prefix;
- }
-
- public void DumpPartToBuffer(StringBuilder buffer, String prefix, List<PartSim> allParts = null)
- {
- buffer.Append(prefix);
- buffer.Append(this.name);
- buffer.AppendFormat(":[id = {0:d}, decouple = {1:d}, invstage = {2:d}", this.partId, this.decoupledInStage, this.inverseStage);
-
- buffer.AppendFormat(", vesselName = '{0}'", this.vesselName);
- buffer.AppendFormat(", vesselType = {0}", SimManager.GetVesselTypeString(this.vesselType));
- buffer.AppendFormat(", initialVesselName = '{0}'", this.initialVesselName);
-
- buffer.AppendFormat(", fuelCF = {0}", this.fuelCrossFeed);
- buffer.AppendFormat(", noCFNKey = '{0}'", this.noCrossFeedNodeKey);
-
- buffer.AppendFormat(", isSep = {0}", this.isSepratron);
-
- foreach (int type in this.resources.Types)
- {
- buffer.AppendFormat(", {0} = {1:g6}", ResourceContainer.GetResourceName(type), this.resources[type]);
- }
-
- if (this.attachNodes.Count > 0)
- {
- buffer.Append(", attached = <");
- this.attachNodes[0].DumpToBuffer(buffer);
- for (int i = 1; i < this.attachNodes.Count; i++)
- {
- buffer.Append(", ");
- this.attachNodes[i].DumpToBuffer(buffer);
- }
- buffer.Append(">");
- }
-
- // Add more info here
-
- buffer.Append("]\n");
-
- if (allParts != null)
- {
- String newPrefix = prefix + " ";
- foreach (PartSim partSim in allParts)
- {
- if (partSim.parent == this)
- {
- partSim.DumpPartToBuffer(buffer, newPrefix, allParts);
- }
- }
- }
+ private Vector3 CalculateThrustVector(List<Transform> thrustTransforms, LogMsg log)
+ {
+ if (thrustTransforms == null)
+ {
+ return Vector3.forward;
+ }
+
+ Vector3 thrustvec = Vector3.zero;
+ for (int i = 0; i < thrustTransforms.Count; ++i)
+ {
+ Transform trans = thrustTransforms[i];
+
+ if (log != null) log.buf.AppendFormat("Transform = ({0:g6}, {1:g6}, {2:g6}) length = {3:g6}\n", trans.forward.x, trans.forward.y, trans.forward.z, trans.forward.magnitude);
+
+ thrustvec -= trans.forward;
+ }
+
+ if (log != null) log.buf.AppendFormat("ThrustVec = ({0:g6}, {1:g6}, {2:g6}) length = {3:g6}\n", thrustvec.x, thrustvec.y, thrustvec.z, thrustvec.magnitude);
+
+ thrustvec.Normalize();
+
+ if (log != null) log.buf.AppendFormat("ThrustVecN = ({0:g6}, {1:g6}, {2:g6}) length = {3:g6}\n", thrustvec.x, thrustvec.y, thrustvec.z, thrustvec.magnitude);
+
+ return thrustvec;
+ }
+
+ private int DecoupledInStage(Part thePart, int stage = -1)
+ {
+ if (IsDecoupler(thePart) && thePart.inverseStage > stage)
+ stage = thePart.inverseStage;
+
+ if (thePart.parent != null)
+ stage = DecoupledInStage(thePart.parent, stage);
+
+ return stage;
+ }
+
+ private bool IsActiveDecoupler(Part thePart)
+ {
+ return thePart.FindModulesImplementing<ModuleDecouple>().Any(mod => !mod.isDecoupled) ||
+ thePart.FindModulesImplementing<ModuleAnchoredDecoupler>().Any(mod => !mod.isDecoupled);
+ }
+
+ private bool IsDecoupler(Part thePart)
+ {
+ return thePart.HasModule<ModuleDecouple>() ||
+ thePart.HasModule<ModuleAnchoredDecoupler>();
+ }
+
+ private bool IsFairing(Part thePart)
+ {
+ return thePart.HasModule<ModuleProceduralFairing>();
+ }
+
+ private bool IsSepratron()
+ {
+ if (!part.ActivatesEvenIfDisconnected)
+ {
+ return false;
+ }
+
+ if (part is SolidRocket)
+ {
+ return true;
+ }
+
+ IEnumerable<ModuleEngines> modList = part.Modules.OfType<ModuleEngines>();
+ if (modList.Count() == 0)
+ {
+ return false;
+ }
+
+ if (modList.First().throttleLocked)
+ {
+ return true;
+ }
+
+ return false;
}
}
}
--- a/KerbalEngineer/VesselSimulator/ResourceContainer.cs
+++ b/KerbalEngineer/VesselSimulator/ResourceContainer.cs
@@ -19,6 +19,7 @@
#region Using Directives
+using System;
using System.Collections;
using System.Collections.Generic;
@@ -30,15 +31,17 @@
{
public class ResourceContainer
{
- private Hashtable resources = new Hashtable();
+ private Dictionary<int, double> resources = new Dictionary<int, double>();
+ private List<int> types = new List<int>();
public double this[int type]
{
get
{
- if (this.resources.ContainsKey(type))
+ double value;
+ if (this.resources.TryGetValue(type, out value))
{
- return (double)this.resources[type];
+ return value;
}
return 0d;
@@ -52,6 +55,7 @@
else
{
this.resources.Add(type, value);
+ this.types.Add(type);
}
}
}
@@ -60,13 +64,6 @@
{
get
{
- List<int> types = new List<int>();
-
- foreach (int key in this.resources.Keys)
- {
- types.Add(key);
- }
-
return types;
}
}
@@ -92,7 +89,7 @@
{
foreach (int type in this.resources.Keys)
{
- if ((double)this.resources[type] > SimManager.RESOURCE_MIN)
+ if (this.resources[type] > SimManager.RESOURCE_MIN)
{
return false;
}
@@ -111,7 +108,7 @@
{
foreach (int type in types)
{
- if (this.HasType(type) && (double)this.resources[type] > SimManager.RESOURCE_MIN)
+ if (this.HasType(type) && this.resources[type] > SimManager.RESOURCE_MIN)
{
return false;
}
@@ -124,17 +121,19 @@
{
if (this.resources.ContainsKey(type))
{
- this.resources[type] = (double)this.resources[type] + amount;
+ this.resources[type] = this.resources[type] + amount;
}
else
{
this.resources.Add(type, amount);
+ this.types.Add(type);
}
}
public void Reset()
{
this.resources.Clear();
+ this.types.Clear();
}
public void Debug()
@@ -148,7 +147,13 @@
public double GetResourceMass(int type)
{
double density = GetResourceDensity(type);
- return density == 0d ? 0d : (double)this.resources[type] * density;
+ return density == 0d ? 0d : this.resources[type] * density;
+ }
+
+ public double GetResourceCost(int type)
+ {
+ double unitCost = GetResourceUnitCost(type);
+ return unitCost == 0d ? 0d : this.resources[type] * unitCost;
}
public static ResourceFlowMode GetResourceFlowMode(int type)
@@ -170,5 +175,10 @@
{
return PartResourceLibrary.Instance.GetDefinition(type).name;
}
+
+ public static double GetResourceUnitCost(int type)
+ {
+ return PartResourceLibrary.Instance.GetDefinition(type).unitCost;
+ }
}
}
--- a/KerbalEngineer/VesselSimulator/SimManager.cs
+++ b/KerbalEngineer/VesselSimulator/SimManager.cs
@@ -35,6 +35,7 @@
#region Constants
public const double RESOURCE_MIN = 0.0001;
+ public const double RESOURCE_PART_EMPTY_THRESH = 0.01;
#endregion
--- a/KerbalEngineer/VesselSimulator/Simulation.cs
+++ b/KerbalEngineer/VesselSimulator/Simulation.cs
@@ -30,6 +30,7 @@
namespace KerbalEngineer.VesselSimulator
{
+ using System.ComponentModel;
using CompoundParts;
using Extensions;
using Helpers;
@@ -42,17 +43,17 @@
private List<EngineSim> allEngines = new List<EngineSim>();
private List<PartSim> allFuelLines = new List<PartSim>();
private List<PartSim> allParts = new List<PartSim>();
- private Dictionary<Part, PartSim> partSimLookup = new Dictionary<Part, PartSim>();
private double atmosphere;
private int currentStage;
private double currentisp;
+ private HashSet<PartSim> decoupledParts = new HashSet<PartSim>();
private bool doingCurrent;
- private List<PartSim> dontStageParts = new List<PartSim>();
- List<List<PartSim>> dontStagePartsLists = new List<List<PartSim>>();
- private HashSet<PartSim> drainingParts = new HashSet<PartSim>();
- private HashSet<int> drainingResources = new HashSet<int>();
- private HashSet<PartSim> decoupledParts = new HashSet<PartSim>();
+ private List<PartSim> dontStageParts;
+ private List<List<PartSim>> dontStagePartsLists = new List<List<PartSim>>();
+ private HashSet<PartSim> drainingParts;
+ private HashSet<int> drainingResources;
private double gravity;
+ private Dictionary<Part, PartSim> partSimLookup;
private int lastStage;
private List<Part> partList = new List<Part>();
@@ -78,6 +79,17 @@
public Simulation()
{
+ this.allParts = new List<PartSim>();
+ this.allFuelLines = new List<PartSim>();
+ this.drainingParts = new HashSet<PartSim>();
+ this.allEngines = new List<EngineSim>();
+ this.activeEngines = new List<EngineSim>();
+ this.drainingResources = new HashSet<int>();
+ this.totalStageThrustForce = new ForceAccumulator();
+
+ // A dictionary for fast lookup of Part->PartSim during the preparation phase
+ partSimLookup = new Dictionary<Part, PartSim>();
+
if (SimManager.logOutput)
{
MonoBehaviour.print("Simulation created");
@@ -91,7 +103,7 @@
double mass = 0d;
for (int i = 0; i < allParts.Count; ++i) {
- mass += allParts[i].GetMass();
+ mass += allParts[i].GetMass(currentStage);
}
return mass;
@@ -107,7 +119,7 @@
for (int i = 0; i < allParts.Count; ++i)
{
PartSim partSim = allParts[i];
- vectorAverager.Add(partSim.centerOfMass, partSim.GetMass());
+ vectorAverager.Add(partSim.centerOfMass, partSim.GetMass(currentStage, true));
}
return vectorAverager.Get();
@@ -127,6 +139,7 @@
log.buf.AppendLine("PrepareSimulation started");
dumpTree = true;
}
+ this._timer.Reset();
this._timer.Start();
// Store the parameters in members for ease of access in other functions
@@ -135,6 +148,7 @@
this.atmosphere = theAtmosphere;
this.mach = theMach;
this.lastStage = Staging.lastStage;
+ this.maxMach = 1.0f;
//MonoBehaviour.print("lastStage = " + lastStage);
// Clear the lists for our simulation parts
@@ -145,10 +159,6 @@
activeEngines.Clear();
drainingResources.Clear();
- PartSim.ReleaseAll();
- EngineSim.ReleaseAll();
- AttachNodeSim.ReleaseAll();
-
// A dictionary for fast lookup of Part->PartSim during the preparation phase
partSimLookup.Clear();
@@ -157,7 +167,7 @@
this.vesselName = this.partList[0].vessel.vesselName;
this.vesselType = this.partList[0].vessel.vesselType;
}
-
+ //MonoBehaviour.print("PrepareSimulation pool size = " + PartSim.pool.Count());
// First we create a PartSim for each Part (giving each a unique id)
int partId = 1;
for (int i = 0; i < partList.Count; ++i)
@@ -175,7 +185,7 @@
}
// Create the PartSim
- PartSim partSim = PartSim.GetPoolObject().Initialise(part, partId, this.atmosphere, log);
+ PartSim partSim = PartSim.New(part, partId, this.atmosphere, log);
// Add it to the Part lookup dictionary and the necessary lists
partSimLookup.Add(part, partSim);
@@ -201,8 +211,9 @@
// Now that all the PartSims have been created we can do any set up that needs access to other parts
// First we set up all the parent links
- foreach (PartSim partSim in this.allParts)
- {
+ for (int i = 0; i < this.allParts.Count; i++)
+ {
+ PartSim partSim = this.allParts[i];
partSim.SetupParent(partSimLookup, log);
}
@@ -280,7 +291,7 @@
return true;
}
-
+
// This function runs the simulation and returns a newly created array of Stage objects
public Stage[] RunSimulation()
{
@@ -289,6 +300,7 @@
MonoBehaviour.print("RunSimulation started");
}
+ this._timer.Reset();
this._timer.Start();
LogMsg log = null;
@@ -300,7 +312,6 @@
// Start with the last stage to simulate
// (this is in a member variable so it can be accessed by AllowedToStage and ActivateStage)
this.currentStage = this.lastStage;
-
// Work out which engines would be active if just doing the staging and if this is different to the
// currently active engines then generate an extra stage
// Loop through all the engines
@@ -373,6 +384,7 @@
// Create the array of stages that will be returned
Stage[] stages = new Stage[this.currentStage + 1];
+ int startStage = currentStage;
// Loop through the stages
while (this.currentStage >= 0)
@@ -380,7 +392,6 @@
if (log != null)
{
log.buf.AppendLine("Simulating stage " + this.currentStage);
- log.buf.AppendLine("ShipMass = " + this.ShipMass);
log.Flush();
this._timer.Reset();
this._timer.Start();
@@ -389,13 +400,18 @@
// Update active engines and resource drains
this.UpdateResourceDrains();
+ // Update the masses of the parts to correctly handle "no physics" parts
+ this.stageStartMass = this.UpdatePartMasses();
+
+ if (log != null)
+ this.allParts[0].DumpPartToBuffer(log.buf, "", this.allParts);
+
// Create the Stage object for this stage
Stage stage = new Stage();
this.stageTime = 0d;
this.vecStageDeltaV = Vector3.zero;
- this.stageStartMass = this.ShipMass;
this.stageStartCom = this.ShipCom;
this.stepStartMass = this.stageStartMass;
@@ -405,11 +421,11 @@
// Store various things in the Stage object
stage.thrust = this.totalStageThrust;
- //MonoBehaviour.print("stage.thrust = " + stage.thrust);
+ if (log != null) log.buf.AppendLine("stage.thrust = " + stage.thrust);
stage.thrustToWeight = this.totalStageThrust / (this.stageStartMass * this.gravity);
stage.maxThrustToWeight = stage.thrustToWeight;
- //MonoBehaviour.print("StageMass = " + stageStartMass);
- //MonoBehaviour.print("Initial maxTWR = " + stage.maxThrustToWeight);
+ if (log != null) log.buf.AppendLine("StageMass = " + stageStartMass);
+ if (log != null) log.buf.AppendLine("Initial maxTWR = " + stage.maxThrustToWeight);
stage.actualThrust = this.totalStageActualThrust;
stage.actualThrustToWeight = this.totalStageActualThrust / (this.stageStartMass * this.gravity);
@@ -434,17 +450,31 @@
stage.thrustOffsetAngle = Math.Asin(sinThrustOffsetAngle) * 180 / Math.PI;
- // Calculate the cost and mass of this stage and add all engines and tanks that are decoupled
- // in the next stage to the dontStageParts list
+ // Calculate the total cost of the vessel at this point
+ stage.totalCost = 0d;
for (int i = 0; i < allParts.Count; ++i)
{
- PartSim partSim = allParts[i];
-
- if (partSim.decoupledInStage == this.currentStage - 1)
- {
- stage.cost += partSim.cost;
- stage.mass += partSim.GetStartMass();
- }
+ if (this.currentStage > allParts[i].decoupledInStage)
+ stage.totalCost += allParts[i].GetCost(currentStage);
+ }
+
+ // The total mass is simply the mass at the start of the stage
+ stage.totalMass = this.stageStartMass;
+
+ // If we have done a previous stage
+ if (currentStage < startStage)
+ {
+ // Calculate what the previous stage's mass and cost were by subtraction
+ Stage prev = stages[currentStage + 1];
+ prev.cost = prev.totalCost - stage.totalCost;
+ prev.mass = prev.totalMass - stage.totalMass;
+ }
+
+ // The above code will never run for the last stage so set those directly
+ if (currentStage == 0)
+ {
+ stage.cost = stage.totalCost;
+ stage.mass = stage.totalMass;
}
this.dontStageParts = dontStagePartsLists[this.currentStage];
@@ -456,8 +486,9 @@
if (this.dontStageParts.Count > 0)
{
log.buf.AppendLine("Parts preventing staging:");
- foreach (PartSim partSim in this.dontStageParts)
- {
+ for (int i = 0; i < this.dontStageParts.Count; i++)
+ {
+ PartSim partSim = this.dontStageParts[i];
partSim.DumpPartToBuffer(log.buf, "");
}
}
@@ -468,6 +499,7 @@
log.Flush();
}
+
// Now we will loop until we are allowed to stage
int loopCounter = 0;
@@ -475,7 +507,6 @@
{
loopCounter++;
//MonoBehaviour.print("loop = " + loopCounter);
-
// Calculate how long each draining tank will take to drain and run for the minimum time
double resourceDrainTime = double.MaxValue;
PartSim partMinDrain = null;
@@ -493,7 +524,6 @@
{
MonoBehaviour.print("Drain time = " + resourceDrainTime + " (" + partMinDrain.name + ":" + partMinDrain.partId + ")");
}
-
foreach (PartSim partSim in this.drainingParts)
{
partSim.DrainResources(resourceDrainTime);
@@ -525,7 +555,7 @@
// Recalculate the current thrust and isp for the next step
this.CalculateThrustAndISP();
-
+
// Check if we actually changed anything
if (this.stepStartMass == this.stepEndMass)
{
@@ -551,6 +581,7 @@
this.stepStartMass = this.stepEndMass;
}
+
// Store more values in the Stage object and stick it in the array
// Store the magnitude of the deltaV vector
@@ -606,8 +637,6 @@
// For each stage we total up the cost, mass, deltaV and time for this stage and all the stages above
for (int j = i; j >= 0; j--)
{
- stages[i].totalCost += stages[j].cost;
- stages[i].totalMass += stages[j].mass;
stages[i].totalDeltaV += stages[j].deltaV;
stages[i].totalTime += stages[j].time;
stages[i].partCount = i > 0 ? stages[i].totalPartCount - stages[i - 1].totalPartCount : stages[i].totalPartCount;
@@ -631,8 +660,73 @@
this._timer.Stop();
MonoBehaviour.print("RunSimulation: " + this._timer.ElapsedMilliseconds + "ms");
}
-
+ FreePooledObject();
+
return stages;
+ }
+
+ public double UpdatePartMasses()
+ {
+ for (int i = 0; i < this.allParts.Count; i++)
+ {
+ this.allParts[i].baseMass = this.allParts[i].realMass;
+ this.allParts[i].baseMassForCoM = this.allParts[i].realMass;
+ }
+
+ for (int i = 0; i < this.allParts.Count; i++)
+ {
+ PartSim part = this.allParts[i];
+
+ // Check if part should pass it's mass onto its parent.
+ if (part.isNoPhysics && part.parent != null)
+ {
+ PartSim partParent = part.parent;
+
+ // Loop through all parents until a physically significant parent is found.
+ while (partParent != null)
+ {
+ // Check if parent is physically significant.
+ if (partParent.isNoPhysics == false)
+ {
+ // Apply the mass to the parent and remove it from the originating part.
+ partParent.baseMassForCoM += part.baseMassForCoM;
+ part.baseMassForCoM = 0.0;
+
+ // Break out of the recursive loop.
+ break;
+ }
+
+ // Recursively loop through the parent parts.
+ partParent = partParent.parent;
+ }
+ }
+ }
+
+ double totalMass = 0d;
+ for (int i = 0; i < this.allParts.Count; i++)
+ {
+ totalMass += this.allParts[i].startMass = this.allParts[i].GetMass(currentStage);
+ }
+
+ return totalMass;
+ }
+
+ // Make sure we free them all, even if they should all be free already at this point
+ public void FreePooledObject()
+ {
+ //MonoBehaviour.print("FreePooledObject pool size before = " + PartSim.pool.Count() + " for " + allParts.Count + " parts");
+ foreach (PartSim part in allParts)
+ {
+ part.Release();
+ }
+ //MonoBehaviour.print("FreePooledObject pool size after = " + PartSim.pool.Count());
+
+ //MonoBehaviour.print("FreePooledObject pool size before = " + EngineSim.pool.Count() + " for " + allEngines.Count + " engines");
+ foreach (EngineSim engine in allEngines)
+ {
+ engine.Release();
+ }
+ //MonoBehaviour.print("FreePooledObject pool size after = " + EngineSim.pool.Count());
}
private void BuildDontStageLists(LogMsg log)
@@ -663,7 +757,8 @@
{
if (log != null)
{
- log.buf.AppendLine(partSim.name + ":" + partSim.partId + " is engine or tank, decoupled = " + partSim.decoupledInStage);
+ log.buf.AppendLine(
+ partSim.name + ":" + partSim.partId + " is engine or tank, decoupled = " + partSim.decoupledInStage);
}
if (partSim.decoupledInStage < -1 || partSim.decoupledInStage > this.currentStage - 1)
@@ -696,7 +791,6 @@
for (int i = 0; i < allEngines.Count; ++i)
{
EngineSim engine = allEngines[i];
-
if (engine.isActive)
{
this.activeEngines.Add(engine);
@@ -734,9 +828,7 @@
this.totalStageThrustForce.AddForce(engine.appliedForces[j]);
}
}
-
//MonoBehaviour.print("vecThrust = " + vecThrust.ToString() + " magnitude = " + vecThrust.magnitude);
-
this.totalStageThrust = this.vecThrust.magnitude;
this.totalStageActualThrust = this.vecActualThrust.magnitude;
@@ -794,8 +886,9 @@
StringBuilder buffer = new StringBuilder(1024);
buffer.AppendFormat("Active engines = {0:d}\n", this.activeEngines.Count);
int i = 0;
- foreach (EngineSim engine in this.activeEngines)
- {
+ for (int j = 0; j < this.activeEngines.Count; j++)
+ {
+ EngineSim engine = this.activeEngines[j];
engine.DumpEngineToBuffer(buffer, "Engine " + (i++) + ":");
}
MonoBehaviour.print(buffer);
@@ -893,14 +986,17 @@
{
// Remove it from the all parts list
this.allParts.Remove(partSim);
+ partSim.Release();
if (partSim.isEngine)
{
// If it is an engine then loop through all the engine modules and remove all the ones from this engine part
for (int i = this.allEngines.Count - 1; i >= 0; i--)
{
- if (this.allEngines[i].partSim == partSim)
+ EngineSim engine = this.allEngines[i];
+ if (engine.partSim == partSim)
{
this.allEngines.RemoveAt(i);
+ engine.Release();
}
}
}
@@ -912,7 +1008,8 @@
}
// Loop through all the (remaining) parts
- for (int i = 0; i < allParts.Count; ++i) {
+ for (int i = 0; i < allParts.Count; ++i)
+ {
// Ask the part to remove all the parts that are decoupled
allParts[i].RemoveAttachedParts(decoupledParts);
}
@@ -954,3 +1051,4 @@
}
}
}
+
Binary files /dev/null and b/Output/KerbalEngineer/KerbalEngineer differ
Binary files /dev/null and b/Output/KerbalEngineer/KerbalEngineer.Unity.dll differ
Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ
--- /dev/null
+++ b/Output/KerbalEngineer/KerbalEngineer.manifest
@@ -1,1 +1,10 @@
+ManifestFileVersion: 0
+AssetBundleManifest:
+ AssetBundleInfos:
+ Info_0:
+ Name: images
+ Dependencies: {}
+ Info_1:
+ Name: prefabs
+ Dependencies: {}
--- a/Output/KerbalEngineer/KerbalEngineer.version
+++ b/Output/KerbalEngineer/KerbalEngineer.version
@@ -1,17 +1,18 @@
{
- "NAME":"Kerbal Engineer Redux 1.0",
+ "NAME":"Kerbal Engineer Redux",
"URL":"http://ksp-avc.cybutek.net/version.php?id=6",
"VERSION":
{
"MAJOR":1,
"MINOR":0,
- "PATCH":16,
- "BUILD":3
+ "PATCH":19,
+ "BUILD":4
},
"KSP_VERSION":
{
"MAJOR":1,
- "MINOR":0,
+ "MINOR":1,
"PATCH":0
}
}
+
Binary files a/Output/KerbalEngineer/Textures/ToolbarIcon.png and /dev/null differ
Binary files /dev/null and b/Output/KerbalEngineer/images differ
--- /dev/null
+++ b/Output/KerbalEngineer/images.manifest
@@ -1,1 +1,21 @@
+ManifestFileVersion: 0
+CRC: 2833314722
+Hashes:
+ AssetFileHash:
+ serializedVersion: 2
+ Hash: b45648c25b082800bed1fc56179dfff5
+ TypeTreeHash:
+ serializedVersion: 2
+ Hash: 00ffc586b3c4c12c72c7fed589b81235
+HashAppended: 0
+ClassTypes:
+- Class: 28
+ Script: {instanceID: 0}
+- Class: 213
+ Script: {instanceID: 0}
+Assets:
+- Assets/Images/ui-drop-down.psd
+- Assets/Images/app-launcher-icon.psd
+- Assets/Images/flight-menu-background.psd
+Dependencies: []
Binary files /dev/null and b/Output/KerbalEngineer/prefabs differ
--- /dev/null
+++ b/Output/KerbalEngineer/prefabs.manifest
@@ -1,1 +1,50 @@
+ManifestFileVersion: 0
+CRC: 606732409
+Hashes:
+ AssetFileHash:
+ serializedVersion: 2
+ Hash: 1c8469db3b91f639cfcf44abac8c6dde
+ TypeTreeHash:
+ serializedVersion: 2
+ Hash: 175d221435a1539bf65dcce68b2c4bb2
+HashAppended: 0
+ClassTypes:
+- Class: 1
+ Script: {instanceID: 0}
+- Class: 21
+ Script: {instanceID: 0}
+- Class: 28
+ Script: {instanceID: 0}
+- Class: 48
+ Script: {instanceID: 0}
+- Class: 114
+ Script: {fileID: 1741964061, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+- Class: 114
+ Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+- Class: 114
+ Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+- Class: 114
+ Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+- Class: 114
+ Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+- Class: 114
+ Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
+- Class: 114
+ Script: {fileID: 571159103, guid: a3a55138b08428847a08c7b48fe72efe, type: 3}
+- Class: 114
+ Script: {fileID: -1842827791, guid: a3a55138b08428847a08c7b48fe72efe, type: 3}
+- Class: 115
+ Script: {instanceID: 0}
+- Class: 128
+ Script: {instanceID: 0}
+- Class: 222
+ Script: {instanceID: 0}
+- Class: 224
+ Script: {instanceID: 0}
+- Class: 225
+ Script: {instanceID: 0}
+Assets:
+- Assets/Prefabs/FlightMenuSection.prefab
+- Assets/Prefabs/FlightMenu.prefab
+Dependencies: []
--- /dev/null
+++ b/ProjectSettings/AudioManager.asset
@@ -1,1 +1,16 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!11 &1
+AudioManager:
+ m_ObjectHideFlags: 0
+ m_Volume: 1
+ Rolloff Scale: 1
+ Doppler Factor: 1
+ Default Speaker Mode: 2
+ m_SampleRate: 0
+ m_DSPBufferSize: 0
+ m_VirtualVoiceCount: 512
+ m_RealVoiceCount: 32
+ m_SpatializerPlugin:
+ m_DisableAudio: 0
--- /dev/null
+++ b/ProjectSettings/DynamicsManager.asset
@@ -1,1 +1,16 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!55 &1
+PhysicsManager:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Gravity: {x: 0, y: -9.81000042, z: 0}
+ m_DefaultMaterial: {fileID: 0}
+ m_BounceThreshold: 2
+ m_SleepThreshold: .00499999989
+ m_DefaultContactOffset: .00999999978
+ m_SolverIterationCount: 6
+ m_QueriesHitTriggers: 1
+ m_EnableAdaptiveForce: 0
+ m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
--- /dev/null
+++ b/ProjectSettings/EditorBuildSettings.asset
@@ -1,1 +1,8 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1045 &1
+EditorBuildSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Scenes: []
--- /dev/null
+++ b/ProjectSettings/EditorSettings.asset
@@ -1,1 +1,16 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!159 &1
+EditorSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 3
+ m_ExternalVersionControlSupport: Visible Meta Files
+ m_SerializationMode: 2
+ m_WebSecurityEmulationEnabled: 0
+ m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d
+ m_DefaultBehaviorMode: 1
+ m_SpritePackerMode: 2
+ m_SpritePackerPaddingPower: 1
+ m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd
+ m_ProjectGenerationRootNamespace:
--- /dev/null
+++ b/ProjectSettings/GraphicsSettings.asset
@@ -1,1 +1,35 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!30 &1
+GraphicsSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 4
+ m_Deferred:
+ m_Mode: 1
+ m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
+ m_DeferredReflections:
+ m_Mode: 1
+ m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
+ m_LegacyDeferred:
+ m_Mode: 1
+ m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
+ m_AlwaysIncludedShaders:
+ - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
+ - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
+ - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
+ - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
+ - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
+ - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0}
+ m_PreloadedShaders: []
+ m_LightmapStripping: 0
+ m_LightmapKeepPlain: 1
+ m_LightmapKeepDirCombined: 1
+ m_LightmapKeepDirSeparate: 1
+ m_LightmapKeepDynamicPlain: 1
+ m_LightmapKeepDynamicDirCombined: 1
+ m_LightmapKeepDynamicDirSeparate: 1
+ m_FogStripping: 0
+ m_FogKeepLinear: 1
+ m_FogKeepExp: 1
+ m_FogKeepExp2: 1
--- /dev/null
+++ b/ProjectSettings/InputManager.asset
@@ -1,1 +1,296 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!13 &1
+InputManager:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Axes:
+ - serializedVersion: 3
+ m_Name: Horizontal
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton: left
+ positiveButton: right
+ altNegativeButton: a
+ altPositiveButton: d
+ gravity: 3
+ dead: .00100000005
+ sensitivity: 3
+ snap: 1
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Vertical
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton: down
+ positiveButton: up
+ altNegativeButton: s
+ altPositiveButton: w
+ gravity: 3
+ dead: .00100000005
+ sensitivity: 3
+ snap: 1
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Fire1
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton: left ctrl
+ altNegativeButton:
+ altPositiveButton: mouse 0
+ gravity: 1000
+ dead: .00100000005
+ sensitivity: 1000
+ snap: 0
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Fire2
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton: left alt
+ altNegativeButton:
+ altPositiveButton: mouse 1
+ gravity: 1000
+ dead: .00100000005
+ sensitivity: 1000
+ snap: 0
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Fire3
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton: left shift
+ altNegativeButton:
+ altPositiveButton: mouse 2
+ gravity: 1000
+ dead: .00100000005
+ sensitivity: 1000
+ snap: 0
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Jump
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton: space
+ altNegativeButton:
+ altPositiveButton:
+ gravity: 1000
+ dead: .00100000005
+ sensitivity: 1000
+ snap: 0
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Mouse X
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton:
+ altNegativeButton:
+ altPositiveButton:
+ gravity: 0
+ dead: 0
+ sensitivity: .100000001
+ snap: 0
+ invert: 0
+ type: 1
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Mouse Y
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton:
+ altNegativeButton:
+ altPositiveButton:
+ gravity: 0
+ dead: 0
+ sensitivity: .100000001
+ snap: 0
+ invert: 0
+ type: 1
+ axis: 1
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Mouse ScrollWheel
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton:
+ altNegativeButton:
+ altPositiveButton:
+ gravity: 0
+ dead: 0
+ sensitivity: .100000001
+ snap: 0
+ invert: 0
+ type: 1
+ axis: 2
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Horizontal
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton:
+ altNegativeButton:
+ altPositiveButton:
+ gravity: 0
+ dead: .189999998
+ sensitivity: 1
+ snap: 0
+ invert: 0
+ type: 2
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Vertical
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton:
+ altNegativeButton:
+ altPositiveButton:
+ gravity: 0
+ dead: .189999998
+ sensitivity: 1
+ snap: 0
+ invert: 1
+ type: 2
+ axis: 1
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Fire1
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton: joystick button 0
+ altNegativeButton:
+ altPositiveButton:
+ gravity: 1000
+ dead: .00100000005
+ sensitivity: 1000
+ snap: 0
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Fire2
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton: joystick button 1
+ altNegativeButton:
+ altPositiveButton:
+ gravity: 1000
+ dead: .00100000005
+ sensitivity: 1000
+ snap: 0
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Fire3
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton: joystick button 2
+ altNegativeButton:
+ altPositiveButton:
+ gravity: 1000
+ dead: .00100000005
+ sensitivity: 1000
+ snap: 0
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Jump
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton: joystick button 3
+ altNegativeButton:
+ altPositiveButton:
+ gravity: 1000
+ dead: .00100000005
+ sensitivity: 1000
+ snap: 0
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Submit
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton: return
+ altNegativeButton:
+ altPositiveButton: joystick button 0
+ gravity: 1000
+ dead: .00100000005
+ sensitivity: 1000
+ snap: 0
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Submit
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton: enter
+ altNegativeButton:
+ altPositiveButton: space
+ gravity: 1000
+ dead: .00100000005
+ sensitivity: 1000
+ snap: 0
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
+ - serializedVersion: 3
+ m_Name: Cancel
+ descriptiveName:
+ descriptiveNegativeName:
+ negativeButton:
+ positiveButton: escape
+ altNegativeButton:
+ altPositiveButton: joystick button 1
+ gravity: 1000
+ dead: .00100000005
+ sensitivity: 1000
+ snap: 0
+ invert: 0
+ type: 0
+ axis: 0
+ joyNum: 0
--- /dev/null
+++ b/ProjectSettings/NavMeshAreas.asset
@@ -1,1 +1,72 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!126 &1
+NavMeshAreas:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ areas:
+ - name: Walkable
+ cost: 1
+ - name: Not Walkable
+ cost: 1
+ - name: Jump
+ cost: 2
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
+ - name:
+ cost: 1
--- /dev/null
+++ b/ProjectSettings/NetworkManager.asset
@@ -1,1 +1,9 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!149 &1
+NetworkManager:
+ m_ObjectHideFlags: 0
+ m_DebugLevel: 0
+ m_Sendrate: 15
+ m_AssetToPrefab: {}
--- /dev/null
+++ b/ProjectSettings/Physics2DSettings.asset
@@ -1,1 +1,26 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!19 &1
+Physics2DSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Gravity: {x: 0, y: -9.81000042}
+ m_DefaultMaterial: {fileID: 0}
+ m_VelocityIterations: 8
+ m_PositionIterations: 3
+ m_VelocityThreshold: 1
+ m_MaxLinearCorrection: .200000003
+ m_MaxAngularCorrection: 8
+ m_MaxTranslationSpeed: 100
+ m_MaxRotationSpeed: 360
+ m_MinPenetrationForPenalty: .00999999978
+ m_BaumgarteScale: .200000003
+ m_BaumgarteTimeOfImpactScale: .75
+ m_TimeToSleep: .5
+ m_LinearSleepTolerance: .00999999978
+ m_AngularSleepTolerance: 2
+ m_QueriesHitTriggers: 1
+ m_QueriesStartInColliders: 1
+ m_ChangeStopsCallbacks: 0
+ m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
--- /dev/null
+++ b/ProjectSettings/ProjectSettings.asset
@@ -1,1 +1,487 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!129 &1
+PlayerSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 7
+ AndroidProfiler: 0
+ defaultScreenOrientation: 4
+ targetDevice: 2
+ targetResolution: 0
+ useOnDemandResources: 0
+ accelerometerFrequency: 60
+ companyName: DefaultCompany
+ productName: New Unity Project
+ defaultCursor: {fileID: 0}
+ cursorHotspot: {x: 0, y: 0}
+ m_ShowUnitySplashScreen: 1
+ defaultScreenWidth: 1024
+ defaultScreenHeight: 768
+ defaultScreenWidthWeb: 960
+ defaultScreenHeightWeb: 600
+ m_RenderingPath: 1
+ m_MobileRenderingPath: 1
+ m_ActiveColorSpace: 0
+ m_MTRendering: 1
+ m_MobileMTRendering: 0
+ m_Stereoscopic3D: 0
+ iosShowActivityIndicatorOnLoading: -1
+ androidShowActivityIndicatorOnLoading: -1
+ iosAppInBackgroundBehavior: 0
+ displayResolutionDialog: 1
+ iosAllowHTTPDownload: 1
+ allowedAutorotateToPortrait: 1
+ allowedAutorotateToPortraitUpsideDown: 1
+ allowedAutorotateToLandscapeRight: 1
+ allowedAutorotateToLandscapeLeft: 1
+ useOSAutorotation: 1
+ use32BitDisplayBuffer: 1
+ disableDepthAndStencilBuffers: 0
+ defaultIsFullScreen: 1
+ defaultIsNativeResolution: 1
+ runInBackground: 0
+ captureSingleScreen: 0
+ Override IPod Music: 0
+ Prepare IOS For Recording: 0
+ submitAnalytics: 1
+ usePlayerLog: 1
+ bakeCollisionMeshes: 0
+ forceSingleInstance: 0
+ resizableWindow: 0
+ useMacAppStoreValidation: 0
+ gpuSkinning: 0
+ xboxPIXTextureCapture: 0
+ xboxEnableAvatar: 0
+ xboxEnableKinect: 0
+ xboxEnableKinectAutoTracking: 0
+ xboxEnableFitness: 0
+ visibleInBackground: 0
+ macFullscreenMode: 2
+ d3d9FullscreenMode: 1
+ d3d11FullscreenMode: 1
+ xboxSpeechDB: 0
+ xboxEnableHeadOrientation: 0
+ xboxEnableGuest: 0
+ n3dsDisableStereoscopicView: 0
+ n3dsEnableSharedListOpt: 1
+ n3dsEnableVSync: 0
+ xboxOneResolution: 0
+ ps3SplashScreen: {fileID: 0}
+ videoMemoryForVertexBuffers: 0
+ psp2PowerMode: 0
+ psp2AcquireBGM: 1
+ wiiUTVResolution: 0
+ wiiUGamePadMSAA: 1
+ wiiUSupportsNunchuk: 0
+ wiiUSupportsClassicController: 0
+ wiiUSupportsBalanceBoard: 0
+ wiiUSupportsMotionPlus: 0
+ wiiUSupportsProController: 0
+ wiiUAllowScreenCapture: 1
+ wiiUControllerCount: 0
+ m_SupportedAspectRatios:
+ 4:3: 1
+ 5:4: 1
+ 16:10: 1
+ 16:9: 1
+ Others: 1
+ bundleIdentifier: com.Company.ProductName
+ bundleVersion: 1.0
+ preloadedAssets: []
+ metroEnableIndependentInputSource: 0
+ metroEnableLowLatencyPresentationAPI: 0
+ xboxOneDisableKinectGpuReservation: 0
+ virtualRealitySupported: 0
+ productGUID: affd9915876e7bc42a4bf20f2a215263
+ AndroidBundleVersionCode: 1
+ AndroidMinSdkVersion: 9
+ AndroidPreferredInstallLocation: 1
+ aotOptions:
+ apiCompatibilityLevel: 2
+ stripEngineCode: 1
+ iPhoneStrippingLevel: 0
+ iPhoneScriptCallOptimization: 0
+ iPhoneBuildNumber: 0
+ ForceInternetPermission: 0
+ ForceSDCardPermission: 0
+ CreateWallpaper: 0
+ APKExpansionFiles: 0
+ preloadShaders: 0
+ StripUnusedMeshComponents: 0
+ VertexChannelCompressionMask:
+ serializedVersion: 2
+ m_Bits: 238
+ iPhoneSdkVersion: 988
+ iPhoneTargetOSVersion: 22
+ uIPrerenderedIcon: 0
+ uIRequiresPersistentWiFi: 0
+ uIRequiresFullScreen: 1
+ uIStatusBarHidden: 1
+ uIExitOnSuspend: 0
+ uIStatusBarStyle: 0
+ iPhoneSplashScreen: {fileID: 0}
+ iPhoneHighResSplashScreen: {fileID: 0}
+ iPhoneTallHighResSplashScreen: {fileID: 0}
+ iPhone47inSplashScreen: {fileID: 0}
+ iPhone55inPortraitSplashScreen: {fileID: 0}
+ iPhone55inLandscapeSplashScreen: {fileID: 0}
+ iPadPortraitSplashScreen: {fileID: 0}
+ iPadHighResPortraitSplashScreen: {fileID: 0}
+ iPadLandscapeSplashScreen: {fileID: 0}
+ iPadHighResLandscapeSplashScreen: {fileID: 0}
+ iOSLaunchScreenType: 0
+ iOSLaunchScreenPortrait: {fileID: 0}
+ iOSLaunchScreenLandscape: {fileID: 0}
+ iOSLaunchScreenBackgroundColor:
+ serializedVersion: 2
+ rgba: 0
+ iOSLaunchScreenFillPct: 100
+ iOSLaunchScreenSize: 100
+ iOSLaunchScreenCustomXibPath:
+ iOSLaunchScreeniPadType: 0
+ iOSLaunchScreeniPadImage: {fileID: 0}
+ iOSLaunchScreeniPadBackgroundColor:
+ serializedVersion: 2
+ rgba: 0
+ iOSLaunchScreeniPadFillPct: 100
+ iOSLaunchScreeniPadSize: 100
+ iOSLaunchScreeniPadCustomXibPath:
+ iOSDeviceRequirements: []
+ AndroidTargetDevice: 0
+ AndroidSplashScreenScale: 0
+ androidSplashScreen: {fileID: 0}
+ AndroidKeystoreName:
+ AndroidKeyaliasName:
+ AndroidTVCompatibility: 1
+ AndroidIsGame: 1
+ androidEnableBanner: 1
+ m_AndroidBanners:
+ - width: 320
+ height: 180
+ banner: {fileID: 0}
+ androidGamepadSupportLevel: 0
+ resolutionDialogBanner: {fileID: 0}
+ m_BuildTargetIcons: []
+ m_BuildTargetBatching: []
+ m_BuildTargetGraphicsAPIs: []
+ webPlayerTemplate: APPLICATION:Default
+ m_TemplateCustomTags: {}
+ wiiUTitleID: 0005000011000000
+ wiiUGroupID: 00010000
+ wiiUCommonSaveSize: 4096
+ wiiUAccountSaveSize: 2048
+ wiiUOlvAccessKey: 0
+ wiiUTinCode: 0
+ wiiUJoinGameId: 0
+ wiiUJoinGameModeMask: 0000000000000000
+ wiiUCommonBossSize: 0
+ wiiUAccountBossSize: 0
+ wiiUAddOnUniqueIDs: []
+ wiiUMainThreadStackSize: 3072
+ wiiULoaderThreadStackSize: 1024
+ wiiUSystemHeapSize: 128
+ wiiUTVStartupScreen: {fileID: 0}
+ wiiUGamePadStartupScreen: {fileID: 0}
+ wiiUProfilerLibPath:
+ actionOnDotNetUnhandledException: 1
+ enableInternalProfiler: 0
+ logObjCUncaughtExceptions: 1
+ enableCrashReportAPI: 0
+ locationUsageDescription:
+ XboxTitleId:
+ XboxImageXexPath:
+ XboxSpaPath:
+ XboxGenerateSpa: 0
+ XboxDeployKinectResources: 0
+ XboxSplashScreen: {fileID: 0}
+ xboxEnableSpeech: 0
+ xboxAdditionalTitleMemorySize: 0
+ xboxDeployKinectHeadOrientation: 0
+ xboxDeployKinectHeadPosition: 0
+ ps3TitleConfigPath:
+ ps3DLCConfigPath:
+ ps3ThumbnailPath:
+ ps3BackgroundPath:
+ ps3SoundPath:
+ ps3NPAgeRating: 12
+ ps3TrophyCommId:
+ ps3NpCommunicationPassphrase:
+ ps3TrophyPackagePath:
+ ps3BootCheckMaxSaveGameSizeKB: 128
+ ps3TrophyCommSig:
+ ps3SaveGameSlots: 1
+ ps3TrialMode: 0
+ ps3VideoMemoryForAudio: 0
+ ps3EnableVerboseMemoryStats: 0
+ ps3UseSPUForUmbra: 0
+ ps3EnableMoveSupport: 1
+ ps3DisableDolbyEncoding: 0
+ ps4NPAgeRating: 12
+ ps4NPTitleSecret:
+ ps4NPTrophyPackPath:
+ ps4ParentalLevel: 1
+ ps4ContentID: ED1633-NPXX51362_00-0000000000000000
+ ps4Category: 0
+ ps4MasterVersion: 01.00
+ ps4AppVersion: 01.00
+ ps4AppType: 0
+ ps4ParamSfxPath:
+ ps4VideoOutPixelFormat: 0
+ ps4VideoOutResolution: 4
+ ps4PronunciationXMLPath:
+ ps4PronunciationSIGPath:
+ ps4BackgroundImagePath:
+ ps4StartupImagePath:
+ ps4SaveDataImagePath:
+ ps4SdkOverride:
+ ps4BGMPath:
+ ps4ShareFilePath:
+ ps4ShareOverlayImagePath:
+ ps4PrivacyGuardImagePath:
+ ps4NPtitleDatPath:
+ ps4RemotePlayKeyAssignment: -1
+ ps4RemotePlayKeyMappingDir:
+ ps4EnterButtonAssignment: 1
+ ps4ApplicationParam1: 0
+ ps4ApplicationParam2: 0
+ ps4ApplicationParam3: 0
+ ps4ApplicationParam4: 0
+ ps4DownloadDataSize: 0
+ ps4GarlicHeapSize: 2048
+ ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ
+ ps4pnSessions: 1
+ ps4pnPresence: 1
+ ps4pnFriends: 1
+ ps4pnGameCustomData: 1
+ playerPrefsSupport: 0
+ ps4ReprojectionSupport: 0
+ ps4UseAudio3dBackend: 0
+ ps4Audio3dVirtualSpeakerCount: 14
+ ps4attribCpuUsage: 0
+ ps4SocialScreenEnabled: 0
+ ps4attribUserManagement: 0
+ ps4attribMoveSupport: 0
+ ps4attrib3DSupport: 0
+ ps4attribShareSupport: 0
+ ps4IncludedModules: []
+ monoEnv:
+ psp2Splashimage: {fileID: 0}
+ psp2NPTrophyPackPath:
+ psp2NPSupportGBMorGJP: 0
+ psp2NPAgeRating: 12
+ psp2NPTitleDatPath:
+ psp2NPCommsID:
+ psp2NPCommunicationsID:
+ psp2NPCommsPassphrase:
+ psp2NPCommsSig:
+ psp2ParamSfxPath:
+ psp2ManualPath:
+ psp2LiveAreaGatePath:
+ psp2LiveAreaBackroundPath:
+ psp2LiveAreaPath:
+ psp2LiveAreaTrialPath:
+ psp2PatchChangeInfoPath:
+ psp2PatchOriginalPackage:
+ psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui
+ psp2KeystoneFile:
+ psp2MemoryExpansionMode: 0
+ psp2DRMType: 0
+ psp2StorageType: 0
+ psp2MediaCapacity: 0
+ psp2DLCConfigPath:
+ psp2ThumbnailPath:
+ psp2BackgroundPath:
+ psp2SoundPath:
+ psp2TrophyCommId:
+ psp2TrophyPackagePath:
+ psp2PackagedResourcesPath:
+ psp2SaveDataQuota: 10240
+ psp2ParentalLevel: 1
+ psp2ShortTitle: Not Set
+ psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF
+ psp2Category: 0
+ psp2MasterVersion: 01.00
+ psp2AppVersion: 01.00
+ psp2TVBootMode: 0
+ psp2EnterButtonAssignment: 2
+ psp2TVDisableEmu: 0
+ psp2AllowTwitterDialog: 1
+ psp2Upgradable: 0
+ psp2HealthWarning: 0
+ psp2UseLibLocation: 0
+ psp2InfoBarOnStartup: 0
+ psp2InfoBarColor: 0
+ psmSplashimage: {fileID: 0}
+ spritePackerPolicy:
+ scriptingDefineSymbols: {}
+ metroPackageName: New Unity Project
+ metroPackageLogo:
+ metroPackageLogo140:
+ metroPackageLogo180:
+ metroPackageLogo240:
+ metroPackageVersion:
+ metroCertificatePath:
+ metroCertificatePassword:
+ metroCertificateSubject:
+ metroCertificateIssuer:
+ metroCertificateNotAfter: 0000000000000000
+ metroApplicationDescription: New Unity Project
+ metroStoreTileLogo80:
+ metroStoreTileLogo:
+ metroStoreTileLogo140:
+ metroStoreTileLogo180:
+ metroStoreTileWideLogo80:
+ metroStoreTileWideLogo:
+ metroStoreTileWideLogo140:
+ metroStoreTileWideLogo180:
+ metroStoreTileSmallLogo80:
+ metroStoreTileSmallLogo:
+ metroStoreTileSmallLogo140:
+ metroStoreTileSmallLogo180:
+ metroStoreSmallTile80:
+ metroStoreSmallTile:
+ metroStoreSmallTile140:
+ metroStoreSmallTile180:
+ metroStoreLargeTile80:
+ metroStoreLargeTile:
+ metroStoreLargeTile140:
+ metroStoreLargeTile180:
+ metroStoreSplashScreenImage:
+ metroStoreSplashScreenImage140:
+ metroStoreSplashScreenImage180:
+ metroPhoneAppIcon:
+ metroPhoneAppIcon140:
+ metroPhoneAppIcon240:
+ metroPhoneSmallTile:
+ metroPhoneSmallTile140:
+ metroPhoneSmallTile240:
+ metroPhoneMediumTile:
+ metroPhoneMediumTile140:
+ metroPhoneMediumTile240:
+ metroPhoneWideTile:
+ metroPhoneWideTile140:
+ metroPhoneWideTile240:
+ metroPhoneSplashScreenImage:
+ metroPhoneSplashScreenImage140:
+ metroPhoneSplashScreenImage240:
+ metroTileShortName:
+ metroCommandLineArgsFile:
+ metroTileShowName: 0
+ metroMediumTileShowName: 0
+ metroLargeTileShowName: 0
+ metroWideTileShowName: 0
+ metroDefaultTileSize: 1
+ metroTileForegroundText: 1
+ metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1}
+ metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1}
+ metroSplashScreenUseBackgroundColor: 0
+ platformCapabilities: {}
+ metroFTAName:
+ metroFTAFileTypes: []
+ metroProtocolName:
+ metroCompilationOverrides: 1
+ blackberryDeviceAddress:
+ blackberryDevicePassword:
+ blackberryTokenPath:
+ blackberryTokenExires:
+ blackberryTokenAuthor:
+ blackberryTokenAuthorId:
+ blackberryCskPassword:
+ blackberrySaveLogPath:
+ blackberrySharedPermissions: 0
+ blackberryCameraPermissions: 0
+ blackberryGPSPermissions: 0
+ blackberryDeviceIDPermissions: 0
+ blackberryMicrophonePermissions: 0
+ blackberryGamepadSupport: 0
+ blackberryBuildId: 0
+ blackberryLandscapeSplashScreen: {fileID: 0}
+ blackberryPortraitSplashScreen: {fileID: 0}
+ blackberrySquareSplashScreen: {fileID: 0}
+ tizenProductDescription:
+ tizenProductURL:
+ tizenSigningProfileName:
+ tizenGPSPermissions: 0
+ tizenMicrophonePermissions: 0
+ n3dsUseExtSaveData: 0
+ n3dsCompressStaticMem: 1
+ n3dsExtSaveDataNumber: 0x12345
+ n3dsStackSize: 131072
+ n3dsTargetPlatform: 2
+ n3dsRegion: 7
+ n3dsMediaSize: 0
+ n3dsLogoStyle: 3
+ n3dsTitle: GameName
+ n3dsProductCode:
+ n3dsApplicationId: 0xFF3FF
+ stvDeviceAddress:
+ stvProductDescription:
+ stvProductAuthor:
+ stvProductAuthorEmail:
+ stvProductLink:
+ stvProductCategory: 0
+ XboxOneProductId:
+ XboxOneUpdateKey:
+ XboxOneSandboxId:
+ XboxOneContentId:
+ XboxOneTitleId:
+ XboxOneSCId:
+ XboxOneGameOsOverridePath:
+ XboxOnePackagingOverridePath:
+ XboxOneAppManifestOverridePath:
+ XboxOnePackageEncryption: 0
+ XboxOnePackageUpdateGranularity: 2
+ XboxOneDescription:
+ XboxOneIsContentPackage: 0
+ XboxOneEnableGPUVariability: 0
+ XboxOneSockets: {}
+ XboxOneSplashScreen: {fileID: 0}
+ XboxOneAllowedProductIds: []
+ XboxOnePersistentLocalStorageSize: 0
+ intPropertyNames:
+ - Android::ScriptingBackend
+ - Metro::ScriptingBackend
+ - Standalone::ScriptingBackend
+ - WP8::ScriptingBackend
+ - WebGL::ScriptingBackend
+ - WebGL::audioCompressionFormat
+ - WebGL::exceptionSupport
+ - WebGL::memorySize
+ - WebPlayer::ScriptingBackend
+ - iOS::Architecture
+ - iOS::EnableIncrementalBuildSupportForIl2cpp
+ - iOS::ScriptingBackend
+ Android::ScriptingBackend: 0
+ Metro::ScriptingBackend: 2
+ Standalone::ScriptingBackend: 0
+ WP8::ScriptingBackend: 2
+ WebGL::ScriptingBackend: 1
+ WebGL::audioCompressionFormat: 4
+ WebGL::exceptionSupport: 1
+ WebGL::memorySize: 256
+ WebPlayer::ScriptingBackend: 0
+ iOS::Architecture: 2
+ iOS::EnableIncrementalBuildSupportForIl2cpp: 1
+ iOS::ScriptingBackend: 1
+ boolPropertyNames:
+ - WebGL::analyzeBuildSize
+ - WebGL::dataCaching
+ - WebGL::useEmbeddedResources
+ - XboxOne::enus
+ WebGL::analyzeBuildSize: 0
+ WebGL::dataCaching: 0
+ WebGL::useEmbeddedResources: 0
+ XboxOne::enus: 1
+ stringPropertyNames:
+ - WebGL::emscriptenArgs
+ - WebGL::template
+ - additionalIl2CppArgs::additionalIl2CppArgs
+ WebGL::emscriptenArgs:
+ WebGL::template: APPLICATION:Default
+ additionalIl2CppArgs::additionalIl2CppArgs:
+ firstStreamedSceneWithResources: 0
+ cloudProjectId:
+ projectName:
+ organizationId:
+ cloudEnabled: 0
--- /dev/null
+++ b/ProjectSettings/ProjectVersion.txt
@@ -1,1 +1,3 @@
+m_EditorVersion: 5.2.4f1
+m_StandardAssetsVersion: 0
--- /dev/null
+++ b/ProjectSettings/QualitySettings.asset
@@ -1,1 +1,173 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!47 &1
+QualitySettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 5
+ m_CurrentQuality: 5
+ m_QualitySettings:
+ - serializedVersion: 2
+ name: Fastest
+ pixelLightCount: 0
+ shadows: 0
+ shadowResolution: 0
+ shadowProjection: 1
+ shadowCascades: 1
+ shadowDistance: 15
+ shadowNearPlaneOffset: 2
+ shadowCascade2Split: .333333343
+ shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669}
+ blendWeights: 1
+ textureQuality: 1
+ anisotropicTextures: 0
+ antiAliasing: 0
+ softParticles: 0
+ softVegetation: 0
+ realtimeReflectionProbes: 0
+ billboardsFaceCameraPosition: 0
+ vSyncCount: 0
+ lodBias: .300000012
+ maximumLODLevel: 0
+ particleRaycastBudget: 4
+ excludedTargetPlatforms: []
+ - serializedVersion: 2
+ name: Fast
+ pixelLightCount: 0
+ shadows: 0
+ shadowResolution: 0
+ shadowProjection: 1
+ shadowCascades: 1
+ shadowDistance: 20
+ shadowNearPlaneOffset: 2
+ shadowCascade2Split: .333333343
+ shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669}
+ blendWeights: 2
+ textureQuality: 0
+ anisotropicTextures: 0
+ antiAliasing: 0
+ softParticles: 0
+ softVegetation: 0
+ realtimeReflectionProbes: 0
+ billboardsFaceCameraPosition: 0
+ vSyncCount: 0
+ lodBias: .400000006
+ maximumLODLevel: 0
+ particleRaycastBudget: 16
+ excludedTargetPlatforms: []
+ - serializedVersion: 2
+ name: Simple
+ pixelLightCount: 1
+ shadows: 1
+ shadowResolution: 0
+ shadowProjection: 1
+ shadowCascades: 1
+ shadowDistance: 20
+ shadowNearPlaneOffset: 2
+ shadowCascade2Split: .333333343
+ shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669}
+ blendWeights: 2
+ textureQuality: 0
+ anisotropicTextures: 1
+ antiAliasing: 0
+ softParticles: 0
+ softVegetation: 0
+ realtimeReflectionProbes: 0
+ billboardsFaceCameraPosition: 0
+ vSyncCount: 0
+ lodBias: .699999988
+ maximumLODLevel: 0
+ particleRaycastBudget: 64
+ excludedTargetPlatforms: []
+ - serializedVersion: 2
+ name: Good
+ pixelLightCount: 2
+ shadows: 2
+ shadowResolution: 1
+ shadowProjection: 1
+ shadowCascades: 2
+ shadowDistance: 40
+ shadowNearPlaneOffset: 2
+ shadowCascade2Split: .333333343
+ shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669}
+ blendWeights: 2
+ textureQuality: 0
+ anisotropicTextures: 1
+ antiAliasing: 0
+ softParticles: 0
+ softVegetation: 1
+ realtimeReflectionProbes: 1
+ billboardsFaceCameraPosition: 1
+ vSyncCount: 1
+ lodBias: 1
+ maximumLODLevel: 0
+ particleRaycastBudget: 256
+ excludedTargetPlatforms: []
+ - serializedVersion: 2
+ name: Beautiful
+ pixelLightCount: 3
+ shadows: 2
+ shadowResolution: 2
+ shadowProjection: 1
+ shadowCascades: 2
+ shadowDistance: 70
+ shadowNearPlaneOffset: 2
+ shadowCascade2Split: .333333343
+ shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669}
+ blendWeights: 4
+ textureQuality: 0
+ anisotropicTextures: 2
+ antiAliasing: 2
+ softParticles: 1
+ softVegetation: 1
+ realtimeReflectionProbes: 1
+ billboardsFaceCameraPosition: 1
+ vSyncCount: 1
+ lodBias: 1.5
+ maximumLODLevel: 0
+ particleRaycastBudget: 1024
+ excludedTargetPlatforms: []
+ - serializedVersion: 2
+ name: Fantastic
+ pixelLightCount: 4
+ shadows: 2
+ shadowResolution: 2
+ shadowProjection: 1
+ shadowCascades: 4
+ shadowDistance: 150
+ shadowNearPlaneOffset: 2
+ shadowCascade2Split: .333333343
+ shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669}
+ blendWeights: 4
+ textureQuality: 0
+ anisotropicTextures: 2
+ antiAliasing: 2
+ softParticles: 1
+ softVegetation: 1
+ realtimeReflectionProbes: 1
+ billboardsFaceCameraPosition: 1
+ vSyncCount: 1
+ lodBias: 2
+ maximumLODLevel: 0
+ particleRaycastBudget: 4096
+ excludedTargetPlatforms: []
+ m_PerPlatformDefaultQuality:
+ Android: 2
+ BlackBerry: 2
+ GLES Emulation: 5
+ Nintendo 3DS: 5
+ PS3: 5
+ PS4: 5
+ PSM: 5
+ PSP2: 2
+ Samsung TV: 2
+ Standalone: 5
+ Tizen: 2
+ WP8: 5
+ Web: 5
+ WebGL: 3
+ Wii U: 5
+ Windows Store Apps: 5
+ XBOX360: 5
+ XboxOne: 5
+ iPhone: 2
--- /dev/null
+++ b/ProjectSettings/TagManager.asset
@@ -1,1 +1,44 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!78 &1
+TagManager:
+ serializedVersion: 2
+ tags: []
+ layers:
+ - Default
+ - TransparentFX
+ - Ignore Raycast
+ -
+ - Water
+ - UI
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ m_SortingLayers:
+ - name: Default
+ uniqueID: 0
+ locked: 0
--- /dev/null
+++ b/ProjectSettings/TimeManager.asset
@@ -1,1 +1,9 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!5 &1
+TimeManager:
+ m_ObjectHideFlags: 0
+ Fixed Timestep: .0199999996
+ Maximum Allowed Timestep: .333333343
+ m_TimeScale: 1
--- /dev/null
+++ b/ProjectSettings/UnityAdsSettings.asset
@@ -1,1 +1,12 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!292 &1
+UnityAdsSettings:
+ m_ObjectHideFlags: 0
+ m_Enabled: 0
+ m_InitializeOnStartup: 1
+ m_TestMode: 0
+ m_EnabledPlatforms: 4294967295
+ m_IosGameId:
+ m_AndroidGameId:
--- /dev/null
+++ b/ProjectSettings/UnityAnalyticsManager.asset
@@ -1,1 +1,11 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!303 &1
+UnityAnalyticsManager:
+ m_ObjectHideFlags: 0
+ m_Enabled: 0
+ m_InitializeOnStartup: 1
+ m_TestMode: 0
+ m_TestEventUrl:
+ m_TestConfigUrl:
Binary files /dev/null and b/Publishing/CurseLogo.png differ
Binary files /dev/null and b/Publishing/CurseLogo.psd differ