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); }
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); }
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); }
public override void ShowGUI () { EditorGUILayout.BeginVertical ("Button"); textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects); craftingType = (CraftingElementType) EditorGUILayout.EnumPopup ("Crafting element type:", craftingType); if (craftingType == CraftingElementType.Ingredients) { numSlots = EditorGUILayout.IntSlider ("Number of slots:", numSlots, 1, 12); 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; } isClickable = true; EditorGUILayout.EndVertical (); PopulateList (); base.ShowGUI (); }
public void CopyCrafting (MenuCrafting _element) { isClickable = _element.isClickable; textEffects = _element.textEffects; numSlots = _element.numSlots; craftingType = _element.craftingType; PopulateList (); base.Copy (_element); }
public override void Declare () { isVisible = true; isClickable = true; numSlots = 4; SetSize (new Vector2 (6f, 10f)); textEffects = TextEffects.None; craftingType = CraftingElementType.Ingredients; items = new List<InvItem>(); }
/** * 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 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 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); }
/** * 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>(); }
/** * 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; }
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); }
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); }