private void DrawScriptItem(ScriptItem item, ref ScriptItem itemToDelete)
        {
            EditorGUILayout.BeginHorizontal();

#if USE_UNET
            if (item.resourceType == ScriptWizardResourceType.Quest || item.resourceType == ScriptWizardResourceType.QuestEntry || item.resourceType == ScriptWizardResourceType.Variable)
            {
                item.netSetMode = (NetSetMode)EditorGUILayout.EnumPopup(item.netSetMode, GUILayout.Width(36));
            }
            else
            {
                item.netSetMode = NetSetMode.Set;
                EditorGUILayout.LabelField("Set", GUILayout.Width(32));
            }
#else
            EditorGUILayout.LabelField("Set", GUILayout.Width(32));
#endif
            ScriptWizardResourceType newResourceType = (ScriptWizardResourceType)EditorGUILayout.EnumPopup(item.resourceType, GUILayout.Width(96));
            if (newResourceType != item.resourceType)
            {
                item.resourceType          = newResourceType;
                item.scriptQuestEntryNames = new string[0];

                s_lastWizardResourceType = LuaWizardBase.GetScriptResourceTypeToConditionResourceType(newResourceType);
            }

            if (item.resourceType == ScriptWizardResourceType.Quest)
            {
                // Quest:
                item.questNamesIndex = EditorGUILayout.Popup(item.questNamesIndex, questNames);
                EditorGUILayout.LabelField("to", GUILayout.Width(22));
                item.questState = QuestStateDrawer.LayoutQuestStatePopup(item.questState, 96);

                s_lastQuestNamesIndex = item.questNamesIndex;
            }
            else if (item.resourceType == ScriptWizardResourceType.QuestEntry)
            {
                // Quest Entry:
                int newQuestNamesIndex = EditorGUILayout.Popup(item.questNamesIndex, complexQuestNames);
                if (newQuestNamesIndex != item.questNamesIndex)
                {
                    item.questNamesIndex       = newQuestNamesIndex;
                    item.scriptQuestEntryNames = new string[0];
                }
                if ((item.scriptQuestEntryNames.Length == 0) && (item.questNamesIndex < complexQuestNames.Length))
                {
                    item.scriptQuestEntryNames = GetQuestEntryNames(complexQuestNames[item.questNamesIndex]);
                }
                item.questEntryIndex = EditorGUILayout.Popup(item.questEntryIndex, item.scriptQuestEntryNames);
                EditorGUILayout.LabelField("to", GUILayout.Width(22));
                item.questState = QuestStateDrawer.LayoutQuestStatePopup(item.questState, 96);

                s_lastQuestNamesIndex = item.questNamesIndex;
                s_lastQuestEntryIndex = item.questEntryIndex;
            }
            else if (item.resourceType == ScriptWizardResourceType.Variable)
            {
                // Variable:
                item.variableNamesIndex = EditorGUILayout.Popup(item.variableNamesIndex, variablePopupNames);
                var variableType = GetWizardVariableType(item.variableNamesIndex);
                DrawValueSetMode(item, variableType);
                switch (variableType)
                {
                case FieldType.Boolean:
                    item.booleanValue = (BooleanType)EditorGUILayout.EnumPopup(item.booleanValue);
                    break;

                case FieldType.Number:
                    item.floatValue = EditorGUILayout.FloatField(item.floatValue);
                    break;

                default:
                    item.stringValue = EditorGUILayout.TextField(item.stringValue);
                    break;
                }

                s_lastVariableNameIndex = item.variableNamesIndex;
            }
            else if (item.resourceType == ScriptWizardResourceType.Actor)
            {
                // Actor:
                item.actorNamesIndex = EditorGUILayout.Popup(item.actorNamesIndex, actorNames);
                item.actorFieldIndex = EditorGUILayout.Popup(item.actorFieldIndex, actorFieldNames);
                var actorFieldType = GetWizardActorFieldType(item.actorFieldIndex);
                DrawValueSetMode(item, actorFieldType);
                switch (actorFieldType)
                {
                case FieldType.Boolean:
                    item.booleanValue = (BooleanType)EditorGUILayout.EnumPopup(item.booleanValue);
                    break;

                case FieldType.Number:
                    item.floatValue = EditorGUILayout.FloatField(item.floatValue);
                    break;

                default:
                    item.stringValue = EditorGUILayout.TextField(item.stringValue);
                    break;
                }

                s_lastActorNamesIndex = item.actorNamesIndex;
                s_lastActorFieldIndex = item.actorFieldIndex;
            }
            else if (item.resourceType == ScriptWizardResourceType.Item)
            {
                // Item:
                item.itemNamesIndex = EditorGUILayout.Popup(item.itemNamesIndex, itemNames);
                item.itemFieldIndex = EditorGUILayout.Popup(item.itemFieldIndex, itemFieldNames);
                var itemFieldType = GetWizardItemFieldType(item.itemFieldIndex);
                DrawValueSetMode(item, itemFieldType);
                switch (itemFieldType)
                {
                case FieldType.Boolean:
                    item.booleanValue = (BooleanType)EditorGUILayout.EnumPopup(item.booleanValue);
                    break;

                case FieldType.Number:
                    item.floatValue = EditorGUILayout.FloatField(item.floatValue);
                    break;

                default:
                    item.stringValue = EditorGUILayout.TextField(item.stringValue);
                    break;
                }

                s_lastItemNamesIndex = item.itemNamesIndex;
                s_lastItemFieldIndex = item.itemFieldIndex;
            }
            else if (item.resourceType == ScriptWizardResourceType.Location)
            {
                // Location:
                item.locationNamesIndex = EditorGUILayout.Popup(item.locationNamesIndex, locationNames);
                item.locationFieldIndex = EditorGUILayout.Popup(item.locationFieldIndex, locationFieldNames);
                var locationFieldType = GetWizardLocationFieldType(item.locationFieldIndex);
                DrawValueSetMode(item, locationFieldType);
                switch (locationFieldType)
                {
                case FieldType.Boolean:
                    item.booleanValue = (BooleanType)EditorGUILayout.EnumPopup(item.booleanValue);
                    break;

                case FieldType.Number:
                    item.floatValue = EditorGUILayout.FloatField(item.floatValue);
                    break;

                default:
                    item.stringValue = EditorGUILayout.TextField(item.stringValue);
                    break;
                }

                s_lastLocationNameIndex  = item.locationNamesIndex;
                s_lastLocationFieldIndex = item.locationFieldIndex;
            }
            else if (item.resourceType == ScriptWizardResourceType.SimStatus)
            {
                // SimStatus:
                item.simStatusID   = EditorGUILayout.IntField(item.simStatusID, GUILayout.Width(50));
                item.simStatusType = (SimStatusType)EditorGUILayout.EnumPopup(item.simStatusType);
            }
            else if (item.resourceType == ScriptWizardResourceType.Alert)
            {
                // Alert:
                item.stringValue = EditorGUILayout.TextField(item.stringValue);
            }
            else if (item.resourceType == ScriptWizardResourceType.Custom)
            {
                // Custom Lua Functions:
                if (customLuaFuncs == null)
                {
                    FindAllCustomLuaFuncs(false, out customLuaFuncs, out customLuaFuncNames);
                }

                int newCustomLuaFuncIndex = EditorGUILayout.Popup(item.customLuaFuncIndex, customLuaFuncNames);
                if (newCustomLuaFuncIndex != item.customLuaFuncIndex)
                {
                    item.customLuaFuncIndex = newCustomLuaFuncIndex;
                    item.customParamValues  = null;
                }
                if (0 <= item.customLuaFuncIndex && item.customLuaFuncIndex < customLuaFuncs.Length)
                {
                    var luaFuncRecord = customLuaFuncs[item.customLuaFuncIndex];
                    if (item.customParamValues == null)
                    {
                        InitCustomParamValues(luaFuncRecord, out item.customParamValues);
                    }
                    for (int i = 0; i < luaFuncRecord.parameters.Length; i++)
                    {
                        switch (luaFuncRecord.parameters[i])
                        {
                        case CustomLuaParameterType.Bool:
                            item.customParamValues[i] = (BooleanType)EditorGUILayout.EnumPopup((BooleanType)item.customParamValues[i]);
                            break;

                        case CustomLuaParameterType.Double:
                            item.customParamValues[i] = EditorGUILayout.FloatField((float)item.customParamValues[i]);
                            break;

                        case CustomLuaParameterType.String:
                            item.customParamValues[i] = EditorGUILayout.TextField((string)item.customParamValues[i]);
                            break;

                        case CustomLuaParameterType.Actor:
                            item.customParamValues[i] = EditorGUILayout.Popup((int)item.customParamValues[i], actorNames);
                            break;

                        case CustomLuaParameterType.Quest:
                            item.customParamValues[i] = EditorGUILayout.Popup((int)item.customParamValues[i], questNames);
                            item.questNamesIndex      = (int)item.customParamValues[i];
                            break;

                        case CustomLuaParameterType.QuestEntry:
                            if ((item.scriptQuestEntryNames.Length == 0) && (item.questNamesIndex < complexQuestNames.Length))
                            {
                                item.scriptQuestEntryNames = GetQuestEntryNames(complexQuestNames[item.questNamesIndex]);
                            }
                            item.customParamValues[i] = EditorGUILayout.Popup((int)item.customParamValues[i], item.scriptQuestEntryNames);
                            break;

                        case CustomLuaParameterType.Variable:
                            item.customParamValues[i] = EditorGUILayout.Popup((int)item.customParamValues[i], variableNames);
                            break;

                        case CustomLuaParameterType.Item:
                            item.customParamValues[i] = EditorGUILayout.Popup((int)item.customParamValues[i], itemNames);
                            break;
                        }
                    }
                }
            }
            else if (item.resourceType == ScriptWizardResourceType.ManualEnter)
            {
                // Custom:
                item.stringValue = EditorGUILayout.TextField(item.stringValue);
            }

            if (GUILayout.Button(new GUIContent("-", "Delete this script action."), EditorStyles.miniButton, GUILayout.Width(22)))
            {
                itemToDelete = item;
            }
            EditorGUILayout.EndHorizontal();
        }
