/** * Initialises the element when it is created within MenuManager. */ public override void Declare() { uiText = null; label = "Label"; isVisible = true; isClickable = false; numSlots = 1; anchor = TextAnchor.MiddleCenter; SetSize(new Vector2(10f, 5f)); labelType = AC_LabelType.Normal; variableID = 0; useCharacterColour = false; autoAdjustHeight = true; textEffects = TextEffects.None; outlineSize = 2f; newLabel = ""; updateIfEmpty = false; showPendingWhileMovingToHotspot = false; inventoryPropertyType = InventoryPropertyType.SelectedItem; itemPropertyID = 0; itemSlotNumber = 0; base.Declare(); }
private void CopyLabel(MenuLabel _element, bool ignoreUnityUI) { if (ignoreUnityUI) { uiText = null; } else { uiText = _element.uiText; } label = _element.label; anchor = _element.anchor; textEffects = _element.textEffects; outlineSize = _element.outlineSize; labelType = _element.labelType; variableID = _element.variableID; useCharacterColour = _element.useCharacterColour; autoAdjustHeight = _element.autoAdjustHeight; updateIfEmpty = _element.updateIfEmpty; showPendingWhileMovingToHotspot = _element.showPendingWhileMovingToHotspot; newLabel = ""; inventoryPropertyType = _element.inventoryPropertyType; itemPropertyID = _element.itemPropertyID; itemSlotNumber = _element.itemSlotNumber; base.Copy(_element); }
public void CopyLabel (MenuLabel _element) { label = _element.label; anchor = _element.anchor; textEffects = _element.textEffects; labelType = _element.labelType; variableID = _element.variableID; variableNumber = _element.variableNumber; useCharacterColour = _element.useCharacterColour; autoAdjustHeight = _element.autoAdjustHeight; newLabel = ""; base.Copy (_element); }
public void CopyLabel(MenuLabel _element) { uiText = _element.uiText; label = _element.label; anchor = _element.anchor; textEffects = _element.textEffects; labelType = _element.labelType; variableID = _element.variableID; variableNumber = _element.variableNumber; useCharacterColour = _element.useCharacterColour; autoAdjustHeight = _element.autoAdjustHeight; updateIfEmpty = _element.updateIfEmpty; newLabel = ""; base.Copy(_element); }
public override void Declare () { label = "Label"; isVisible = true; isClickable = false; numSlots = 1; anchor = TextAnchor.MiddleCenter; SetSize (new Vector2 (10f, 5f)); labelType = AC_LabelType.Normal; variableID = 0; variableNumber = 0; useCharacterColour = false; autoAdjustHeight = true; textEffects = TextEffects.None; newLabel = ""; base.Declare (); }
private void CopyLabel(MenuLabel _element) { uiText = _element.uiText; label = _element.label; anchor = _element.anchor; textEffects = _element.textEffects; labelType = _element.labelType; variableID = _element.variableID; useCharacterColour = _element.useCharacterColour; autoAdjustHeight = _element.autoAdjustHeight; updateIfEmpty = _element.updateIfEmpty; newLabel = ""; inventoryPropertyType = _element.inventoryPropertyType; itemPropertyID = _element.itemPropertyID; itemSlotNumber = _element.itemSlotNumber; base.Copy(_element); }
public override void ShowGUI(MenuSource source) { EditorGUILayout.BeginVertical("Button"); if (source != MenuSource.AdventureCreator) { uiText = LinkedUiGUI <Text> (uiText, "Linked Text:", source); EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); } labelType = (AC_LabelType)EditorGUILayout.EnumPopup("Label type:", labelType); if (source == MenuSource.AdventureCreator || labelType == AC_LabelType.Normal) { label = EditorGUILayout.TextField("Label text:", label); } if (labelType == AC_LabelType.GlobalVariable) { variableID = AdvGame.GlobalVariableGUI("Global Variable:", variableID); } else if (labelType == AC_LabelType.DialogueLine) { useCharacterColour = EditorGUILayout.Toggle("Use Character text colour?", useCharacterColour); if (sizeType == AC_SizeType.Manual) { autoAdjustHeight = EditorGUILayout.Toggle("Auto-adjust height to fit?", autoAdjustHeight); } } if (labelType == AC_LabelType.Hotspot || labelType == AC_LabelType.DialogueLine || labelType == AC_LabelType.DialogueSpeaker) { updateIfEmpty = EditorGUILayout.Toggle("Update if string is empty?", updateIfEmpty); } if (source == MenuSource.AdventureCreator) { anchor = (TextAnchor)EditorGUILayout.EnumPopup("Text alignment:", anchor); textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects); } EditorGUILayout.EndVertical(); base.ShowGUI(source); }
public override void Declare() { uiText = null; label = "Label"; isVisible = true; isClickable = false; numSlots = 1; anchor = TextAnchor.MiddleCenter; SetSize(new Vector2(10f, 5f)); labelType = AC_LabelType.Normal; variableID = 0; variableNumber = 0; useCharacterColour = false; autoAdjustHeight = true; textEffects = TextEffects.None; newLabel = ""; updateIfEmpty = false; base.Declare(); }
public override void ShowGUI(Menu menu) { string apiPrefix = "(AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\") as AC.MenuLabel)"; MenuSource source = menu.menuSource; EditorGUILayout.BeginVertical("Button"); if (source != MenuSource.AdventureCreator) { uiText = LinkedUiGUI <Text> (uiText, "Linked Text:", source); EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); } labelType = (AC_LabelType)CustomGUILayout.EnumPopup("Label type:", labelType, apiPrefix + ".labelType"); if (labelType == AC_LabelType.Normal) { label = CustomGUILayout.TextField("Label text:", label, apiPrefix + ".label"); } else if (source == MenuSource.AdventureCreator) { label = CustomGUILayout.TextField("Placeholder text:", label, apiPrefix + ".label"); } if (labelType == AC_LabelType.GlobalVariable) { variableID = AdvGame.GlobalVariableGUI("Global Variable:", variableID); } else if (labelType == AC_LabelType.DialogueLine) { useCharacterColour = CustomGUILayout.Toggle("Use Character text colour?", useCharacterColour, apiPrefix + ".useCharacterColour"); if (sizeType == AC_SizeType.Manual) { autoAdjustHeight = CustomGUILayout.Toggle("Auto-adjust height to fit?", autoAdjustHeight, apiPrefix + ".autoAdjustHeight"); } } if (labelType == AC_LabelType.Hotspot || labelType == AC_LabelType.DialogueLine || labelType == AC_LabelType.DialogueSpeaker) { updateIfEmpty = CustomGUILayout.Toggle("Update if string is empty?", updateIfEmpty, apiPrefix + ".updateIfEmpty"); if (labelType == AC_LabelType.Hotspot) { showPendingWhileMovingToHotspot = CustomGUILayout.ToggleLeft("Show pending Interaction while moving to Hotspot?", showPendingWhileMovingToHotspot, apiPrefix + ".showPendingWhileMovingToHotspot"); } } else if (labelType == AC_LabelType.InventoryProperty) { if (AdvGame.GetReferences().inventoryManager) { if (AdvGame.GetReferences().inventoryManager.invVars != null && AdvGame.GetReferences().inventoryManager.invVars.Count > 0) { InvVar[] invVars = AdvGame.GetReferences().inventoryManager.invVars.ToArray(); List <string> invVarNames = new List <string>(); int itemPropertyNumber = 0; for (int i = 0; i < invVars.Length; i++) { if (invVars[i].id == itemPropertyID) { itemPropertyNumber = i; } invVarNames.Add(invVars[i].id + ": " + invVars[i].label); } itemPropertyNumber = CustomGUILayout.Popup("Inventory property:", itemPropertyNumber, invVarNames.ToArray(), apiPrefix + ".itemPropertyNumber"); itemPropertyID = invVars[itemPropertyNumber].id; inventoryPropertyType = (InventoryPropertyType)CustomGUILayout.EnumPopup("Inventory item source:", inventoryPropertyType, apiPrefix + ".inventoryPropertyType"); } else { EditorGUILayout.HelpBox("No Inventory properties defined!", MessageType.Warning); } } else { EditorGUILayout.HelpBox("No Inventory Manager assigned!", MessageType.Warning); } } EditorGUILayout.EndVertical(); base.ShowGUI(menu); }
public override void ShowGUI(MenuSource source) { EditorGUILayout.BeginVertical ("Button"); if (source != MenuSource.AdventureCreator) { uiText = LinkedUiGUI <Text> (uiText, "Linked Text:", source); EditorGUILayout.EndVertical (); EditorGUILayout.BeginVertical ("Button"); } labelType = (AC_LabelType) EditorGUILayout.EnumPopup ("Label type:", labelType); if (labelType == AC_LabelType.Normal) { label = EditorGUILayout.TextField ("Label text:", label); } else if (source == MenuSource.AdventureCreator) { label = EditorGUILayout.TextField ("Placeholder text:", label); } if (labelType == AC_LabelType.GlobalVariable) { variableID = AdvGame.GlobalVariableGUI ("Global Variable:", variableID); } else if (labelType == AC_LabelType.DialogueLine) { useCharacterColour = EditorGUILayout.Toggle ("Use Character text colour?", useCharacterColour); if (sizeType == AC_SizeType.Manual) { autoAdjustHeight = EditorGUILayout.Toggle ("Auto-adjust height to fit?", autoAdjustHeight); } } if (labelType == AC_LabelType.Hotspot || labelType == AC_LabelType.DialogueLine || labelType == AC_LabelType.DialogueSpeaker) { updateIfEmpty = EditorGUILayout.Toggle ("Update if string is empty?", updateIfEmpty); } else if (labelType == AC_LabelType.InventoryProperty) { if (AdvGame.GetReferences ().inventoryManager) { if (AdvGame.GetReferences ().inventoryManager.invVars != null && AdvGame.GetReferences ().inventoryManager.invVars.Count > 0) { InvVar[] invVars = AdvGame.GetReferences ().inventoryManager.invVars.ToArray (); List<string> invVarNames = new List<string>(); int itemPropertyNumber = 0; for (int i=0; i<invVars.Length; i++) { if (invVars[i].id == itemPropertyID) { itemPropertyNumber = i; } invVarNames.Add (invVars[i].id + ": " + invVars[i].label); } itemPropertyNumber = EditorGUILayout.Popup ("Inventory property:", itemPropertyNumber, invVarNames.ToArray ()); itemPropertyID = invVars[itemPropertyNumber].id; inventoryPropertyType = (InventoryPropertyType) EditorGUILayout.EnumPopup ("Inventory item source:", inventoryPropertyType); } else { EditorGUILayout.HelpBox ("No Inventory properties defined!", MessageType.Warning); } } else { EditorGUILayout.HelpBox ("No Inventory Manager assigned!", MessageType.Warning); } } if (source == MenuSource.AdventureCreator) { anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor); textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects); } EditorGUILayout.EndVertical (); base.ShowGUI (source); }
private void CopyLabel(MenuLabel _element) { uiText = _element.uiText; label = _element.label; anchor = _element.anchor; textEffects = _element.textEffects; labelType = _element.labelType; variableID = _element.variableID; useCharacterColour = _element.useCharacterColour; autoAdjustHeight = _element.autoAdjustHeight; updateIfEmpty = _element.updateIfEmpty; newLabel = ""; inventoryPropertyType = _element.inventoryPropertyType; itemPropertyID = _element.itemPropertyID; itemSlotNumber = _element.itemSlotNumber; base.Copy (_element); }
/** * Initialises the element when it is created within MenuManager. */ public override void Declare() { uiText = null; label = "Label"; isVisible = true; isClickable = false; numSlots = 1; anchor = TextAnchor.MiddleCenter; SetSize (new Vector2 (10f, 5f)); labelType = AC_LabelType.Normal; variableID = 0; useCharacterColour = false; autoAdjustHeight = true; textEffects = TextEffects.None; newLabel = ""; updateIfEmpty = false; inventoryPropertyType = InventoryPropertyType.SelectedItem; itemPropertyID = 0; itemSlotNumber = 0; base.Declare (); }
public override void ShowGUI(Menu menu) { string apiPrefix = "(AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\") as AC.MenuLabel)"; MenuSource source = menu.menuSource; EditorGUILayout.BeginVertical("Button"); if (source != MenuSource.AdventureCreator) { #if TextMeshProIsPresent uiText = LinkedUiGUI <TMPro.TextMeshProUGUI> (uiText, "Linked Text:", source); #else uiText = LinkedUiGUI <Text> (uiText, "Linked Text:", source); #endif EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); } labelType = (AC_LabelType)CustomGUILayout.EnumPopup("Label type:", labelType, apiPrefix + ".labelType", "What kind of text the label displays"); if (labelType == AC_LabelType.Normal) { label = CustomGUILayout.TextField("Label text:", label, apiPrefix + ".label", "The display text"); } else if (source == MenuSource.AdventureCreator) { label = CustomGUILayout.TextField("Placeholder text:", label, apiPrefix + ".label"); } if (labelType == AC_LabelType.GlobalVariable) { variableID = AdvGame.GlobalVariableGUI("Global Variable:", variableID, "The Global Variable whose value will be displayed"); } else if (labelType == AC_LabelType.DialogueLine) { useCharacterColour = CustomGUILayout.Toggle("Use Character text colour?", useCharacterColour, apiPrefix + ".useCharacterColour", "If True, then the displayed subtitle text will use the speaking character's subtitle text colour"); if (sizeType == AC_SizeType.Manual) { autoAdjustHeight = CustomGUILayout.Toggle("Auto-adjust height to fit?", autoAdjustHeight, apiPrefix + ".autoAdjustHeight", "If True, then the label's height will adjust itself to fit the text within it"); } } if (labelType == AC_LabelType.Hotspot || labelType == AC_LabelType.DialogueLine || labelType == AC_LabelType.DialogueSpeaker) { updateIfEmpty = CustomGUILayout.Toggle("Update if string is empty?", updateIfEmpty, apiPrefix + ".updateIfEmpty", "If True, then the display text buffer can be empty "); if (labelType == AC_LabelType.Hotspot) { showPendingWhileMovingToHotspot = CustomGUILayout.ToggleLeft("Show pending Interaction while moving to Hotspot?", showPendingWhileMovingToHotspot, apiPrefix + ".showPendingWhileMovingToHotspot", "If True, then the label will not change while the player is moving towards a Hotspot in order to run an interaction"); } } else if (labelType == AC_LabelType.InventoryProperty) { if (AdvGame.GetReferences().inventoryManager) { if (AdvGame.GetReferences().inventoryManager.invVars != null && AdvGame.GetReferences().inventoryManager.invVars.Count > 0) { InvVar[] invVars = AdvGame.GetReferences().inventoryManager.invVars.ToArray(); List <string> invVarNames = new List <string>(); int itemPropertyNumber = 0; for (int i = 0; i < invVars.Length; i++) { if (invVars[i].id == itemPropertyID) { itemPropertyNumber = i; } invVarNames.Add(invVars[i].id + ": " + invVars[i].label); } itemPropertyNumber = CustomGUILayout.Popup("Inventory property:", itemPropertyNumber, invVarNames.ToArray(), apiPrefix + ".itemPropertyNumber", "The inventory property to show"); itemPropertyID = invVars[itemPropertyNumber].id; inventoryPropertyType = (InventoryPropertyType)CustomGUILayout.EnumPopup("Inventory item source:", inventoryPropertyType, apiPrefix + ".inventoryPropertyType", "What kind of item to display properties for"); } else { EditorGUILayout.HelpBox("No Inventory properties defined!", MessageType.Warning); } } else { EditorGUILayout.HelpBox("No Inventory Manager assigned!", MessageType.Warning); } } EditorGUILayout.EndVertical(); base.ShowGUI(menu); }
public override void ShowGUI(Menu menu) { MenuSource source = menu.menuSource; EditorGUILayout.BeginVertical("Button"); if (source != MenuSource.AdventureCreator) { uiText = LinkedUiGUI <Text> (uiText, "Linked Text:", source); EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Button"); } labelType = (AC_LabelType)EditorGUILayout.EnumPopup("Label type:", labelType); if (labelType == AC_LabelType.Normal) { label = EditorGUILayout.TextField("Label text:", label); } else if (source == MenuSource.AdventureCreator) { label = EditorGUILayout.TextField("Placeholder text:", label); } if (labelType == AC_LabelType.GlobalVariable) { variableID = AdvGame.GlobalVariableGUI("Global Variable:", variableID); } else if (labelType == AC_LabelType.DialogueLine) { useCharacterColour = EditorGUILayout.Toggle("Use Character text colour?", useCharacterColour); if (sizeType == AC_SizeType.Manual) { autoAdjustHeight = EditorGUILayout.Toggle("Auto-adjust height to fit?", autoAdjustHeight); } } if (labelType == AC_LabelType.Hotspot || labelType == AC_LabelType.DialogueLine || labelType == AC_LabelType.DialogueSpeaker) { updateIfEmpty = EditorGUILayout.Toggle("Update if string is empty?", updateIfEmpty); } else if (labelType == AC_LabelType.InventoryProperty) { if (AdvGame.GetReferences().inventoryManager) { if (AdvGame.GetReferences().inventoryManager.invVars != null && AdvGame.GetReferences().inventoryManager.invVars.Count > 0) { InvVar[] invVars = AdvGame.GetReferences().inventoryManager.invVars.ToArray(); List <string> invVarNames = new List <string>(); int itemPropertyNumber = 0; for (int i = 0; i < invVars.Length; i++) { if (invVars[i].id == itemPropertyID) { itemPropertyNumber = i; } invVarNames.Add(invVars[i].id + ": " + invVars[i].label); } itemPropertyNumber = EditorGUILayout.Popup("Inventory property:", itemPropertyNumber, invVarNames.ToArray()); itemPropertyID = invVars[itemPropertyNumber].id; inventoryPropertyType = (InventoryPropertyType)EditorGUILayout.EnumPopup("Inventory item source:", inventoryPropertyType); } else { EditorGUILayout.HelpBox("No Inventory properties defined!", MessageType.Warning); } } else { EditorGUILayout.HelpBox("No Inventory Manager assigned!", MessageType.Warning); } } if (source == MenuSource.AdventureCreator) { 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); } } EditorGUILayout.EndVertical(); base.ShowGUI(menu); }
public override void ShowGUI(MenuSource source) { EditorGUILayout.BeginVertical ("Button"); if (source != MenuSource.AdventureCreator) { uiText = LinkedUiGUI <Text> (uiText, "Linked Text:", source); EditorGUILayout.EndVertical (); EditorGUILayout.BeginVertical ("Button"); } labelType = (AC_LabelType) EditorGUILayout.EnumPopup ("Label type:", labelType); if (source == MenuSource.AdventureCreator || labelType == AC_LabelType.Normal) { label = EditorGUILayout.TextField ("Label text:", label); } if (labelType == AC_LabelType.GlobalVariable) { variableID = AdvGame.GlobalVariableGUI ("Global Variable:", variableID); } else if (labelType == AC_LabelType.DialogueLine) { useCharacterColour = EditorGUILayout.Toggle ("Use Character text colour?", useCharacterColour); if (sizeType == AC_SizeType.Manual) { autoAdjustHeight = EditorGUILayout.Toggle ("Auto-adjust height to fit?", autoAdjustHeight); } } if (labelType == AC_LabelType.Hotspot || labelType == AC_LabelType.DialogueLine || labelType == AC_LabelType.DialogueSpeaker) { updateIfEmpty = EditorGUILayout.Toggle ("Update if string is empty?", updateIfEmpty); } if (source == MenuSource.AdventureCreator) { anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor); textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects); } EditorGUILayout.EndVertical (); base.ShowGUI (source); }
public override void ShowGUI () { EditorGUILayout.BeginVertical ("Button"); label = EditorGUILayout.TextField ("Label text:", label); labelType = (AC_LabelType) EditorGUILayout.EnumPopup ("Label type:", labelType); if (labelType == AC_LabelType.GlobalVariable) { VariableGUI (); } else if (labelType == AC_LabelType.DialogueLine) { useCharacterColour = EditorGUILayout.Toggle ("Use Character text colour?", useCharacterColour); if (sizeType == AC_SizeType.Manual) { autoAdjustHeight = EditorGUILayout.Toggle ("Auto-adjust height to fit?", autoAdjustHeight); } } anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor); textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects); EditorGUILayout.EndVertical (); base.ShowGUI (); }