diff --git a/Assets/Scripts/UI/HideUI.cs b/Assets/Scripts/UI/HideUI.cs index 3734f7097c98c60137a5ff29b58ab565ecbef3de..98e018fe34625d5e2bebce1f84ebc560d5f98558 100644 --- a/Assets/Scripts/UI/HideUI.cs +++ b/Assets/Scripts/UI/HideUI.cs @@ -2,6 +2,7 @@ using UnityEngine.SceneManagement; using static CommunicationEvents; using static UIconfig; +using System.Collections; //using static CamControl_1; public class HideUI : MonoBehaviour @@ -19,7 +20,8 @@ public string modload; public string cancel_keyBind; public string MathM_keyBind; - + public float waitingBetweenInputs = 0.2f; + private double numinputtrigger = 0; public UnityStandardAssets.Characters.FirstPerson.FirstPersonController CamControl_StdAsset; @@ -33,10 +35,52 @@ public string //public MeshRenderer CursorRenderer_FirstP_oldInpOrig; //public int whichCursor; - + private ControlMapping input_ControlMapping; internal Canvas UICanvas; + private void Awake() + { + //New InputSystem + input_ControlMapping = new ControlMapping(); + input_ControlMapping.Actionmap1.Cancel.Enable(); + input_ControlMapping.Actionmap1.ToolMode.Enable(); + input_ControlMapping.Actionmap1.MathMode.Enable(); + input_ControlMapping.Actionmap1.Modifier.Enable(); + input_ControlMapping.Actionmap1.Load.Enable(); + input_ControlMapping.Actionmap1.Save.Enable(); + input_ControlMapping.Actionmap1.Reset.Enable(); + input_ControlMapping.Actionmap1.Undo.Enable(); + input_ControlMapping.Actionmap1.Redo.Enable(); + + } + private void OnEnable() + { + input_ControlMapping.Actionmap1.Cancel.Enable(); + input_ControlMapping.Actionmap1.ToolMode.Enable(); + input_ControlMapping.Actionmap1.MathMode.Enable(); + input_ControlMapping.Actionmap1.Modifier.Enable(); + input_ControlMapping.Actionmap1.Load.Enable(); + input_ControlMapping.Actionmap1.Save.Enable(); + input_ControlMapping.Actionmap1.Reset.Enable(); + input_ControlMapping.Actionmap1.Undo.Enable(); + input_ControlMapping.Actionmap1.Redo.Enable(); + } + + private void OnDisable() + { + input_ControlMapping.Actionmap1.Cancel.Disable(); + input_ControlMapping.Actionmap1.ToolMode.Disable(); + input_ControlMapping.Actionmap1.MathMode.Disable(); + input_ControlMapping.Actionmap1.Modifier.Enable(); + input_ControlMapping.Actionmap1.Load.Disable(); + input_ControlMapping.Actionmap1.Save.Disable(); + input_ControlMapping.Actionmap1.Reset.Disable(); + input_ControlMapping.Actionmap1.Undo.Disable(); + input_ControlMapping.Actionmap1.Redo.Disable(); + } + + void Start() { if (UIconfig.FrameITUIversion == 1) // 1= FrameITUI; 2= FrameITUI_mobil @@ -70,6 +114,31 @@ void Start2() SetCursorRenderer123(camActive); } + } + void Start3() + { + print("Start3"); + /* + UIconfig.CanvasOnOff_Array[14] = 1; + UIconfig.CanvasOnOff_Array[20] = 0; + //setUI_Vis_walk(0); + //UIconfig.CanvasOnOff_Array[20] = 0; + */ + Update(); + /* + //CheckUI_Vis_walk(); + UIconfig.CanvasOnOff_Array[14] = 0; + UIconfig.CanvasOnOff_Array[20] = 1; + UIconfig.CanvasOnOff_Array[10] = 1; + + UIconfig.CanvasOnOff_Array[3] = 1; + */ + SetCamControl123(false); + + + + + } // Update is called once per frame @@ -78,53 +147,177 @@ void Update() if (UIconfig.FrameITUIversion == 1) { - Update2(); + Update3(); } } + void Update3() + { + //CheckUI_Vis_walk(); + CheckIf(); + + + Update2(); + + CheckUI_Vis(); + + } - void Update2() { + IEnumerator slowInput() + { + + yield return new WaitForSecondsRealtime(waitingBetweenInputs); + + numinputtrigger = 0; + + + yield return null; + + } + void CheckIf() + { - if (Input.GetButtonDown(MathM_keyBind)) + if (UIconfig.InputManagerVersion == 1) { - if (LockOnly) + if (Input.GetButtonDown(cancel_keyBind)) { - CamControl_StdAsset.enabled = !CamControl_StdAsset.enabled; - SetCursorRenderer123(CamControl_StdAsset.enabled); - SetCamControl123(CamControl_StdAsset.enabled); + + UIconfig.CanvasOnOff_Array[02] = 1; + //UIconfig.CanvasOnOff_Array[10] = 0; + return; } - else + + if (Input.GetButtonDown(MathM_keyBind)) { - Cursor.visible = !UICanvas.enabled; - SetCamControl123(UICanvas.enabled); + if (LockOnly) + { + CamControl_StdAsset.enabled = !CamControl_StdAsset.enabled; + SetCursorRenderer123(CamControl_StdAsset.enabled); + SetCamControl123(CamControl_StdAsset.enabled); + + } + else + { + Cursor.visible = !UICanvas.enabled; + SetCamControl123(UICanvas.enabled); + + SetCursorRenderer123(UICanvas.enabled); - SetCursorRenderer123(UICanvas.enabled); + UICanvas.enabled = !UICanvas.enabled; + } - UICanvas.enabled = !UICanvas.enabled; } } - else if (Input.GetButton(modifier)) + + + if (UIconfig.InputManagerVersion == 2 && numinputtrigger == 0) { - if (Input.GetButtonDown(modundo)) - StageStatic.stage.factState.undo(); - else if (Input.GetButtonDown(modredo)) - StageStatic.stage.factState.redo(); - else if (Input.GetButtonDown(modreset)) - StageStatic.stage.factState.softreset(); - else if (Input.GetButtonDown(modsave)) - StageStatic.stage.push_record(); - else if (Input.GetButtonDown(modload)) + if (input_ControlMapping.Actionmap1.Cancel.ReadValue<float>() != 0) { - StageStatic.stage.factState.hardreset(); - StageStatic.LoadInitStage(StageStatic.stage.name, !StageStatic.stage.use_install_folder); + numinputtrigger++; + StartCoroutine(slowInput()); + + UIconfig.CanvasOnOff_Array[02] = 1; + //UIconfig.CanvasOnOff_Array[10] = 0; + return; + } + + if (input_ControlMapping.Actionmap1.MathMode.ReadValue<float>() != 0) + { + numinputtrigger++; + StartCoroutine(slowInput()); + + if (LockOnly) + { + CamControl_StdAsset.enabled = !CamControl_StdAsset.enabled; + SetCursorRenderer123(CamControl_StdAsset.enabled); + SetCamControl123(CamControl_StdAsset.enabled); + + } + else + { + Cursor.visible = !UICanvas.enabled; + SetCamControl123(UICanvas.enabled); + + SetCursorRenderer123(UICanvas.enabled); + + UICanvas.enabled = !UICanvas.enabled; + } + } } - if (Input.GetButtonDown(cancel_keyBind)) - { - UIconfig.CanvasOnOff_Array[02] = 1; - //UIconfig.CanvasOnOff_Array[10] = 0; - return; + + + + + + } + + + void CheckUI_Vis() + { + GadgetCanBeUsed = true; + } + + + + void Update2() { + if (UIconfig.InputManagerVersion == 1) + { + if (Input.GetButton(modifier)) + { + if (Input.GetButtonDown(modundo)) + StageStatic.stage.factState.undo(); + else if (Input.GetButtonDown(modredo)) + StageStatic.stage.factState.redo(); + else if (Input.GetButtonDown(modreset)) + StageStatic.stage.factState.softreset(); + else if (Input.GetButtonDown(modsave)) + StageStatic.stage.push_record(); + else if (Input.GetButtonDown(modload)) + { + StageStatic.stage.factState.hardreset(); + StageStatic.LoadInitStage(StageStatic.stage.name, !StageStatic.stage.use_install_folder); + } + } + } + if (UIconfig.InputManagerVersion == 2) + { + if (input_ControlMapping.Actionmap1.Modifier.ReadValue<float>() != 0) + { + if (input_ControlMapping.Actionmap1.Undo.ReadValue<float>() != 0 && numinputtrigger == 0) + { + StageStatic.stage.factState.undo(); + numinputtrigger++; + StartCoroutine(slowInput()); + } + else if (input_ControlMapping.Actionmap1.Redo.ReadValue<float>() != 0 && numinputtrigger == 0) + { + StageStatic.stage.factState.redo(); + numinputtrigger++; + StartCoroutine(slowInput()); + } + else if (input_ControlMapping.Actionmap1.Reset.ReadValue<float>() != 0 && numinputtrigger == 0) + { + StageStatic.stage.factState.softreset(); + numinputtrigger++; + StartCoroutine(slowInput()); + } + else if (input_ControlMapping.Actionmap1.Save.ReadValue<float>() != 0 && numinputtrigger < 10) + { + StageStatic.stage.push_record(); + numinputtrigger = numinputtrigger + 10; + StartCoroutine(slowInput()); + } + else if (input_ControlMapping.Actionmap1.Load.ReadValue<float>() != 0 && numinputtrigger == 0) + { + StageStatic.stage.factState.hardreset(); + StageStatic.LoadInitStage(StageStatic.stage.name, !StageStatic.stage.use_install_folder); + numinputtrigger++; + StartCoroutine(slowInput()); + } + } } /* diff --git a/Assets/Scripts/UI/HideUI_mobile.cs b/Assets/Scripts/UI/HideUI_mobile.cs index b218982343fa0888650bcd5e1473e718a601467d..66ea2338c38e20666b58a27f3e4b95971ba105bc 100644 --- a/Assets/Scripts/UI/HideUI_mobile.cs +++ b/Assets/Scripts/UI/HideUI_mobile.cs @@ -43,6 +43,12 @@ private void Awake() input_ControlMapping.Actionmap1.Cancel.Enable(); input_ControlMapping.Actionmap1.ToolMode.Enable(); input_ControlMapping.Actionmap1.MathMode.Enable(); + input_ControlMapping.Actionmap1.Modifier.Enable(); + input_ControlMapping.Actionmap1.Load.Enable(); + input_ControlMapping.Actionmap1.Save.Enable(); + input_ControlMapping.Actionmap1.Reset.Enable(); + input_ControlMapping.Actionmap1.Undo.Enable(); + input_ControlMapping.Actionmap1.Redo.Enable(); } private void OnEnable() @@ -50,6 +56,12 @@ private void OnEnable() input_ControlMapping.Actionmap1.Cancel.Enable(); input_ControlMapping.Actionmap1.ToolMode.Enable(); input_ControlMapping.Actionmap1.MathMode.Enable(); + input_ControlMapping.Actionmap1.Modifier.Enable(); + input_ControlMapping.Actionmap1.Load.Enable(); + input_ControlMapping.Actionmap1.Save.Enable(); + input_ControlMapping.Actionmap1.Reset.Enable(); + input_ControlMapping.Actionmap1.Undo.Enable(); + input_ControlMapping.Actionmap1.Redo.Enable(); } private void OnDisable() @@ -57,6 +69,12 @@ private void OnDisable() input_ControlMapping.Actionmap1.Cancel.Disable(); input_ControlMapping.Actionmap1.ToolMode.Disable(); input_ControlMapping.Actionmap1.MathMode.Disable(); + input_ControlMapping.Actionmap1.Modifier.Enable(); + input_ControlMapping.Actionmap1.Load.Disable(); + input_ControlMapping.Actionmap1.Save.Disable(); + input_ControlMapping.Actionmap1.Reset.Disable(); + input_ControlMapping.Actionmap1.Undo.Disable(); + input_ControlMapping.Actionmap1.Redo.Disable(); } @@ -122,9 +140,7 @@ void Start3() UIconfig.CanvasOnOff_Array[3] = 1; SetCamControl123(false); - Update(); - print("Start4"); - + } @@ -152,10 +168,9 @@ void Update3() CheckUI_Vis_walk(); CheckIf(); - if (UIconfig.InputManagerVersion == 1) - { - Update2(); - } + + Update2(); + CheckUI_Vis(); } @@ -514,32 +529,74 @@ void CheckUI_Vis() void Update2() { - - if (Input.GetButton(modifier)) + if (UIconfig.InputManagerVersion == 1) { - if (Input.GetButtonDown(modundo)) - StageStatic.stage.factState.undo(); - else if (Input.GetButtonDown(modredo)) - StageStatic.stage.factState.redo(); - else if (Input.GetButtonDown(modreset)) - StageStatic.stage.factState.softreset(); - else if (Input.GetButtonDown(modsave)) - StageStatic.stage.push_record(); - else if (Input.GetButtonDown(modload)) + if (Input.GetButton(modifier)) { - StageStatic.stage.factState.hardreset(); - StageStatic.LoadInitStage(StageStatic.stage.name, !StageStatic.stage.use_install_folder); + if (Input.GetButtonDown(modundo)) + StageStatic.stage.factState.undo(); + else if (Input.GetButtonDown(modredo)) + StageStatic.stage.factState.redo(); + else if (Input.GetButtonDown(modreset)) + StageStatic.stage.factState.softreset(); + else if (Input.GetButtonDown(modsave)) + StageStatic.stage.push_record(); + else if (Input.GetButtonDown(modload)) + { + StageStatic.stage.factState.hardreset(); + StageStatic.LoadInitStage(StageStatic.stage.name, !StageStatic.stage.use_install_folder); + } } - } - - /* - //Todo before capturing: Make directories "UFrameIT-Screenshots/Unity_ScreenCapture" in project folder - else if (Input.GetKeyDown(ScreenshotKey)) { - ScreenCapture.CaptureScreenshot("UFrameIT-Screenshots\\Unity_ScreenCapture\\Capture.png"); } - */ + if (UIconfig.InputManagerVersion == 2) + { + if (input_ControlMapping.Actionmap1.Modifier.ReadValue<float>() != 0) + { + if (input_ControlMapping.Actionmap1.Undo.ReadValue<float>() != 0 && numinputtrigger == 0) + { + StageStatic.stage.factState.undo(); + numinputtrigger++; + StartCoroutine(slowInput()); + } + else if (input_ControlMapping.Actionmap1.Redo.ReadValue<float>() != 0 && numinputtrigger == 0) + { + StageStatic.stage.factState.redo(); + numinputtrigger++; + StartCoroutine(slowInput()); + } + else if (input_ControlMapping.Actionmap1.Reset.ReadValue<float>() != 0 && numinputtrigger == 0) + { + StageStatic.stage.factState.softreset(); + numinputtrigger++; + StartCoroutine(slowInput()); + } + else if (input_ControlMapping.Actionmap1.Save.ReadValue<float>() != 0 && numinputtrigger < 10) + { + StageStatic.stage.push_record(); + numinputtrigger= numinputtrigger+10; + StartCoroutine(slowInput()); + } + else if (input_ControlMapping.Actionmap1.Load.ReadValue<float>() != 0 && numinputtrigger == 0) + { + StageStatic.stage.factState.hardreset(); + StageStatic.LoadInitStage(StageStatic.stage.name, !StageStatic.stage.use_install_folder); + numinputtrigger++; + StartCoroutine(slowInput()); + } + } + } + /* + //Todo before capturing: Make directories "UFrameIT-Screenshots/Unity_ScreenCapture" in project folder + else if (Input.GetKeyDown(ScreenshotKey)) { + ScreenCapture.CaptureScreenshot("UFrameIT-Screenshots\\Unity_ScreenCapture\\Capture.png"); + } + */ } + + + + private void SetCursorRenderer123(bool opt) { CursorRenderer.enabled = opt; diff --git a/Assets/Scripts/UI/PlayerControls/ControlMapping.cs b/Assets/Scripts/UI/PlayerControls/ControlMapping.cs index 17ba5e14bf4f8fa64b7fa8721e7c94e841133e13..e9b65d41aba0676b4031a35cbe6de772a99c2042 100644 --- a/Assets/Scripts/UI/PlayerControls/ControlMapping.cs +++ b/Assets/Scripts/UI/PlayerControls/ControlMapping.cs @@ -98,6 +98,60 @@ public @ControlMapping() ""processors"": """", ""interactions"": """", ""initialStateCheck"": false + }, + { + ""name"": ""Modifier"", + ""type"": ""Button"", + ""id"": ""1cf75c5d-6c25-442f-85f6-bda3011e9b4b"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Load"", + ""type"": ""Button"", + ""id"": ""e399348c-431a-4b20-a0d2-1521ad09a56d"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Save"", + ""type"": ""Button"", + ""id"": ""ad291feb-9419-473d-8e23-d15653e6f34d"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Reset"", + ""type"": ""Button"", + ""id"": ""d55ab964-c17f-4aa1-a32d-788cb189b6a6"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Undo"", + ""type"": ""Button"", + ""id"": ""61668718-3468-40a0-a21c-37ec8ac1c6fc"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Redo"", + ""type"": ""Button"", + ""id"": ""672b8c93-e33f-4ad1-8da0-0214551c817d"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false } ], ""bindings"": [ @@ -463,6 +517,72 @@ public @ControlMapping() ""action"": ""Talking"", ""isComposite"": false, ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""85df03b3-004a-42f1-9305-910a2a23c72c"", + ""path"": ""<Keyboard>/m"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Modifier"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""3d9f5766-f379-403b-adca-e68c3a59646f"", + ""path"": ""<Keyboard>/l"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Load"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""00a13e97-1c6c-45bd-85e0-ae69f4d6ae99"", + ""path"": ""<Keyboard>/s"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Save"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""a02a919b-c908-4739-bb38-0d78bf336bc5"", + ""path"": ""<Keyboard>/backspace"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Reset"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""bb711fbe-cc20-4036-b440-6ccabba2354c"", + ""path"": ""<Keyboard>/u"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Undo"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""fc16e4e3-32ae-4e08-8314-fe84f611e0ad"", + ""path"": ""<Keyboard>/r"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Redo"", + ""isComposite"": false, + ""isPartOfComposite"": false } ] }, @@ -1252,6 +1372,12 @@ public @ControlMapping() m_Actionmap1_ToolMode = m_Actionmap1.FindAction("ToolMode", throwIfNotFound: true); m_Actionmap1_MathMode = m_Actionmap1.FindAction("MathMode", throwIfNotFound: true); m_Actionmap1_Talking = m_Actionmap1.FindAction("Talking", throwIfNotFound: true); + m_Actionmap1_Modifier = m_Actionmap1.FindAction("Modifier", throwIfNotFound: true); + m_Actionmap1_Load = m_Actionmap1.FindAction("Load", throwIfNotFound: true); + m_Actionmap1_Save = m_Actionmap1.FindAction("Save", throwIfNotFound: true); + m_Actionmap1_Reset = m_Actionmap1.FindAction("Reset", throwIfNotFound: true); + m_Actionmap1_Undo = m_Actionmap1.FindAction("Undo", throwIfNotFound: true); + m_Actionmap1_Redo = m_Actionmap1.FindAction("Redo", throwIfNotFound: true); // Actnmp_HC_Bttn m_Actnmp_HC_Bttn = asset.FindActionMap("Actnmp_HC_Bttn", throwIfNotFound: true); m_Actnmp_HC_Bttn_Movement = m_Actnmp_HC_Bttn.FindAction("Movement", throwIfNotFound: true); @@ -1335,6 +1461,12 @@ public int FindBinding(InputBinding bindingMask, out InputAction action) private readonly InputAction m_Actionmap1_ToolMode; private readonly InputAction m_Actionmap1_MathMode; private readonly InputAction m_Actionmap1_Talking; + private readonly InputAction m_Actionmap1_Modifier; + private readonly InputAction m_Actionmap1_Load; + private readonly InputAction m_Actionmap1_Save; + private readonly InputAction m_Actionmap1_Reset; + private readonly InputAction m_Actionmap1_Undo; + private readonly InputAction m_Actionmap1_Redo; public struct Actionmap1Actions { private @ControlMapping m_Wrapper; @@ -1347,6 +1479,12 @@ public struct Actionmap1Actions public InputAction @ToolMode => m_Wrapper.m_Actionmap1_ToolMode; public InputAction @MathMode => m_Wrapper.m_Actionmap1_MathMode; public InputAction @Talking => m_Wrapper.m_Actionmap1_Talking; + public InputAction @Modifier => m_Wrapper.m_Actionmap1_Modifier; + public InputAction @Load => m_Wrapper.m_Actionmap1_Load; + public InputAction @Save => m_Wrapper.m_Actionmap1_Save; + public InputAction @Reset => m_Wrapper.m_Actionmap1_Reset; + public InputAction @Undo => m_Wrapper.m_Actionmap1_Undo; + public InputAction @Redo => m_Wrapper.m_Actionmap1_Redo; public InputActionMap Get() { return m_Wrapper.m_Actionmap1; } public void Enable() { Get().Enable(); } public void Disable() { Get().Disable(); } @@ -1380,6 +1518,24 @@ public void SetCallbacks(IActionmap1Actions instance) @Talking.started -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnTalking; @Talking.performed -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnTalking; @Talking.canceled -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnTalking; + @Modifier.started -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnModifier; + @Modifier.performed -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnModifier; + @Modifier.canceled -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnModifier; + @Load.started -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnLoad; + @Load.performed -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnLoad; + @Load.canceled -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnLoad; + @Save.started -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnSave; + @Save.performed -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnSave; + @Save.canceled -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnSave; + @Reset.started -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnReset; + @Reset.performed -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnReset; + @Reset.canceled -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnReset; + @Undo.started -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnUndo; + @Undo.performed -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnUndo; + @Undo.canceled -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnUndo; + @Redo.started -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnRedo; + @Redo.performed -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnRedo; + @Redo.canceled -= m_Wrapper.m_Actionmap1ActionsCallbackInterface.OnRedo; } m_Wrapper.m_Actionmap1ActionsCallbackInterface = instance; if (instance != null) @@ -1408,6 +1564,24 @@ public void SetCallbacks(IActionmap1Actions instance) @Talking.started += instance.OnTalking; @Talking.performed += instance.OnTalking; @Talking.canceled += instance.OnTalking; + @Modifier.started += instance.OnModifier; + @Modifier.performed += instance.OnModifier; + @Modifier.canceled += instance.OnModifier; + @Load.started += instance.OnLoad; + @Load.performed += instance.OnLoad; + @Load.canceled += instance.OnLoad; + @Save.started += instance.OnSave; + @Save.performed += instance.OnSave; + @Save.canceled += instance.OnSave; + @Reset.started += instance.OnReset; + @Reset.performed += instance.OnReset; + @Reset.canceled += instance.OnReset; + @Undo.started += instance.OnUndo; + @Undo.performed += instance.OnUndo; + @Undo.canceled += instance.OnUndo; + @Redo.started += instance.OnRedo; + @Redo.performed += instance.OnRedo; + @Redo.canceled += instance.OnRedo; } } } @@ -1613,6 +1787,12 @@ public interface IActionmap1Actions void OnToolMode(InputAction.CallbackContext context); void OnMathMode(InputAction.CallbackContext context); void OnTalking(InputAction.CallbackContext context); + void OnModifier(InputAction.CallbackContext context); + void OnLoad(InputAction.CallbackContext context); + void OnSave(InputAction.CallbackContext context); + void OnReset(InputAction.CallbackContext context); + void OnUndo(InputAction.CallbackContext context); + void OnRedo(InputAction.CallbackContext context); } public interface IActnmp_HC_BttnActions { diff --git a/Assets/Scripts/UI/PlayerControls/ControlMapping.inputactions b/Assets/Scripts/UI/PlayerControls/ControlMapping.inputactions index 103996f3b8a50d39deac020fb4ee5aa676b40d85..dc2f6ec0fec05e83b9ff198d58cf3ed609921c1c 100644 --- a/Assets/Scripts/UI/PlayerControls/ControlMapping.inputactions +++ b/Assets/Scripts/UI/PlayerControls/ControlMapping.inputactions @@ -76,6 +76,60 @@ "processors": "", "interactions": "", "initialStateCheck": false + }, + { + "name": "Modifier", + "type": "Button", + "id": "1cf75c5d-6c25-442f-85f6-bda3011e9b4b", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Load", + "type": "Button", + "id": "e399348c-431a-4b20-a0d2-1521ad09a56d", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Save", + "type": "Button", + "id": "ad291feb-9419-473d-8e23-d15653e6f34d", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Reset", + "type": "Button", + "id": "d55ab964-c17f-4aa1-a32d-788cb189b6a6", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Undo", + "type": "Button", + "id": "61668718-3468-40a0-a21c-37ec8ac1c6fc", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Redo", + "type": "Button", + "id": "672b8c93-e33f-4ad1-8da0-0214551c817d", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false } ], "bindings": [ @@ -441,6 +495,72 @@ "action": "Talking", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "85df03b3-004a-42f1-9305-910a2a23c72c", + "path": "<Keyboard>/m", + "interactions": "", + "processors": "", + "groups": "", + "action": "Modifier", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "3d9f5766-f379-403b-adca-e68c3a59646f", + "path": "<Keyboard>/l", + "interactions": "", + "processors": "", + "groups": "", + "action": "Load", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "00a13e97-1c6c-45bd-85e0-ae69f4d6ae99", + "path": "<Keyboard>/s", + "interactions": "", + "processors": "", + "groups": "", + "action": "Save", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "a02a919b-c908-4739-bb38-0d78bf336bc5", + "path": "<Keyboard>/backspace", + "interactions": "", + "processors": "", + "groups": "", + "action": "Reset", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "bb711fbe-cc20-4036-b440-6ccabba2354c", + "path": "<Keyboard>/u", + "interactions": "", + "processors": "", + "groups": "", + "action": "Undo", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "fc16e4e3-32ae-4e08-8314-fe84f611e0ad", + "path": "<Keyboard>/r", + "interactions": "", + "processors": "", + "groups": "", + "action": "Redo", + "isComposite": false, + "isPartOfComposite": false } ] }, diff --git a/Assets/Stages/TechDemo B.JSON b/Assets/Stages/TechDemo B.JSON index 93dca637ef60dc021e2b09a39ded027157a7cf80..abc4e3885ec4965cb1e7e4586f147c0d8df0f778 100644 --- a/Assets/Stages/TechDemo B.JSON +++ b/Assets/Stages/TechDemo B.JSON @@ -1 +1 @@ -{"category":"Demo Category","number":0,"name":"TechDemo B","description":"River Stage","scene":"RiverWorld","use_install_folder":true,"hierarchie":[],"player_record_list":{},"player_record":{}} \ No newline at end of file +{"category":"Demo Category","number":0,"name":"TechDemo B","description":"River Stage","scene":"RiverWorld","use_install_folder":true,"hierarchie":[],"player_record_list":{"TechDemo B_save_0":{"solved":false,"date":-8585445539369229758,"seconds":27.484050800001569,"name":"TechDemo B_save_0"},"TechDemo B_save_1":{"solved":false,"date":-8585445539366582645,"seconds":55.249958000003971,"name":"TechDemo B_save_1"},"TechDemo B_save_2":{"solved":false,"date":-8585445539358723962,"seconds":83.800902800005133,"name":"TechDemo B_save_2"},"TechDemo B_save_3":{"solved":false,"date":-8585445539356242005,"seconds":112.60032270000738,"name":"TechDemo B_save_3"}},"player_record":{"solved":false,"date":-8585445539671936283,"seconds":112.60032270000738,"name":"TechDemo B_save"}} \ No newline at end of file diff --git a/Assets/Stages/ValidationSets/FactStateMachines/TechDemo B_sol.JSON b/Assets/Stages/ValidationSets/FactStateMachines/TechDemo B_sol.JSON index 158ef3dbab977c624865eb75a92dcbb216cd550d..6857b41a7fbc533b2cf5716fcf7298618ac646cc 100644 --- a/Assets/Stages/ValidationSets/FactStateMachines/TechDemo B_sol.JSON +++ b/Assets/Stages/ValidationSets/FactStateMachines/TechDemo B_sol.JSON @@ -1 +1 @@ -{"PointFacts":[{"Point":{"x":0.0,"y":0.0,"z":0.0,"magnitude":0.0,"sqrMagnitude":0.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact149","Label":"A","hasCustomLabel":false,"LabelId":1},{"Point":{"x":0.0,"y":6.0,"z":0.0,"normalized":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"magnitude":6.0,"sqrMagnitude":36.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact150","Label":"B","hasCustomLabel":false,"LabelId":2}],"LineFacts":[{"Distance":6.0,"Pid1":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact149","Pid2":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact150","Dir":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact151","Label":"[AB]","hasCustomLabel":false,"LabelId":0}],"RayFacts":[],"OnLineFacts":[],"AngleFacts":[],"MetaInf":{"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact149":{"workflow_id":0,"active":true},"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact150":{"workflow_id":1,"active":true},"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact151":{"workflow_id":2,"active":true}},"Workflow":[{"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact149","samestep":false,"steplink":3,"creation":true},{"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact150","samestep":true,"steplink":0,"creation":true},{"Id":"http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact151","samestep":true,"steplink":0,"creation":true}],"marker":3,"worksteps":1,"backlog":0,"soft_resetted":false,"invoke":false,"MaxLabelId":2,"UnusedLabelIds":[]} \ No newline at end of file +{"PointFacts":[{"Point":{"x":0.0,"y":0.0,"z":0.0,"magnitude":0.0,"sqrMagnitude":0.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact567","Label":"A","hasCustomLabel":false,"LabelId":1},{"Point":{"x":0.0,"y":6.0,"z":0.0,"normalized":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"magnitude":6.0,"sqrMagnitude":36.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact568","Label":"B","hasCustomLabel":false,"LabelId":2}],"LineFacts":[{"Distance":6.0,"Pid1":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact567","Pid2":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact568","Dir":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact569","Label":"[AB]","hasCustomLabel":false,"LabelId":0}],"RayFacts":[],"OnLineFacts":[],"AngleFacts":[],"MetaInf":{"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact567":{"workflow_id":0,"active":true},"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact568":{"workflow_id":1,"active":true},"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact569":{"workflow_id":2,"active":true}},"Workflow":[{"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact567","samestep":false,"steplink":3,"creation":true},{"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact568","samestep":true,"steplink":0,"creation":true},{"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact569","samestep":true,"steplink":0,"creation":true}],"marker":3,"worksteps":1,"backlog":0,"soft_resetted":false,"invoke":false,"MaxLabelId":2,"UnusedLabelIds":[]} \ No newline at end of file diff --git a/Assets/Stages/ValidationSets/TechDemo B_val.JSON b/Assets/Stages/ValidationSets/TechDemo B_val.JSON index f620ff128b57ffa6a7cc6bc449ae4de6927122d5..793ce5236a7d19cc6bdec6b22743a541ce960db8 100644 --- a/Assets/Stages/ValidationSets/TechDemo B_val.JSON +++ b/Assets/Stages/ValidationSets/TechDemo B_val.JSON @@ -1 +1 @@ -[{"MasterIDs":["http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact151"],"SolutionIndex":[],"RelationIndex":[],"ComparerString":"LineFactHightDirectionComparer"},{"MasterIDs":["http://mathhub.info/FrameIT/frameworld/integrationtests?SampleSituationSpace/Root?fact151"],"SolutionIndex":[],"RelationIndex":[],"ComparerString":"LineSpanningOverRiverWorldComparer"},{"MasterIDs":[],"SolutionIndex":[1],"RelationIndex":[0],"ComparerString":"LineFactHightComparer"}] \ No newline at end of file +[{"MasterIDs":["http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact569"],"SolutionIndex":[],"RelationIndex":[],"ComparerString":"LineFactHightDirectionComparer"},{"MasterIDs":["http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact569"],"SolutionIndex":[],"RelationIndex":[],"ComparerString":"LineSpanningOverRiverWorldComparer"},{"MasterIDs":[],"SolutionIndex":[1],"RelationIndex":[0],"ComparerString":"LineFactHightComparer"}] \ No newline at end of file diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index 0a74b62c402f2c5273503b05534a6f733b7d29e2..681b79cabf99eb55d1333b469a01b2d9e37257cb 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -27,10 +27,10 @@ EditorUserSettings: value: 22424703114646680e0b0227036c721518021d39630527392304183df7e57a2decee22f0 flags: 0 RecentlyUsedScenePath-7: - value: 22424703114646680e0b0227036c681f041b1c39631a2f26283b2a3cf0ec3076f7e93ffdfe + value: 22424703114646680e0b0227036c721518021d3963042725232a151ee7ee213dacf238e0f323 flags: 0 RecentlyUsedScenePath-8: - value: 22424703114646680e0b0227036c721518021d3963042725232a151ee7ee213dacf238e0f323 + value: 22424703114646680e0b0227036c681f041b1c39631a2f26283b2a3cf0ec3076f7e93ffdfe flags: 0 UnityRemoteDevice: value: 225f4d46245b0d4902070862342649191512