Beispiel #2
0
        private void DrawConditionItem(ConditionItem item, ref ConditionItem itemToDelete)
        {
            EditorGUILayout.BeginHorizontal();

            ConditionWizardResourceType newConditionType = (ConditionWizardResourceType)EditorGUILayout.EnumPopup(item.conditionType, GUILayout.Width(96));

            if (newConditionType != item.conditionType)
            {
                item.conditionType             = newConditionType;
                item.conditionsQuestEntryNames = new string[0];

                s_lastWizardResourceType = newConditionType;
            }

            if (item.conditionType == ConditionWizardResourceType.Quest)
            {
                // Quest:
                item.questNamesIndex = EditorGUILayout.Popup(item.questNamesIndex, questNames);
                item.equalityType    = (EqualityType)EditorGUILayout.EnumPopup(item.equalityType, GUILayout.Width(60));
                item.questState      = QuestStateDrawer.LayoutQuestStatePopup(item.questState, 96);

                s_lastQuestNamesIndex = item.questNamesIndex;
            }
            else if (item.conditionType == ConditionWizardResourceType.QuestEntry)
            {
                // Quest Entry:
                int newQuestNamesIndex = EditorGUILayout.Popup(item.questNamesIndex, complexQuestNames);
                if (newQuestNamesIndex != item.questNamesIndex)
                {
                    item.questNamesIndex           = newQuestNamesIndex;
                    item.conditionsQuestEntryNames = new string[0];
                }
                if ((item.conditionsQuestEntryNames.Length == 0) && (item.questNamesIndex < complexQuestNames.Length))
                {
                    item.conditionsQuestEntryNames = GetQuestEntryNames(complexQuestNames[item.questNamesIndex]);
                }
                item.questEntryIndex = EditorGUILayout.Popup(item.questEntryIndex, item.conditionsQuestEntryNames);
                item.equalityType    = (EqualityType)EditorGUILayout.EnumPopup(item.equalityType, GUILayout.Width(60));
                item.questState      = QuestStateDrawer.LayoutQuestStatePopup(item.questState, 96);

                s_lastQuestNamesIndex = item.questNamesIndex;
                s_lastQuestEntryIndex = item.questEntryIndex;
            }
            else if (item.conditionType == ConditionWizardResourceType.Variable)
            {
                // Variable:
                item.variableNamesIndex = EditorGUILayout.Popup(item.variableNamesIndex, variableNames);
                DrawRightHand(item, GetWizardVariableType(item.variableNamesIndex));

                s_lastVariableNameIndex = item.variableNamesIndex;
            }
            else if (item.conditionType == ConditionWizardResourceType.Actor)
            {
                // Actor:
                item.actorNamesIndex = EditorGUILayout.Popup(item.actorNamesIndex, actorNames);
                item.actorFieldIndex = EditorGUILayout.Popup(item.actorFieldIndex, actorFieldNames);
                DrawRightHand(item, GetWizardActorFieldType(item.actorFieldIndex));

                s_lastActorNamesIndex = item.actorNamesIndex;
                s_lastActorFieldIndex = item.actorFieldIndex;
            }
            else if (item.conditionType == ConditionWizardResourceType.Item)
            {
                // Item:
                item.itemNamesIndex = EditorGUILayout.Popup(item.itemNamesIndex, itemNames);
                item.itemFieldIndex = EditorGUILayout.Popup(item.itemFieldIndex, itemFieldNames);
                DrawRightHand(item, GetWizardItemFieldType(item.itemFieldIndex));

                s_lastItemNamesIndex = item.itemNamesIndex;
                s_lastItemFieldIndex = item.itemFieldIndex;
            }
            else if (item.conditionType == ConditionWizardResourceType.Location)
            {
                // Location:
                item.locationNamesIndex = EditorGUILayout.Popup(item.locationNamesIndex, locationNames);
                item.locationFieldIndex = EditorGUILayout.Popup(item.locationFieldIndex, locationFieldNames);
                DrawRightHand(item, GetWizardLocationFieldType(item.locationFieldIndex));

                s_lastLocationNameIndex  = item.locationNamesIndex;
                s_lastLocationFieldIndex = item.locationFieldIndex;
            }

            else if (item.conditionType == ConditionWizardResourceType.SimStatus)
            {
                // SimStatus:
                item.simStatusThisID = EditorGUILayout.Toggle(GUIContent.none, item.simStatusThisID, GUILayout.Width(14));
                if (item.simStatusThisID)
                {
                    EditorGUILayout.LabelField("thisID", GUILayout.Width(38));
                }
                else
                {
                    item.simStatusID = EditorGUILayout.IntField(item.simStatusID, GUILayout.Width(38));
                }
                item.equalityType  = (EqualityType)EditorGUILayout.EnumPopup(item.equalityType, GUILayout.Width(56));
                item.simStatusType = (SimStatusType)EditorGUILayout.EnumPopup(item.simStatusType);
            }

            else if (item.conditionType == ConditionWizardResourceType.Custom)
            {
                // Custom Lua Functions:
                if (customLuaFuncs == null)
                {
                    FindAllCustomLuaFuncs(true, out customLuaFuncs, out customLuaFuncNames);
                }

                int newCustomLuaFuncIndex = EditorGUILayout.Popup(item.customLuaFuncIndex, customLuaFuncNames);
                if (newCustomLuaFuncIndex != item.customLuaFuncIndex)
                {
                    item.customLuaFuncIndex = newCustomLuaFuncIndex;
                    item.customParamValues  = null;
                }
                if (0 <= item.customLuaFuncIndex && item.customLuaFuncIndex < customLuaFuncs.Length)
                {
                    var luaFuncRecord = customLuaFuncs[item.customLuaFuncIndex];
                    if (item.customParamValues == null)
                    {
                        InitCustomParamValues(luaFuncRecord, out item.customParamValues);
                    }
                    for (int i = 0; i < luaFuncRecord.parameters.Length; i++)
                    {
                        switch (luaFuncRecord.parameters[i])
                        {
                        case CustomLuaParameterType.Bool:
                            item.customParamValues[i] = (BooleanType)EditorGUILayout.EnumPopup((BooleanType)item.customParamValues[i]);
                            break;

                        case CustomLuaParameterType.Double:
                            item.customParamValues[i] = EditorGUILayout.FloatField((float)item.customParamValues[i]);
                            break;

                        case CustomLuaParameterType.String:
                            item.customParamValues[i] = EditorGUILayout.TextField((string)item.customParamValues[i]);
                            break;

                        case CustomLuaParameterType.Actor:
                            item.customParamValues[i] = EditorGUILayout.Popup((int)item.customParamValues[i], actorNames);
                            break;

                        case CustomLuaParameterType.Quest:
                            item.customParamValues[i] = EditorGUILayout.Popup((int)item.customParamValues[i], questNames);
                            item.questNamesIndex      = (int)item.customParamValues[i];
                            break;

                        case CustomLuaParameterType.QuestEntry:
                            if ((item.conditionsQuestEntryNames.Length == 0) && (item.questNamesIndex < complexQuestNames.Length))
                            {
                                item.conditionsQuestEntryNames = GetQuestEntryNames(complexQuestNames[item.questNamesIndex]);
                            }
                            item.customParamValues[i] = EditorGUILayout.Popup((int)item.customParamValues[i], item.conditionsQuestEntryNames);
                            break;

                        case CustomLuaParameterType.Variable:
                            item.customParamValues[i] = EditorGUILayout.Popup((int)item.customParamValues[i], variableNames);
                            break;
                        }
                    }
                    switch (luaFuncRecord.returnValue)
                    {
                    case CustomLuaReturnType.Bool:
                        DrawRightHand(item, FieldType.Boolean);
                        break;

                    case CustomLuaReturnType.Double:
                        DrawRightHand(item, FieldType.Number);
                        break;

                    case CustomLuaReturnType.String:
                        DrawRightHand(item, FieldType.Text);
                        break;
                    }
                }
            }

            else if (item.conditionType == ConditionWizardResourceType.ManualEnter)
            {
                // Custom:
                item.stringValue = EditorGUILayout.TextField(item.stringValue);
            }

            if (GUILayout.Button(new GUIContent("-", "Delete this condition."), EditorStyles.miniButton, GUILayout.Width(22)))
            {
                itemToDelete = item;
            }
            EditorGUILayout.EndHorizontal();
        }
