Altered flight engineer menu button highlight and pressed colours so that they're more noticable.
Binary files a/Assets/Plugins/KerbalEngineer.Unity.dll and b/Assets/Plugins/KerbalEngineer.Unity.dll differ
--- a/Assets/Prefabs/FlightMenu.prefab
+++ b/Assets/Prefabs/FlightMenu.prefab
@@ -354,8 +354,8 @@
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_HighlightedColor: {r: .467545569, g: 1, b: .448529422, a: 1}
+ m_PressedColor: {r: .800000072, g: 1, b: 0, a: 1}
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
m_ColorMultiplier: 1
m_FadeDuration: .100000001
@@ -377,7 +377,7 @@
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11415294}
- m_MethodName: SetControlBar
+ m_MethodName: SetControlBarVisible
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
@@ -445,8 +445,8 @@
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_HighlightedColor: {r: .467545569, g: 1, b: .448529422, a: 1}
+ m_PressedColor: {r: .800000072, g: 1, b: 0, a: 1}
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
m_ColorMultiplier: 1
m_FadeDuration: .100000001
@@ -812,8 +812,8 @@
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_HighlightedColor: {r: .467545569, g: 1, b: .448529422, a: 1}
+ m_PressedColor: {r: .800000072, g: 1, b: 0, a: 1}
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
m_ColorMultiplier: 1
m_FadeDuration: .100000001
@@ -835,7 +835,7 @@
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11415294}
- m_MethodName: SetShowEngineer
+ m_MethodName: SetDisplayStackVisible
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
@@ -1269,7 +1269,7 @@
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_SlowFadeDuration
- value: .300000012
+ value: .200000003
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_ContentTransform
--- a/Assets/Prefabs/FlightMenuSection.prefab
+++ b/Assets/Prefabs/FlightMenuSection.prefab
@@ -202,8 +202,8 @@
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_HighlightedColor: {r: .467545569, g: 1, b: .448529422, a: 1}
+ m_PressedColor: {r: .800000072, g: 1, b: 0, a: 1}
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
m_ColorMultiplier: 1
m_FadeDuration: .100000001
@@ -276,8 +276,8 @@
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_HighlightedColor: {r: .467545569, g: 1, b: .448529422, a: 1}
+ m_PressedColor: {r: .800000072, g: 1, b: 0, a: 1}
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
m_ColorMultiplier: 1
m_FadeDuration: .100000001
@@ -651,6 +651,42 @@
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: SetEditorVisible
objectReference: {fileID: 0}
+ - target: {fileID: 0}
+ propertyPath: m_Colors.m_NormalColor.r
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 0}
+ propertyPath: m_Colors.m_NormalColor.b
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 0}
+ propertyPath: m_Colors.m_HighlightedColor.r
+ value: .467545569
+ objectReference: {fileID: 0}
+ - target: {fileID: 0}
+ propertyPath: m_Colors.m_HighlightedColor.g
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 0}
+ propertyPath: m_Colors.m_HighlightedColor.b
+ value: .448529422
+ objectReference: {fileID: 0}
+ - target: {fileID: 0}
+ propertyPath: m_Colors.m_NormalColor.g
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 0}
+ propertyPath: m_Colors.m_PressedColor.r
+ value: .800000072
+ objectReference: {fileID: 0}
+ - target: {fileID: 0}
+ propertyPath: m_Colors.m_PressedColor.g
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 0}
+ propertyPath: m_Colors.m_PressedColor.b
+ value: 0
+ objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 130812}
--- a/Assets/Scenes/main.unity
+++ b/Assets/Scenes/main.unity
@@ -347,9 +347,65 @@
propertyPath: m_SizeDelta.y
value: 54
objectReference: {fileID: 0}
- - target: {fileID: 11465882, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
- propertyPath: m_Text
- value: NEW CUSTOM SECTION
+ - target: {fileID: 11415068, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
+ value: SetControlBarVisible
+ objectReference: {fileID: 0}
+ - target: {fileID: 11485338, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
+ value: SetDisplayStackVisible
+ objectReference: {fileID: 0}
+ - target: {fileID: 11485338, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_HighlightedColor.r
+ value: .467545569
+ objectReference: {fileID: 0}
+ - target: {fileID: 11485338, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_HighlightedColor.g
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 11485338, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_HighlightedColor.b
+ value: .448529422
+ objectReference: {fileID: 0}
+ - target: {fileID: 11485338, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_PressedColor.r
+ value: .800000072
+ objectReference: {fileID: 0}
+ - target: {fileID: 11485338, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_PressedColor.g
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 11485338, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_PressedColor.b
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 11485338, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_PressedColor.a
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 11415068, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_HighlightedColor.r
+ value: .467545569
+ objectReference: {fileID: 0}
+ - target: {fileID: 11415068, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_HighlightedColor.g
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 11415068, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_HighlightedColor.b
+ value: .448529422
+ objectReference: {fileID: 0}
+ - target: {fileID: 11415068, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_PressedColor.r
+ value: .800000072
+ objectReference: {fileID: 0}
+ - target: {fileID: 11415068, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_PressedColor.g
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 11415068, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
+ propertyPath: m_Colors.m_PressedColor.b
+ value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: a41f85cb0b8964f43947e85b3e833c0f, type: 2}
--- a/KerbalEngineer.Unity/CanvasGroupFader.cs
+++ b/KerbalEngineer.Unity/CanvasGroupFader.cs
@@ -28,7 +28,7 @@
private CanvasGroup m_CanvasGroup;
private IEnumerator m_FadeCoroutine;
- public bool fading
+ public bool IsFading
{
get
{
@@ -88,6 +88,9 @@
/// </summary>
private IEnumerator FadeCoroutine(float from, float to, float duration, Action callback)
{
+ // wait for end of frame so that only the last call to fade that frame is honoured.
+ yield return new WaitForEndOfFrame();
+
float progress = 0.0f;
while (progress <= 1.0f)
--- a/KerbalEngineer.Unity/Flight/FlightMenu.cs
+++ b/KerbalEngineer.Unity/Flight/FlightMenu.cs
@@ -45,7 +45,6 @@
private float m_SlowFadeDuration = 1.0f;
private IFlightAppLauncher m_FlightAppLauncher;
-
private RectTransform m_RectTransform;
public void OnPointerEnter(PointerEventData eventData)
@@ -56,7 +55,7 @@
public void OnPointerExit(PointerEventData eventData)
{
// slow-fade out if the application launcher button is off
- if (m_FlightAppLauncher != null && m_FlightAppLauncher.isOn == false)
+ if (m_FlightAppLauncher != null && m_FlightAppLauncher.IsOn == false)
{
FadeTo(0.0f, m_SlowFadeDuration, Destroy);
}
@@ -92,11 +91,22 @@
/// <summary>
/// Sets the control bar visiblity.
/// </summary>
- public void SetControlBar(bool visible)
+ public void SetControlBarVisible(bool visible)
{
if (m_FlightAppLauncher != null)
{
- m_FlightAppLauncher.controlBar = visible;
+ m_FlightAppLauncher.IsControlBarVisible = visible;
+ }
+ }
+
+ /// <summary>
+ /// Sets the display stack visibility.
+ /// </summary>
+ public void SetDisplayStackVisible(bool visible)
+ {
+ if (m_FlightAppLauncher != null)
+ {
+ m_FlightAppLauncher.IsDisplayStackVisible = visible;
}
}
@@ -117,17 +127,6 @@
CreateSectionControls(m_FlightAppLauncher.GetCustomSections());
}
- /// <summary>
- /// Sets the display stack visibility.
- /// </summary>
- public void SetShowEngineer(bool visible)
- {
- if (m_FlightAppLauncher != null)
- {
- m_FlightAppLauncher.showEngineer = visible;
- }
- }
-
protected override void Awake()
{
base.Awake();
@@ -151,8 +150,8 @@
}
// set toggle states to match the actual states
- SetToggle(m_ShowEngineerToggle, m_FlightAppLauncher.showEngineer);
- SetToggle(m_ControlBarToggle, m_FlightAppLauncher.controlBar);
+ SetToggle(m_ShowEngineerToggle, m_FlightAppLauncher.IsDisplayStackVisible);
+ SetToggle(m_ControlBarToggle, m_FlightAppLauncher.IsControlBarVisible);
// update anchor position
if (m_RectTransform != null)
--- a/KerbalEngineer.Unity/Flight/FlightMenuSection.cs
+++ b/KerbalEngineer.Unity/Flight/FlightMenuSection.cs
@@ -37,7 +37,7 @@
/// <summary>
/// Gets or sets the section's editor visibility.
/// </summary>
- public bool editorVisible
+ public bool IsEditorVisible
{
get
{
--- a/KerbalEngineer.Unity/Flight/IFlightAppLauncher.cs
+++ b/KerbalEngineer.Unity/Flight/IFlightAppLauncher.cs
@@ -23,11 +23,11 @@
public interface IFlightAppLauncher
{
- bool controlBar { get; set; }
+ bool IsControlBarVisible { get; set; }
- bool isOn { get; }
+ bool IsDisplayStackVisible { get; set; }
- bool showEngineer { get; set; }
+ bool IsOn { get; }
void ClampToScreen(RectTransform rectTransform);
--- a/KerbalEngineer/AppLauncherButton.cs
+++ b/KerbalEngineer/AppLauncherButton.cs
@@ -30,7 +30,7 @@
/// <summary>
/// Gets or sets the toggle button state.
/// </summary>
- public bool isOn
+ public bool IsOn
{
get
{
@@ -77,7 +77,7 @@
m_Button.Enable();
}
}
-
+
/// <summary>
/// Gets the anchor position for pop-up content.
/// </summary>
@@ -87,7 +87,7 @@
{
return Vector3.zero;
}
-
+
Vector3 anchor = m_Button.GetAnchor();
anchor.x -= 3.0f;
@@ -124,9 +124,9 @@
protected virtual void Awake()
{
// cache icon texture
- if (m_IconTexture == null && AssetBundleLoader.images != null)
- {
- m_IconTexture = AssetBundleLoader.images.LoadAsset<Texture2D>("app-launcher-icon");
+ if (m_IconTexture == null && AssetBundleLoader.Images != null)
+ {
+ m_IconTexture = AssetBundleLoader.Images.LoadAsset<Texture2D>("app-launcher-icon");
}
// subscribe event listeners
--- a/KerbalEngineer/AssetBundleLoader.cs
+++ b/KerbalEngineer/AssetBundleLoader.cs
@@ -29,7 +29,7 @@
/// <summary>
/// Gets the loaded images asset bundle.
/// </summary>
- public static AssetBundle images
+ public static AssetBundle Images
{
get
{
@@ -40,7 +40,7 @@
/// <summary>
/// Gets the loaded prefabs asset bundle.
/// </summary>
- public static AssetBundle prefabs
+ public static AssetBundle Prefabs
{
get
{
--- a/KerbalEngineer/Editor/BuildAppLauncher.cs
+++ b/KerbalEngineer/Editor/BuildAppLauncher.cs
@@ -48,7 +48,7 @@
if (EditorLogic.RootPart != null)
{
// set button state based on existing visibility
- isOn = BuildAdvanced.Instance.Visible;
+ IsOn = BuildAdvanced.Instance.Visible;
}
else
{
--- a/KerbalEngineer/Flight/FlightAppLauncher.cs
+++ b/KerbalEngineer/Flight/FlightAppLauncher.cs
@@ -35,7 +35,7 @@
/// <summary>
/// Gets the current instance of the FlightAppLauncher object.
/// </summary>
- public static FlightAppLauncher instance
+ public static FlightAppLauncher Instance
{
get
{
@@ -52,9 +52,25 @@
}
/// <summary>
+ /// Gets a list of custom sections.
+ /// </summary>
+ IList<ISectionModule> IFlightAppLauncher.GetCustomSections()
+ {
+ return new List<ISectionModule>(SectionLibrary.CustomSections.ToArray());
+ }
+
+ /// <summary>
+ /// Gets a list of stock sections.
+ /// </summary>
+ public IList<ISectionModule> GetStockSections()
+ {
+ return new List<ISectionModule>(SectionLibrary.StockSections.ToArray());
+ }
+
+ /// <summary>
/// Gets or sets the control bar's visibility.
/// </summary>
- public bool controlBar
+ public bool IsControlBarVisible
{
get
{
@@ -75,25 +91,9 @@
}
/// <summary>
- /// Gets a list of custom sections.
- /// </summary>
- IList<ISectionModule> IFlightAppLauncher.GetCustomSections()
- {
- return new List<ISectionModule>(SectionLibrary.CustomSections.ToArray());
- }
-
- /// <summary>
- /// Gets a list of stock sections.
- /// </summary>
- public IList<ISectionModule> GetStockSections()
- {
- return new List<ISectionModule>(SectionLibrary.StockSections.ToArray());
- }
-
- /// <summary>
/// Gets or sets the display stack's visibility.
/// </summary>
- public bool showEngineer
+ public bool IsDisplayStackVisible
{
get
{
@@ -140,9 +140,9 @@
m_Instance = this;
// cache menu prefab
- if (m_MenuPrefab == null && AssetBundleLoader.prefabs != null)
- {
- m_MenuPrefab = AssetBundleLoader.prefabs.LoadAsset<GameObject>("FlightMenu");
+ if (m_MenuPrefab == null && AssetBundleLoader.Prefabs != null)
+ {
+ m_MenuPrefab = AssetBundleLoader.Prefabs.LoadAsset<GameObject>("FlightMenu");
}
}
@@ -158,7 +158,7 @@
protected override void OnHoverOut()
{
- if (isOn == false)
+ if (IsOn == false)
{
Close();
}
Binary files a/Output/KerbalEngineer/KerbalEngineer and b/Output/KerbalEngineer/KerbalEngineer differ
Binary files a/Output/KerbalEngineer/KerbalEngineer.Unity.dll and b/Output/KerbalEngineer/KerbalEngineer.Unity.dll differ
Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ
Binary files a/Output/KerbalEngineer/prefabs and b/Output/KerbalEngineer/prefabs differ
--- a/Output/KerbalEngineer/prefabs.manifest
+++ b/Output/KerbalEngineer/prefabs.manifest
@@ -1,9 +1,9 @@
ManifestFileVersion: 0
-CRC: 3151923579
+CRC: 3889460463
Hashes:
AssetFileHash:
serializedVersion: 2
- Hash: 190dda20513d4497692c3a813ba1392f
+ Hash: dc7af1c2d3aa8684359541d179f53bae
TypeTreeHash:
serializedVersion: 2
Hash: a43c45227b2ed7e5db39229032ceda8b