示例#1
0
        private void ItemsGUI()
        {
            EditorGUILayout.LabelField("Unhandled events", EditorStyles.boldLabel);
            unhandledCombine = ActionListAssetMenu.AssetGUI("Combine:", unhandledCombine);
            unhandledHotspot = ActionListAssetMenu.AssetGUI("Use on hotspot:", unhandledHotspot);
            if (settingsManager != null && settingsManager.CanGiveItems())
            {
                unhandledGive = ActionListAssetMenu.AssetGUI("Give to NPC:", unhandledGive);
            }

            List <string> binList = new List <string>();

            foreach (InvBin bin in bins)
            {
                binList.Add(bin.label);
            }

            EditorGUILayout.Space();
            CreateItemsGUI(binList.ToArray());
            EditorGUILayout.Space();

            if (selectedItem != null && items.Contains(selectedItem))
            {
                EditorGUILayout.LabelField("Inventory item '" + selectedItem.label + "' properties", EditorStyles.boldLabel);

                EditorGUILayout.BeginVertical("Button");
                selectedItem.label    = EditorGUILayout.TextField("Name:", selectedItem.label);
                selectedItem.altLabel = EditorGUILayout.TextField("Label (if not name):", selectedItem.altLabel);

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Category:", GUILayout.Width(146f));
                if (bins.Count > 0)
                {
                    binNumber          = GetBinSlot(selectedItem.binID);
                    binNumber          = EditorGUILayout.Popup(binNumber, binList.ToArray());
                    selectedItem.binID = bins[binNumber].id;
                }
                else
                {
                    selectedItem.binID = -1;
                    EditorGUILayout.LabelField("No categories defined!", EditorStyles.miniLabel, GUILayout.Width(146f));
                }
                EditorGUILayout.EndHorizontal();

                selectedItem.tex = (Texture2D)EditorGUILayout.ObjectField("Texture:", selectedItem.tex, typeof(Texture2D), false);

                if (settingsManager && (settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive || settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot || (settingsManager.interactionMethod == AC_InteractionMethod.ChooseHotspotThenInteraction && settingsManager.inventoryInteractions == InventoryInteractions.Single)))
                {
                    selectedItem.activeTex = (Texture2D)EditorGUILayout.ObjectField("Active texture:", selectedItem.activeTex, typeof(Texture2D), false);
                }

                selectedItem.carryOnStart = EditorGUILayout.Toggle("Carry on start?", selectedItem.carryOnStart);
                if (selectedItem.carryOnStart && AdvGame.GetReferences().settingsManager&& AdvGame.GetReferences().settingsManager.playerSwitching == PlayerSwitching.Allow && !AdvGame.GetReferences().settingsManager.shareInventory)
                {
                    selectedItem.carryOnStartNotDefault = EditorGUILayout.Toggle("Give to non-default player?", selectedItem.carryOnStartNotDefault);
                    if (selectedItem.carryOnStartNotDefault)
                    {
                        selectedItem.carryOnStartID = ChoosePlayerGUI(selectedItem.carryOnStartID);
                    }
                }

                selectedItem.canCarryMultiple = EditorGUILayout.Toggle("Can carry multiple?", selectedItem.canCarryMultiple);
                if (selectedItem.canCarryMultiple)
                {
                    selectedItem.useSeparateSlots = EditorGUILayout.Toggle("Place in separate slots?", selectedItem.useSeparateSlots);
                }
                if (selectedItem.carryOnStart && selectedItem.canCarryMultiple)
                {
                    selectedItem.count = EditorGUILayout.IntField("Quantity on start:", selectedItem.count);
                }
                else
                {
                    selectedItem.count = 1;
                }

                selectedItem.overrideUseSyntax = EditorGUILayout.Toggle("Override 'Use' syntax?", selectedItem.overrideUseSyntax);
                if (selectedItem.overrideUseSyntax)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Use syntax:", GUILayout.Width(100f));
                    selectedItem.hotspotPrefix1.label = EditorGUILayout.TextField(selectedItem.hotspotPrefix1.label, GUILayout.MaxWidth(80f));
                    EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f));
                    selectedItem.hotspotPrefix2.label = EditorGUILayout.TextField(selectedItem.hotspotPrefix2.label, GUILayout.MaxWidth(80f));
                    EditorGUILayout.LabelField("(hotspot)", GUILayout.MaxWidth(55f));
                    EditorGUILayout.EndHorizontal();
                }

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Standard interactions", EditorStyles.boldLabel);
                if (settingsManager && settingsManager.interactionMethod != AC_InteractionMethod.ContextSensitive && settingsManager.inventoryInteractions == InventoryInteractions.Multiple && AdvGame.GetReferences().cursorManager)
                {
                    CursorManager cursorManager = AdvGame.GetReferences().cursorManager;

                    List <string> iconList = new List <string>();
                    foreach (CursorIcon icon in cursorManager.cursorIcons)
                    {
                        iconList.Add(icon.label);
                    }

                    if (cursorManager.cursorIcons.Count > 0)
                    {
                        foreach (InvInteraction interaction in selectedItem.interactions)
                        {
                            EditorGUILayout.BeginHorizontal();
                            invNumber        = GetIconSlot(interaction.icon.id);
                            invNumber        = EditorGUILayout.Popup(invNumber, iconList.ToArray());
                            interaction.icon = cursorManager.cursorIcons[invNumber];

                            interaction.actionList = ActionListAssetMenu.AssetGUI("", interaction.actionList);

                            if (GUILayout.Button(deleteContent, EditorStyles.miniButtonRight, buttonWidth))
                            {
                                Undo.RecordObject(this, "Delete interaction");
                                selectedItem.interactions.Remove(interaction);
                                break;
                            }
                            EditorGUILayout.EndHorizontal();
                        }
                    }
                    else
                    {
                        EditorGUILayout.HelpBox("No interaction icons defined - please use the Cursor Manager", MessageType.Warning);
                    }
                    if (GUILayout.Button("Add interaction"))
                    {
                        Undo.RecordObject(this, "Add new interaction");
                        selectedItem.interactions.Add(new InvInteraction(cursorManager.cursorIcons[0]));
                    }
                }
                else
                {
                    selectedItem.useActionList = ActionListAssetMenu.AssetGUI("Use:", selectedItem.useActionList);
                    if (cursorManager && cursorManager.allowInteractionCursorForInventory && cursorManager.cursorIcons.Count > 0)
                    {
                        int useCursor_int = cursorManager.GetIntFromID(selectedItem.useIconID);
                        useCursor_int          = EditorGUILayout.Popup("Use cursor icon:", useCursor_int, cursorManager.GetLabelsArray(useCursor_int));
                        selectedItem.useIconID = cursorManager.cursorIcons[useCursor_int].id;
                    }
                    else
                    {
                        selectedItem.useIconID = 0;
                    }
                    selectedItem.lookActionList = ActionListAssetMenu.AssetGUI("Examine:", selectedItem.lookActionList);
                }

                if (settingsManager.CanSelectItems(false))
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("Unhandled interactions", EditorStyles.boldLabel);
                    selectedItem.unhandledActionList        = ActionListAssetMenu.AssetGUI("Unhandled use on Hotspot:", selectedItem.unhandledActionList);
                    selectedItem.unhandledCombineActionList = ActionListAssetMenu.AssetGUI("Unhandled combine:", selectedItem.unhandledCombineActionList);
                }

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Combine interactions", EditorStyles.boldLabel);
                for (int i = 0; i < selectedItem.combineActionList.Count; i++)
                {
                    EditorGUILayout.BeginHorizontal();
                    invNumber = GetArraySlot(selectedItem.combineID[i]);
                    invNumber = EditorGUILayout.Popup(invNumber, GetLabelList());
                    selectedItem.combineID[i] = items[invNumber].id;

                    selectedItem.combineActionList[i] = ActionListAssetMenu.AssetGUI("", selectedItem.combineActionList[i]);

                    if (GUILayout.Button(deleteContent, EditorStyles.miniButtonRight, buttonWidth))
                    {
                        Undo.RecordObject(this, "Delete combine event");
                        selectedItem.combineActionList.RemoveAt(i);
                        selectedItem.combineID.RemoveAt(i);
                        break;
                    }
                    EditorGUILayout.EndHorizontal();
                }
                if (GUILayout.Button("Add combine event"))
                {
                    Undo.RecordObject(this, "Add new combine event");
                    selectedItem.combineActionList.Add(null);
                    selectedItem.combineID.Add(0);
                }

                EditorGUILayout.EndVertical();
            }
        }
