public void CopyButton(MenuButton _element) { uiButton = _element.uiButton; uiText = _element.uiText; label = _element.label; hotspotLabel = _element.hotspotLabel; hotspotLabelID = _element.hotspotLabelID; anchor = _element.anchor; textEffects = _element.textEffects; buttonClickType = _element.buttonClickType; simulateInput = _element.simulateInput; simulateValue = _element.simulateValue; doFade = _element.doFade; switchMenuTitle = _element.switchMenuTitle; inventoryBoxTitle = _element.inventoryBoxTitle; shiftInventory = _element.shiftInventory; loopJournal = _element.loopJournal; actionList = _element.actionList; inputAxis = _element.inputAxis; clickTexture = _element.clickTexture; clickAlpha = _element.clickAlpha; shiftAmount = _element.shiftAmount; onlyShowWhenEffective = _element.onlyShowWhenEffective; allowContinuousClick = _element.allowContinuousClick; parameterID = _element.parameterID; parameterValue = _element.parameterValue; base.Copy (_element); }
public override void Declare () { label = "Button"; hotspotLabel = ""; hotspotLabelID = -1; isVisible = true; isClickable = true; textEffects = TextEffects.None; buttonClickType = AC_ButtonClickType.RunActionList; simulateInput = SimulateInputType.Button; simulateValue = 1f; numSlots = 1; anchor = TextAnchor.MiddleCenter; SetSize (new Vector2 (10f, 5f)); doFade = false; switchMenuTitle = ""; inventoryBoxTitle = ""; shiftInventory = AC_ShiftInventory.ShiftLeft; loopJournal = false; actionList = null; inputAxis = ""; clickTexture = null; clickAlpha = 0f; shiftAmount = 1; onlyShowWhenEffective = false; allowContinuousClick = false; base.Declare (); }
/** * <summary>Checks if the element's slots can be shifted in a particular direction.</summary> * <param name = "shiftType">The direction to shift slots in (Left, Right)</param> * <returns>True if the element's slots can be shifted in the particular direction</returns> */ public override bool CanBeShifted(AC_ShiftInventory shiftType) { if (shiftType == AC_ShiftInventory.ShiftLeft) { if (offset == 0) { return false; } } else { if ((maxSlots + offset) >= items.Count) { return false; } } return true; }
/** * <summary>Checks if the element's slots can be shifted in a particular direction.</summary> * <param name = "shiftType">The direction to shift slots in (Left, Right)</param> * <returns>True if the element's slots can be shifted in the particular direction</returns> */ public override bool CanBeShifted(AC_ShiftInventory shiftType) { if (numSlots == 0) { return false; } if (shiftType == AC_ShiftInventory.ShiftLeft) { if (offset == 0) { return false; } } else { if (offset >= GetMaxOffset ()) { return false; } } return true; }
/** * <summary>Shifts which slots are on display, if the number of slots the element has exceeds the number of slots it can show at once.</summary> * <param name = "shiftType">The direction to shift slots in (Left, Right)</param> * <param name = "doLoop">If True, then shifting right beyond the last page will display the first page, and vice-versa</param> */ public void Shift(AC_ShiftInventory shiftType, bool doLoop) { if (shiftType == AC_ShiftInventory.ShiftRight) { if (pages.Count > showPage) { showPage ++; } else if (doLoop) { showPage = 1; } } else if (shiftType == AC_ShiftInventory.ShiftLeft) { if (showPage > 1) { showPage --; } else if (doLoop) { showPage = pages.Count; } } }
/** * <summary>Shifts which slots are on display, if the number of slots the element has exceeds the number of slots it can show at once.</summary> * <param name = "shiftType">The direction to shift slots in (Left, Right)</param> * <param name = "amount">The amount to shift slots by</param> */ public override void Shift(AC_ShiftInventory shiftType, int amount) { if (isVisible && numSlots >= maxSlots) { Shift (shiftType, maxSlots, KickStarter.options.GetNumProfiles (), amount); } }
/** * <summary>Shifts which slots are on display, if the number of slots the element has exceeds the number of slots it can show at once.</summary> * <param name = "shiftType">The direction to shift slots in (Left, Right)</param> * <param name = "amount">The amount to shift slots by</param> */ public override void Shift(AC_ShiftInventory shiftType, int amount) { if (numSlots >= maxSlots) { Shift (shiftType, maxSlots, items.Count, amount); } }
public override void Shift (AC_ShiftInventory shiftType, int amount) { if (isVisible && numSlots >= maxSlots) { Shift (shiftType, maxSlots, numOptions, amount); } }
/** * <summary>Checks if the element's slots can be shifted in a particular direction.</summary> * <param name = "shiftType">The direction to shift slots in (Left, Right)</param> * <returns>True if the element's slots can be shifted in the particular direction</returns> */ public virtual bool CanBeShifted(AC_ShiftInventory shiftType) { return(true); }
/** * <summary>Shifts which slots are on display, if the number of slots the element has exceeds the number of slots it can show at once.</summary> * <param name = "shiftType">The direction to shift pages in (Left, Right)</param> * <param name = "doLoop">If True, then shifting right beyond the last page will display the first page, and vice-versa</param> * <param name = "amount">The amount to shift pages by</param> */ public void Shift(AC_ShiftInventory shiftType, bool doLoop, int amount) { if (journalType == JournalType.DisplayExistingJournal) { ACDebug.LogWarning ("The journal '" + title + "' cannot be shifted - instead its linked journal (" + otherJournalTitle + ") must be shifted instead."); return; } if (shiftType == AC_ShiftInventory.ShiftRight) { showPage += amount; } else if (shiftType == AC_ShiftInventory.ShiftLeft) { showPage -= amount; } if (showPage < 1) { if (doLoop) { showPage = pages.Count; } else { showPage = 1; } } else if (showPage > pages.Count) { if (doLoop) { showPage = 1; } else { showPage = pages.Count; } } }
public override bool CanBeShifted(AC_ShiftInventory shiftType) { if (journalType == JournalType.DisplayExistingJournal) { return false; } if (shiftType == AC_ShiftInventory.ShiftLeft) { if (showPage == 1) { return false; } } else { if (pages.Count <= showPage) { return false; } } return true; }
public virtual bool CanBeShifted (AC_ShiftInventory shiftType) { return true; }
public virtual void Shift (AC_ShiftInventory shiftType, int amount) { Debug.LogWarning ("The MenuElement " + this.title + " cannot be 'Shifted'"); }
protected void Shift (AC_ShiftInventory shiftType, int maxSlots, int arraySize, int amount) { if (shiftType == AC_ShiftInventory.ShiftRight) { offset += amount; if ((maxSlots + offset) >= arraySize) { offset = arraySize - maxSlots; } } else if (shiftType == AC_ShiftInventory.ShiftLeft && offset > 0) { offset -= amount; if (offset < 0) { offset = 0; } } }
public override void ShowGUI () { EditorGUILayout.BeginVertical ("Button"); label = EditorGUILayout.TextField ("Button text:", label); anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor); textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects); hotspotLabel = EditorGUILayout.TextField ("Hotspot label override:", hotspotLabel); EditorGUILayout.BeginHorizontal (); EditorGUILayout.LabelField ("Click texture:", GUILayout.Width (145f)); clickTexture = (Texture2D) EditorGUILayout.ObjectField (clickTexture, typeof (Texture2D), false, GUILayout.Width (70f), GUILayout.Height (30f)); EditorGUILayout.EndHorizontal (); buttonClickType = (AC_ButtonClickType) EditorGUILayout.EnumPopup ("Click type:", buttonClickType); if (buttonClickType == AC_ButtonClickType.TurnOffMenu) { doFade = EditorGUILayout.Toggle ("Do transition?", doFade); } else if (buttonClickType == AC_ButtonClickType.Crossfade) { switchMenuTitle = EditorGUILayout.TextField ("Menu to switch to:", switchMenuTitle); } else if (buttonClickType == AC_ButtonClickType.OffsetInventoryOrDialogue) { inventoryBoxTitle = EditorGUILayout.TextField ("Element to affect:", inventoryBoxTitle); shiftInventory = (AC_ShiftInventory) EditorGUILayout.EnumPopup ("Offset type:", shiftInventory); shiftAmount = EditorGUILayout.IntField ("Offset amount:", shiftAmount); onlyShowWhenEffective = EditorGUILayout.Toggle ("Only show when effective?", onlyShowWhenEffective); } else if (buttonClickType == AC_ButtonClickType.OffsetJournal) { inventoryBoxTitle = EditorGUILayout.TextField ("Journal to affect:", inventoryBoxTitle); shiftInventory = (AC_ShiftInventory) EditorGUILayout.EnumPopup ("Offset type:", shiftInventory); loopJournal = EditorGUILayout.Toggle ("Cycle pages?", loopJournal); } else if (buttonClickType == AC_ButtonClickType.RunActionList) { actionList = (ActionListAsset) EditorGUILayout.ObjectField ("ActionList to run:", actionList, typeof (ActionListAsset), false); } else if (buttonClickType == AC_ButtonClickType.CustomScript) { allowContinuousClick = EditorGUILayout.Toggle ("Accept held-down clicks?", allowContinuousClick); ShowClipHelp (); } else if (buttonClickType == AC_ButtonClickType.SimulateInput) { simulateInput = (SimulateInputType) EditorGUILayout.EnumPopup ("Simulate:", simulateInput); inputAxis = EditorGUILayout.TextField ("Input axis:", inputAxis); if (simulateInput == SimulateInputType.Axis) { simulateValue = EditorGUILayout.FloatField ("Input value:", simulateValue); } } EditorGUILayout.EndVertical (); base.ShowGUI (); }
public override void Shift(AC_ShiftInventory shiftType, int amount) { if (isVisible && numSlots >= maxSlots) { Shift (shiftType, maxSlots, GetNumFilledSlots (), amount); } }
/** * <summary>Shifts which slots are on display, if the number of slots the element has exceeds the number of slots it can show at once.</summary> * <param name = "shiftType">The direction to shift slots in (Left, Right)</param> * <param name = "amount">The amount to shift slots by</param> */ public virtual void Shift(AC_ShiftInventory shiftType, int amount) { ACDebug.LogWarning("The MenuElement " + this.title + " cannot be 'Shifted'"); }