Skip to content
Snippets Groups Projects
ControlOptionsM_Keyboard_mobile.cs 2.62 KiB
Newer Older
  • Learn to ignore specific revisions
  • using UnityEngine;
    using UnityEngine.UI; //andr
    using static StreamingAssetLoader;
    
    
    public class ControlOptionsM_Keyboard_mobile : MonoBehaviour
    {
    
        public GameObject MCiW_ButtonT;
        public GameObject MCiW_ButtonUT;
    
    
        public GameObject IHS_ButtonT;
        public GameObject IHS_ButtonUT;
    
    
    
    
        /*
        public GameObject TAV_Slider;
        public GameObject TAvisibilityT;
        */
    
        private Color colChangeable = new Color(1f, 1f, 1f, 0.5f);
        private Color colChangeable2 = new Color(1f, 1f, 1f, 0.5f);
    
        //public GameObject TouchModeButton;
    
    
        //public GameObject back_GObj;
    
        void Start()
        {
            UpdateUI_6();
    
    MaZiFAU's avatar
    MaZiFAU committed
    
    
        }
    
        private void Update()
        {
            UpdateUI_6();
        }
    
        void UpdateUI_6()
        {
            switch (UIconfig.MouseKeepingInWindow)
            {
                case true:
    
                    MCiW_ButtonT.GetComponent<Text>().text = "Mouse is hold in Window";
                    MCiW_ButtonUT.GetComponent<Text>().text = "Press to change Mode ";
                    Cursor.lockState = CursorLockMode.Confined;
                    break;
    
                case false:
    
                    MCiW_ButtonT.GetComponent<Text>().text = "Mouse can leave Window";
                    MCiW_ButtonUT.GetComponent<Text>().text = "Press to change Mode";
                    Cursor.lockState = CursorLockMode.None;
                    break;
    
            }
    
    
    
            switch (UIconfig.scrolldirection)
            {
                case -1:
    
                    IHS_ButtonT.GetComponent<Text>().text = "Mousewheel up is left";
                    IHS_ButtonUT.GetComponent<Text>().text = "Press to toggle";
                    break;
    
                case 1:
    
                    IHS_ButtonT.GetComponent<Text>().text = "Mousewheel up is right";
                    IHS_ButtonUT.GetComponent<Text>().text = "Press to toggle";
                    break;
    
                default:
    
                    IHS_ButtonT.GetComponent<Text>().text = "Panic??";
                    IHS_ButtonUT.GetComponent<Text>().text = "Press to toggle";
                    break;
            }
    
    
    
        }
    
        public void ChangeMouseCaptureInWindow()
        {
            switch (UIconfig.MouseKeepingInWindow)
            {
                case false:
                    UIconfig.MouseKeepingInWindow = true;
                    Cursor.lockState = CursorLockMode.Confined;
                    break;
    
    
    
                case true:
                    UIconfig.MouseKeepingInWindow = false;
                    Cursor.lockState = CursorLockMode.None;
                    break;
    
            }
    
    MaZiFAU's avatar
    MaZiFAU committed
    
    
        public void InvertHotbarScrollDirection()
        {
            UIconfig.scrolldirection *= -1;
    
            //updateUIpreview();
            NetworkJSON_Save();
        }
    
    
    MaZiFAU's avatar
    MaZiFAU committed