Beispiel #3
0
        private void DrawScriptItem(ScriptItem item, ref ScriptItem itemToDelete)
        {
            EditorGUILayout.BeginHorizontal();

            EditorGUILayout.LabelField("Set", GUILayout.Width(32));
            ScriptWizardResourceType newResourceType = (ScriptWizardResourceType)EditorGUILayout.EnumPopup(item.resourceType, GUILayout.Width(96));

            if (newResourceType != item.resourceType)
            {
                item.resourceType          = newResourceType;
                item.scriptQuestEntryNames = new string[0];
            }

            if (item.resourceType == ScriptWizardResourceType.Quest)
            {
                // Quest:
                item.questNamesIndex = EditorGUILayout.Popup(item.questNamesIndex, questNames);
                EditorGUILayout.LabelField("to", GUILayout.Width(22));
                //---Was: item.questState = (QuestState) EditorGUILayout.EnumPopup(item.questState, GUILayout.Width(96));
                item.questState = QuestStateDrawer.LayoutQuestStatePopup(item.questState, 96);
            }
            else if (item.resourceType == ScriptWizardResourceType.QuestEntry)
            {
                // Quest Entry:
                int newQuestNamesIndex = EditorGUILayout.Popup(item.questNamesIndex, complexQuestNames);
                if (newQuestNamesIndex != item.questNamesIndex)
                {
                    item.questNamesIndex       = newQuestNamesIndex;
                    item.scriptQuestEntryNames = new string[0];
                }
                if ((item.scriptQuestEntryNames.Length == 0) && (item.questNamesIndex < complexQuestNames.Length))
                {
                    item.scriptQuestEntryNames = GetQuestEntryNames(complexQuestNames[item.questNamesIndex]);
                }
                item.questEntryIndex = EditorGUILayout.Popup(item.questEntryIndex, item.scriptQuestEntryNames);
                EditorGUILayout.LabelField("to", GUILayout.Width(22));
                //---Was: item.questState = (QuestState) EditorGUILayout.EnumPopup(item.questState, GUILayout.Width(96));
                item.questState = QuestStateDrawer.LayoutQuestStatePopup(item.questState, 96);
            }
            else if (item.resourceType == ScriptWizardResourceType.Variable)
            {
                // Variable:
                item.variableNamesIndex = EditorGUILayout.Popup(item.variableNamesIndex, variableNames);
                var variableType = GetWizardVariableType(item.variableNamesIndex);
                DrawValueSetMode(item, variableType);
                switch (variableType)
                {
                case FieldType.Boolean:
                    item.booleanValue = (BooleanType)EditorGUILayout.EnumPopup(item.booleanValue);
                    break;

                case FieldType.Number:
                    item.floatValue = EditorGUILayout.FloatField(item.floatValue);
                    break;

                default:
                    item.stringValue = EditorGUILayout.TextField(item.stringValue);
                    break;
                }
            }
            else if (item.resourceType == ScriptWizardResourceType.Actor)
            {
                // Actor:
                item.actorNamesIndex = EditorGUILayout.Popup(item.actorNamesIndex, actorNames);
                item.actorFieldIndex = EditorGUILayout.Popup(item.actorFieldIndex, actorFieldNames);
                var actorFieldType = GetWizardActorFieldType(item.actorFieldIndex);
                DrawValueSetMode(item, actorFieldType);
                switch (actorFieldType)
                {
                case FieldType.Boolean:
                    item.booleanValue = (BooleanType)EditorGUILayout.EnumPopup(item.booleanValue);
                    break;

                case FieldType.Number:
                    item.floatValue = EditorGUILayout.FloatField(item.floatValue);
                    break;

                default:
                    item.stringValue = EditorGUILayout.TextField(item.stringValue);
                    break;
                }
            }
            else if (item.resourceType == ScriptWizardResourceType.Item)
            {
                // Item:
                item.itemNamesIndex = EditorGUILayout.Popup(item.itemNamesIndex, itemNames);
                item.itemFieldIndex = EditorGUILayout.Popup(item.itemFieldIndex, itemFieldNames);
                var itemFieldType = GetWizardItemFieldType(item.itemFieldIndex);
                DrawValueSetMode(item, itemFieldType);
                switch (itemFieldType)
                {
                case FieldType.Boolean:
                    item.booleanValue = (BooleanType)EditorGUILayout.EnumPopup(item.booleanValue);
                    break;

                case FieldType.Number:
                    item.floatValue = EditorGUILayout.FloatField(item.floatValue);
                    break;

                default:
                    item.stringValue = EditorGUILayout.TextField(item.stringValue);
                    break;
                }
            }
            else if (item.resourceType == ScriptWizardResourceType.Location)
            {
                // Location:
                item.locationNamesIndex = EditorGUILayout.Popup(item.locationNamesIndex, locationNames);
                item.locationFieldIndex = EditorGUILayout.Popup(item.locationFieldIndex, locationFieldNames);
                var locationFieldType = GetWizardLocationFieldType(item.locationFieldIndex);
                DrawValueSetMode(item, locationFieldType);
                switch (locationFieldType)
                {
                case FieldType.Boolean:
                    item.booleanValue = (BooleanType)EditorGUILayout.EnumPopup(item.booleanValue);
                    break;

                case FieldType.Number:
                    item.floatValue = EditorGUILayout.FloatField(item.floatValue);
                    break;

                default:
                    item.stringValue = EditorGUILayout.TextField(item.stringValue);
                    break;
                }
            }
            else if (item.resourceType == ScriptWizardResourceType.SimStatus)
            {
                // SimStatus:
                item.simStatusID   = EditorGUILayout.IntField(item.simStatusID, GUILayout.Width(50));
                item.simStatusType = (SimStatusType)EditorGUILayout.EnumPopup(item.simStatusType);
            }
            else if (item.resourceType == ScriptWizardResourceType.Alert)
            {
                // Alert:
                item.stringValue = EditorGUILayout.TextField(item.stringValue);
            }
            else if (item.resourceType == ScriptWizardResourceType.Custom)
            {
                // Custom:
                item.stringValue = EditorGUILayout.TextField(item.stringValue);
            }

            if (GUILayout.Button(new GUIContent("-", "Delete this script action."), EditorStyles.miniButton, GUILayout.Width(22)))
            {
                itemToDelete = item;
            }
            EditorGUILayout.EndHorizontal();
        }
