Ejemplo n.º 1
0
        private void DoBinding(KeyBind kb)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label(kb.description, GUILayout.Width(165));
            string label;

            if (IsCapturing() && kb == captureTarget)
            {
                label = "...";
            }
            else
            {
                label = kb.HumanBinding;
            }
            if (GUILayout.Button(label, GUILayout.Width(110)))
            {
                if (captureTarget == null)
                {
                    StartKeyCapture(kb);
                }
                else
                {
                    CancelKeyCapture();
                }
            }
            if (!kb.IsRequiredBound() && GUILayout.Button("clear", WindowStyles.DeleteButtonStyle))
            {
                CancelKeyCapture();
                kb.SetBinding(null);
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
        }
Ejemplo n.º 2
0
 private void DoBinding(KeyBind kb)
 {
     GUILayout.BeginHorizontal();
     GUILayout.Label(kb.description, GUILayout.Width(165));
     string label;
     if (IsCapturing() && kb == captureTarget) {
         label = "...";
     } else {
         label = kb.HumanBinding;
     }
     if (GUILayout.Button(label, GUILayout.Width(110))) {
         if (captureTarget == null) {
             StartKeyCapture(kb);
         } else {
             CancelKeyCapture();
         }
     }
     if (!kb.IsRequiredBound() && GUILayout.Button("clear", C.DeleteButtonStyle)) {
         CancelKeyCapture();
         kb.SetBinding(null);
     }
     GUILayout.FlexibleSpace();
     GUILayout.EndHorizontal();
 }
Ejemplo n.º 3
0
 private void CompleteKeyCapture(Event ev)
 {
     captureTarget.SetBinding(ev);
     StateHandler.keyBindings.captureAnyKey -= HandleCapturedKey;
     captureTarget = null;
 }