Exemplo n.º 1
0
        private void DrawParameterViewer(DDNAEventManagerEventParameter parameter)
        {
            List <string> usingEvents = GetEventNamesThatUseParameter(parameter.id);

            GUILayout.BeginVertical();

            EditorGUILayout.LabelField("Application ID", parameter.application.ToString());
            EditorGUILayout.LabelField("ID", parameter.id.ToString());
            EditorGUILayout.LabelField("Name", parameter.name);
            EventsManagerUI.SizedTextAreaLabel(_parent.position.width - LIST_WIDTH, "Description", parameter.description);

            EditorGUILayout.LabelField("Type", parameter.type);
            if (parameter.type == "STRING")
            {
                EditorGUILayout.LabelField("Format", parameter.format);
            }
            if (usingEvents.Count > 0)
            {
                EditorGUILayout.HelpBox("This parameter is in use by the following events: \n- " +
                                        String.Join("\n- ", usingEvents),
                                        MessageType.Info);
            }
            else
            {
                EditorGUILayout.HelpBox("This parameter is not used by any events!",
                                        MessageType.Info);
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndVertical();
        }
Exemplo n.º 2
0
 private void SelectNewParameter(DDNAEventManagerEventParameter newParameter)
 {
     GUI.FocusControl(null);
     _selectedParameterId     = newParameter.id;
     _selectedParameterObject = newParameter;
     _mode = Mode.View;
 }
Exemplo n.º 3
0
 private void ClearSelectedParameter()
 {
     GUI.FocusControl(null);
     _selectedParameterId     = 0;
     _selectedParameterObject = null;
     _mode = Mode.View;
 }
Exemplo n.º 4
0
        private void ParameterCreated(DDNAEventManagerEventParameter parameter)
        {
            _newDescription = null;
            _newFormat      = null;
            _newName        = null;
            _newType        = ParameterType.String;

            _selectedParameterId     = parameter.id;
            _selectedParameterObject = parameter;

            _parent.RefreshData();
            _mode = Mode.View;

            _parent.Repaint();
        }
Exemplo n.º 5
0
 public void Refresh()
 {
     // Relink the current parameter object, as it may no longer contain the same data
     // as before. The ID should never change after creation, but somebody may have changed
     // the underlying data via the website.
     if (_mode == Mode.View &&
         _selectedParameterId > 0 &&
         _parameterProvider.HasData)
     {
         foreach (DDNAEventManagerEventParameter apiParameter in _parameterProvider.Data)
         {
             if (apiParameter.id == _selectedParameterId)
             {
                 _selectedParameterObject = apiParameter;
             }
         }
     }
 }
Exemplo n.º 6
0
        private void DrawParameterDetail(DDNAEventManagerEventParameter parameter, float fieldWidth)
        {
            bool isString = parameter.type == "STRING";

            EditorGUI.indentLevel++;
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Required", EditorStyles.boldLabel, GUILayout.Width(fieldWidth));
            EditorGUILayout.LabelField("Type", EditorStyles.boldLabel, GUILayout.Width(fieldWidth));
            if (isString)
            {
                EditorGUILayout.LabelField("Format", EditorStyles.boldLabel, GUILayout.Width(fieldWidth));
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(parameter.required.ToString(), GUILayout.Width(fieldWidth));
            EditorGUILayout.LabelField(parameter.type, GUILayout.Width(fieldWidth));
            if (isString)
            {
                EditorGUILayout.LabelField(parameter.format, GUILayout.Width(fieldWidth));
            }
            EditorGUILayout.EndHorizontal();
            EditorGUI.indentLevel--;
        }