/// <summary> /// Gets the <see cref="QuickBarItemType"/> and value to add to the quick bar. /// </summary> /// <param name="type">When this method returns true, contains the <see cref="QuickBarItemType"/> /// to add.</param> /// <param name="value">When this method returns true, contains the value for for the quick bar item.</param> /// <returns>True if the item can be added to the quick bar; otherwise false.</returns> bool IQuickBarItemProvider.TryAddToQuickBar(out QuickBarItemType type, out int value) { type = QuickBarItemType; value = QuickBarItemValue; if (!((IDragDropProvider)this).CanDragContents) { return(false); } return(true); }
/// <summary> /// Gets the <see cref="QuickBarItemType"/> and value to add to the quick bar. /// </summary> /// <param name="type">When this method returns true, contains the <see cref="QuickBarItemType"/> /// to add.</param> /// <param name="value">When this method returns true, contains the value for for the quick bar item.</param> /// <returns> /// True if the item can be added to the quick bar; otherwise false. /// </returns> bool IQuickBarItemProvider.TryAddToQuickBar(out QuickBarItemType type, out int value) { type = QuickBarItemType.Inventory; value = (int)Slot; var item = Item; if (item == null) { return(false); } return(true); }
/// <summary> /// Gets the <see cref="QuickBarItemType"/> and value to add to the quick bar. /// </summary> /// <param name="type">When this method returns true, contains the <see cref="QuickBarItemType"/> /// to add.</param> /// <param name="value">When this method returns true, contains the value for for the quick bar item.</param> /// <returns>True if the item can be added to the quick bar; otherwise false.</returns> bool IQuickBarItemProvider.TryAddToQuickBar(out QuickBarItemType type, out int value) { type = QuickBarItemType.Skill; value = 0; if (SkillInfo == null) { return(false); } value = (int)SkillInfo.Value; return(true); }
/// <summary> /// Sets the quick bar item's type and value. /// </summary> /// <param name="type">The <see cref="QuickBarItemType"/>.</param> /// <param name="value">The value.</param> public void SetQuickBar(QuickBarItemType type, int value) { // Check that at least one of the values are new if (type == QuickBarItemType && value == QuickBarItemValue) { return; } // Set the new values _quickBarItemType = type; _quickBarItemValue = value; // Clear some values _grh.SetGrh(null); _skillInfo = null; // Additional type-based handling switch (type) { case QuickBarItemType.Skill: _skillInfo = SkillInfoManager.Instance[(SkillType)QuickBarItemValue]; if (_skillInfo == null) { SetQuickBar(QuickBarItemType.None, 0); return; } _grh.SetGrh(_skillInfo.Icon, AnimType.Loop, TickCount.Now); if (_grh.GrhData == null) { SetQuickBar(QuickBarItemType.None, 0); return; } break; } }
/// <summary> /// Gets the <see cref="QuickBarItemType"/> and value to add to the quick bar. /// </summary> /// <param name="type">When this method returns true, contains the <see cref="QuickBarItemType"/> /// to add.</param> /// <param name="value">When this method returns true, contains the value for for the quick bar item.</param> /// <returns> /// True if the item can be added to the quick bar; otherwise false. /// </returns> bool IQuickBarItemProvider.TryAddToQuickBar(out QuickBarItemType type, out int value) { type = QuickBarItemType.Inventory; value = (int)Slot; var item = Item; if (item == null) return false; return true; }
/// <summary> /// Gets the <see cref="QuickBarItemType"/> and value to add to the quick bar. /// </summary> /// <param name="type">When this method returns true, contains the <see cref="QuickBarItemType"/> /// to add.</param> /// <param name="value">When this method returns true, contains the value for for the quick bar item.</param> /// <returns>True if the item can be added to the quick bar; otherwise false.</returns> bool IQuickBarItemProvider.TryAddToQuickBar(out QuickBarItemType type, out int value) { type = QuickBarItemType.Skill; value = 0; if (SkillInfo == null) return false; value = (int)SkillInfo.Value; return true; }
/// <summary> /// Initializes a new instance of the <see cref="QuickBarSlotValues"/> struct. /// </summary> /// <param name="slot">The slot.</param> /// <param name="type">The type.</param> /// <param name="value">The value.</param> QuickBarSlotValues(byte slot, QuickBarItemType type, int value) { Slot = slot; Type = type; Value = value; }
/// <summary> /// Gets the <see cref="QuickBarItemType"/> and value to add to the quick bar. /// </summary> /// <param name="type">When this method returns true, contains the <see cref="QuickBarItemType"/> /// to add.</param> /// <param name="value">When this method returns true, contains the value for for the quick bar item.</param> /// <returns>True if the item can be added to the quick bar; otherwise false.</returns> bool IQuickBarItemProvider.TryAddToQuickBar(out QuickBarItemType type, out int value) { type = QuickBarItemType; value = QuickBarItemValue; if (!((IDragDropProvider)this).CanDragContents) return false; return true; }
/// <summary> /// Sets the quick bar item's type and value. /// </summary> /// <param name="type">The <see cref="QuickBarItemType"/>.</param> /// <param name="value">The value.</param> public void SetQuickBar(QuickBarItemType type, int value) { // Check that at least one of the values are new if (type == QuickBarItemType && value == QuickBarItemValue) return; // Set the new values _quickBarItemType = type; _quickBarItemValue = value; // Clear some values _grh.SetGrh(null); _skillInfo = null; // Additional type-based handling switch (type) { case QuickBarItemType.Skill: _skillInfo = SkillInfoManager.Instance[(SkillType)QuickBarItemValue]; if (_skillInfo == null) { SetQuickBar(QuickBarItemType.None, 0); return; } _grh.SetGrh(_skillInfo.Icon, AnimType.Loop, TickCount.Now); if (_grh.GrhData == null) { SetQuickBar(QuickBarItemType.None, 0); return; } break; } }