protected virtual void OnValidate() { if (Image == null) { if (IsEquipmentSlot) { Image = GetComponent <Image>(); } else { Image = gameObject.transform.Find("Slot2").GetComponent <Image>(); } } if (toolTip == null) { toolTip = FindObjectOfType <ItemToolTip>(); } AmountText = GetComponentInChildren <Text>(); if (!GetComponent <EquipmentSlots>()) { ItemNameText = transform.Find("ItemNameText").GetComponent <Text>(); ItemStatText = transform.Find("ItemStatText").GetComponent <Text>(); ItemDescriptionText = transform.Find("ItemDescriptionText").GetComponent <Text>(); } }
public override void PopulateInfoWindow(ItemToolTip infoWindow, IInventoryItem tipItem) { infoWindow.AddItemTitle(this, tipItem, 0f); infoWindow.AddConditionInfo(tipItem); infoWindow.AddSectionTitle("Protection", 0f); for (int i = 0; i < 6; i++) { if (this.armorValues[i] != 0f) { float contentHeight = infoWindow.GetContentHeight(); GameObject obj2 = infoWindow.AddBasicLabel(TakeDamage.DamageIndexToString((DamageTypeIndex)i), 0f); GameObject obj3 = infoWindow.AddBasicLabel("+" + ((int)this.armorValues[i]).ToString("N0"), 0f); obj3.transform.SetLocalPositionX(145f); obj3.GetComponentInChildren <UILabel>().color = Color.green; obj2.transform.SetLocalPositionY(-(contentHeight + 10f)); obj3.transform.SetLocalPositionY(-(contentHeight + 10f)); } } infoWindow.AddSectionTitle("Equipment Slot", 20f); string text = "Head, Chest, Legs, Feet"; if ((base._itemFlags & Inventory.SlotFlags.Head) == Inventory.SlotFlags.Head) { text = "Head"; } else if ((base._itemFlags & Inventory.SlotFlags.Chest) == Inventory.SlotFlags.Chest) { text = "Chest"; } infoWindow.AddBasicLabel(text, 10f); infoWindow.AddItemDescription(this, 15f); infoWindow.FinishPopulating(); }
private void OnTooltip(bool show) { IInventoryItem item = (!show || (this._myDisplayItem == null)) ? null : this._myDisplayItem; ItemDataBlock itemdb = (!show || (this._myDisplayItem == null)) ? null : this._myDisplayItem.datablock; ItemToolTip.SetToolTip(itemdb, item); }
private void Awake() { if (_toolTip == null) { _toolTip = ItemToolTip.ToolTip; } }
private void OnTooltip(bool show) { IInventoryItem inventoryItem; ItemDataBlock itemDataBlock; if (!show || this._myDisplayItem == null) { inventoryItem = null; } else { inventoryItem = this._myDisplayItem; } IInventoryItem inventoryItem1 = inventoryItem; if (!show || this._myDisplayItem == null) { itemDataBlock = null; } else { itemDataBlock = this._myDisplayItem.datablock; } ItemToolTip.SetToolTip(itemDataBlock, inventoryItem1); }
private void OnValidate() { if (itemToolTip == null) { itemToolTip = FindObjectOfType <ItemToolTip>(); } }
void Awake() { if (inventory == null) { var inventoryManager = GameObject.FindWithTag("InventoryManager"); inventory = inventoryManager.GetComponent <PlayerInventory>(); } if (isInventoryPanel) { // Find the DropButton inside the slotpanel only if its inventory panel slot dropItemButton = gameObject.transform.GetChild(1).gameObject; dropItemButton.SetActive(false); } //Debug.Log("object we foudn was: " + dropItemButton); eventTrigger = this.gameObject.GetComponent <EventTrigger>(); playerCharacter = GameObject.FindGameObjectWithTag("MyPlayer"); playerAttack = playerCharacter.GetComponent <Attack>(); playerHealth = playerCharacter.GetComponent <PlayerHealth>(); slotIcon = this.gameObject.GetComponent <Image>(); if (guiScreenManager == null) { guiScreenManager = GameObject.Find("Canvas/Screens").GetComponent <GuiScreenManager>(); } itemToolTip = transform.Find("ToolTipHoverCanvas").GetComponent <ItemToolTip>(); }
public virtual void PopulateInfoWindow(ItemToolTip infoWindow, IInventoryItem item) { infoWindow.AddItemTitle(this, item, 0f); infoWindow.AddConditionInfo(item); infoWindow.AddItemDescription(this, 15f); infoWindow.FinishPopulating(); }
public override void PopulateInfoWindow(ItemToolTip infoWindow, IInventoryItem tipItem) { infoWindow.AddItemTitle(this, tipItem, 0f); infoWindow.AddSectionTitle("Medical", 15f); infoWindow.AddBasicLabel("Instantly heals " + amountToHeal + " health and stops bleeding.", 15f); infoWindow.FinishPopulating(); }
private void Awake() { itemImage = this.gameObject.GetComponent <Image>(); selectedItem = GameObject.Find("SelectedItem").GetComponent <UIItem>(); toolTipObject = GameObject.Find("ItemToolTip"); toolTip = GameObject.Find("ItemToolTipText").GetComponent <ItemToolTip>(); ui = GameObject.Find("InventoryPanel").GetComponent <UIInventory>(); }
private void Awake() { if (ToolTip != null) { return; } ToolTip = this; }
private void Awake() { itemImage = this.gameObject.GetComponent <Image>(); selectedItem = GameObject.Find("SelectedItem").GetComponent <UIItem>(); playerEquip = GameObject.Find("Player").GetComponent <PlayerEquip>(); toolTipObject = GameObject.Find("ItemToolTip"); toolTip = GameObject.Find("ItemToolTipText").GetComponent <ItemToolTip>(); }
protected override void OnEditorMouseDown(object sender, MouseEventArgs e) { IsMouseDown = true; if (!GetXyPosition(e, out _, out _, out var index)) { return; } var selectedItem = Items[index]; switch (e.Button) { case MouseButtons.Left: var newItem = new Furniture(MainFormReference.GetCurrentItem()); if (selectedItem != newItem) { // Save Old Item PushNewItemChange(selectedItem, index, UndoStack); // Clear Redo Stack NewChange(null); // Set New Item Items[index] = newItem; // Redraw Item Image var img = EditorPictureBox.Image; EditorPictureBox.Image = ImageGeneration.DrawFurnitureArrows((Bitmap)Inventory.GetItemPic(ItemCellSize, ItemsPerRow, Items, MainForm.SaveFile.SaveType, EditorPictureBox.Size), (Furniture[])Items, ItemsPerRow); img?.Dispose(); // Update ToolTip ItemToolTip.Show( string.Format(HoverText, newItem.Name, newItem.ItemId.ToString("X4"), newItem.ItemFlag.ToString()), this, e.X + 10, e.Y + 10, int.MaxValue); // Fire ItemChanged Event OnItemChanged(selectedItem, newItem, index); MainForm.SaveFile.ChangesMade = true; Modified = true; } break; case MouseButtons.Right: MainFormReference.SetCurrentItem(selectedItem); break; case MouseButtons.Middle: var tempItems = (Furniture[])Items; Utilities.Utility.FloodFillFurnitureArray(ref tempItems, ItemsPerRow, index, (Furniture)Items[index], new Furniture(MainFormReference.GetCurrentItem())); Items = tempItems; break; } }
private void Awake() { _globalToolTip = this; if (this.uiCamera == null) { this.uiCamera = NGUITools.FindCameraForLayer(base.gameObject.layer); } this.planeTest = new Plane((Vector3)(this.uiCamera.transform.forward * 1f), new Vector3(0f, 0f, 2f)); }
private void Start() { if (_toolTip == null) { _toolTip = ItemToolTip.ToolTip; } color_icon = icon.color; coord = icon.transform.position; }
public override void PopulateInfoWindow(ItemToolTip infoWindow, IInventoryItem tipItem) { infoWindow.AddItemTitle(this, tipItem, 0f); infoWindow.AddSectionTitle("Medical", 15f); string empty = string.Empty; empty = (this.healthAddMin != this.healthAddMax ? string.Concat(new object[] { "Heals ", this.healthAddMin, " to ", this.healthAddMax, " health." }) : string.Concat("Heals ", this.healthAddMin, " health.")); infoWindow.AddBasicLabel(empty, 15f); infoWindow.FinishPopulating(); }
protected virtual void OnValidate() { if (Image == null) { Image = GetComponent <Image>(); } if (toolTip == null) { toolTip = FindObjectOfType <ItemToolTip>(); } }
protected virtual void OnValidate() { if (Image == null) { Image = GetComponent <Image>(); } if (toolTip == null) { toolTip = FindObjectOfType <ItemToolTip>(); } AmountText = GetComponentInChildren <Text>(); }
protected virtual void OnValidate() { if (icon == null) { icon = GetComponent <Image>(); } if (_toolTip == null) { _toolTip = ItemToolTip.ToolTip; } }
protected virtual void OnValidate() { //Only called on editor and triggers when script is loaded or change one of its values on the editor //used this to fill the image variable for each slot if (image == null) { image = GetComponent <Image>(); } if (tooltip == null) { tooltip = FindObjectOfType <ItemToolTip>(); } }
public void OnTooltip(bool show) { ItemDataBlock itemDataBlock; if (!show || !(this.actualItemDataBlock != null)) { itemDataBlock = null; } else { itemDataBlock = this.actualItemDataBlock; } ItemToolTip.SetToolTip(itemDataBlock, null); }
// Load unit inventory // turnscheduler has event invoke sent Unit/UnitInventory on unit selected; public void Awake() { if (itemTooltip == null) { itemTooltip = FindObjectOfType <ItemToolTip>(); } // setup Events // Pointer Enter unitPersonalInventory.OnPointerEnterEvent += ShowTooltip; // Pointer Exit unitPersonalInventory.OnPointerExitEvent += HideTooltip; // Left Click unitPersonalInventory.OnLeftClickEvent += PersonalInventoryLeftClick; }
public override void PopulateInfoWindow(ItemToolTip infoWindow, IInventoryItem tipItem) { infoWindow.AddItemTitle(this, tipItem, 0f); infoWindow.AddSectionTitle("Medical", 15f); string text = string.Empty; if (this.healthAddMin == this.healthAddMax) { text = "Heals " + this.healthAddMin + " health."; } else { object[] objArray1 = new object[] { "Heals ", this.healthAddMin, " to ", this.healthAddMax, " health." }; text = string.Concat(objArray1); } infoWindow.AddBasicLabel(text, 15f); infoWindow.FinishPopulating(); }
public override void PopulateInfoWindow(ItemToolTip infoWindow, IInventoryItem tipItem) { infoWindow.AddItemTitle(this, tipItem, 0f); infoWindow.AddSectionTitle("Ingredients", 15f); for (int i = 0; i < this.ingredients.Length; i++) { string name = this.ingredients[i].Ingredient.name; if (this.ingredients[i].amount > 1) { name = name + " x" + this.ingredients[i].amount; } infoWindow.AddBasicLabel(name, 15f); } infoWindow.AddSectionTitle("Result Item", 15f); infoWindow.AddBasicLabel(this.resultItem.name, 15f); infoWindow.AddItemDescription(this, 15f); infoWindow.FinishPopulating(); }
public override void PopulateInfoWindow(ItemToolTip infoWindow, IInventoryItem tipItem) { infoWindow.AddItemTitle(this, tipItem, 0f); infoWindow.AddSectionTitle("Consumable", 15f); if (this.calories > 0f) { infoWindow.AddBasicLabel(this.calories + " Calories", 15f); } if (this.litresOfWater > 0f) { infoWindow.AddBasicLabel(this.litresOfWater + "L Water", 15f); } if (this.antiRads > 0f) { infoWindow.AddBasicLabel("-" + this.antiRads + " Rads", 15f); } if (this.healthToHeal != 0f) { infoWindow.AddBasicLabel(((this.healthToHeal <= 0f) ? string.Empty : "+") + this.healthToHeal + " Health", 15f); } infoWindow.AddItemDescription(this, 15f); infoWindow.FinishPopulating(); }
public override void PopulateInfoWindow(ItemToolTip infoWindow, IInventoryItem tipItem) { infoWindow.AddItemTitle(this, tipItem, 0f); infoWindow.AddConditionInfo(tipItem); infoWindow.AddSectionTitle("Weapon Stats", 20f); float single = this.recoilPitchMax + this.recoilYawMax; float single1 = 60f; float single2 = 1f / this.fireRate; if (!this.isSemiAuto) { infoWindow.AddProgressStat("Fire Rate", single2, 12f, 15f); } else { infoWindow.AddBasicLabel("Semi Automatic Weapon", 15f); } infoWindow.AddProgressStat("Damage", this.GetGUIDamage(), 100f, 15f); infoWindow.AddProgressStat("Recoil", single, single1, 15f); infoWindow.AddProgressStat("Range", this.GetBulletRange(null), 200f, 15f); infoWindow.AddItemDescription(this, 15f); infoWindow.FinishPopulating(); }
/*private void OnValidate() * { * * }*/ public void Awake() { if (itemTooltip == null) { itemTooltip = FindObjectOfType <ItemToolTip>(); } commonInventory.SetStartingItems(unitSaveManager.LoadInventory()); // commonInventory.SetStartingItems(unitSaveManager.LoadInventory()); // Setup Events // Pointer Enter commonInventory.OnPointerEnterEvent += ShowTooltip; unitPersonalInventory.OnPointerEnterEvent += ShowTooltip; // Pointer Exit commonInventory.OnPointerExitEvent += HideTooltip; unitPersonalInventory.OnPointerExitEvent += HideTooltip; // Left Click commonInventory.OnLeftClickEvent += InventoryLeftClick; unitPersonalInventory.OnLeftClickEvent += UnitPersonalInventoryLeftClick; }
public override void PopulateInfoWindow(ItemToolTip infoWindow, IInventoryItem tipItem) { }
private void Start() { ToolTip = this; HideToolTip(); }
public void OnTooltip(bool show) { ItemToolTip.SetToolTip((!show || (this.actualItemDataBlock == null)) ? null : this.actualItemDataBlock, null); }
private void Awake() { ItemToolTip._globalToolTip = this; if (this.uiCamera == null) { this.uiCamera = NGUITools.FindCameraForLayer(base.gameObject.layer); } this.planeTest = new Plane(this.uiCamera.transform.forward * 1f, new Vector3(0f, 0f, 2f)); }