示例#2
0
        private void ItemsGUI()
        {
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            EditorGUILayout.LabelField("Unhandled events", CustomStyles.subHeader);
            EditorGUILayout.Space();

            unhandledCombine = ActionListAssetMenu.AssetGUI("Combine:", unhandledCombine, "AC.KickStarter.runtimeInventory.unhandledCombine");
            unhandledHotspot = ActionListAssetMenu.AssetGUI("Use on hotspot:", unhandledHotspot, "AC.KickStarter.runtimeInventory.unhandledHotspot");
            if (settingsManager != null && settingsManager.CanGiveItems())
            {
                unhandledGive = ActionListAssetMenu.AssetGUI("Give to NPC:", unhandledGive, "AC.KickStarter.runtimeInventory.unhandledGive");
            }

            passUnhandledHotspotAsParameter = CustomGUILayout.ToggleLeft("Pass Hotspot as GameObject parameter?", passUnhandledHotspotAsParameter, "AC.KickStarter.inventoryManager.passUnhandledHotspotAsParameter");
            if (passUnhandledHotspotAsParameter && unhandledHotspot != null)
            {
                EditorGUILayout.HelpBox("The Hotspot will be set as " + unhandledHotspot.name + "'s first parameter, which must be set to type 'GameObject'.", MessageType.Info);
            }

            List <string> binList = new List <string>();

            foreach (InvBin bin in bins)
            {
                binList.Add(bin.label);
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            CreateItemsGUI(binList.ToArray());
            EditorGUILayout.Space();

            if (selectedItem != null && items.Contains(selectedItem))
            {
                string apiPrefix = "AC.KickStarter.runtimeInventory.GetItem (" + selectedItem.id + ")";

                EditorGUILayout.BeginVertical(CustomStyles.thinBox);
                EditorGUILayout.LabelField("Inventory item '" + selectedItem.label + "' settings", CustomStyles.subHeader);
                EditorGUILayout.Space();

                selectedItem.label    = CustomGUILayout.TextField("Name:", selectedItem.label, apiPrefix + ".label");
                selectedItem.altLabel = CustomGUILayout.TextField("Label (if not name):", selectedItem.altLabel, apiPrefix + ".altLabel");

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Category:", GUILayout.Width(146f));
                if (bins.Count > 0)
                {
                    binNumber          = GetBinSlot(selectedItem.binID);
                    binNumber          = CustomGUILayout.Popup(binNumber, binList.ToArray(), apiPrefix + ".binID");
                    selectedItem.binID = bins[binNumber].id;
                }
                else
                {
                    selectedItem.binID = -1;
                    EditorGUILayout.LabelField("No categories defined!", EditorStyles.miniLabel, GUILayout.Width(146f));
                }
                EditorGUILayout.EndHorizontal();

                selectedItem.carryOnStart = CustomGUILayout.Toggle("Carry on start?", selectedItem.carryOnStart, apiPrefix + ".carryOnStart");
                if (selectedItem.carryOnStart && AdvGame.GetReferences().settingsManager&& AdvGame.GetReferences().settingsManager.playerSwitching == PlayerSwitching.Allow && !AdvGame.GetReferences().settingsManager.shareInventory)
                {
                    selectedItem.carryOnStartNotDefault = CustomGUILayout.Toggle("Give to non-default player?", selectedItem.carryOnStartNotDefault, apiPrefix + ".carryOnStartNotDefault");
                    if (selectedItem.carryOnStartNotDefault)
                    {
                        selectedItem.carryOnStartID = ChoosePlayerGUI(selectedItem.carryOnStartID, apiPrefix + ".carryOnStartID");
                    }
                }

                selectedItem.canCarryMultiple = CustomGUILayout.Toggle("Can carry multiple?", selectedItem.canCarryMultiple, apiPrefix + ".canCarryMultiple");
                if (selectedItem.canCarryMultiple)
                {
                    selectedItem.useSeparateSlots = CustomGUILayout.Toggle("Place in separate slots?", selectedItem.useSeparateSlots, apiPrefix + ".useSeparateSlots");
                }
                if (selectedItem.carryOnStart && selectedItem.canCarryMultiple)
                {
                    selectedItem.count = CustomGUILayout.IntField("Quantity on start:", selectedItem.count, apiPrefix + ".count");
                }
                else
                {
                    selectedItem.count = 1;
                }

                selectedItem.overrideUseSyntax = CustomGUILayout.Toggle("Override 'Use' syntax?", selectedItem.overrideUseSyntax, apiPrefix + ".overrideUseSyntax");
                if (selectedItem.overrideUseSyntax)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Use syntax:", GUILayout.Width(100f));
                    selectedItem.hotspotPrefix1.label = EditorGUILayout.TextField(selectedItem.hotspotPrefix1.label, GUILayout.MaxWidth(80f));
                    EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f));
                    selectedItem.hotspotPrefix2.label = EditorGUILayout.TextField(selectedItem.hotspotPrefix2.label, GUILayout.MaxWidth(80f));
                    EditorGUILayout.LabelField("(hotspot)", GUILayout.MaxWidth(55f));
                    EditorGUILayout.EndHorizontal();
                }

                selectedItem.linkedPrefab = (GameObject)CustomGUILayout.ObjectField <GameObject> ("Linked prefab:", selectedItem.linkedPrefab, false, apiPrefix + ".linkedPrefab");
                if (selectedItem.linkedPrefab != null)
                {
                    EditorGUILayout.HelpBox("This reference is only accessibly through scripting.", MessageType.Info);
                }

                GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(1));

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Main graphic:", GUILayout.Width(145));
                selectedItem.tex = (Texture2D)CustomGUILayout.ObjectField <Texture2D> (selectedItem.tex, false, GUILayout.Width(70), GUILayout.Height(70), apiPrefix + ".tex");
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Active graphic:", GUILayout.Width(145));
                selectedItem.activeTex = (Texture2D)CustomGUILayout.ObjectField <Texture2D> (selectedItem.activeTex, false, GUILayout.Width(70), GUILayout.Height(70), apiPrefix + ".activeTex");
                EditorGUILayout.EndHorizontal();


                if (AdvGame.GetReferences().settingsManager != null && AdvGame.GetReferences().settingsManager.selectInventoryDisplay == SelectInventoryDisplay.ShowSelectedGraphic)
                {
                    selectedItem.selectedTex = (Texture2D)CustomGUILayout.ObjectField <Texture2D> ("Selected graphic:", selectedItem.selectedTex, false, apiPrefix + ".selectedTex");
                }
                if (AdvGame.GetReferences().cursorManager != null)
                {
                    CursorManager cursorManager = AdvGame.GetReferences().cursorManager;
                    if (cursorManager.inventoryHandling == InventoryHandling.ChangeCursor || cursorManager.inventoryHandling == InventoryHandling.ChangeCursorAndHotspotLabel)
                    {
                        GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(1));
                        selectedItem.cursorIcon.ShowGUI(true, "Cursor (optional):", cursorManager.cursorRendering, apiPrefix + ".cursorIcon");
                        GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(1));
                    }
                }

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Standard interactions", CustomStyles.subHeader);
                if (settingsManager && settingsManager.interactionMethod != AC_InteractionMethod.ContextSensitive && settingsManager.inventoryInteractions == InventoryInteractions.Multiple && AdvGame.GetReferences().cursorManager)
                {
                    CursorManager cursorManager = AdvGame.GetReferences().cursorManager;

                    List <string> iconList = new List <string>();
                    foreach (CursorIcon icon in cursorManager.cursorIcons)
                    {
                        iconList.Add(icon.label);
                    }

                    if (cursorManager.cursorIcons.Count > 0)
                    {
                        foreach (InvInteraction interaction in selectedItem.interactions)
                        {
                            EditorGUILayout.BeginHorizontal();
                            invNumber        = GetIconSlot(interaction.icon.id);
                            invNumber        = EditorGUILayout.Popup(invNumber, iconList.ToArray());
                            interaction.icon = cursorManager.cursorIcons[invNumber];

                            int    i        = selectedItem.interactions.IndexOf(interaction);
                            string autoName = selectedItem.label + "_" + interaction.icon.label;
                            interaction.actionList = ActionListAssetMenu.AssetGUI("", interaction.actionList, apiPrefix + ".interactions[" + i + "].actionList", autoName);

                            if (GUILayout.Button(deleteContent, EditorStyles.miniButtonRight, buttonWidth))
                            {
                                Undo.RecordObject(this, "Delete interaction");
                                selectedItem.interactions.Remove(interaction);
                                break;
                            }
                            EditorGUILayout.EndHorizontal();
                        }
                    }
                    else
                    {
                        EditorGUILayout.HelpBox("No interaction icons defined - please use the Cursor Manager", MessageType.Warning);
                    }
                    if (GUILayout.Button("Add interaction"))
                    {
                        Undo.RecordObject(this, "Add new interaction");
                        selectedItem.interactions.Add(new InvInteraction(cursorManager.cursorIcons[0]));
                    }
                }
                else
                {
                    string autoName = selectedItem.label + "_Use";
                    selectedItem.useActionList = ActionListAssetMenu.AssetGUI("Use:", selectedItem.useActionList, apiPrefix + ".useActionList", autoName);
                    if (cursorManager && cursorManager.allowInteractionCursorForInventory && cursorManager.cursorIcons.Count > 0)
                    {
                        int useCursor_int = cursorManager.GetIntFromID(selectedItem.useIconID) + 1;
                        if (selectedItem.useIconID == -1)
                        {
                            useCursor_int = 0;
                        }
                        useCursor_int = CustomGUILayout.Popup("Use cursor icon:", useCursor_int, cursorManager.GetLabelsArray(true), apiPrefix + ".useIconID");

                        if (useCursor_int == 0)
                        {
                            selectedItem.useIconID = -1;
                        }
                        else if (cursorManager.cursorIcons.Count > (useCursor_int - 1))
                        {
                            selectedItem.useIconID = cursorManager.cursorIcons[useCursor_int - 1].id;
                        }
                    }
                    else
                    {
                        selectedItem.useIconID = 0;
                    }
                    autoName = selectedItem.label + "_Examine";
                    selectedItem.lookActionList = ActionListAssetMenu.AssetGUI("Examine:", selectedItem.lookActionList, apiPrefix + ".lookActionList", autoName);
                }

                if (settingsManager.CanSelectItems(false))
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("Unhandled interactions", CustomStyles.subHeader);
                    string autoName = selectedItem.label + "_Unhandled_Hotspot";
                    selectedItem.unhandledActionList = ActionListAssetMenu.AssetGUI("Unhandled use on Hotspot:", selectedItem.unhandledActionList, apiPrefix + ".unhandledActionList", autoName);
                    autoName = selectedItem.label + "_Unhandled_Combine";
                    selectedItem.unhandledCombineActionList = ActionListAssetMenu.AssetGUI("Unhandled combine:", selectedItem.unhandledCombineActionList, apiPrefix + ".unhandledCombineActionList", autoName);
                }

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Combine interactions", CustomStyles.subHeader);
                for (int i = 0; i < selectedItem.combineActionList.Count; i++)
                {
                    EditorGUILayout.BeginHorizontal();
                    invNumber = GetArraySlot(selectedItem.combineID[i]);
                    invNumber = EditorGUILayout.Popup(invNumber, GetLabelList());
                    selectedItem.combineID[i] = items[invNumber].id;

                    string autoName = selectedItem.label + "_Combine_" + GetLabelList() [invNumber];
                    selectedItem.combineActionList[i] = ActionListAssetMenu.AssetGUI("", selectedItem.combineActionList[i], apiPrefix + ".combineActionList[" + i + "]", autoName);

                    if (GUILayout.Button(deleteContent, EditorStyles.miniButtonRight, buttonWidth))
                    {
                        Undo.RecordObject(this, "Delete combine event");
                        selectedItem.combineActionList.RemoveAt(i);
                        selectedItem.combineID.RemoveAt(i);
                        break;
                    }
                    EditorGUILayout.EndHorizontal();
                }
                if (GUILayout.Button("Add combine event"))
                {
                    Undo.RecordObject(this, "Add new combine event");
                    selectedItem.combineActionList.Add(null);
                    selectedItem.combineID.Add(0);
                }

                // List all "reverse" inventory combinations
                string reverseCombinations = "";
                foreach (InvItem otherItem in items)
                {
                    if (otherItem != selectedItem)
                    {
                        if (otherItem.combineID.Contains(selectedItem.id))
                        {
                            reverseCombinations += "- " + otherItem.label + "\n";
                            continue;
                        }
                    }
                }
                if (reverseCombinations.Length > 0)
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.HelpBox("The following inventory items have combine interactions that reference this item:\n" + reverseCombinations, MessageType.Info);
                }

                if (invVars.Count > 0)
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("Properties", CustomStyles.subHeader);

                    RebuildProperties(selectedItem);

                    // UI for setting property values
                    if (selectedItem.vars.Count > 0)
                    {
                        foreach (InvVar invVar in selectedItem.vars)
                        {
                            string label = invVar.label + ":";
                            if (invVar.label.Length == 0)
                            {
                                label = "Property " + invVar.id.ToString() + ":";
                            }

                            if (invVar.type == VariableType.Boolean)
                            {
                                if (invVar.val != 1)
                                {
                                    invVar.val = 0;
                                }
                                invVar.val = CustomGUILayout.Popup(label, invVar.val, boolType, apiPrefix + ".GetProperty (" + invVar.id + ").val");
                            }
                            else if (invVar.type == VariableType.Integer)
                            {
                                invVar.val = CustomGUILayout.IntField(label, invVar.val, apiPrefix + ".GetProperty (" + invVar.id + ").val");
                            }
                            else if (invVar.type == VariableType.PopUp)
                            {
                                invVar.val = CustomGUILayout.Popup(label, invVar.val, invVar.popUps, apiPrefix + ".GetProperty (" + invVar.id + ").val");
                            }
                            else if (invVar.type == VariableType.String)
                            {
                                invVar.textVal = CustomGUILayout.TextField(label, invVar.textVal, apiPrefix + ".GetProperty (" + invVar.id + ").textVal");
                            }
                            else if (invVar.type == VariableType.Float)
                            {
                                invVar.floatVal = CustomGUILayout.FloatField(label, invVar.floatVal, apiPrefix + ".GetProperty (" + invVar.id + ").floatVal");
                            }
                        }
                    }
                    else
                    {
                        EditorGUILayout.HelpBox("No properties have been defined that this inventory item can use.", MessageType.Info);
                    }
                }

                EditorGUILayout.EndVertical();
            }
        }
