Esempio n. 1
0
 void pb_MouseMove(object sender, MouseEventArgs e)
 {
     int index;
     if (clip.Contains(e.Location))
     {
         index = (e.Y - clip.Top) / 13 + scroll.Value;
         if (index >= objList.Count)
             index = -1;
     }
     else
         index = -1;
     if (index != hoveredIndex)
     {
         hoveredIndex = index;
         panel.Update();
         if (hoveredIndex != -1)
         {
             var pred = currentToolTip;
             if (objList[hoveredIndex] is L2Character)
             {
                 characterToolTip.Character = objList[hoveredIndex] as L2Character;
                 currentToolTip = characterToolTip;
             }
             else
             {
                 npcToolTip.Npc = objList[hoveredIndex] as L2Npc;
                 currentToolTip = npcToolTip;
             }
             if (pred != null)
                 if (pred != currentToolTip)
                     pred.Hide();
             currentToolTip.Update();
         }
         else
         {
             currentToolTip.Hide();
             currentToolTip = null;
         }
     }
     if (currentToolTip != null)
     {
         var loc = pb.PointToScreen(e.Location);
         loc.Offset(16, 16);
         currentToolTip.Show(loc);
     }
 }
Esempio n. 2
0
 void world_ObjectsChanged()
 {
     if (currentToolTip != null)
     {
         bool change = false;
         if (currentToolTip == characterToolTip)
         {
             if (0 <= hoveredIndex && hoveredIndex < objList.Count)
                 if (characterToolTip.Character != objList[hoveredIndex])
                     change = true;
         }
         else
         {
             if (0 <= hoveredIndex && hoveredIndex < objList.Count)
                 if (npcToolTip.Npc != objList[hoveredIndex])
                     change = true;
         }
         if (change)
         {
             currentToolTip.Hide();
             if (objList[hoveredIndex] is L2Character)
             {
                 characterToolTip.Character = objList[hoveredIndex] as L2Character;
                 currentToolTip = characterToolTip;
             }
             else
             {
                 npcToolTip.Npc = objList[hoveredIndex] as L2Npc;
                 currentToolTip = npcToolTip;
             }
             currentToolTip.Update();
         }
     }
 }
Esempio n. 3
0
 void pb_MouseLeave(object sender, EventArgs e)
 {
     if (hoveredIndex != -1)
     {
         hoveredIndex = -1;
         panel.Update();
         if (currentToolTip != null)
         {
             currentToolTip.Hide();
             currentToolTip = null;
         }
     }
 }