コード例 #1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="PriorityIcon" /> class.
 /// </summary>
 /// <param name="name">
 ///     The name.
 /// </param>
 /// <param name="height">
 ///     The height.
 /// </param>
 /// <param name="enabled">
 ///     The enabled.
 /// </param>
 public PriorityIcon(string name, float height, bool enabled)
 {
     this.texture = name.Substring(0, "item".Length) == "item"
                        ? Textures.GetTexture(
         "materials/ensage_ui/items/" + name.Substring("item_".Length) + ".vmat")
                        : Textures.GetTexture("materials/ensage_ui/spellicons/" + name + ".vmat");
     this.Height         = height;
     this.Name           = name;
     this.Item           = this.Name.Contains("item");
     this.priorityNumber = new DrawText
     {
         FontFlags = FontFlags.AntiAlias, Color = Color.White,
         Position  = this.Position + new Vector2(4, 3)
     };
     this.transition = new QuadEaseInOut(0.35);
     this.Hover      = new QuadEaseInOut(0.35);
     this.Hover.Start(0, 40);
     this.Enabled = enabled;
 }
コード例 #2
0
ファイル: DragAndDrop.cs プロジェクト: y921231/Ensage.Common
        /// <summary>
        ///     Initializes a new instance of the <see cref="DragAndDrop" /> class.
        /// </summary>
        /// <param name="height">
        ///     The height.
        /// </param>
        /// <param name="itemList">
        ///     The item list.
        /// </param>
        public DragAndDrop(float height, List <string> itemList)
        {
            this.Height = height;
            var count = 0u;

            this.PriorityIconsDictionary = new Dictionary <PriorityIcon, uint>();
            this.itemList = new List <string>(itemList);
            foreach (var s in itemList)
            {
                this.PriorityIconsDictionary.Add(new PriorityIcon(s, height, true), count);
                count++;
            }

            this.doubleClickSleeper = new Sleeper();
            this.iconCountSleeper   = new Sleeper();
            this.iconSizeSleeper    = new Sleeper();
            this.transition         = new QuadEaseInOut(0.35);
            this.transition.Start(0, 150);
            this.abilityToggler = new AbilityToggler(new Dictionary <string, bool>());
            this.Width          = itemList.Count * this.Height;
        }