From 8cb63cf4f73c54ae6e187c767a7db0c7cb79d7df Mon Sep 17 00:00:00 2001 From: Koosemose Date: Fri, 17 Feb 2017 23:35:19 -0500 Subject: [PATCH 01/12] Canvas Rescaler --- Assets/UIRescaler.cs | 28 ++++++++++++++++++++++++++++ Assets/UIRescaler.cs.meta | 12 ++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Assets/UIRescaler.cs create mode 100644 Assets/UIRescaler.cs.meta diff --git a/Assets/UIRescaler.cs b/Assets/UIRescaler.cs new file mode 100644 index 000000000..84df2d062 --- /dev/null +++ b/Assets/UIRescaler.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using System.Collections; +using UnityEngine; +using UnityEngine.UI; + +public class UIRescaler : MonoBehaviour { + public int lastScreenWidth = 0; + + void Start(){ + lastScreenWidth = Screen.width; + StartCoroutine("AdjustScale"); + Debug.LogWarning(lastScreenWidth); + } + + void Update(){ + if( lastScreenWidth != Screen.width ){ + lastScreenWidth = Screen.width; + StartCoroutine("AdjustScale"); + } + + } + + IEnumerator AdjustScale(){ + Debug.LogWarning(lastScreenWidth); + this.GetComponent().scaleFactor = Screen.width / 1920f; + yield return null; + } +} \ No newline at end of file diff --git a/Assets/UIRescaler.cs.meta b/Assets/UIRescaler.cs.meta new file mode 100644 index 000000000..bedb7684f --- /dev/null +++ b/Assets/UIRescaler.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2125ec9446c957546833e5124271beda +timeCreated: 1487391455 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 0f870f06bc1f778905b2f7ea12f1dd90a0218fb5 Mon Sep 17 00:00:00 2001 From: Koosemose Date: Fri, 17 Feb 2017 23:45:25 -0500 Subject: [PATCH 02/12] Stylecop --- Assets/UIRescaler.cs | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Assets/UIRescaler.cs b/Assets/UIRescaler.cs index 84df2d062..195aee48f 100644 --- a/Assets/UIRescaler.cs +++ b/Assets/UIRescaler.cs @@ -1,27 +1,38 @@ -using System.Collections.Generic; +#region License +// ==================================================== +// Project Porcupine Copyright(C) 2016 Team Porcupine +// This program comes with ABSOLUTELY NO WARRANTY; This is free software, +// and you are welcome to redistribute it under certain conditions; See +// file LICENSE, which is part of this source code package, for details. +// ==================================================== +#endregion + using System.Collections; using UnityEngine; using UnityEngine.UI; -public class UIRescaler : MonoBehaviour { +public class UIRescaler : MonoBehaviour +{ public int lastScreenWidth = 0; - void Start(){ + public void Start() + { lastScreenWidth = Screen.width; StartCoroutine("AdjustScale"); Debug.LogWarning(lastScreenWidth); } - void Update(){ - if( lastScreenWidth != Screen.width ){ + public void Update() + { + if (lastScreenWidth != Screen.width) + { lastScreenWidth = Screen.width; StartCoroutine("AdjustScale"); } - } - IEnumerator AdjustScale(){ - Debug.LogWarning(lastScreenWidth); + private IEnumerator AdjustScale() + { this.GetComponent().scaleFactor = Screen.width / 1920f; yield return null; } From 4a66d9ae08a3189bc2575799675ea2232bdccf90 Mon Sep 17 00:00:00 2001 From: Koosemose Date: Sun, 19 Feb 2017 23:26:30 -0500 Subject: [PATCH 03/12] Save Scene Changes --- Assets/_Scenes_/_World.unity | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Assets/_Scenes_/_World.unity b/Assets/_Scenes_/_World.unity index bc2108602..90fdd064e 100644 --- a/Assets/_Scenes_/_World.unity +++ b/Assets/_Scenes_/_World.unity @@ -1664,6 +1664,7 @@ GameObject: - 223: {fileID: 2038247392} - 114: {fileID: 2038247391} - 114: {fileID: 2038247390} + - 114: {fileID: 2038247393} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -1749,6 +1750,18 @@ Canvas: m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 +--- !u!114 &2038247393 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2038247388} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2125ec9446c957546833e5124271beda, type: 3} + m_Name: + m_EditorClassIdentifier: + lastScreenWidth: 0 --- !u!1 &2048170185 GameObject: m_ObjectHideFlags: 0 From 0939ebf84b464ba7dabf14a0808930b41cd18e23 Mon Sep 17 00:00:00 2001 From: Koosemose Date: Tue, 21 Feb 2017 23:12:20 -0500 Subject: [PATCH 04/12] DPI- based scaling --- Assets/UIRescaler.cs | 48 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/Assets/UIRescaler.cs b/Assets/UIRescaler.cs index 195aee48f..d12e6732d 100644 --- a/Assets/UIRescaler.cs +++ b/Assets/UIRescaler.cs @@ -13,13 +13,48 @@ public class UIRescaler : MonoBehaviour { - public int lastScreenWidth = 0; + private const float MaxScale = 2f; + private const float MinScale = .5f; + + private int lastScreenWidth = 0; + private float dpi; + private float scale = 1f; + + public float Scale + { + get + { + return scale; + } + + set + { + if (value > MaxScale) + { + scale = MaxScale; + } + else if (value < MinScale) + { + scale = MinScale; + } + else + { + scale = value; + } + } + } public void Start() { lastScreenWidth = Screen.width; - StartCoroutine("AdjustScale"); - Debug.LogWarning(lastScreenWidth); + dpi = Screen.dpi; + if (dpi.AreEqual(0f)) + { + // Screen dpi may sometimes not be able to get the correct dpi, so we choose a reasonable default in that case. + dpi = 96f; + } + + AdjustScale(); } public void Update() @@ -27,13 +62,12 @@ public void Update() if (lastScreenWidth != Screen.width) { lastScreenWidth = Screen.width; - StartCoroutine("AdjustScale"); + AdjustScale(); } } - private IEnumerator AdjustScale() + private void AdjustScale() { - this.GetComponent().scaleFactor = Screen.width / 1920f; - yield return null; + this.GetComponent().scaleFactor = (Screen.width / 1920f) * (dpi / 96) * scale; } } \ No newline at end of file From d2358de3dcd81c8dc996a80336a84bcb10d162a2 Mon Sep 17 00:00:00 2001 From: Koosemose Date: Sun, 5 Mar 2017 22:10:38 -0500 Subject: [PATCH 05/12] UI Scale setting --- .../CSharp/SettingsMenuFunctions.cs | 37 +++++++++++++++++++ .../StreamingAssets/Data/SettingsTemplate.xml | 1 + Assets/UIRescaler.cs | 3 +- 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs b/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs index 8a8058eff..c529e0d2b 100644 --- a/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs +++ b/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs @@ -115,6 +115,11 @@ public static FontSizeSlider GetFontSizeSlider() return new FontSizeSlider(); } + public static UIScaleSlider GetUIScaleSlider() + { + return new UIScaleSlider(); + } + public static PerformanceHUDComboBox GetPerformanceHUDComboBox() { return new PerformanceHUDComboBox(); @@ -728,6 +733,38 @@ public override void ApplySetting() } } +public class UIScaleSlider : GenericSlider +{ + public override GameObject InitializeElement() + { + GameObject go = base.InitializeElement(); + + // Set it from 0 - 100 (still reflective of 0-1, but shows from 0 - 100) + format = "({0:0.#}) "; + + sliderElement.minValue = .5f; + sliderElement.maxValue = 2f; + sliderElement.value = getValue(); + // We want to apply our own listener + sliderElement.onValueChanged.RemoveAllListeners(); + sliderElement.onValueChanged.AddListener( + (float v) => + { + if (v != value) + { + valueChanged = true; + value = v; + textElement.text = string.Format(format, value) + LocalizationTable.GetLocalization(option.name); + } + }); + + sliderElement.onValueChanged.Invoke(sliderElement.value); + textElement.text = string.Format(format, value) + LocalizationTable.GetLocalization(option.name); + + return go; + } +} + public class SoundSlider : GenericSlider { public override GameObject InitializeElement() diff --git a/Assets/StreamingAssets/Data/SettingsTemplate.xml b/Assets/StreamingAssets/Data/SettingsTemplate.xml index b6164af72..26f71bbb2 100644 --- a/Assets/StreamingAssets/Data/SettingsTemplate.xml +++ b/Assets/StreamingAssets/Data/SettingsTemplate.xml @@ -8,6 +8,7 @@ diff --git a/Assets/UIRescaler.cs b/Assets/UIRescaler.cs index d12e6732d..d411453c4 100644 --- a/Assets/UIRescaler.cs +++ b/Assets/UIRescaler.cs @@ -59,7 +59,7 @@ public void Start() public void Update() { - if (lastScreenWidth != Screen.width) +// if (lastScreenWidth != Screen.width) { lastScreenWidth = Screen.width; AdjustScale(); @@ -68,6 +68,7 @@ public void Update() private void AdjustScale() { + Settings.GetSetting("ui_scale", out scale); this.GetComponent().scaleFactor = (Screen.width / 1920f) * (dpi / 96) * scale; } } \ No newline at end of file From 8324e9fc9f9a1305c3ab226a149979b0195b032e Mon Sep 17 00:00:00 2001 From: Koosemose Date: Mon, 6 Mar 2017 02:12:26 -0500 Subject: [PATCH 06/12] Remove dpi scaling and scale on height rather than width --- Assets/UIRescaler.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Assets/UIRescaler.cs b/Assets/UIRescaler.cs index d411453c4..47394bb58 100644 --- a/Assets/UIRescaler.cs +++ b/Assets/UIRescaler.cs @@ -17,7 +17,6 @@ public class UIRescaler : MonoBehaviour private const float MinScale = .5f; private int lastScreenWidth = 0; - private float dpi; private float scale = 1f; public float Scale @@ -47,12 +46,6 @@ public float Scale public void Start() { lastScreenWidth = Screen.width; - dpi = Screen.dpi; - if (dpi.AreEqual(0f)) - { - // Screen dpi may sometimes not be able to get the correct dpi, so we choose a reasonable default in that case. - dpi = 96f; - } AdjustScale(); } @@ -69,6 +62,6 @@ public void Update() private void AdjustScale() { Settings.GetSetting("ui_scale", out scale); - this.GetComponent().scaleFactor = (Screen.width / 1920f) * (dpi / 96) * scale; + this.GetComponent().scaleFactor = (Screen.height / 720f) * scale; } } \ No newline at end of file From f75a84e8c7a8946befda34ee42b040e71b96d2c7 Mon Sep 17 00:00:00 2001 From: Koosemose Date: Mon, 6 Mar 2017 02:18:13 -0500 Subject: [PATCH 07/12] Adjust Baseline scale --- Assets/UIRescaler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/UIRescaler.cs b/Assets/UIRescaler.cs index 47394bb58..10fc28bb6 100644 --- a/Assets/UIRescaler.cs +++ b/Assets/UIRescaler.cs @@ -62,6 +62,6 @@ public void Update() private void AdjustScale() { Settings.GetSetting("ui_scale", out scale); - this.GetComponent().scaleFactor = (Screen.height / 720f) * scale; + this.GetComponent().scaleFactor = (Screen.height / 1080f) * scale; } } \ No newline at end of file From 15ac53246b9f0659c8e024afb478c7f8055987b4 Mon Sep 17 00:00:00 2001 From: Koosemose Date: Mon, 6 Mar 2017 02:41:19 -0500 Subject: [PATCH 08/12] Fully change to height based scaling --- Assets/UIRescaler.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/UIRescaler.cs b/Assets/UIRescaler.cs index 10fc28bb6..557c78c03 100644 --- a/Assets/UIRescaler.cs +++ b/Assets/UIRescaler.cs @@ -16,7 +16,7 @@ public class UIRescaler : MonoBehaviour private const float MaxScale = 2f; private const float MinScale = .5f; - private int lastScreenWidth = 0; + private int lastScreenHeight = 0; private float scale = 1f; public float Scale @@ -45,16 +45,16 @@ public float Scale public void Start() { - lastScreenWidth = Screen.width; + lastScreenHeight = Screen.height; AdjustScale(); } public void Update() { -// if (lastScreenWidth != Screen.width) + if (lastScreenHeight != Screen.height) { - lastScreenWidth = Screen.width; + lastScreenHeight = Screen.height; AdjustScale(); } } From 045a1ef7c2699e4ad1d2398b5d22a2e1ab2ddef4 Mon Sep 17 00:00:00 2001 From: Koosemose Date: Mon, 6 Mar 2017 02:41:48 -0500 Subject: [PATCH 09/12] Rescale after applying scale change --- Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs | 6 ++++++ Assets/UIRescaler.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs b/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs index c529e0d2b..868f2b25c 100644 --- a/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs +++ b/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs @@ -763,6 +763,12 @@ public override GameObject InitializeElement() return go; } + + public override void ApplySetting() + { + base.ApplySetting(); + sliderElement.GetComponentInParent().AdjustScale(); + } } public class SoundSlider : GenericSlider diff --git a/Assets/UIRescaler.cs b/Assets/UIRescaler.cs index 557c78c03..b44499f7e 100644 --- a/Assets/UIRescaler.cs +++ b/Assets/UIRescaler.cs @@ -59,7 +59,7 @@ public void Update() } } - private void AdjustScale() + public void AdjustScale() { Settings.GetSetting("ui_scale", out scale); this.GetComponent().scaleFactor = (Screen.height / 1080f) * scale; From 051071d3f48e7e715e46d5fea94660952239aa07 Mon Sep 17 00:00:00 2001 From: Koosemose Date: Mon, 6 Mar 2017 02:52:38 -0500 Subject: [PATCH 10/12] Adjust settings slider to .1 steps --- .../StreamingAssets/CSharp/SettingsMenuFunctions.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs b/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs index 868f2b25c..53b95c4db 100644 --- a/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs +++ b/Assets/StreamingAssets/CSharp/SettingsMenuFunctions.cs @@ -742,9 +742,10 @@ public override GameObject InitializeElement() // Set it from 0 - 100 (still reflective of 0-1, but shows from 0 - 100) format = "({0:0.#}) "; - sliderElement.minValue = .5f; - sliderElement.maxValue = 2f; - sliderElement.value = getValue(); + sliderElement.wholeNumbers = true; + sliderElement.minValue = 5; + sliderElement.maxValue = 20; + sliderElement.value = getValue() * 10; // We want to apply our own listener sliderElement.onValueChanged.RemoveAllListeners(); sliderElement.onValueChanged.AddListener( @@ -754,19 +755,19 @@ public override GameObject InitializeElement() { valueChanged = true; value = v; - textElement.text = string.Format(format, value) + LocalizationTable.GetLocalization(option.name); + textElement.text = string.Format(format, value / 10) + LocalizationTable.GetLocalization(option.name); } }); sliderElement.onValueChanged.Invoke(sliderElement.value); - textElement.text = string.Format(format, value) + LocalizationTable.GetLocalization(option.name); + textElement.text = string.Format(format, value / 10) + LocalizationTable.GetLocalization(option.name); return go; } public override void ApplySetting() { - base.ApplySetting(); + Settings.SetSetting(option.key, value / 10); sliderElement.GetComponentInParent().AdjustScale(); } } From f89f929ec1689945d67255b10d082207c9dd1ceb Mon Sep 17 00:00:00 2001 From: Koosemose Date: Thu, 16 Mar 2017 04:47:42 -0400 Subject: [PATCH 11/12] workaround for Unity scaling bug --- .../UI/Components/FileListItem.prefab | 12 ++++++++++ .../Resources/UI/Components/QuestItem.prefab | 24 +++++++++++++++++++ .../UI/MenuLeft/ConstructionMenu.prefab | 2 +- .../MenuLeft/ConstructionMenu/Button.prefab | 12 ++++++++++ .../UI/SettingsMenu/Heading Section.prefab | 12 ++++++++++ .../UI/SettingsMenu/SettingsButton.prefab | 12 ++++++++++ .../UI/SettingsMenu/SettingsDropdown.prefab | 12 ++++++++++ .../UI/SettingsMenu/SettingsField.prefab | 12 ++++++++++ .../UI/SettingsMenu/SettingsMenu.prefab | 12 ++++++++++ .../UI/SettingsMenu/SettingsRadio.prefab | 12 ++++++++++ .../UI/SettingsMenu/SettingsSlider.prefab | 12 ++++++++++ .../SettingsMenu/SettingsSquareRadio.prefab | 12 ++++++++++ .../UI/SettingsMenu/SettingsSwitch.prefab | 12 ++++++++++ .../UI/SettingsMenu/SettingsText.prefab | 12 ++++++++++ .../UI/SettingsMenu/SettingsToggle.prefab | 12 ++++++++++ Assets/Scripts/UI/UIElementScaleFixer.cs | 20 ++++++++++++++++ Assets/Scripts/UI/UIElementScaleFixer.cs.meta | 12 ++++++++++ Assets/{ => Scripts/UI}/UIRescaler.cs | 0 Assets/{ => Scripts/UI}/UIRescaler.cs.meta | 0 19 files changed, 213 insertions(+), 1 deletion(-) create mode 100644 Assets/Scripts/UI/UIElementScaleFixer.cs create mode 100644 Assets/Scripts/UI/UIElementScaleFixer.cs.meta rename Assets/{ => Scripts/UI}/UIRescaler.cs (100%) rename Assets/{ => Scripts/UI}/UIRescaler.cs.meta (100%) diff --git a/Assets/Resources/UI/Components/FileListItem.prefab b/Assets/Resources/UI/Components/FileListItem.prefab index 1d6c2382d..7242bab6c 100644 --- a/Assets/Resources/UI/Components/FileListItem.prefab +++ b/Assets/Resources/UI/Components/FileListItem.prefab @@ -11,6 +11,7 @@ GameObject: - 114: {fileID: 11478130} - 222: {fileID: 222000013378982534} - 114: {fileID: 114000010318403776} + - 114: {fileID: 114000012690282044} m_Layer: 5 m_Name: FileListItem m_TagString: Untagged @@ -163,6 +164,17 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 +--- !u!114 &114000012690282044 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 117544} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!222 &222000013378982534 CanvasRenderer: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/Components/QuestItem.prefab b/Assets/Resources/UI/Components/QuestItem.prefab index b76ca91e2..4aef3217d 100644 --- a/Assets/Resources/UI/Components/QuestItem.prefab +++ b/Assets/Resources/UI/Components/QuestItem.prefab @@ -58,6 +58,8 @@ GameObject: - 114: {fileID: 114000012546263802} - 114: {fileID: 114000012203566418} - 114: {fileID: 114000010617629678} + - 114: {fileID: 114000013935797010} + - 114: {fileID: 114000012354133912} m_Layer: 5 m_Name: QuestItem m_TagString: Untagged @@ -290,6 +292,17 @@ MonoBehaviour: m_BlockingMask: serializedVersion: 2 m_Bits: 4294967295 +--- !u!114 &114000012354133912 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011337798844} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000012414203538 MonoBehaviour: m_ObjectHideFlags: 1 @@ -410,6 +423,17 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: Tile +--- !u!114 &114000013935797010 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011337798844} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000014074064690 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/MenuLeft/ConstructionMenu.prefab b/Assets/Resources/UI/MenuLeft/ConstructionMenu.prefab index 52018560f..ba174cf8d 100644 --- a/Assets/Resources/UI/MenuLeft/ConstructionMenu.prefab +++ b/Assets/Resources/UI/MenuLeft/ConstructionMenu.prefab @@ -671,7 +671,7 @@ MonoBehaviour: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_FontSize: 18 m_FontStyle: 1 - m_BestFit: 0 + m_BestFit: 1 m_MinSize: 10 m_MaxSize: 40 m_Alignment: 4 diff --git a/Assets/Resources/UI/MenuLeft/ConstructionMenu/Button.prefab b/Assets/Resources/UI/MenuLeft/ConstructionMenu/Button.prefab index d2d7e6063..dc401ffd7 100644 --- a/Assets/Resources/UI/MenuLeft/ConstructionMenu/Button.prefab +++ b/Assets/Resources/UI/MenuLeft/ConstructionMenu/Button.prefab @@ -57,6 +57,7 @@ GameObject: - 222: {fileID: 222000012738706156} - 114: {fileID: 114000011913635658} - 114: {fileID: 114000010141881724} + - 114: {fileID: 114000011250756422} m_Layer: 5 m_Name: Button m_TagString: Untagged @@ -120,6 +121,17 @@ MonoBehaviour: localizeInStart: 1 text: {fileID: 0} defaultText: +--- !u!114 &114000011250756422 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013691832882} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000011913635658 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/SettingsMenu/Heading Section.prefab b/Assets/Resources/UI/SettingsMenu/Heading Section.prefab index 4ba3c1a4f..f2a84aded 100644 --- a/Assets/Resources/UI/SettingsMenu/Heading Section.prefab +++ b/Assets/Resources/UI/SettingsMenu/Heading Section.prefab @@ -57,6 +57,7 @@ GameObject: - 114: {fileID: 114000010065151278} - 114: {fileID: 114000012681863884} - 114: {fileID: 114000012764975788} + - 114: {fileID: 114000010269573494} m_Layer: 5 m_Name: Heading Section m_TagString: Untagged @@ -77,6 +78,17 @@ MonoBehaviour: m_EditorClassIdentifier: root: {fileID: 1000011375798180} headingText: {fileID: 114000013773110676} +--- !u!114 &114000010269573494 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014122894870} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000010326162276 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/SettingsMenu/SettingsButton.prefab b/Assets/Resources/UI/SettingsMenu/SettingsButton.prefab index a85ad0e84..05ab1e3c2 100644 --- a/Assets/Resources/UI/SettingsMenu/SettingsButton.prefab +++ b/Assets/Resources/UI/SettingsMenu/SettingsButton.prefab @@ -24,6 +24,7 @@ GameObject: - 114: {fileID: 114000013521423838} - 114: {fileID: 114000011852658578} - 114: {fileID: 114000010215954120} + - 114: {fileID: 114000011399251584} m_Layer: 5 m_Name: SettingsButton m_TagString: Untagged @@ -90,6 +91,17 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null +--- !u!114 &114000011399251584 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011889461486} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000011728363504 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/SettingsMenu/SettingsDropdown.prefab b/Assets/Resources/UI/SettingsMenu/SettingsDropdown.prefab index 0e31e9f3a..118d07f67 100644 --- a/Assets/Resources/UI/SettingsMenu/SettingsDropdown.prefab +++ b/Assets/Resources/UI/SettingsMenu/SettingsDropdown.prefab @@ -88,6 +88,7 @@ GameObject: - 222: {fileID: 222000013032223076} - 114: {fileID: 114000014179489124} - 114: {fileID: 114000010358411874} + - 114: {fileID: 114000013719909410} m_Layer: 5 m_Name: SettingsDropdown m_TagString: Untagged @@ -592,6 +593,17 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 +--- !u!114 &114000013719909410 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011237016840} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000013956353114 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/SettingsMenu/SettingsField.prefab b/Assets/Resources/UI/SettingsMenu/SettingsField.prefab index d1306da59..b364618a0 100644 --- a/Assets/Resources/UI/SettingsMenu/SettingsField.prefab +++ b/Assets/Resources/UI/SettingsMenu/SettingsField.prefab @@ -22,6 +22,7 @@ GameObject: - 222: {fileID: 222000012311069016} - 114: {fileID: 114000010206266248} - 114: {fileID: 114000011715643710} + - 114: {fileID: 114000011260665556} m_Layer: 5 m_Name: SettingsField m_TagString: Untagged @@ -123,6 +124,17 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: Enter text... +--- !u!114 &114000011260665556 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011427886720} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000011715643710 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/SettingsMenu/SettingsMenu.prefab b/Assets/Resources/UI/SettingsMenu/SettingsMenu.prefab index 5961f1140..021b07329 100644 --- a/Assets/Resources/UI/SettingsMenu/SettingsMenu.prefab +++ b/Assets/Resources/UI/SettingsMenu/SettingsMenu.prefab @@ -158,6 +158,7 @@ GameObject: - 224: {fileID: 224000013598409594} - 222: {fileID: 222000011043662548} - 114: {fileID: 114000011840756104} + - 114: {fileID: 114000013415599324} m_Layer: 5 m_Name: SettingsMenu m_TagString: Untagged @@ -1979,6 +1980,17 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 +--- !u!114 &114000013415599324 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011176379986} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000013466440812 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/SettingsMenu/SettingsRadio.prefab b/Assets/Resources/UI/SettingsMenu/SettingsRadio.prefab index c3b497b33..60a07092c 100644 --- a/Assets/Resources/UI/SettingsMenu/SettingsRadio.prefab +++ b/Assets/Resources/UI/SettingsMenu/SettingsRadio.prefab @@ -37,6 +37,7 @@ GameObject: m_Component: - 224: {fileID: 224000010400765800} - 114: {fileID: 114000012045197150} + - 114: {fileID: 114000012290837518} m_Layer: 5 m_Name: SettingsRadio m_TagString: Untagged @@ -160,6 +161,17 @@ MonoBehaviour: m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_IsOn: 1 +--- !u!114 &114000012290837518 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012075128086} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!222 &222000012185448870 CanvasRenderer: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/SettingsMenu/SettingsSlider.prefab b/Assets/Resources/UI/SettingsMenu/SettingsSlider.prefab index 85a312536..98a23a20a 100644 --- a/Assets/Resources/UI/SettingsMenu/SettingsSlider.prefab +++ b/Assets/Resources/UI/SettingsMenu/SettingsSlider.prefab @@ -20,6 +20,7 @@ GameObject: m_Component: - 224: {fileID: 224000013769853932} - 114: {fileID: 114000010705991186} + - 114: {fileID: 114000010407120946} m_Layer: 5 m_Name: SettingsSlider m_TagString: Untagged @@ -136,6 +137,17 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 +--- !u!114 &114000010407120946 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012222472366} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000010705991186 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/SettingsMenu/SettingsSquareRadio.prefab b/Assets/Resources/UI/SettingsMenu/SettingsSquareRadio.prefab index 3562e9a3e..33732b05d 100644 --- a/Assets/Resources/UI/SettingsMenu/SettingsSquareRadio.prefab +++ b/Assets/Resources/UI/SettingsMenu/SettingsSquareRadio.prefab @@ -20,6 +20,7 @@ GameObject: m_Component: - 224: {fileID: 224000011034739758} - 114: {fileID: 114000011688845056} + - 114: {fileID: 114000012197679114} m_Layer: 5 m_Name: SettingsSquareRadio m_TagString: Untagged @@ -133,6 +134,17 @@ MonoBehaviour: m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_IsOn: 1 +--- !u!114 &114000012197679114 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011483629928} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000012458001780 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/SettingsMenu/SettingsSwitch.prefab b/Assets/Resources/UI/SettingsMenu/SettingsSwitch.prefab index 749828f85..b09d5f0ff 100644 --- a/Assets/Resources/UI/SettingsMenu/SettingsSwitch.prefab +++ b/Assets/Resources/UI/SettingsMenu/SettingsSwitch.prefab @@ -37,6 +37,7 @@ GameObject: m_Component: - 224: {fileID: 224000013036247610} - 114: {fileID: 114000012921276924} + - 114: {fileID: 114000012594959840} m_Layer: 5 m_Name: SettingsSwitch m_TagString: Untagged @@ -88,6 +89,17 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 +--- !u!114 &114000012594959840 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010638297662} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000012921276924 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/SettingsMenu/SettingsText.prefab b/Assets/Resources/UI/SettingsMenu/SettingsText.prefab index c30b54545..861e9fd68 100644 --- a/Assets/Resources/UI/SettingsMenu/SettingsText.prefab +++ b/Assets/Resources/UI/SettingsMenu/SettingsText.prefab @@ -21,6 +21,7 @@ GameObject: - 224: {fileID: 224000014255584338} - 222: {fileID: 222000012472736264} - 114: {fileID: 114000010165475254} + - 114: {fileID: 114000012374642832} m_Layer: 5 m_Name: SettingsText m_TagString: Untagged @@ -61,6 +62,17 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: +--- !u!114 &114000012374642832 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011330954174} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!222 &222000012472736264 CanvasRenderer: m_ObjectHideFlags: 1 diff --git a/Assets/Resources/UI/SettingsMenu/SettingsToggle.prefab b/Assets/Resources/UI/SettingsMenu/SettingsToggle.prefab index 255c57327..529850c17 100644 --- a/Assets/Resources/UI/SettingsMenu/SettingsToggle.prefab +++ b/Assets/Resources/UI/SettingsMenu/SettingsToggle.prefab @@ -54,6 +54,7 @@ GameObject: m_Component: - 224: {fileID: 224000010693051802} - 114: {fileID: 114000014154172918} + - 114: {fileID: 114000010207217168} m_Layer: 5 m_Name: SettingsToggle m_TagString: Untagged @@ -61,6 +62,17 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!114 &114000010207217168 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014203165242} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000012008749980 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Scripts/UI/UIElementScaleFixer.cs b/Assets/Scripts/UI/UIElementScaleFixer.cs new file mode 100644 index 000000000..476c46099 --- /dev/null +++ b/Assets/Scripts/UI/UIElementScaleFixer.cs @@ -0,0 +1,20 @@ +#region License +// ==================================================== +// Project Porcupine Copyright(C) 2016 Team Porcupine +// This program comes with ABSOLUTELY NO WARRANTY; This is free software, +// and you are welcome to redistribute it under certain conditions; See +// file LICENSE, which is part of this source code package, for details. +// ==================================================== +#endregion + +using UnityEngine; + +// HACK: This is a needed workaround for any most any UI ELeemnt that is instantiated after start. +// If this script isn't attached it may cause errors at different scalings. +public class UIElementScaleFixer : MonoBehaviour +{ + public void Start() + { + transform.localScale = Vector3.one; + } +} diff --git a/Assets/Scripts/UI/UIElementScaleFixer.cs.meta b/Assets/Scripts/UI/UIElementScaleFixer.cs.meta new file mode 100644 index 000000000..4e7678149 --- /dev/null +++ b/Assets/Scripts/UI/UIElementScaleFixer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5d9d9b4ba7df5664b97950a2c6fbf394 +timeCreated: 1489652266 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UIRescaler.cs b/Assets/Scripts/UI/UIRescaler.cs similarity index 100% rename from Assets/UIRescaler.cs rename to Assets/Scripts/UI/UIRescaler.cs diff --git a/Assets/UIRescaler.cs.meta b/Assets/Scripts/UI/UIRescaler.cs.meta similarity index 100% rename from Assets/UIRescaler.cs.meta rename to Assets/Scripts/UI/UIRescaler.cs.meta From 82d1f6c4fb1359b0558b778f8114bc32a29035fb Mon Sep 17 00:00:00 2001 From: Koosemose Date: Thu, 16 Mar 2017 05:22:38 -0400 Subject: [PATCH 12/12] Missed UI Element scaling fix --- Assets/Resources/UI/Components/JobListItem.prefab | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Assets/Resources/UI/Components/JobListItem.prefab b/Assets/Resources/UI/Components/JobListItem.prefab index 35da9030d..f6e3520cb 100644 --- a/Assets/Resources/UI/Components/JobListItem.prefab +++ b/Assets/Resources/UI/Components/JobListItem.prefab @@ -11,6 +11,7 @@ GameObject: - 114: {fileID: 114000011180822494} - 222: {fileID: 222000013378982534} - 114: {fileID: 114000010318403776} + - 114: {fileID: 114000012657899036} m_Layer: 5 m_Name: JobListItem m_TagString: Untagged @@ -196,6 +197,17 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: currentColor: {r: 0, g: 0, b: 0, a: 0} +--- !u!114 &114000012657899036 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 117544} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9d9b4ba7df5664b97950a2c6fbf394, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &114000013548480896 MonoBehaviour: m_ObjectHideFlags: 1