Exemple #1
0
            /// <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);
            }
Exemple #2
0
            /// <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);
            }
Exemple #3
0
            /// <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);
            }
Exemple #4
0
            /// <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;
                }
            }
Exemple #5
0
            /// <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;
            }
Exemple #6
0
            /// <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;
            }
Exemple #7
0
 /// <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;
 }
Exemple #8
0
            /// <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;
            }
Exemple #9
0
            /// <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;
                }
            }
Exemple #10
0
 /// <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;
 }