Beispiel #4
0
        private void DrawConditionItem(ConditionItem item, ref ConditionItem itemToDelete)
        {
            EditorGUILayout.BeginHorizontal();

            ConditionWizardResourceType newConditionType = (ConditionWizardResourceType)EditorGUILayout.EnumPopup(item.conditionType, GUILayout.Width(96));

            if (newConditionType != item.conditionType)
            {
                item.conditionType             = newConditionType;
                item.conditionsQuestEntryNames = new string[0];
            }

            if (item.conditionType == ConditionWizardResourceType.Quest)
            {
                // Quest:
                item.questNamesIndex = EditorGUILayout.Popup(item.questNamesIndex, questNames);
                item.equalityType    = (EqualityType)EditorGUILayout.EnumPopup(item.equalityType, GUILayout.Width(60));
                item.questState      = QuestStateDrawer.LayoutQuestStatePopup(item.questState, 96);
            }
            else if (item.conditionType == ConditionWizardResourceType.QuestEntry)
            {
                // Quest Entry:
                int newQuestNamesIndex = EditorGUILayout.Popup(item.questNamesIndex, complexQuestNames);
                if (newQuestNamesIndex != item.questNamesIndex)
                {
                    item.questNamesIndex           = newQuestNamesIndex;
                    item.conditionsQuestEntryNames = new string[0];
                }
                if ((item.conditionsQuestEntryNames.Length == 0) && (item.questNamesIndex < complexQuestNames.Length))
                {
                    item.conditionsQuestEntryNames = GetQuestEntryNames(complexQuestNames[item.questNamesIndex]);
                }
                item.questEntryIndex = EditorGUILayout.Popup(item.questEntryIndex, item.conditionsQuestEntryNames);
                item.equalityType    = (EqualityType)EditorGUILayout.EnumPopup(item.equalityType, GUILayout.Width(60));
                item.questState      = QuestStateDrawer.LayoutQuestStatePopup(item.questState, 96);
            }
            else if (item.conditionType == ConditionWizardResourceType.Variable)
            {
                // Variable:
                item.variableNamesIndex = EditorGUILayout.Popup(item.variableNamesIndex, variableNames);
                DrawRightHand(item, GetWizardVariableType(item.variableNamesIndex));
            }
            else if (item.conditionType == ConditionWizardResourceType.Actor)
            {
                // Actor:
                item.actorNamesIndex = EditorGUILayout.Popup(item.actorNamesIndex, actorNames);
                item.actorFieldIndex = EditorGUILayout.Popup(item.actorFieldIndex, actorFieldNames);
                DrawRightHand(item, GetWizardActorFieldType(item.actorFieldIndex));
            }
            else if (item.conditionType == ConditionWizardResourceType.Item)
            {
                // Item:
                item.itemNamesIndex = EditorGUILayout.Popup(item.itemNamesIndex, itemNames);
                item.itemFieldIndex = EditorGUILayout.Popup(item.itemFieldIndex, itemFieldNames);
                DrawRightHand(item, GetWizardItemFieldType(item.itemFieldIndex));
            }
            else if (item.conditionType == ConditionWizardResourceType.Location)
            {
                // Location:
                item.locationNamesIndex = EditorGUILayout.Popup(item.locationNamesIndex, locationNames);
                item.locationFieldIndex = EditorGUILayout.Popup(item.locationFieldIndex, locationFieldNames);
                DrawRightHand(item, GetWizardLocationFieldType(item.locationFieldIndex));
            }

            else if (item.conditionType == ConditionWizardResourceType.SimStatus)
            {
                // SimStatus:
                item.simStatusThisID = EditorGUILayout.Toggle(GUIContent.none, item.simStatusThisID, GUILayout.Width(14));
                if (item.simStatusThisID)
                {
                    EditorGUILayout.LabelField("thisID", GUILayout.Width(38));
                }
                else
                {
                    item.simStatusID = EditorGUILayout.IntField(item.simStatusID, GUILayout.Width(38));
                }
                item.equalityType  = (EqualityType)EditorGUILayout.EnumPopup(item.equalityType, GUILayout.Width(56));
                item.simStatusType = (SimStatusType)EditorGUILayout.EnumPopup(item.simStatusType);
            }

            else if (item.conditionType == ConditionWizardResourceType.Custom)
            {
                // Custom:
                item.stringValue = EditorGUILayout.TextField(item.stringValue);
            }

            if (GUILayout.Button(new GUIContent("-", "Delete this condition."), EditorStyles.miniButton, GUILayout.Width(22)))
            {
                itemToDelete = item;
            }
            EditorGUILayout.EndHorizontal();
        }