public void ShowGUI ()
		{
			settingsManager = AdvGame.GetReferences().settingsManager;

			cursorRendering = (CursorRendering) EditorGUILayout.EnumPopup ("Cursor rendering:", cursorRendering);
			EditorGUILayout.Space ();
			
			EditorGUILayout.BeginVertical ("Button");
				EditorGUILayout.LabelField ("Main cursor", EditorStyles.boldLabel);
				cursorDisplay = (CursorDisplay) EditorGUILayout.EnumPopup ("Display cursor:", cursorDisplay);
				allowMainCursor = EditorGUILayout.Toggle ("Replace mouse cursor?", allowMainCursor);
				if (allowMainCursor || (settingsManager && settingsManager.inputMethod == InputMethod.KeyboardOrController))
				{
					IconBaseGUI ("Main cursor:", pointerIcon);
					IconBaseGUI ("Walk cursor (optional):", walkIcon);
					onlyWalkWhenOverNavMesh = EditorGUILayout.ToggleLeft ("Only show 'Walk' Cursor when over NavMesh?", onlyWalkWhenOverNavMesh);
				}
			EditorGUILayout.EndVertical ();
			
			EditorGUILayout.Space ();

			EditorGUILayout.BeginVertical ("Button");
				EditorGUILayout.LabelField ("Hotspot settings", EditorStyles.boldLabel);
				addHotspotPrefix = EditorGUILayout.Toggle ("Prefix cursor labels?", addHotspotPrefix);
				IconBaseGUI ("Mouse-over cursor:", mouseOverIcon);
			EditorGUILayout.EndVertical ();

			EditorGUILayout.Space ();
			
			EditorGUILayout.BeginVertical ("Button");
				EditorGUILayout.LabelField ("Inventory cursor", EditorStyles.boldLabel);
				if ((settingsManager && settingsManager.interactionMethod != AC_InteractionMethod.ChooseHotspotThenInteraction) ||
			    (settingsManager && settingsManager.SelectInteractionMethod () == SelectInteractions.CyclingCursorAndClickingHotspot))
				{
					inventoryHandling = (InventoryHandling) EditorGUILayout.EnumPopup ("When inventory selected:", inventoryHandling);
					if (inventoryHandling == InventoryHandling.ChangeCursor || inventoryHandling == InventoryHandling.ChangeCursorAndHotspotLabel)
					{
						inventoryCursorSize = EditorGUILayout.FloatField ("Inventory cursor size:", inventoryCursorSize);
					}
				}
				EditorGUILayout.BeginHorizontal ();
					EditorGUILayout.LabelField ("Syntax:", GUILayout.Width (60f));
					hotspotPrefix1.label = EditorGUILayout.TextField (hotspotPrefix1.label, GUILayout.MaxWidth (80f));
					EditorGUILayout.LabelField ("(item)", GUILayout.MaxWidth (40f));

					hotspotPrefix2.label = EditorGUILayout.TextField (hotspotPrefix2.label, GUILayout.MaxWidth (80f));
					EditorGUILayout.LabelField ("(hotspot)", GUILayout.MaxWidth (55f));
				EditorGUILayout.EndHorizontal ();
			EditorGUILayout.EndVertical ();
			
			EditorGUILayout.Space ();
			
			EditorGUILayout.BeginVertical ("Button");
				EditorGUILayout.LabelField ("Interaction icons", EditorStyles.boldLabel);
				
				if (settingsManager == null || settingsManager.interactionMethod != AC_InteractionMethod.ChooseHotspotThenInteraction)
				{
					allowInteractionCursor = EditorGUILayout.BeginToggleGroup ("Change cursor when over Hotspots?", allowInteractionCursor);
						if (settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
						{
							cycleCursors = EditorGUILayout.Toggle ("Cycle with right click?", cycleCursors);
						}
						if (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
						{
							allowInteractionCursorForInventory = EditorGUILayout.Toggle ("Change for inventory too?", allowInteractionCursorForInventory);
						}
					EditorGUILayout.EndToggleGroup ();
				}
				
				IconsGUI ();
			
				EditorGUILayout.Space ();
			
				if (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
				{
					LookIconGUI ();
				}
			EditorGUILayout.EndVertical ();

			EditorGUILayout.Space ();

			EditorGUILayout.BeginVertical ("Button");
				IconBaseGUI ("Wait cursor", waitIcon);
			EditorGUILayout.EndVertical ();

			if (GUI.changed)
			{
				EditorUtility.SetDirty (this);
			}
		}
示例#2
0
        /**
         * Shows the GUI.
         */
        public void ShowGUI()
        {
            settingsManager = AdvGame.GetReferences().settingsManager;

            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showSettings = CustomGUILayout.ToggleHeader(showSettings, "Global cursor settings");
            if (showSettings)
            {
                cursorRendering = (CursorRendering)CustomGUILayout.EnumPopup("Cursor rendering:", cursorRendering, "AC.KickStarter.cursorManager.cursorRendering", "The rendering method of all cursors");
                if (cursorRendering == CursorRendering.Software)
                {
                    lockSystemCursor = CustomGUILayout.ToggleLeft("Lock system cursor when locking AC cursor?", lockSystemCursor, "AC.KickStarter.cursorManager.lockSystemCursor", "If True, the system cursor will be locked when the AC cursor is");
                }
                forceCursorInEditor = CustomGUILayout.ToggleLeft("Always show system cursor in Editor?", forceCursorInEditor, "AC.KickStarter.cursorManager.forceCursorInEditor");

                if (cursorRendering == CursorRendering.Software)
                {
                    keepCursorWithinScreen = CustomGUILayout.ToggleLeft("Always keep cursor within screen boundary?", keepCursorWithinScreen, "AC.KickStarter.cursorManager.keepCursorWithinScreen", "If True, then the cursor will always be kept within the boundary of the game window");
                }
                else
                {
                    keepCursorWithinScreen = CustomGUILayout.ToggleLeft("Always keep perceived cursor within screen boundary?", keepCursorWithinScreen, "AC.KickStarter.cursorManager.keepCursorWithinScreen", "If True, then the cursor will always be kept within the boundary of the game window");
                }

                                #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
                confineSystemCursor = CustomGUILayout.ToggleLeft("Confine system cursor to game window?", confineSystemCursor, "AC.KickStarter.cursorManager.confineSystemCursor", "If True, then the system cursor will be confined to the game window");
                                #endif

                hideCursorWhenDraggingMoveables = CustomGUILayout.ToggleLeft("Hide cursor when manipulating Draggables?", hideCursorWhenDraggingMoveables, "AC.KickStarter.cursorManager.hideCursorWhenDraggingMoveables", "If True, the cursor will be hidden when manipulating Draggable objects");
            }
            CustomGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showMainCursor = CustomGUILayout.ToggleHeader(showMainCursor, "Main cursor settings");
            if (showMainCursor)
            {
                cursorDisplay = (CursorDisplay)CustomGUILayout.EnumPopup("Display cursor:", cursorDisplay, "AC.KickStarter.cursorManager.cursorDisplay", "The rule that defines when the main cursor is shown");
                if (cursorDisplay != CursorDisplay.Never)
                {
                    allowMainCursor = CustomGUILayout.Toggle("Replace mouse cursor?", allowMainCursor, "AC.KickStarter.cursorManager.allowMainCursor", "If True, then the system's default hardware cursor will replaced with a custom one");
                    if (allowMainCursor || (settingsManager && settingsManager.inputMethod == InputMethod.KeyboardOrController))
                    {
                        IconBaseGUI(string.Empty, pointerIcon, "AC.KickStarter.cursorManager.pointerIcon", "The game's default cursor", false);
                    }
                }
            }
            CustomGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showWalkCursor = CustomGUILayout.ToggleHeader(showWalkCursor, "Walk cursor");
            if (showWalkCursor)
            {
                if (allowMainCursor)
                {
                    allowWalkCursor = CustomGUILayout.Toggle("Provide walk cursor?", allowWalkCursor, "AC.KickStarter.cursorManager.allowWalkCursor", "If True, then a separate cursor will display when in 'walk mode'");
                    if (allowWalkCursor)
                    {
                        if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot && allowIconInput)
                        {
                            EditorGUILayout.LabelField("Input button:", "Icon_Walk");
                        }
                        IconBaseGUI(string.Empty, walkIcon, "AC.KickStarter.cursorManager.walkIcon", "The cursor when in 'walk mode'");
                        onlyWalkWhenOverNavMesh = CustomGUILayout.ToggleLeft("Only show 'Walk' Cursor when over NavMesh?", onlyWalkWhenOverNavMesh, "AC.KickStarter.cursorManager.onlyWalkWhenOverNavMesh", "If True, then the walk cursor will only show when the cursor is hovering over a NavMesh");
                    }
                }
                addWalkPrefix = CustomGUILayout.Toggle("Prefix cursor labels?", addWalkPrefix, "AC.KickStarter.cursorManager.addWalkPrefix", "If True, then a prefix can be added to the Hotspot label when in 'walk mode'");
                if (addWalkPrefix)
                {
                    walkPrefix.label = CustomGUILayout.TextField("Walk prefix:", walkPrefix.label, "AC.KickStarter.cursorManager.walkPrefix");
                }
            }
            CustomGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showHotspotCursor = CustomGUILayout.ToggleHeader(showHotspotCursor, "Hotspot cursor");
            if (showHotspotCursor)
            {
                addHotspotPrefix = CustomGUILayout.Toggle("Prefix cursor labels?", addHotspotPrefix, "AC.KickStarter.cursorManager.addHotspotPrefix", "If True, then the Cursor's interaction verb will prefix the Hotspot label when hovering over Hotspots");
                IconBaseGUI(string.Empty, mouseOverIcon, "AC.KickStarter.cursorManager.mouseOverIcon");
            }
            CustomGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showInventoryCursor = CustomGUILayout.ToggleHeader(showInventoryCursor, "Inventory cursor");
            if (showInventoryCursor)
            {
                inventoryHandling = (InventoryHandling)CustomGUILayout.EnumPopup("When inventory selected:", inventoryHandling, "AC.KickStarter.cursorManager.inventoryHandling", "What happens to the cursor when an inventory item is selected");
                if (inventoryHandling != InventoryHandling.ChangeCursor)
                {
                    onlyShowInventoryLabelOverHotspots = CustomGUILayout.ToggleLeft("Only show label when over Hotspots and Inventory?", onlyShowInventoryLabelOverHotspots, "AC.KickStarter.cursorManager.onlyShowInventoryLabelOverHotspots", "If True, then Hotspot labels will not show when an inventory item is selected unless the cursor is over another inventory item or a Hotspot");
                }
                if (inventoryHandling != InventoryHandling.ChangeHotspotLabel)
                {
                    inventoryCursorSize = CustomGUILayout.FloatField("Inventory cursor size:", inventoryCursorSize, "AC.KickStarter.cursorManager.inventoryCursorSize", "The size of selected inventory item graphics when used as a cursor");
                }
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Use syntax:", GUILayout.Width(100f));
                hotspotPrefix1.label = CustomGUILayout.TextField(hotspotPrefix1.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix1");
                EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f));
                hotspotPrefix2.label = CustomGUILayout.TextField(hotspotPrefix2.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix2");
                EditorGUILayout.LabelField("(hotspot)", GUILayout.MaxWidth(55f));
                EditorGUILayout.EndHorizontal();
                if (AdvGame.GetReferences().settingsManager&& AdvGame.GetReferences().settingsManager.CanGiveItems())
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Give syntax:", GUILayout.Width(100f));
                    hotspotPrefix3.label = CustomGUILayout.TextField(hotspotPrefix3.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix3");
                    EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f));
                    hotspotPrefix4.label = CustomGUILayout.TextField(hotspotPrefix4.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix4");
                    EditorGUILayout.LabelField("(hotspot)", GUILayout.MaxWidth(55f));
                    EditorGUILayout.EndHorizontal();
                }

                if (inventoryHandling != InventoryHandling.ChangeHotspotLabel || KickStarter.settingsManager.cycleInventoryCursors)
                {
                    EditorGUILayout.Space();
                    displayCountFont        = (Font)CustomGUILayout.ObjectField <Font> ("Display count font:", displayCountFont, false, "AC.KickStarter.cursorManager.displayCountFont", "The font to use when displaying the selected item's count");
                    displayCountSize        = CustomGUILayout.FloatField("Display count size:", displayCountSize, "AC.KickStarter.cursorManager.displayCountSize", "How large to display the selected item's count");
                    displayCountTextEffects = (TextEffects)CustomGUILayout.EnumPopup("Display count effects:", displayCountTextEffects, "AC.KickStarter.cursorManager.displayCountTextEffects", "The text effect to use when displaying the selected item's count");
                }
            }
            CustomGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showInteractionIcons = CustomGUILayout.ToggleHeader(showInteractionIcons, "Interaction icons");
            if (showInteractionIcons)
            {
                if (settingsManager == null || settingsManager.interactionMethod != AC_InteractionMethod.ChooseHotspotThenInteraction)
                {
                    allowInteractionCursor = CustomGUILayout.ToggleLeft("Change cursor based on Interaction?", allowInteractionCursor, "AC.KickStarter.cursorManager.allowInteractionCursor", "If True, then the cursor will be controlled by the current Interaction when hovering over a Hotspot");
                    if (allowInteractionCursor && (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive))
                    {
                        allowInteractionCursorForInventory = CustomGUILayout.ToggleLeft("Change when over Inventory items too?", allowInteractionCursorForInventory, "AC.KickStarter.cursorManager.allowInteractionCursorForInventory", "If True, then the cursor will be controlled by the current Interaction when hovering over an inventory item (see InvItem)");
                    }
                    if (settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
                    {
                        cycleCursors                    = CustomGUILayout.ToggleLeft("Cycle Interactions with right-click?", cycleCursors, "AC.KickStarter.cursorManager.cycleCursors", "If True, then cursor modes can by clicked by right-clicking");
                        allowIconInput                  = CustomGUILayout.ToggleLeft("Set Interaction with specific inputs?", allowIconInput, "AC.KickStarter.cursorManager.allowIconInput", "then the player can switch the active icon by invoking a specific input");
                        onlyAnimateOverHotspots         = CustomGUILayout.ToggleLeft("Only animate icons when over Hotspots?", onlyAnimateOverHotspots, "AC.KickStarter.cursorManager.onlyAnimateOverHotspots", "If True, then animated cursors will only animate if the cursor is over a Hotspot");
                        onlyShowCursorLabelOverHotspots = CustomGUILayout.ToggleLeft("Only show label when over Hotspots and Inventory?", onlyShowCursorLabelOverHotspots, "AC.KickStarter.cursorManager.onlyShowCursorLabelOverHotspots", "If True, then Hotspot labels will not show when no inventory item is selected unless the cursor is over another inventory item or a Hotspot");
                    }
                }

                if ((settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive && lookUseCursorAction == LookUseCursorAction.RightClickCyclesModes) ||
                    (settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot && settingsManager.inventoryInteractions == InventoryInteractions.Multiple) ||
                    (settingsManager && settingsManager.SelectInteractionMethod() == SelectInteractions.CyclingCursorAndClickingHotspot && settingsManager.inventoryInteractions == InventoryInteractions.Multiple))
                {
                    allowCursorCyclingWhenPaused = CustomGUILayout.ToggleLeft("Allow cursor cycling when paused?", allowCursorCyclingWhenPaused, "AC.KickStarter.cursorManager.allowCursorCyclingWhenPaused", "If True, then the cursor can be cycled while the game is paused");
                }


                IconsGUI();

                EditorGUILayout.Space();

                if (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
                {
                    LookIconGUI();
                }
            }
            CustomGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showCutsceneCursor = CustomGUILayout.ToggleHeader(showCutsceneCursor, "Cutscene cursor");
            if (showCutsceneCursor)
            {
                IconBaseGUI(string.Empty, waitIcon, "AC.KickStarter.cursorManager.waitIcon", "The cursor while the game is running a gameplay-blocking cutscene");
            }
            CustomGUILayout.EndVertical();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(this);
            }
        }