private void CopyCrafting(MenuCrafting _element, bool ignoreUnityUI) { if (ignoreUnityUI) { uiSlots = null; } else { uiSlots = new UISlot[_element.uiSlots.Length]; for (int i = 0; i < uiSlots.Length; i++) { uiSlots[i] = new UISlot(_element.uiSlots[i]); } } isClickable = _element.isClickable; textEffects = _element.textEffects; outlineSize = _element.outlineSize; numSlots = _element.numSlots; craftingType = _element.craftingType; displayType = _element.displayType; uiHideStyle = _element.uiHideStyle; actionListOnWrongIngredients = _element.actionListOnWrongIngredients; linkUIGraphic = _element.linkUIGraphic; autoCreate = _element.autoCreate; inventoryItemCountDisplay = _element.inventoryItemCountDisplay; PopulateList(MenuSource.AdventureCreator); base.Copy(_element); }
/** * Initialises the element when it is created within MenuManager. */ public override void Declare() { uiSlots = null; isVisible = true; isClickable = true; fixedOption = false; displayType = ConversationDisplayType.TextOnly; testIcon = null; optionToShow = 1; numSlots = 0; SetSize(new Vector2(20f, 5f)); maxSlots = 10; anchor = TextAnchor.MiddleLeft; textEffects = TextEffects.None; outlineSize = 2f; markAlreadyChosen = false; alreadyChosenFontColour = Color.white; alreadyChosenFontHighlightedColour = Color.white; showIndexNumbers = false; uiHideStyle = UIHideStyle.DisableObject; linkUIGraphic = LinkUIGraphic.ImageComponent; resetOffsetWhenRestart = true; base.Declare(); }
private void CopyDialogList(MenuDialogList _element, bool ignoreUnityUI) { if (ignoreUnityUI) { uiSlots = null; } else { uiSlots = _element.uiSlots; } textEffects = _element.textEffects; outlineSize = _element.outlineSize; displayType = _element.displayType; testIcon = _element.testIcon; anchor = _element.anchor; labels = _element.labels; fixedOption = _element.fixedOption; optionToShow = _element.optionToShow; maxSlots = _element.maxSlots; markAlreadyChosen = _element.markAlreadyChosen; alreadyChosenFontColour = _element.alreadyChosenFontColour; alreadyChosenFontHighlightedColour = _element.alreadyChosenFontHighlightedColour; showIndexNumbers = _element.showIndexNumbers; uiHideStyle = _element.uiHideStyle; linkUIGraphic = _element.linkUIGraphic; resetOffsetWhenRestart = _element.resetOffsetWhenRestart; base.Copy(_element); }
private void CopyCrafting(MenuCrafting _element, bool ignoreUnityUI) { if (ignoreUnityUI) { uiSlots = null; } else { uiSlots = _element.uiSlots; } isClickable = _element.isClickable; textEffects = _element.textEffects; outlineSize = _element.outlineSize; numSlots = _element.numSlots; craftingType = _element.craftingType; displayType = _element.displayType; uiHideStyle = _element.uiHideStyle; actionListOnWrongIngredients = _element.actionListOnWrongIngredients; linkUIGraphic = _element.linkUIGraphic; PopulateList(MenuSource.AdventureCreator); base.Copy(_element); }
private void CopyInventoryBox(MenuInventoryBox _element, bool ignoreUnityUI) { if (ignoreUnityUI) { uiSlots = null; } else { uiSlots = _element.uiSlots; } isClickable = _element.isClickable; textEffects = _element.textEffects; outlineSize = _element.outlineSize; inventoryBoxType = _element.inventoryBoxType; numSlots = _element.numSlots; maxSlots = _element.maxSlots; limitToCategory = _element.limitToCategory; limitToDefinedInteractions = _element.limitToDefinedInteractions; categoryID = _element.categoryID; selectItemsAfterTaking = _element.selectItemsAfterTaking; displayType = _element.displayType; uiHideStyle = _element.uiHideStyle; categoryIDs = _element.categoryIDs; linkUIGraphic = _element.linkUIGraphic; UpdateLimitCategory(); items = GetItemList(); base.Copy(_element); Upgrade(); }
public override void ShowGUI(Menu menu) { MenuSource source = menu.menuSource; EditorGUILayout.BeginVertical("Button"); if (source == MenuSource.AdventureCreator) { textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects); if (textEffects != TextEffects.None) { outlineSize = EditorGUILayout.Slider("Effect size:", outlineSize, 1f, 5f); } } displayType = (ConversationDisplayType)EditorGUILayout.EnumPopup("Display:", displayType); if (displayType == ConversationDisplayType.IconAndText && source == MenuSource.AdventureCreator) { EditorGUILayout.HelpBox("'Icon And Text' mode is only available for Unity UI-based Menus.", MessageType.Warning); } craftingType = (CraftingElementType)EditorGUILayout.EnumPopup("Crafting element type:", craftingType); if (craftingType == CraftingElementType.Ingredients) { numSlots = EditorGUILayout.IntSlider("Number of slots:", numSlots, 1, 12); if (source == MenuSource.AdventureCreator) { slotSpacing = EditorGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f); orientation = (ElementOrientation)EditorGUILayout.EnumPopup("Slot orientation:", orientation); if (orientation == ElementOrientation.Grid) { gridWidth = EditorGUILayout.IntSlider("Grid size:", gridWidth, 1, 10); } } } else { numSlots = 1; } if (source != MenuSource.AdventureCreator) { EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); uiHideStyle = (UIHideStyle)EditorGUILayout.EnumPopup("When invisible:", uiHideStyle); EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel); uiSlots = ResizeUISlots(uiSlots, numSlots); for (int i = 0; i < uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI(i, source); } } isClickable = true; EditorGUILayout.EndVertical(); PopulateList(source); base.ShowGUI(menu); }
private void CopyInventoryBox(MenuInventoryBox _element) { uiSlots = _element.uiSlots; isClickable = _element.isClickable; textEffects = _element.textEffects; outlineSize = _element.outlineSize; inventoryBoxType = _element.inventoryBoxType; numSlots = _element.numSlots; maxSlots = _element.maxSlots; limitToCategory = _element.limitToCategory; limitToDefinedInteractions = _element.limitToDefinedInteractions; categoryID = _element.categoryID; selectItemsAfterTaking = _element.selectItemsAfterTaking; displayType = _element.displayType; uiHideStyle = _element.uiHideStyle; categoryIDs = _element.categoryIDs; UpdateLimitCategory(); PopulateList(); base.Copy(_element); Upgrade(); }
/** * Initialises the element when it is created within MenuManager. */ public override void Declare() { uiSlots = null; isVisible = true; isClickable = true; numSlots = 4; SetSize (new Vector2 (6f, 10f)); textEffects = TextEffects.None; craftingType = CraftingElementType.Ingredients; displayType = ConversationDisplayType.IconOnly; items = new List<InvItem>(); }
public override void Declare() { uiSlots = null; isVisible = true; isClickable = true; numSlots = 4; SetSize(new Vector2(6f, 10f)); textEffects = TextEffects.None; craftingType = CraftingElementType.Ingredients; displayType = ConversationDisplayType.IconOnly; items = new List <InvItem>(); }
public void CopyCrafting(MenuCrafting _element) { uiSlots = _element.uiSlots; isClickable = _element.isClickable; textEffects = _element.textEffects; numSlots = _element.numSlots; craftingType = _element.craftingType; displayType = _element.displayType; PopulateList(MenuSource.AdventureCreator); base.Copy(_element); }
public void CopyDialogList (MenuDialogList _element) { textEffects = _element.textEffects; displayType = _element.displayType; testIcon = _element.testIcon; anchor = _element.anchor; labels = _element.labels; fixedOption = _element.fixedOption; optionToShow = _element.optionToShow; maxSlots = _element.maxSlots; base.Copy (_element); }
public void CopyCrafting(MenuCrafting _element) { uiSlots = _element.uiSlots; isClickable = _element.isClickable; textEffects = _element.textEffects; numSlots = _element.numSlots; craftingType = _element.craftingType; displayType = _element.displayType; PopulateList (MenuSource.AdventureCreator); base.Copy (_element); }
private void CopyCrafting(MenuCrafting _element) { uiSlots = _element.uiSlots; isClickable = _element.isClickable; textEffects = _element.textEffects; outlineSize = _element.outlineSize; numSlots = _element.numSlots; craftingType = _element.craftingType; displayType = _element.displayType; uiHideStyle = _element.uiHideStyle; PopulateList(MenuSource.AdventureCreator); base.Copy(_element); }
public void CopyDialogList(MenuDialogList _element) { uiSlots = _element.uiSlots; textEffects = _element.textEffects; displayType = _element.displayType; testIcon = _element.testIcon; anchor = _element.anchor; labels = _element.labels; fixedOption = _element.fixedOption; optionToShow = _element.optionToShow; maxSlots = _element.maxSlots; base.Copy(_element); }
public override void ShowGUI(MenuSource source) { EditorGUILayout.BeginVertical("Button"); if (source == MenuSource.AdventureCreator) { textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects); } displayType = (ConversationDisplayType)EditorGUILayout.EnumPopup("Display:", displayType); craftingType = (CraftingElementType)EditorGUILayout.EnumPopup("Crafting element type:", craftingType); if (craftingType == CraftingElementType.Ingredients) { numSlots = EditorGUILayout.IntSlider("Number of slots:", numSlots, 1, 12); if (source == MenuSource.AdventureCreator) { slotSpacing = EditorGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f); orientation = (ElementOrientation)EditorGUILayout.EnumPopup("Slot orientation:", orientation); if (orientation == ElementOrientation.Grid) { gridWidth = EditorGUILayout.IntSlider("Grid size:", gridWidth, 1, 10); } } } else { categoryID = -1; numSlots = 1; } if (source != MenuSource.AdventureCreator) { EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); uiSlots = ResizeUISlots(uiSlots, numSlots); for (int i = 0; i < uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI(i, source); } } isClickable = true; EditorGUILayout.EndVertical(); PopulateList(source); base.ShowGUI(source); }
public override void Declare () { isVisible = true; isClickable = true; fixedOption = false; displayType = ConversationDisplayType.TextOnly; testIcon = null; optionToShow = 1; numSlots = 0; SetSize (new Vector2 (20f, 5f)); maxSlots = 10; anchor = TextAnchor.MiddleLeft; textEffects = TextEffects.None; base.Declare (); }
/** * Initialises the element when it is created within MenuManager. */ public override void Declare() { uiSlots = null; isVisible = true; isClickable = true; numSlots = 4; SetSize(new Vector2(6f, 10f)); textEffects = TextEffects.None; outlineSize = 2f; craftingType = CraftingElementType.Ingredients; displayType = ConversationDisplayType.IconOnly; uiHideStyle = UIHideStyle.DisableObject; actionListOnWrongIngredients = null; linkUIGraphic = LinkUIGraphic.ImageComponent; items = new List <InvItem>(); }
public override void Declare() { uiSlots = null; isVisible = true; isClickable = true; inventoryBoxType = AC_InventoryBoxType.Default; numSlots = 0; SetSize(new Vector2(6f, 10f)); maxSlots = 10; limitToCategory = false; selectItemsAfterTaking = true; categoryID = -1; displayType = ConversationDisplayType.IconOnly; textEffects = TextEffects.None; items = new List <InvItem>(); }
public void CopyInventoryBox(MenuInventoryBox _element) { uiSlots = _element.uiSlots; isClickable = _element.isClickable; textEffects = _element.textEffects; inventoryBoxType = _element.inventoryBoxType; numSlots = _element.numSlots; maxSlots = _element.maxSlots; limitToCategory = _element.limitToCategory; categoryID = _element.categoryID; selectItemsAfterTaking = _element.selectItemsAfterTaking; displayType = _element.displayType; PopulateList(); base.Copy(_element); }
private void CopyDialogList(MenuDialogList _element) { uiSlots = _element.uiSlots; textEffects = _element.textEffects; displayType = _element.displayType; testIcon = _element.testIcon; anchor = _element.anchor; labels = _element.labels; fixedOption = _element.fixedOption; optionToShow = _element.optionToShow; maxSlots = _element.maxSlots; markAlreadyChosen = _element.markAlreadyChosen; alreadyChosenFontColour = _element.alreadyChosenFontColour; base.Copy(_element); }
public override void Declare() { uiSlots = null; isVisible = true; isClickable = true; fixedOption = false; displayType = ConversationDisplayType.TextOnly; testIcon = null; optionToShow = 1; numSlots = 0; SetSize(new Vector2(20f, 5f)); maxSlots = 10; anchor = TextAnchor.MiddleLeft; textEffects = TextEffects.None; base.Declare(); }
private void CopyInventoryBox(MenuInventoryBox _element, bool ignoreUnityUI) { if (ignoreUnityUI) { uiSlots = null; } else { uiSlots = _element.uiSlots; } uiPointerState = _element.uiPointerState; isClickable = _element.isClickable; textEffects = _element.textEffects; outlineSize = _element.outlineSize; inventoryBoxType = _element.inventoryBoxType; numSlots = _element.numSlots; maxSlots = _element.maxSlots; limitToCategory = _element.limitToCategory; limitToDefinedInteractions = _element.limitToDefinedInteractions; categoryID = _element.categoryID; selectItemsAfterTaking = _element.selectItemsAfterTaking; displayType = _element.displayType; uiHideStyle = _element.uiHideStyle; categoryIDs = _element.categoryIDs; linkUIGraphic = _element.linkUIGraphic; UpdateLimitCategory(); items = GetItemList(); base.Copy(_element); if (Application.isPlaying) { if (!(inventoryBoxType == AC_InventoryBoxType.HotspotBased && maxSlots == 1)) { alternativeInputButton = ""; } } Upgrade(); }
/** * Initialises the element when it is created within MenuManager. */ public override void Declare() { uiSlots = null; isVisible = true; isClickable = true; numSlots = 4; SetSize(new Vector2(6f, 10f)); textEffects = TextEffects.None; outlineSize = 2f; craftingType = CraftingElementType.Ingredients; displayType = ConversationDisplayType.IconOnly; uiHideStyle = UIHideStyle.DisableObject; actionListOnWrongIngredients = null; linkUIGraphic = LinkUIGraphic.ImageComponent; invInstances = new List <InvInstance>(); autoCreate = true; inventoryItemCountDisplay = InventoryItemCountDisplay.OnlyIfMultiple; containerSelectMode = ContainerSelectMode.MoveToInventoryAndSelect; }
private void CopyDialogList(MenuDialogList _element) { uiSlots = _element.uiSlots; textEffects = _element.textEffects; outlineSize = _element.outlineSize; displayType = _element.displayType; testIcon = _element.testIcon; anchor = _element.anchor; labels = _element.labels; fixedOption = _element.fixedOption; optionToShow = _element.optionToShow; maxSlots = _element.maxSlots; markAlreadyChosen = _element.markAlreadyChosen; alreadyChosenFontColour = _element.alreadyChosenFontColour; showIndexNumbers = _element.showIndexNumbers; uiHideStyle = _element.uiHideStyle; base.Copy(_element); }
/** * Initialises the element when it is created within MenuManager. */ public override void Declare() { uiSlots = null; isVisible = true; isClickable = true; fixedOption = false; displayType = ConversationDisplayType.TextOnly; testIcon = null; optionToShow = 1; numSlots = 0; SetSize(new Vector2(20f, 5f)); maxSlots = 10; anchor = TextAnchor.MiddleLeft; textEffects = TextEffects.None; outlineSize = 2f; markAlreadyChosen = false; alreadyChosenFontColour = Color.white; showIndexNumbers = false; base.Declare(); }
/** * Initialises the element when it is created within MenuManager. */ public override void Declare() { uiSlots = null; isVisible = true; isClickable = true; inventoryBoxType = AC_InventoryBoxType.Default; numSlots = 0; SetSize(new Vector2(6f, 10f)); maxSlots = 10; limitToCategory = false; limitToDefinedInteractions = true; selectItemsAfterTaking = true; categoryID = -1; displayType = ConversationDisplayType.IconOnly; textEffects = TextEffects.None; outlineSize = 2f; uiHideStyle = UIHideStyle.DisableObject; items = new List <InvItem>(); categoryIDs = new List <int>(); linkUIGraphic = LinkUIGraphic.ImageComponent; }
public override void ShowGUI(MenuSource source) { EditorGUILayout.BeginVertical("Button"); fixedOption = EditorGUILayout.Toggle("Fixed option number?", fixedOption); if (fixedOption) { numSlots = 1; slotSpacing = 0f; optionToShow = EditorGUILayout.IntSlider("Option to display:", optionToShow, 1, 10); } else { maxSlots = EditorGUILayout.IntField("Maximum no. of slots:", maxSlots); if (source == MenuSource.AdventureCreator) { numSlots = EditorGUILayout.IntSlider("Test slots:", numSlots, 1, maxSlots); slotSpacing = EditorGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f); orientation = (ElementOrientation)EditorGUILayout.EnumPopup("Slot orientation:", orientation); if (orientation == ElementOrientation.Grid) { gridWidth = EditorGUILayout.IntSlider("Grid size:", gridWidth, 1, 10); } } } displayType = (ConversationDisplayType)EditorGUILayout.EnumPopup("Display type:", displayType); if (source == MenuSource.AdventureCreator) { if (displayType == ConversationDisplayType.IconOnly) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Test icon:", GUILayout.Width(145f)); testIcon = (Texture2D)EditorGUILayout.ObjectField(testIcon, typeof(Texture2D), false, GUILayout.Width(70f), GUILayout.Height(30f)); EditorGUILayout.EndHorizontal(); } else { anchor = (TextAnchor)EditorGUILayout.EnumPopup("Text alignment:", anchor); textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects); } } else { EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); if (fixedOption) { uiSlots = ResizeUISlots(uiSlots, 1); } else { uiSlots = ResizeUISlots(uiSlots, maxSlots); } for (int i = 0; i < uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI(i, source); } } ChangeCursorGUI(source); EditorGUILayout.EndVertical(); base.ShowGUI(source); }
public override void ShowGUI(Menu menu) { MenuSource source = menu.menuSource; EditorGUILayout.BeginVertical("Button"); fixedOption = EditorGUILayout.Toggle("Fixed option number?", fixedOption); if (fixedOption) { numSlots = 1; slotSpacing = 0f; optionToShow = EditorGUILayout.IntSlider("Option to display:", optionToShow, 1, 10); } else { maxSlots = EditorGUILayout.IntField("Maximum no. of slots:", maxSlots); if (source == MenuSource.AdventureCreator) { numSlots = EditorGUILayout.IntSlider("Test slots:", numSlots, 1, maxSlots); slotSpacing = EditorGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f); orientation = (ElementOrientation)EditorGUILayout.EnumPopup("Slot orientation:", orientation); if (orientation == ElementOrientation.Grid) { gridWidth = EditorGUILayout.IntSlider("Grid size:", gridWidth, 1, 10); } } } displayType = (ConversationDisplayType)EditorGUILayout.EnumPopup("Display type:", displayType); markAlreadyChosen = EditorGUILayout.Toggle("Mark options already used?", markAlreadyChosen); if (markAlreadyChosen) { alreadyChosenFontColour = (Color)EditorGUILayout.ColorField("'Already chosen' colour:", alreadyChosenFontColour); } if (source == MenuSource.AdventureCreator) { if (displayType == ConversationDisplayType.IconOnly) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Test icon:", GUILayout.Width(145f)); testIcon = (Texture2D)EditorGUILayout.ObjectField(testIcon, typeof(Texture2D), false, GUILayout.Width(70f), GUILayout.Height(30f)); EditorGUILayout.EndHorizontal(); } else { anchor = (TextAnchor)EditorGUILayout.EnumPopup("Text alignment:", anchor); textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects); if (textEffects != TextEffects.None) { outlineSize = EditorGUILayout.Slider("Effect size:", outlineSize, 1f, 5f); } } } else { EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); uiHideStyle = (UIHideStyle)EditorGUILayout.EnumPopup("When invisible:", uiHideStyle); EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel); if (fixedOption) { uiSlots = ResizeUISlots(uiSlots, 1); } else { uiSlots = ResizeUISlots(uiSlots, maxSlots); } for (int i = 0; i < uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI(i, source); } } if (displayType == ConversationDisplayType.TextOnly) { showIndexNumbers = EditorGUILayout.Toggle("Prefix with index numbers?", showIndexNumbers); } ChangeCursorGUI(menu); EditorGUILayout.EndVertical(); base.ShowGUI(menu); }
public override void ShowGUI(Menu menu) { string apiPrefix = "AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\")"; MenuSource source = menu.menuSource; EditorGUILayout.BeginVertical("Button"); inventoryBoxType = (AC_InventoryBoxType)CustomGUILayout.EnumPopup("Inventory box type:", inventoryBoxType, apiPrefix + ".inventoryBoxType"); if (inventoryBoxType == AC_InventoryBoxType.Default || inventoryBoxType == AC_InventoryBoxType.CustomScript) { maxSlots = CustomGUILayout.IntSlider("Max number of slots:", maxSlots, 1, 30, apiPrefix + ".maxSlots"); isClickable = true; } else if (inventoryBoxType == AC_InventoryBoxType.DisplaySelected) { isClickable = false; maxSlots = 1; } else if (inventoryBoxType == AC_InventoryBoxType.DisplayLastSelected) { isClickable = true; maxSlots = 1; } else if (inventoryBoxType == AC_InventoryBoxType.Container) { isClickable = true; maxSlots = CustomGUILayout.IntSlider("Max number of slots:", maxSlots, 1, 30, apiPrefix + ".maxSlots"); selectItemsAfterTaking = CustomGUILayout.Toggle("Select item after taking?", selectItemsAfterTaking, apiPrefix + ".selectItemsAfterTaking"); } else { isClickable = true; if (source == MenuSource.AdventureCreator) { numSlots = CustomGUILayout.IntField("Test slots:", numSlots, apiPrefix + ".numSlots"); } maxSlots = CustomGUILayout.IntSlider("Max number of slots:", maxSlots, 1, 30, apiPrefix + ".maxSlots"); } if (inventoryBoxType == AC_InventoryBoxType.HotspotBased) { limitToDefinedInteractions = CustomGUILayout.ToggleLeft("Only show items referenced in Interactions?", limitToDefinedInteractions, apiPrefix + ".limitToDefinedInteractions"); } displayType = (ConversationDisplayType)CustomGUILayout.EnumPopup("Display type:", displayType, apiPrefix + ".displayType"); if (displayType == ConversationDisplayType.IconAndText && source == MenuSource.AdventureCreator) { EditorGUILayout.HelpBox("'Icon And Text' mode is only available for Unity UI-based Menus.", MessageType.Warning); } if (inventoryBoxType != AC_InventoryBoxType.DisplaySelected && inventoryBoxType != AC_InventoryBoxType.DisplayLastSelected && source == MenuSource.AdventureCreator) { slotSpacing = CustomGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f, apiPrefix + ".slotSpacing"); orientation = (ElementOrientation)CustomGUILayout.EnumPopup("Slot orientation:", orientation, apiPrefix + ".orientation"); if (orientation == ElementOrientation.Grid) { gridWidth = CustomGUILayout.IntSlider("Grid size:", gridWidth, 1, 10, apiPrefix + ".gridWidth"); } } if (inventoryBoxType == AC_InventoryBoxType.CustomScript) { ShowClipHelp(); } uiHideStyle = (UIHideStyle)CustomGUILayout.EnumPopup("When slot is empty:", uiHideStyle, apiPrefix + ".uiHideStyle"); if (source != MenuSource.AdventureCreator) { EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel); uiSlots = ResizeUISlots(uiSlots, maxSlots); for (int i = 0; i < uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI(i, source); } linkUIGraphic = (LinkUIGraphic)EditorGUILayout.EnumPopup("Link graphics to:", linkUIGraphic); } EditorGUILayout.EndVertical(); if (CanBeLimitedByCategory()) { ShowCategoriesUI(apiPrefix); } base.ShowGUI(menu); }
/** * Initialises the element when it is created within MenuManager. */ public override void Declare() { uiSlots = null; isVisible = true; isClickable = true; inventoryBoxType = AC_InventoryBoxType.Default; numSlots = 0; SetSize (new Vector2 (6f, 10f)); maxSlots = 10; limitToCategory = false; limitToDefinedInteractions = true; selectItemsAfterTaking = true; categoryID = -1; displayType = ConversationDisplayType.IconOnly; textEffects = TextEffects.None; items = new List<InvItem>(); }
public override void ShowGUI(Menu menu) { string apiPrefix = "(AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\") as AC.MenuCrafting)"; MenuSource source = menu.menuSource; EditorGUILayout.BeginVertical("Button"); craftingType = (CraftingElementType)CustomGUILayout.EnumPopup("Crafting element type:", craftingType, apiPrefix + ".craftingType", "What part of the crafting process this element is used for"); if (craftingType == CraftingElementType.Ingredients) { numSlots = CustomGUILayout.IntSlider("Number of slots:", numSlots, 1, 12); if (source == MenuSource.AdventureCreator && numSlots > 1) { slotSpacing = EditorGUILayout.Slider(new GUIContent("Slot spacing:", "The distance between slots"), slotSpacing, 0f, 20f); orientation = (ElementOrientation)CustomGUILayout.EnumPopup("Slot orientation:", orientation, apiPrefix + ".orientation", "The slot orientation"); if (orientation == ElementOrientation.Grid) { gridWidth = CustomGUILayout.IntSlider("Grid size:", gridWidth, 1, 10, apiPrefix + ".gridWidth"); } } } else { autoCreate = CustomGUILayout.Toggle("Result is automatic?", autoCreate, apiPrefix + ".autoCreate", "If True, then the output ingredient will appear automatically when the correct ingredients are used. If False, then the player will have to run the 'Inventory: Crafting' Action as an additional step."); numSlots = 1; actionListOnWrongIngredients = ActionListAssetMenu.AssetGUI("ActionList on fail:", actionListOnWrongIngredients, menu.title + "_OnFailRecipe", apiPrefix + ".actionListOnWrongIngredients", "Ahe ActionList asset to run if a crafting attempt is made but no succesful recipe is possible. This only works if crafting is performed manually via the Inventory: Crafting Action."); if (actionListOnWrongIngredients != null) { EditorGUILayout.HelpBox("This ActionList will only be run if the result is calculated manually via the 'Inventory: Crafting' Action.", MessageType.Info); } } displayType = (ConversationDisplayType)CustomGUILayout.EnumPopup("Display type:", displayType, apiPrefix + ".displayType", "How items are displayed"); if (displayType == ConversationDisplayType.IconAndText && source == MenuSource.AdventureCreator) { EditorGUILayout.HelpBox("'Icon And Text' mode is only available for Unity UI-based Menus.", MessageType.Warning); } inventoryItemCountDisplay = (InventoryItemCountDisplay)CustomGUILayout.EnumPopup("Display item amounts:", inventoryItemCountDisplay, apiPrefix + ".inventoryItemCountDisplay", "How item counts are drawn"); if (source != MenuSource.AdventureCreator) { EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); uiHideStyle = (UIHideStyle)CustomGUILayout.EnumPopup("When invisible:", uiHideStyle, apiPrefix + ".uiHideStyle", "The method by which this element (or slots within it) are hidden from view when made invisible"); EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel); uiSlots = ResizeUISlots(uiSlots, numSlots); for (int i = 0; i < uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI(i, source); } linkUIGraphic = (LinkUIGraphic)CustomGUILayout.EnumPopup("Link graphics to:", linkUIGraphic, "", "What Image component the element's graphics should be linked to"); } isClickable = true; EditorGUILayout.EndVertical(); PopulateList(source); base.ShowGUI(menu); }
public override void ShowGUI(Menu menu) { string apiPrefix = "(AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\") as AC.MenuCrafting)"; MenuSource source = menu.menuSource; EditorGUILayout.BeginVertical("Button"); craftingType = (CraftingElementType)CustomGUILayout.EnumPopup("Crafting element type:", craftingType, apiPrefix + ".craftingType"); if (craftingType == CraftingElementType.Ingredients) { numSlots = CustomGUILayout.IntSlider("Number of slots:", numSlots, 1, 12); if (source == MenuSource.AdventureCreator) { slotSpacing = EditorGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f); orientation = (ElementOrientation)CustomGUILayout.EnumPopup("Slot orientation:", orientation, apiPrefix + ".orientation"); if (orientation == ElementOrientation.Grid) { gridWidth = CustomGUILayout.IntSlider("Grid size:", gridWidth, 1, 10, apiPrefix + ".gridWidth"); } } } else { numSlots = 1; actionListOnWrongIngredients = ActionListAssetMenu.AssetGUI("ActionList on fail:", actionListOnWrongIngredients, apiPrefix + ".actionListOnWrongIngredients", "ActionList_On_Fail_Recipe"); if (actionListOnWrongIngredients != null) { EditorGUILayout.HelpBox("This ActionList will only be run if the result is calculated manually via the 'Inventory: Crafting' Action.", MessageType.Info); } } displayType = (ConversationDisplayType)CustomGUILayout.EnumPopup("Display type:", displayType, apiPrefix + ".displayType"); if (displayType == ConversationDisplayType.IconAndText && source == MenuSource.AdventureCreator) { EditorGUILayout.HelpBox("'Icon And Text' mode is only available for Unity UI-based Menus.", MessageType.Warning); } if (source != MenuSource.AdventureCreator) { EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); uiHideStyle = (UIHideStyle)CustomGUILayout.EnumPopup("When invisible:", uiHideStyle, apiPrefix + ".uiHideStyle"); EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel); uiSlots = ResizeUISlots(uiSlots, numSlots); for (int i = 0; i < uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI(i, source); } linkUIGraphic = (LinkUIGraphic)EditorGUILayout.EnumPopup("Link graphics to:", linkUIGraphic); } isClickable = true; EditorGUILayout.EndVertical(); PopulateList(source); base.ShowGUI(menu); }
/** * <summary>Sets the item currently being hovered over by the mouse cursor.</summary> * <param name = "item">The item to set</param> * <param name = "displayType">The display type of the item in the Menu (IconOnly, TextOnly)</param> */ public void SetHoverItem(InvItem item, ConversationDisplayType displayType = ConversationDisplayType.IconOnly) { hoverItem = item; if (displayType == ConversationDisplayType.IconOnly) { showHoverLabel = true; } else { showHoverLabel = false; } }
public override void ShowGUI(MenuSource source) { EditorGUILayout.BeginVertical ("Button"); if (source == MenuSource.AdventureCreator) { textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects); } displayType = (ConversationDisplayType) EditorGUILayout.EnumPopup ("Display:", displayType); inventoryBoxType = (AC_InventoryBoxType) EditorGUILayout.EnumPopup ("Inventory box type:", inventoryBoxType); if (inventoryBoxType == AC_InventoryBoxType.Default || inventoryBoxType == AC_InventoryBoxType.CustomScript) { limitToCategory = EditorGUILayout.Toggle ("Limit to category?", limitToCategory); if (limitToCategory) { if (AdvGame.GetReferences ().inventoryManager) { List<string> binList = new List<string>(); List<InvBin> bins = AdvGame.GetReferences ().inventoryManager.bins; foreach (InvBin bin in bins) { binList.Add (bin.label); } EditorGUILayout.BeginHorizontal (); EditorGUILayout.LabelField ("Category:", GUILayout.Width (146f)); if (binList.Count > 0) { int binNumber = GetBinSlot (categoryID, bins); binNumber = EditorGUILayout.Popup (binNumber, binList.ToArray()); categoryID = bins[binNumber].id; } else { categoryID = -1; EditorGUILayout.LabelField ("No categories defined!", EditorStyles.miniLabel, GUILayout.Width (146f)); } EditorGUILayout.EndHorizontal (); } else { EditorGUILayout.HelpBox ("No Inventory Manager defined!", MessageType.Warning); categoryID = -1; } } else { categoryID = -1; } maxSlots = EditorGUILayout.IntSlider ("Max number of slots:", maxSlots, 1, 30); isClickable = true; } else if (inventoryBoxType == AC_InventoryBoxType.DisplaySelected) { isClickable = false; maxSlots = 1; } else if (inventoryBoxType == AC_InventoryBoxType.DisplayLastSelected) { isClickable = true; maxSlots = 1; } else if (inventoryBoxType == AC_InventoryBoxType.Container) { isClickable = true; maxSlots = EditorGUILayout.IntSlider ("Max number of slots:", maxSlots, 1, 30); selectItemsAfterTaking = EditorGUILayout.Toggle ("Select item after taking?", selectItemsAfterTaking); } else { isClickable = true; if (source == MenuSource.AdventureCreator) { numSlots = EditorGUILayout.IntField ("Test slots:", numSlots); } maxSlots = EditorGUILayout.IntSlider ("Max number of slots:", maxSlots, 1, 30); } if (inventoryBoxType == AC_InventoryBoxType.HotspotBased) { limitToDefinedInteractions = EditorGUILayout.ToggleLeft ("Only show items referenced in Interactions?", limitToDefinedInteractions); } if (inventoryBoxType != AC_InventoryBoxType.DisplaySelected && inventoryBoxType != AC_InventoryBoxType.DisplayLastSelected && source == MenuSource.AdventureCreator) { slotSpacing = EditorGUILayout.Slider ("Slot spacing:", slotSpacing, 0f, 20f); orientation = (ElementOrientation) EditorGUILayout.EnumPopup ("Slot orientation:", orientation); if (orientation == ElementOrientation.Grid) { gridWidth = EditorGUILayout.IntSlider ("Grid size:", gridWidth, 1, 10); } } if (inventoryBoxType == AC_InventoryBoxType.CustomScript) { ShowClipHelp (); } if (source != MenuSource.AdventureCreator) { EditorGUILayout.EndVertical (); EditorGUILayout.BeginVertical ("Button"); uiSlots = ResizeUISlots (uiSlots, maxSlots); for (int i=0; i<uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI (i, source); } } EditorGUILayout.EndVertical (); base.ShowGUI (source); }
public override void ShowGUI(MenuSource source) { EditorGUILayout.BeginVertical("Button"); if (source == MenuSource.AdventureCreator) { textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects); if (textEffects != TextEffects.None) { outlineSize = EditorGUILayout.Slider("Effect size:", outlineSize, 1f, 5f); } } displayType = (ConversationDisplayType)EditorGUILayout.EnumPopup("Display:", displayType); inventoryBoxType = (AC_InventoryBoxType)EditorGUILayout.EnumPopup("Inventory box type:", inventoryBoxType); if (inventoryBoxType == AC_InventoryBoxType.Default || inventoryBoxType == AC_InventoryBoxType.CustomScript) { limitToCategory = EditorGUILayout.Toggle("Limit to category?", limitToCategory); if (limitToCategory) { if (AdvGame.GetReferences().inventoryManager) { List <string> binList = new List <string>(); List <InvBin> bins = AdvGame.GetReferences().inventoryManager.bins; foreach (InvBin bin in bins) { binList.Add(bin.label); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Category:", GUILayout.Width(146f)); if (binList.Count > 0) { int binNumber = GetBinSlot(categoryID, bins); binNumber = EditorGUILayout.Popup(binNumber, binList.ToArray()); categoryID = bins[binNumber].id; } else { categoryID = -1; EditorGUILayout.LabelField("No categories defined!", EditorStyles.miniLabel, GUILayout.Width(146f)); } EditorGUILayout.EndHorizontal(); } else { EditorGUILayout.HelpBox("No Inventory Manager defined!", MessageType.Warning); categoryID = -1; } } else { categoryID = -1; } maxSlots = EditorGUILayout.IntSlider("Max number of slots:", maxSlots, 1, 30); isClickable = true; } else if (inventoryBoxType == AC_InventoryBoxType.DisplaySelected) { isClickable = false; maxSlots = 1; } else if (inventoryBoxType == AC_InventoryBoxType.DisplayLastSelected) { isClickable = true; maxSlots = 1; } else if (inventoryBoxType == AC_InventoryBoxType.Container) { isClickable = true; maxSlots = EditorGUILayout.IntSlider("Max number of slots:", maxSlots, 1, 30); selectItemsAfterTaking = EditorGUILayout.Toggle("Select item after taking?", selectItemsAfterTaking); } else { isClickable = true; if (source == MenuSource.AdventureCreator) { numSlots = EditorGUILayout.IntField("Test slots:", numSlots); } maxSlots = EditorGUILayout.IntSlider("Max number of slots:", maxSlots, 1, 30); } if (inventoryBoxType == AC_InventoryBoxType.HotspotBased) { limitToDefinedInteractions = EditorGUILayout.ToggleLeft("Only show items referenced in Interactions?", limitToDefinedInteractions); } if (inventoryBoxType != AC_InventoryBoxType.DisplaySelected && inventoryBoxType != AC_InventoryBoxType.DisplayLastSelected && source == MenuSource.AdventureCreator) { slotSpacing = EditorGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f); orientation = (ElementOrientation)EditorGUILayout.EnumPopup("Slot orientation:", orientation); if (orientation == ElementOrientation.Grid) { gridWidth = EditorGUILayout.IntSlider("Grid size:", gridWidth, 1, 10); } } if (inventoryBoxType == AC_InventoryBoxType.CustomScript) { ShowClipHelp(); } if (source != MenuSource.AdventureCreator) { EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); uiHideStyle = (UIHideStyle)EditorGUILayout.EnumPopup("When invisible:", uiHideStyle); EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel); uiSlots = ResizeUISlots(uiSlots, maxSlots); for (int i = 0; i < uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI(i, source); } } EditorGUILayout.EndVertical(); base.ShowGUI(source); }
public override void ShowGUI(MenuSource source) { EditorGUILayout.BeginVertical ("Button"); if (source == MenuSource.AdventureCreator) { textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects); } displayType = (ConversationDisplayType) EditorGUILayout.EnumPopup ("Display:", displayType); craftingType = (CraftingElementType) EditorGUILayout.EnumPopup ("Crafting element type:", craftingType); if (craftingType == CraftingElementType.Ingredients) { numSlots = EditorGUILayout.IntSlider ("Number of slots:", numSlots, 1, 12); if (source == MenuSource.AdventureCreator) { slotSpacing = EditorGUILayout.Slider ("Slot spacing:", slotSpacing, 0f, 20f); orientation = (ElementOrientation) EditorGUILayout.EnumPopup ("Slot orientation:", orientation); if (orientation == ElementOrientation.Grid) { gridWidth = EditorGUILayout.IntSlider ("Grid size:", gridWidth, 1, 10); } } } else { categoryID = -1; numSlots = 1; } if (source != MenuSource.AdventureCreator) { EditorGUILayout.EndVertical (); EditorGUILayout.BeginVertical ("Button"); uiSlots = ResizeUISlots (uiSlots, numSlots); for (int i=0; i<uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI (i, source); } } isClickable = true; EditorGUILayout.EndVertical (); PopulateList (source); base.ShowGUI (source); }
public override void ShowGUI () { EditorGUILayout.BeginVertical ("Button"); fixedOption = EditorGUILayout.Toggle ("Fixed option number?", fixedOption); if (fixedOption) { numSlots = 1; slotSpacing = 0f; optionToShow = EditorGUILayout.IntSlider ("Option to display:", optionToShow, 1, 10); } else { numSlots = EditorGUILayout.IntSlider ("Test slots:", numSlots, 1, maxSlots); maxSlots = EditorGUILayout.IntSlider ("Maximum no. of slots:", maxSlots, 1, 10); slotSpacing = EditorGUILayout.Slider ("Slot spacing:", slotSpacing, 0f, 20f); orientation = (ElementOrientation) EditorGUILayout.EnumPopup ("Slot orientation:", orientation); if (orientation == ElementOrientation.Grid) { gridWidth = EditorGUILayout.IntSlider ("Grid size:", gridWidth, 1, 10); } } displayType = (ConversationDisplayType) EditorGUILayout.EnumPopup ("Display type:", displayType); if (displayType == ConversationDisplayType.IconOnly) { EditorGUILayout.BeginHorizontal (); EditorGUILayout.LabelField ("Test icon:", GUILayout.Width (145f)); testIcon = (Texture2D) EditorGUILayout.ObjectField (testIcon, typeof (Texture2D), false, GUILayout.Width (70f), GUILayout.Height (30f)); EditorGUILayout.EndHorizontal (); } else { anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor); textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects); } EditorGUILayout.EndVertical (); base.ShowGUI (); }
public override void ShowGUI(Menu menu) { string apiPrefix = "(AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\") as AC.MenuDialogList)"; MenuSource source = menu.menuSource; EditorGUILayout.BeginVertical("Button"); fixedOption = CustomGUILayout.Toggle("Fixed option number?", fixedOption, apiPrefix + ".fixedOption", "If True, then only one dialogue option will be shown"); if (fixedOption) { numSlots = 1; slotSpacing = 0f; optionToShow = CustomGUILayout.IntSlider("Option to display:", optionToShow, 1, 10, apiPrefix + ".optionToShow", "The index number of the dialogue option to show"); } else { maxSlots = CustomGUILayout.IntField("Maximum number of slots:", maxSlots, apiPrefix + ".maxSlots", "The maximum number of dialogue options that can be shown at once"); resetOffsetWhenRestart = CustomGUILayout.Toggle("Reset offset when turn on?", resetOffsetWhenRestart, apiPrefix + ".resetOffsetWhenRestart", "If True, then the offset value will be reset when the parent menu is turned on for the same Conversation that it last displayed"); if (source == MenuSource.AdventureCreator) { numSlots = CustomGUILayout.IntSlider("Test slots:", numSlots, 1, maxSlots, apiPrefix + ".numSlots"); slotSpacing = CustomGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 30f, apiPrefix + ".slotSpacing"); orientation = (ElementOrientation)CustomGUILayout.EnumPopup("Slot orientation:", orientation, apiPrefix + ".orientation"); if (orientation == ElementOrientation.Grid) { gridWidth = CustomGUILayout.IntSlider("Grid size:", gridWidth, 1, 10, apiPrefix + ".gridWidth"); } } } displayType = (ConversationDisplayType)CustomGUILayout.EnumPopup("Display type:", displayType, apiPrefix + ".displayType", "How the Conversation's dialogue options are displayed"); if (displayType == ConversationDisplayType.IconAndText && source == MenuSource.AdventureCreator) { EditorGUILayout.HelpBox("'Icon And Text' mode is only available for Unity UI-based Menus.", MessageType.Warning); } markAlreadyChosen = CustomGUILayout.Toggle("Mark options already used?", markAlreadyChosen, apiPrefix + ".markAlreadyChosen", "If True, then options that have already been clicked can be displayed in a different colour"); if (markAlreadyChosen) { alreadyChosenFontColour = (Color)CustomGUILayout.ColorField("'Already chosen' colour:", alreadyChosenFontColour, apiPrefix + ".alreadyChosenFontColour", "The font colour for options already chosen"); alreadyChosenFontHighlightedColour = (Color)CustomGUILayout.ColorField("'Already chosen' highlighted colour:", alreadyChosenFontHighlightedColour, apiPrefix + ".alreadyChosenFontHighlightedColour", "The font colour when the option is highlighted but has already been chosen"); } if (source != MenuSource.AdventureCreator) { EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); uiHideStyle = (UIHideStyle)CustomGUILayout.EnumPopup("When invisible:", uiHideStyle, apiPrefix + ".uiHideStyle", "The method by which this element (or slots within it) are hidden from view when made invisible"); EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel); if (fixedOption) { uiSlots = ResizeUISlots(uiSlots, 1); } else { uiSlots = ResizeUISlots(uiSlots, maxSlots); } for (int i = 0; i < uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI(i, source); } linkUIGraphic = (LinkUIGraphic)CustomGUILayout.EnumPopup("Link graphics to:", linkUIGraphic, "", "What Image component the element's graphics should be linked to"); } if (displayType == ConversationDisplayType.TextOnly || displayType == ConversationDisplayType.IconAndText) { showIndexNumbers = CustomGUILayout.Toggle("Prefix with index numbers?", showIndexNumbers, apiPrefix + ".showIndexNumbers", "If True, then each option's index number will be prefixed to the label"); } ChangeCursorGUI(menu); EditorGUILayout.EndVertical(); base.ShowGUI(menu); }
public override void ShowGUI(MenuSource source) { EditorGUILayout.BeginVertical ("Button"); fixedOption = EditorGUILayout.Toggle ("Fixed option number?", fixedOption); if (fixedOption) { numSlots = 1; slotSpacing = 0f; optionToShow = EditorGUILayout.IntSlider ("Option to display:", optionToShow, 1, 10); } else { maxSlots = EditorGUILayout.IntField ("Maximum no. of slots:", maxSlots); if (source == MenuSource.AdventureCreator) { numSlots = EditorGUILayout.IntSlider ("Test slots:", numSlots, 1, maxSlots); slotSpacing = EditorGUILayout.Slider ("Slot spacing:", slotSpacing, 0f, 20f); orientation = (ElementOrientation) EditorGUILayout.EnumPopup ("Slot orientation:", orientation); if (orientation == ElementOrientation.Grid) { gridWidth = EditorGUILayout.IntSlider ("Grid size:", gridWidth, 1, 10); } } } displayType = (ConversationDisplayType) EditorGUILayout.EnumPopup ("Display type:", displayType); markAlreadyChosen = EditorGUILayout.Toggle ("Mark options already used?", markAlreadyChosen); if (markAlreadyChosen) { alreadyChosenFontColour = (Color) EditorGUILayout.ColorField ("'Already chosen' colour:", alreadyChosenFontColour); } if (source == MenuSource.AdventureCreator) { if (displayType == ConversationDisplayType.IconOnly) { EditorGUILayout.BeginHorizontal (); EditorGUILayout.LabelField ("Test icon:", GUILayout.Width (145f)); testIcon = (Texture2D) EditorGUILayout.ObjectField (testIcon, typeof (Texture2D), false, GUILayout.Width (70f), GUILayout.Height (30f)); EditorGUILayout.EndHorizontal (); } else { anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor); textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects); } } else { EditorGUILayout.EndVertical (); EditorGUILayout.BeginVertical ("Button"); uiHideStyle = (UIHideStyle) EditorGUILayout.EnumPopup ("When invisible:", uiHideStyle); EditorGUILayout.LabelField ("Linked button objects", EditorStyles.boldLabel); if (fixedOption) { uiSlots = ResizeUISlots (uiSlots, 1); } else { uiSlots = ResizeUISlots (uiSlots, maxSlots); } for (int i=0; i<uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI (i, source); } } ChangeCursorGUI (source); EditorGUILayout.EndVertical (); base.ShowGUI (source); }
private void CopyDialogList(MenuDialogList _element) { uiSlots = _element.uiSlots; textEffects = _element.textEffects; displayType = _element.displayType; testIcon = _element.testIcon; anchor = _element.anchor; labels = _element.labels; fixedOption = _element.fixedOption; optionToShow = _element.optionToShow; maxSlots = _element.maxSlots; markAlreadyChosen = _element.markAlreadyChosen; alreadyChosenFontColour = _element.alreadyChosenFontColour; base.Copy (_element); }
private void CopyInventoryBox(MenuInventoryBox _element) { uiSlots = _element.uiSlots; isClickable = _element.isClickable; textEffects = _element.textEffects; inventoryBoxType = _element.inventoryBoxType; numSlots = _element.numSlots; maxSlots = _element.maxSlots; limitToCategory = _element.limitToCategory; limitToDefinedInteractions = _element.limitToDefinedInteractions; categoryID = _element.categoryID; selectItemsAfterTaking = _element.selectItemsAfterTaking; displayType = _element.displayType; PopulateList (); base.Copy (_element); }
public override void ShowGUI(Menu menu) { string apiPrefix = "(AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\") as AC.MenuDialogList)"; MenuSource source = menu.menuSource; EditorGUILayout.BeginVertical("Button"); fixedOption = CustomGUILayout.Toggle("Fixed option number?", fixedOption, apiPrefix + ".fixedOption"); if (fixedOption) { numSlots = 1; slotSpacing = 0f; optionToShow = CustomGUILayout.IntSlider("Option to display:", optionToShow, 1, 10, apiPrefix + ".optionToShow"); } else { maxSlots = CustomGUILayout.IntField("Maximum number of slots:", maxSlots, apiPrefix + ".maxSlots"); resetOffsetWhenRestart = CustomGUILayout.ToggleLeft("Always reset offset when turn on?", resetOffsetWhenRestart, apiPrefix + ".resetOffsetWhenRestart"); if (source == MenuSource.AdventureCreator) { numSlots = CustomGUILayout.IntSlider("Test slots:", numSlots, 1, maxSlots, apiPrefix + ".numSlots"); slotSpacing = CustomGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f, apiPrefix + ".slotSpacing"); orientation = (ElementOrientation)CustomGUILayout.EnumPopup("Slot orientation:", orientation, apiPrefix + ".orientation"); if (orientation == ElementOrientation.Grid) { gridWidth = CustomGUILayout.IntSlider("Grid size:", gridWidth, 1, 10, apiPrefix + ".gridWidth"); } } } displayType = (ConversationDisplayType)CustomGUILayout.EnumPopup("Display type:", displayType, apiPrefix + ".displayType"); if (displayType == ConversationDisplayType.IconAndText && source == MenuSource.AdventureCreator) { EditorGUILayout.HelpBox("'Icon And Text' mode is only available for Unity UI-based Menus.", MessageType.Warning); } markAlreadyChosen = CustomGUILayout.Toggle("Mark options already used?", markAlreadyChosen, apiPrefix + ".markAlreadyChosen"); if (markAlreadyChosen) { alreadyChosenFontColour = (Color)CustomGUILayout.ColorField("'Already chosen' colour:", alreadyChosenFontColour, apiPrefix + ".alreadyChosenFontColour"); alreadyChosenFontHighlightedColour = (Color)CustomGUILayout.ColorField("'Already chosen' highlighted colour:", alreadyChosenFontHighlightedColour, apiPrefix + ".alreadyChosenFontHighlightedColour"); } if (source != MenuSource.AdventureCreator) { EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); uiHideStyle = (UIHideStyle)CustomGUILayout.EnumPopup("When invisible:", uiHideStyle, apiPrefix + ".uiHideStyle"); EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel); if (fixedOption) { uiSlots = ResizeUISlots(uiSlots, 1); } else { uiSlots = ResizeUISlots(uiSlots, maxSlots); } for (int i = 0; i < uiSlots.Length; i++) { uiSlots[i].LinkedUiGUI(i, source); } linkUIGraphic = (LinkUIGraphic)EditorGUILayout.EnumPopup("Link graphics to:", linkUIGraphic); } if (displayType == ConversationDisplayType.TextOnly || displayType == ConversationDisplayType.IconAndText) { showIndexNumbers = CustomGUILayout.Toggle("Prefix with index numbers?", showIndexNumbers, apiPrefix + ".showIndexNumbers"); } ChangeCursorGUI(menu); EditorGUILayout.EndVertical(); base.ShowGUI(menu); }