示例#3
0
        private void ItemsGUI()
        {
            EditorGUILayout.LabelField("Unhandled events", EditorStyles.boldLabel);
            unhandledCombine = ActionListAssetMenu.AssetGUI("Combine:", unhandledCombine);
            unhandledHotspot = ActionListAssetMenu.AssetGUI("Use on hotspot:", unhandledHotspot);
            if (settingsManager != null && settingsManager.CanGiveItems())
            {
                unhandledGive = ActionListAssetMenu.AssetGUI("Give to NPC:", unhandledGive);
            }

            List <string> binList = new List <string>();

            foreach (InvBin bin in bins)
            {
                binList.Add(bin.label);
            }

            EditorGUILayout.Space();
            CreateItemsGUI(binList.ToArray());
            EditorGUILayout.Space();

            if (selectedItem != null && items.Contains(selectedItem))
            {
                EditorGUILayout.LabelField("Inventory item '" + selectedItem.label + "' settings", EditorStyles.boldLabel);

                EditorGUILayout.BeginVertical("Button");
                selectedItem.label    = EditorGUILayout.TextField("Name:", selectedItem.label);
                selectedItem.altLabel = EditorGUILayout.TextField("Label (if not name):", selectedItem.altLabel);

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Category:", GUILayout.Width(146f));
                if (bins.Count > 0)
                {
                    binNumber          = GetBinSlot(selectedItem.binID);
                    binNumber          = EditorGUILayout.Popup(binNumber, binList.ToArray());
                    selectedItem.binID = bins[binNumber].id;
                }
                else
                {
                    selectedItem.binID = -1;
                    EditorGUILayout.LabelField("No categories defined!", EditorStyles.miniLabel, GUILayout.Width(146f));
                }
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Main graphic:", GUILayout.Width(145));
                selectedItem.tex = (Texture2D)EditorGUILayout.ObjectField(selectedItem.tex, typeof(Texture2D), false, GUILayout.Width(70), GUILayout.Height(70));
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Active graphic:", GUILayout.Width(145));
                selectedItem.activeTex = (Texture2D)EditorGUILayout.ObjectField(selectedItem.activeTex, typeof(Texture2D), false, GUILayout.Width(70), GUILayout.Height(70));
                EditorGUILayout.EndHorizontal();

                if (AdvGame.GetReferences().settingsManager != null && AdvGame.GetReferences().settingsManager.selectInventoryDisplay == SelectInventoryDisplay.ShowSelectedGraphic)
                {
                    selectedItem.selectedTex = (Texture2D)EditorGUILayout.ObjectField("Selected graphic:", selectedItem.selectedTex, typeof(Texture2D), false);
                }
                if (AdvGame.GetReferences().cursorManager != null)
                {
                    CursorManager cursorManager = AdvGame.GetReferences().cursorManager;
                    if (cursorManager.inventoryHandling == InventoryHandling.ChangeCursor || cursorManager.inventoryHandling == InventoryHandling.ChangeCursorAndHotspotLabel)
                    {
                        GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(1));
                        selectedItem.cursorIcon.ShowGUI(true, cursorManager.cursorRendering, "Cursor (optional):");
                        GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(1));
                    }
                }

                selectedItem.carryOnStart = EditorGUILayout.Toggle("Carry on start?", selectedItem.carryOnStart);
                if (selectedItem.carryOnStart && AdvGame.GetReferences().settingsManager&& AdvGame.GetReferences().settingsManager.playerSwitching == PlayerSwitching.Allow && !AdvGame.GetReferences().settingsManager.shareInventory)
                {
                    selectedItem.carryOnStartNotDefault = EditorGUILayout.Toggle("Give to non-default player?", selectedItem.carryOnStartNotDefault);
                    if (selectedItem.carryOnStartNotDefault)
                    {
                        selectedItem.carryOnStartID = ChoosePlayerGUI(selectedItem.carryOnStartID);
                    }
                }

                selectedItem.canCarryMultiple = EditorGUILayout.Toggle("Can carry multiple?", selectedItem.canCarryMultiple);
                if (selectedItem.canCarryMultiple)
                {
                    selectedItem.useSeparateSlots = EditorGUILayout.Toggle("Place in separate slots?", selectedItem.useSeparateSlots);
                }
                if (selectedItem.carryOnStart && selectedItem.canCarryMultiple)
                {
                    selectedItem.count = EditorGUILayout.IntField("Quantity on start:", selectedItem.count);
                }
                else
                {
                    selectedItem.count = 1;
                }

                selectedItem.overrideUseSyntax = EditorGUILayout.Toggle("Override 'Use' syntax?", selectedItem.overrideUseSyntax);
                if (selectedItem.overrideUseSyntax)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Use syntax:", GUILayout.Width(100f));
                    selectedItem.hotspotPrefix1.label = EditorGUILayout.TextField(selectedItem.hotspotPrefix1.label, GUILayout.MaxWidth(80f));
                    EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f));
                    selectedItem.hotspotPrefix2.label = EditorGUILayout.TextField(selectedItem.hotspotPrefix2.label, GUILayout.MaxWidth(80f));
                    EditorGUILayout.LabelField("(hotspot)", GUILayout.MaxWidth(55f));
                    EditorGUILayout.EndHorizontal();
                }

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Standard interactions", EditorStyles.boldLabel);
                if (settingsManager && settingsManager.interactionMethod != AC_InteractionMethod.ContextSensitive && settingsManager.inventoryInteractions == InventoryInteractions.Multiple && AdvGame.GetReferences().cursorManager)
                {
                    CursorManager cursorManager = AdvGame.GetReferences().cursorManager;

                    List <string> iconList = new List <string>();
                    foreach (CursorIcon icon in cursorManager.cursorIcons)
                    {
                        iconList.Add(icon.label);
                    }

                    if (cursorManager.cursorIcons.Count > 0)
                    {
                        foreach (InvInteraction interaction in selectedItem.interactions)
                        {
                            EditorGUILayout.BeginHorizontal();
                            invNumber        = GetIconSlot(interaction.icon.id);
                            invNumber        = EditorGUILayout.Popup(invNumber, iconList.ToArray());
                            interaction.icon = cursorManager.cursorIcons[invNumber];

                            interaction.actionList = ActionListAssetMenu.AssetGUI("", interaction.actionList);

                            if (GUILayout.Button(deleteContent, EditorStyles.miniButtonRight, buttonWidth))
                            {
                                Undo.RecordObject(this, "Delete interaction");
                                selectedItem.interactions.Remove(interaction);
                                break;
                            }
                            EditorGUILayout.EndHorizontal();
                        }
                    }
                    else
                    {
                        EditorGUILayout.HelpBox("No interaction icons defined - please use the Cursor Manager", MessageType.Warning);
                    }
                    if (GUILayout.Button("Add interaction"))
                    {
                        Undo.RecordObject(this, "Add new interaction");
                        selectedItem.interactions.Add(new InvInteraction(cursorManager.cursorIcons[0]));
                    }
                }
                else
                {
                    selectedItem.useActionList = ActionListAssetMenu.AssetGUI("Use:", selectedItem.useActionList);
                    if (cursorManager && cursorManager.allowInteractionCursorForInventory && cursorManager.cursorIcons.Count > 0)
                    {
                        int useCursor_int = cursorManager.GetIntFromID(selectedItem.useIconID);
                        useCursor_int          = EditorGUILayout.Popup("Use cursor icon:", useCursor_int, cursorManager.GetLabelsArray());
                        selectedItem.useIconID = cursorManager.cursorIcons[useCursor_int].id;
                    }
                    else
                    {
                        selectedItem.useIconID = 0;
                    }
                    selectedItem.lookActionList = ActionListAssetMenu.AssetGUI("Examine:", selectedItem.lookActionList);
                }

                if (settingsManager.CanSelectItems(false))
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("Unhandled interactions", EditorStyles.boldLabel);
                    selectedItem.unhandledActionList        = ActionListAssetMenu.AssetGUI("Unhandled use on Hotspot:", selectedItem.unhandledActionList);
                    selectedItem.unhandledCombineActionList = ActionListAssetMenu.AssetGUI("Unhandled combine:", selectedItem.unhandledCombineActionList);
                }

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Combine interactions", EditorStyles.boldLabel);
                for (int i = 0; i < selectedItem.combineActionList.Count; i++)
                {
                    EditorGUILayout.BeginHorizontal();
                    invNumber = GetArraySlot(selectedItem.combineID[i]);
                    invNumber = EditorGUILayout.Popup(invNumber, GetLabelList());
                    selectedItem.combineID[i] = items[invNumber].id;

                    selectedItem.combineActionList[i] = ActionListAssetMenu.AssetGUI("", selectedItem.combineActionList[i]);

                    if (GUILayout.Button(deleteContent, EditorStyles.miniButtonRight, buttonWidth))
                    {
                        Undo.RecordObject(this, "Delete combine event");
                        selectedItem.combineActionList.RemoveAt(i);
                        selectedItem.combineID.RemoveAt(i);
                        break;
                    }
                    EditorGUILayout.EndHorizontal();
                }
                if (GUILayout.Button("Add combine event"))
                {
                    Undo.RecordObject(this, "Add new combine event");
                    selectedItem.combineActionList.Add(null);
                    selectedItem.combineID.Add(0);
                }

                // List all "reverse" inventory combinations
                string reverseCombinations = "";
                foreach (InvItem otherItem in items)
                {
                    if (otherItem != selectedItem)
                    {
                        if (otherItem.combineID.Contains(selectedItem.id))
                        {
                            reverseCombinations += "- " + otherItem.label + "\n";
                            continue;
                        }
                    }
                }
                if (reverseCombinations.Length > 0)
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.HelpBox("The following inventory items have combine interactions that reference this item:\n" + reverseCombinations, MessageType.Info);
                }

                if (invVars.Count > 0)
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("Properties", EditorStyles.boldLabel);

                    RebuildProperties(selectedItem);

                    // UI for setting property values
                    if (selectedItem.vars.Count > 0)
                    {
                        foreach (InvVar invVar in selectedItem.vars)
                        {
                            string label = invVar.label + ":";
                            if (invVar.label.Length == 0)
                            {
                                label = "Property " + invVar.id.ToString() + ":";
                            }

                            if (invVar.type == VariableType.Boolean)
                            {
                                if (invVar.val != 1)
                                {
                                    invVar.val = 0;
                                }
                                invVar.val = EditorGUILayout.Popup(label, invVar.val, boolType);
                            }
                            else if (invVar.type == VariableType.Integer)
                            {
                                invVar.val = EditorGUILayout.IntField(label, invVar.val);
                            }
                            else if (invVar.type == VariableType.PopUp)
                            {
                                invVar.val = EditorGUILayout.Popup(label, invVar.val, invVar.popUps);
                            }
                            else if (invVar.type == VariableType.String)
                            {
                                invVar.textVal = EditorGUILayout.TextField(label, invVar.textVal);
                            }
                            else if (invVar.type == VariableType.Float)
                            {
                                invVar.floatVal = EditorGUILayout.FloatField(label, invVar.floatVal);
                            }
                        }
                    }
                    else
                    {
                        EditorGUILayout.HelpBox("No properties have been defined that this inventory item can use.", MessageType.Info);
                    }
                }

                EditorGUILayout.EndVertical();
            }
        }