public void ShowGUI(bool includeSize, string _label = "Texture:", CursorRendering cursorRendering = CursorRendering.Software, string apiPrefix = "") { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(_label, GUILayout.Width(145)); texture = (Texture)CustomGUILayout.ObjectField <Texture> (texture, false, GUILayout.Width(70), GUILayout.Height(70), apiPrefix + ".texture"); EditorGUILayout.EndHorizontal(); if (texture == null) { return; } if (includeSize) { if (cursorRendering == CursorRendering.Software) { size = CustomGUILayout.FloatField("Size:", size, apiPrefix + ".size"); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Click offset (from " + ((cursorRendering == CursorRendering.Software) ? "centre):" : "top left):"), GUILayout.Width(150f)); clickOffset = CustomGUILayout.Vector2Field("", clickOffset, apiPrefix + ".clickOffset"); EditorGUILayout.EndHorizontal(); } isAnimated = CustomGUILayout.Toggle("Animate?", isAnimated, apiPrefix + ".isAnimated"); if (isAnimated) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Frames:", GUILayout.Width(50f)); numFrames = CustomGUILayout.IntField(numFrames, GUILayout.Width(70f), apiPrefix + ".numFrames"); EditorGUILayout.LabelField("Rows:", GUILayout.Width(50f)); numRows = CustomGUILayout.IntField(numRows, GUILayout.Width(70f), apiPrefix + ".numRows"); EditorGUILayout.LabelField("Columns:", GUILayout.Width(50f)); numCols = CustomGUILayout.IntField(numCols, GUILayout.Width(70f), apiPrefix + ".numCols"); EditorGUILayout.EndHorizontal(); animSpeed = CustomGUILayout.FloatField("Animation speed:", animSpeed, apiPrefix + ".animSpeed"); endAnimOnLastFrame = CustomGUILayout.Toggle("End on last frame?", endAnimOnLastFrame, apiPrefix + ".endAnimOnLastFrame"); } }
public void ShowGUI(bool includeSize, CursorRendering cursorRendering = CursorRendering.Software, string _label = "Texture:") { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(_label, GUILayout.Width(145)); texture = (Texture2D)EditorGUILayout.ObjectField(texture, typeof(Texture2D), false, GUILayout.Width(70), GUILayout.Height(70)); EditorGUILayout.EndHorizontal(); if (includeSize) { EditorGUILayout.BeginHorizontal(); if (cursorRendering == CursorRendering.Hardware) { EditorGUILayout.LabelField("Click offset (from top left):", GUILayout.Width(150f)); } else { EditorGUILayout.LabelField("Size:", GUILayout.Width(30f)); size = EditorGUILayout.FloatField(size, GUILayout.Width(50f)); EditorGUILayout.LabelField("Click offset (from centre):", GUILayout.Width(150f)); } clickOffset = EditorGUILayout.Vector2Field("", clickOffset, GUILayout.Width(130f)); EditorGUILayout.EndHorizontal(); } isAnimated = EditorGUILayout.Toggle("Animate?", isAnimated); if (isAnimated) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Frames:", GUILayout.Width(50f)); numFrames = EditorGUILayout.IntField(numFrames, GUILayout.Width(70f)); EditorGUILayout.LabelField("Rows:", GUILayout.Width(50f)); numRows = EditorGUILayout.IntField(numRows, GUILayout.Width(70f)); EditorGUILayout.LabelField("Columns:", GUILayout.Width(50f)); numCols = EditorGUILayout.IntField(numCols, GUILayout.Width(70f)); EditorGUILayout.EndHorizontal(); animSpeed = EditorGUILayout.FloatField("Animation speed:", animSpeed); endAnimOnLastFrame = EditorGUILayout.Toggle("End on last frame?", endAnimOnLastFrame); } }
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); } }
/** * 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 } EditorGUILayout.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("", pointerIcon, "AC.KickStarter.cursorManager.pointerIcon", "The game's default cursor", false); } } } EditorGUILayout.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("", 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"); } } EditorGUILayout.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("", mouseOverIcon, "AC.KickStarter.cursorManager.mouseOverIcon"); } EditorGUILayout.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(); } } EditorGUILayout.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"); } } IconsGUI(); EditorGUILayout.Space(); if (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive) { LookIconGUI(); } } EditorGUILayout.EndVertical(); EditorGUILayout.Space(); EditorGUILayout.BeginVertical(CustomStyles.thinBox); showCutsceneCursor = CustomGUILayout.ToggleHeader(showCutsceneCursor, "Cutscene cursor"); if (showCutsceneCursor) { IconBaseGUI("", waitIcon, "AC.KickStarter.cursorManager.waitIcon", "The cursor while the game is running a gameplay-blocking cutscene"); } EditorGUILayout.EndVertical(); if (GUI.changed) { EditorUtility.SetDirty(this); } }
public void ShowGUI(bool includeSize, bool includeAlwaysAnimate = true, string _label = "Texture:", CursorRendering cursorRendering = CursorRendering.Software, string apiPrefix = "", string tooltip = "") { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(new GUIContent(_label, tooltip), GUILayout.Width(145)); texture = (Texture)CustomGUILayout.ObjectField <Texture> (texture, false, GUILayout.Width(70), GUILayout.Height(70), string.IsNullOrEmpty(apiPrefix) ? "" : (apiPrefix + ".texture")); EditorGUILayout.EndHorizontal(); if (texture == null) { return; } if (includeSize) { if (cursorRendering == CursorRendering.Software) { size = CustomGUILayout.FloatField("Size:", size, string.IsNullOrEmpty(apiPrefix) ? "" : (apiPrefix + ".size")); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Click offset (from " + ((cursorRendering == CursorRendering.Software) ? "centre):" : "top left):"), GUILayout.Width(150f)); clickOffset = CustomGUILayout.Vector2Field("", clickOffset, string.IsNullOrEmpty(apiPrefix) ? "" : (apiPrefix + ".clickOffset")); EditorGUILayout.EndHorizontal(); } #if ALLOW_MOVIETEXTURE if (!(texture is MovieTexture)) #endif { isAnimated = CustomGUILayout.Toggle("Animate?", isAnimated, string.IsNullOrEmpty(apiPrefix) ? "" : (apiPrefix + ".isAnimated")); if (isAnimated) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Frames:", GUILayout.Width(50f)); numFrames = CustomGUILayout.IntField(numFrames, GUILayout.Width(70f), string.IsNullOrEmpty(apiPrefix) ? "" : (apiPrefix + ".numFrames")); EditorGUILayout.LabelField("Rows:", GUILayout.Width(50f)); numRows = CustomGUILayout.IntField(numRows, GUILayout.Width(70f), string.IsNullOrEmpty(apiPrefix) ? "" : (apiPrefix + ".numRows")); EditorGUILayout.LabelField("Columns:", GUILayout.Width(50f)); numCols = CustomGUILayout.IntField(numCols, GUILayout.Width(70f), string.IsNullOrEmpty(apiPrefix) ? "" : (apiPrefix + ".numCols")); EditorGUILayout.EndHorizontal(); animSpeed = CustomGUILayout.FloatField("Animation speed:", animSpeed, string.IsNullOrEmpty(apiPrefix) ? "" : (apiPrefix + ".animSpeed")); showExtra = EditorGUILayout.Foldout(showExtra, "Additional settings:"); if (showExtra) { EditorGUILayout.BeginVertical(CustomStyles.thinBox); if (includeAlwaysAnimate) { alwaysAnimate = CustomGUILayout.ToggleLeft("Always animate?", alwaysAnimate, string.IsNullOrEmpty(apiPrefix) ? "" : (apiPrefix + ".alwaysAnimate")); } endAnimOnLastFrame = CustomGUILayout.ToggleLeft("End on last frame?", endAnimOnLastFrame, string.IsNullOrEmpty(apiPrefix) ? "" : (apiPrefix + ".endAnimOnLastFrame")); skipFirstFrameWhenLooping = CustomGUILayout.ToggleLeft("Skip first when animating?", skipFirstFrameWhenLooping, string.IsNullOrEmpty(apiPrefix) ? "" : (apiPrefix + ".skipFirstFrameWhenLooping")); SyncFrameSpeeds(); for (int i = 0; i < numFrames; i++) { if (i == 0 && skipFirstFrameWhenLooping) { continue; } if (i == (numFrames - 1) && endAnimOnLastFrame) { continue; } frameSpeeds[i] = EditorGUILayout.Slider("Frame #" + (i + 1).ToString() + " relative speed:", frameSpeeds[i], 0.01f, 1f); } EditorGUILayout.EndVertical(); } } } }
/** * 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"); if (cursorRendering == CursorRendering.Software) { lockSystemCursor = CustomGUILayout.ToggleLeft("Lock system cursor when locking AC cursor?", lockSystemCursor, "AC.KickStarter.cursorManager.lockSystemCursor"); } forceCursorInEditor = CustomGUILayout.ToggleLeft("Always show system cursor in Editor?", forceCursorInEditor, "AC.KickStarter.cursorManager.forceCursorInEditor"); } EditorGUILayout.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"); if (cursorDisplay != CursorDisplay.Never) { allowMainCursor = CustomGUILayout.Toggle("Replace mouse cursor?", allowMainCursor, "AC.KickStarter.cursorManager.allowMainCursor"); if (allowMainCursor || (settingsManager && settingsManager.inputMethod == InputMethod.KeyboardOrController)) { IconBaseGUI("", pointerIcon, "AC.KickStarter.cursorManager.pointerIcon"); } } } EditorGUILayout.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 (allowWalkCursor) { if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot) { EditorGUILayout.LabelField("Input button:", "Icon_Walk"); } IconBaseGUI("", walkIcon, "AC.KickStarter.cursorManager.walkIcon"); onlyWalkWhenOverNavMesh = CustomGUILayout.ToggleLeft("Only show 'Walk' Cursor when over NavMesh?", onlyWalkWhenOverNavMesh, "AC.KickStarter.cursorManager.onlyWalkWhenOverNavMesh"); } } addWalkPrefix = CustomGUILayout.Toggle("Prefix cursor labels?", addWalkPrefix, "AC.KickStarter.cursorManager.addWalkPrefix"); if (addWalkPrefix) { walkPrefix.label = CustomGUILayout.TextField("Walk prefix:", walkPrefix.label, "AC.KickStarter.cursorManager.walkPrefix"); } } EditorGUILayout.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"); IconBaseGUI("", mouseOverIcon, "AC.KickStarter.cursorManager.mouseOverIcon"); } EditorGUILayout.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"); if (inventoryHandling != InventoryHandling.ChangeCursor) { onlyShowInventoryLabelOverHotspots = CustomGUILayout.ToggleLeft("Only show label when over Hotspots and Inventory?", onlyShowInventoryLabelOverHotspots, "AC.KickStarter.cursorManager.onlyShowInventoryLabelOverHotspots"); } if (inventoryHandling != InventoryHandling.ChangeHotspotLabel) { inventoryCursorSize = CustomGUILayout.FloatField("Inventory cursor size:", inventoryCursorSize, "AC.KickStarter.cursorManager.inventoryCursorSize"); } 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(); } } EditorGUILayout.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 (allowInteractionCursor && (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)) { allowInteractionCursorForInventory = CustomGUILayout.ToggleLeft("Change when over Inventory items too?", allowInteractionCursorForInventory, "AC.KickStarter.cursorManager.allowInteractionCursorForInventory"); } if (settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot) { cycleCursors = CustomGUILayout.ToggleLeft("Cycle Interactions with right-click?", cycleCursors, "AC.KickStarter.cursorManager.cycleCursors"); onlyAnimateOverHotspots = CustomGUILayout.ToggleLeft("Only animate icons when over Hotspots?", onlyAnimateOverHotspots, "AC.KickStarter.cursorManager.onlyAnimateOverHotspots"); } } IconsGUI(); EditorGUILayout.Space(); if (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive) { LookIconGUI(); } } EditorGUILayout.EndVertical(); EditorGUILayout.Space(); EditorGUILayout.BeginVertical(CustomStyles.thinBox); showCutsceneCursor = CustomGUILayout.ToggleHeader(showCutsceneCursor, "Cutscene cursor"); if (showCutsceneCursor) { IconBaseGUI("", waitIcon, "AC.KickStarter.cursorManager.waitIcon"); } EditorGUILayout.EndVertical(); if (GUI.changed) { EditorUtility.SetDirty(this); } }
public void ShowGUI(bool includeSize, CursorRendering cursorRendering = CursorRendering.Software, string _label = "Texture:") { EditorGUILayout.BeginHorizontal (); EditorGUILayout.LabelField (_label, GUILayout.Width (145)); texture = (Texture2D) EditorGUILayout.ObjectField (texture, typeof (Texture2D), false, GUILayout.Width (70), GUILayout.Height (70)); EditorGUILayout.EndHorizontal (); if (includeSize) { EditorGUILayout.BeginHorizontal (); if (cursorRendering == CursorRendering.Hardware) { EditorGUILayout.LabelField ("Click offset (from top left):", GUILayout.Width (150f)); } else { EditorGUILayout.LabelField ("Size:", GUILayout.Width (30f)); size = EditorGUILayout.FloatField (size, GUILayout.Width (50f)); EditorGUILayout.LabelField ("Click offset (from centre):", GUILayout.Width (150f)); } clickOffset = EditorGUILayout.Vector2Field ("", clickOffset, GUILayout.Width (130f)); EditorGUILayout.EndHorizontal (); } isAnimated = EditorGUILayout.Toggle ("Animate?", isAnimated); if (isAnimated) { EditorGUILayout.BeginHorizontal (); EditorGUILayout.LabelField ("Frames:", GUILayout.Width (50f)); numFrames = EditorGUILayout.IntField (numFrames, GUILayout.Width (70f)); EditorGUILayout.LabelField ("Rows:", GUILayout.Width (50f)); numRows = EditorGUILayout.IntField (numRows, GUILayout.Width (70f)); EditorGUILayout.LabelField ("Columns:", GUILayout.Width (50f)); numCols = EditorGUILayout.IntField (numCols, GUILayout.Width (70f)); EditorGUILayout.EndHorizontal (); animSpeed = EditorGUILayout.FloatField ("Animation speed:", animSpeed); endAnimOnLastFrame = EditorGUILayout.Toggle ("End on last frame?", endAnimOnLastFrame); } }
/** * Shows the GUI. */ 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); if (cursorDisplay != CursorDisplay.Never) { allowMainCursor = EditorGUILayout.Toggle("Replace mouse cursor?", allowMainCursor); if (allowMainCursor || (settingsManager && settingsManager.inputMethod == InputMethod.KeyboardOrController)) { IconBaseGUI("Main cursor:", pointerIcon); } } EditorGUILayout.EndVertical(); EditorGUILayout.Space(); EditorGUILayout.BeginVertical("Button"); EditorGUILayout.LabelField("Walk settings", EditorStyles.boldLabel); if (allowMainCursor) { allowWalkCursor = EditorGUILayout.Toggle("Provide walk cursor?", allowWalkCursor); if (allowWalkCursor) { if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot) { EditorGUILayout.LabelField("Input button:", "Icon_Walk"); } IconBaseGUI("Walk cursor:", walkIcon); onlyWalkWhenOverNavMesh = EditorGUILayout.ToggleLeft("Only show 'Walk' Cursor when over NavMesh?", onlyWalkWhenOverNavMesh); } } addWalkPrefix = EditorGUILayout.Toggle("Prefix cursor labels?", addWalkPrefix); if (addWalkPrefix) { walkPrefix.label = EditorGUILayout.TextField("Walk prefix:", walkPrefix.label); } 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); inventoryHandling = (InventoryHandling)EditorGUILayout.EnumPopup("When inventory selected:", inventoryHandling); if (inventoryHandling != InventoryHandling.ChangeCursor) { onlyShowInventoryLabelOverHotspots = EditorGUILayout.ToggleLeft("Only show label when over Hotspots and Inventory?", onlyShowInventoryLabelOverHotspots); } if (inventoryHandling != InventoryHandling.ChangeHotspotLabel) { inventoryCursorSize = EditorGUILayout.FloatField("Inventory cursor size:", inventoryCursorSize); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Use syntax:", GUILayout.Width(100f)); 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(); if (AdvGame.GetReferences().settingsManager&& AdvGame.GetReferences().settingsManager.CanGiveItems()) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Give syntax:", GUILayout.Width(100f)); hotspotPrefix3.label = EditorGUILayout.TextField(hotspotPrefix3.label, GUILayout.MaxWidth(80f)); EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f)); hotspotPrefix4.label = EditorGUILayout.TextField(hotspotPrefix4.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.ToggleLeft("Change cursor based on Interaction?", allowInteractionCursor); if (allowInteractionCursor && (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)) { allowInteractionCursorForInventory = EditorGUILayout.ToggleLeft("Change when over Inventory items too?", allowInteractionCursorForInventory); } if (settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot) { cycleCursors = EditorGUILayout.ToggleLeft("Cycle Interactions with right-click?", cycleCursors); } } 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); } }
/** * Shows the GUI. */ 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); if (cursorDisplay != CursorDisplay.Never) { allowMainCursor = EditorGUILayout.Toggle ("Replace mouse cursor?", allowMainCursor); if (allowMainCursor || (settingsManager && settingsManager.inputMethod == InputMethod.KeyboardOrController)) { IconBaseGUI ("Main cursor:", pointerIcon); } } EditorGUILayout.EndVertical (); EditorGUILayout.Space (); EditorGUILayout.BeginVertical ("Button"); EditorGUILayout.LabelField ("Walk settings", EditorStyles.boldLabel); if (allowMainCursor) { allowWalkCursor = EditorGUILayout.Toggle ("Provide walk cursor?", allowWalkCursor); if (allowWalkCursor) { if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot) { EditorGUILayout.LabelField ("Input button:", "Icon_Walk"); } IconBaseGUI ("Walk cursor:", walkIcon); onlyWalkWhenOverNavMesh = EditorGUILayout.ToggleLeft ("Only show 'Walk' Cursor when over NavMesh?", onlyWalkWhenOverNavMesh); } } addWalkPrefix = EditorGUILayout.Toggle ("Prefix cursor labels?", addWalkPrefix); if (addWalkPrefix) { walkPrefix.label = EditorGUILayout.TextField ("Walk prefix:", walkPrefix.label); } 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); inventoryHandling = (InventoryHandling) EditorGUILayout.EnumPopup ("When inventory selected:", inventoryHandling); if (inventoryHandling != InventoryHandling.ChangeCursor) { onlyShowInventoryLabelOverHotspots = EditorGUILayout.ToggleLeft ("Only show label when over Hotspots and Inventory?", onlyShowInventoryLabelOverHotspots); } if (inventoryHandling != InventoryHandling.ChangeHotspotLabel) { inventoryCursorSize = EditorGUILayout.FloatField ("Inventory cursor size:", inventoryCursorSize); } EditorGUILayout.BeginHorizontal (); EditorGUILayout.LabelField ("Use syntax:", GUILayout.Width (100f)); 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 (); if (AdvGame.GetReferences ().settingsManager && AdvGame.GetReferences ().settingsManager.CanGiveItems ()) { EditorGUILayout.BeginHorizontal (); EditorGUILayout.LabelField ("Give syntax:", GUILayout.Width (100f)); hotspotPrefix3.label = EditorGUILayout.TextField (hotspotPrefix3.label, GUILayout.MaxWidth (80f)); EditorGUILayout.LabelField ("(item)", GUILayout.MaxWidth (40f)); hotspotPrefix4.label = EditorGUILayout.TextField (hotspotPrefix4.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.ToggleLeft ("Change cursor based on Interaction?", allowInteractionCursor); if (allowInteractionCursor && (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)) { allowInteractionCursorForInventory = EditorGUILayout.ToggleLeft ("Change when over Inventory items too?", allowInteractionCursorForInventory); } if (settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot) { cycleCursors = EditorGUILayout.ToggleLeft ("Cycle Interactions with right-click?", cycleCursors); } } 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); } }