From f3b4a8e2c27bf2784c4988126e082fc608dd7cad Mon Sep 17 00:00:00 2001 From: Stefan Richter <o-s-r1993@web.de> Date: Sun, 12 Mar 2023 01:24:42 +0100 Subject: [PATCH] Added AutoSettingsAdaption Button --- .../Prefabs/UI/NetwMenue/OptionsM.prefab | 309 ++++++++++++++++++ .../Scripts/Loading/StreamingAssetLoader.cs | 1 + .../Scripts/UI/NetwMenue/StartMenue_mobile.cs | 3 +- .../UI/NetwMenue/SystemOptionsMenue_mobile.cs | 52 ++- Assets/Scripts/UI/UIconfig.cs | 1 + .../Config/Network.JSON | 4 +- 6 files changed, 365 insertions(+), 5 deletions(-) diff --git a/Assets/Resources/Prefabs/UI/NetwMenue/OptionsM.prefab b/Assets/Resources/Prefabs/UI/NetwMenue/OptionsM.prefab index bcdd744a..56708f7d 100644 --- a/Assets/Resources/Prefabs/UI/NetwMenue/OptionsM.prefab +++ b/Assets/Resources/Prefabs/UI/NetwMenue/OptionsM.prefab @@ -5986,6 +5986,8 @@ MonoBehaviour: Opsys_ButtonUT: {fileID: 9018472344697824337} FrameITUI_ButtonT: {fileID: 5861497761551979794} FrameITUI_ButtonUT: {fileID: 4867843466607851529} + AutoSettingsAdap_Button: {fileID: 0} + AutoSettingsAdap_ButtonUT: {fileID: 0} --- !u!114 &1986695175098610074 MonoBehaviour: m_ObjectHideFlags: 0 @@ -8046,6 +8048,87 @@ MonoBehaviour: m_EditorClassIdentifier: backTo_GObj: {fileID: 3680199913404635203} parentM_GObj: {fileID: 220600721669129657} +--- !u!1 &2314625511950152017 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3843860648220887044} + - component: {fileID: 1014641858770768143} + - component: {fileID: 8862342039482492242} + m_Layer: 5 + m_Name: TextSlotTOOsetting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3843860648220887044 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2314625511950152017} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5822541630066150013} + m_Father: {fileID: 8282056207990590973} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0.8} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: -0.0000076294} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1014641858770768143 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2314625511950152017} + m_CullTransparentMesh: 1 +--- !u!114 &8862342039482492242 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2314625511950152017} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 30 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 40 + m_Alignment: 1 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Touchcontrols ON --- !u!1 &2402478635372571321 GameObject: m_ObjectHideFlags: 0 @@ -9159,6 +9242,8 @@ MonoBehaviour: Opsys_ButtonUT: {fileID: 4515047496373876988} FrameITUI_ButtonT: {fileID: 5861497761551979794} FrameITUI_ButtonUT: {fileID: 4867843466607851529} + AutoSettingsAdap_Button: {fileID: 0} + AutoSettingsAdap_ButtonUT: {fileID: 0} --- !u!1 &3425580818276207209 GameObject: m_ObjectHideFlags: 0 @@ -10617,6 +10702,8 @@ MonoBehaviour: Opsys_ButtonUT: {fileID: 7635230150363548799} FrameITUI_ButtonT: {fileID: 4058364548222253969} FrameITUI_ButtonUT: {fileID: 1363689793225369312} + AutoSettingsAdap_Button: {fileID: 2314625511950152017} + AutoSettingsAdap_ButtonUT: {fileID: 9095357065203387310} --- !u!1 &4016450546580129681 GameObject: m_ObjectHideFlags: 0 @@ -12622,6 +12709,7 @@ RectTransform: - {fileID: 7249704526189622164} - {fileID: 7184855062139488493} - {fileID: 4349135317353766966} + - {fileID: 8282056207990590973} m_Father: {fileID: 7890457196579690101} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -14266,6 +14354,140 @@ MonoBehaviour: m_EditorClassIdentifier: backTo_GObj: {fileID: 99907273253604842} parentM_GObj: {fileID: 266457293881304185} +--- !u!1 &7858714513584545460 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8282056207990590973} + - component: {fileID: 4331474773829978130} + - component: {fileID: 279621163145034387} + - component: {fileID: 4276631784943864210} + m_Layer: 5 + m_Name: AutoSettingsOnOff + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8282056207990590973 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7858714513584545460} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3843860648220887044} + m_Father: {fileID: 8924899338328608077} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.6, y: 0.48689857} + m_AnchorMax: {x: 1, y: 0.6101997} + m_AnchoredPosition: {x: 0.000015258789, y: 0} + m_SizeDelta: {x: -0.000030517578, y: 0.00054932} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4331474773829978130 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7858714513584545460} + m_CullTransparentMesh: 1 +--- !u!114 &279621163145034387 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7858714513584545460} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: e4f1fee3de32377429fd1348fae62b10, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4276631784943864210 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7858714513584545460} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + 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: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 279621163145034387} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 7320806596421241701} + m_TargetAssemblyTypeName: SystemOptionsMenue_mobile, Assembly-CSharp + m_MethodName: ChangeAutoSettingsAdaption + m_Mode: 1 + 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 --- !u!1 &7865027569057119928 GameObject: m_ObjectHideFlags: 0 @@ -14559,6 +14781,8 @@ MonoBehaviour: Opsys_ButtonUT: {fileID: 4515047496373876988} FrameITUI_ButtonT: {fileID: 5861497761551979794} FrameITUI_ButtonUT: {fileID: 4867843466607851529} + AutoSettingsAdap_Button: {fileID: 0} + AutoSettingsAdap_ButtonUT: {fileID: 0} --- !u!1 &8156409310062843141 GameObject: m_ObjectHideFlags: 0 @@ -16273,6 +16497,86 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &9095357065203387310 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5822541630066150013} + - component: {fileID: 6454412504516446622} + - component: {fileID: 7741479016111323796} + m_Layer: 5 + m_Name: TextSlotTOO2settings + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5822541630066150013 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9095357065203387310} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3843860648220887044} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.083000004} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0.000022888} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6454412504516446622 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9095357065203387310} + m_CullTransparentMesh: 1 +--- !u!114 &7741479016111323796 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9095357065203387310} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 25 + m_FontStyle: 2 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 40 + m_Alignment: 7 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Press for deactivating --- !u!1 &9098370179205817362 GameObject: m_ObjectHideFlags: 0 @@ -16785,6 +17089,11 @@ PrefabInstance: propertyPath: parentM_GObj value: objectReference: {fileID: 220600721669129657} + - target: {fileID: 5924704485175712605, guid: 386732dae91d6c546ac0f02745d283dc, + type: 3} + propertyPath: m_Text + value: Z + objectReference: {fileID: 0} - target: {fileID: 9012457569728381634, guid: 386732dae91d6c546ac0f02745d283dc, type: 3} propertyPath: m_Name diff --git a/Assets/Scripts/Loading/StreamingAssetLoader.cs b/Assets/Scripts/Loading/StreamingAssetLoader.cs index 61b560cc..1d1d5970 100644 --- a/Assets/Scripts/Loading/StreamingAssetLoader.cs +++ b/Assets/Scripts/Loading/StreamingAssetLoader.cs @@ -78,6 +78,7 @@ public static void NetworkJSON_Save() myObject.TouchMode = UIconfig.touchControlMode; myObject.TAvisibility = UIconfig.TAvisibility; myObject.autoOSrecognition = CommunicationEvents.autoOSrecognition; + myObject.autoSettingsAdaption = UIconfig.autoSettingsAdaption; myObject.Opsys = CommunicationEvents.Opsys.ToString(); myObject.FrameITUIversion = UIconfig.FrameITUIversion; myObject.InputManagerVersion = UIconfig.InputManagerVersion; diff --git a/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs b/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs index 12eaa520..3deb88cb 100644 --- a/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs +++ b/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs @@ -36,9 +36,8 @@ private void Awake() toChild1(); - if (checkOperationSystemAlreadyDone == false) + if (checkOperationSystemAlreadyDone == false || checkOperationSystemAlreadyDone_check == false) { - start2_CheckOS_CheckConfig(); checkOperationSystemAlreadyDone = true; } diff --git a/Assets/Scripts/UI/NetwMenue/SystemOptionsMenue_mobile.cs b/Assets/Scripts/UI/NetwMenue/SystemOptionsMenue_mobile.cs index 9d68153f..e4781bfe 100644 --- a/Assets/Scripts/UI/NetwMenue/SystemOptionsMenue_mobile.cs +++ b/Assets/Scripts/UI/NetwMenue/SystemOptionsMenue_mobile.cs @@ -22,7 +22,10 @@ public class SystemOptionsMenue_mobile : MonoBehaviour public GameObject FrameITUI_ButtonT; public GameObject FrameITUI_ButtonUT; - + + public GameObject AutoSettingsAdap_Button; + public GameObject AutoSettingsAdap_ButtonUT; + /* @@ -66,6 +69,28 @@ void UpdateUI_6() } + switch (UIconfig.autoSettingsAdaption) + { + case false: + + //GameObject.Find("TextSlotTOO").GetComponent<Text>().text = "Touch controls OFF"; + AutoSettingsAdap_Button.GetComponent<Text>().text = "Settings Adaption: OFF"; + AutoSettingsAdap_ButtonUT.GetComponentInChildren<Text>().text = "Press for activating"; + break; + + case true: + + AutoSettingsAdap_Button.GetComponent<Text>().text = "Settings Adaption: ON"; + AutoSettingsAdap_ButtonUT.GetComponentInChildren<Text>().text = "Press for deactivating"; + break; + + + } + + + + + switch (CommunicationEvents.Opsys) { case OperationSystem.Windows: @@ -142,6 +167,31 @@ public void ChangeAutoOSrecognition() NetworkJSON_Save(); } + public void ChangeAutoSettingsAdaption() + { + switch (UIconfig.autoSettingsAdaption) + { + case false: + UIconfig.autoSettingsAdaption = true; + AutoSettingsAdap_Button.GetComponent<Text>().text = "Settings Adaption: ON"; + AutoSettingsAdap_ButtonUT.GetComponentInChildren<Text>().text = "Press for deactivating"; + break; + + case true: + UIconfig.autoSettingsAdaption = false; + //GameObject.Find("TextSlotTOO").GetComponent<Text>().text = "Touch controls OFF"; + AutoSettingsAdap_Button.GetComponent<Text>().text = "Settings Adaption: OFF"; + AutoSettingsAdap_ButtonUT.GetComponentInChildren<Text>().text = "Press for activating"; + break; + + + } + //updateUIpreview(); + NetworkJSON_Save(); + } + + + public void ChangeOpsysModes() { switch (CommunicationEvents.Opsys) diff --git a/Assets/Scripts/UI/UIconfig.cs b/Assets/Scripts/UI/UIconfig.cs index 883c9612..7ff3546a 100644 --- a/Assets/Scripts/UI/UIconfig.cs +++ b/Assets/Scripts/UI/UIconfig.cs @@ -43,6 +43,7 @@ public enum InteractingRangeMode public static double cursorSize_SliderMax = 1; //Faktor public static double cursorsize_default = 0.03125; public static bool checkOperationSystemAlreadyDone = false; + public static bool checkOperationSystemAlreadyDone_check = false; public static int refHeight = -1; public static int refWidth = -1; diff --git a/Assets/StreamingAssets/StreamToPersistentDataPath/Config/Network.JSON b/Assets/StreamingAssets/StreamToPersistentDataPath/Config/Network.JSON index cdcf47f0..ac0e842d 100644 --- a/Assets/StreamingAssets/StreamToPersistentDataPath/Config/Network.JSON +++ b/Assets/StreamingAssets/StreamToPersistentDataPath/Config/Network.JSON @@ -8,8 +8,8 @@ "ControlMode": "Keyboard", "TouchMode": 1, "TAvisibility": 1.0, - "autoOSrecognition": false, - "autoSettingsAdaption": false, + "autoOSrecognition": true, + "autoSettingsAdaption": true, "Opsys": "Android", "FrameITUIversion": 2, "InputManagerVersion": 1, -- GitLab