Exemplo n.º 1
0
 private void OnSkillDrag(string href)
 {
     if (href.Length >= 9 && href.Substring(0, 9) == "skillbtn=")
     {
         int skillIndex;
         if (!int.TryParse(href.Substring(9), out skillIndex))
         {
             return;
         }
         SkillEntry         skill = PlayerState.Skills.SkillEntryByIndex(skillIndex);
         InputManager       input = ServiceRegistry.GetService <InputManager>();
         UseSkillButtonGump gump  = new UseSkillButtonGump(skill);
         UserInterface.AddControl(gump, input.MousePosition.X - 60, input.MousePosition.Y - 20);
         UserInterface.AttemptDragControl(gump, input.MousePosition, true);
     }
 }
Exemplo n.º 2
0
 public override void OnHtmlInputEvent(string href, MouseEvent e)
 {
     if (e == MouseEvent.Click)
     {
         if (href.Substring(0, 6) == "skill=" || href.Substring(0, 9) == "skillbtn=")
         {
             int skillIndex;
             if (!int.TryParse(href.Substring(href.IndexOf('=') + 1), out skillIndex))
             {
                 return;
             }
             m_World.Interaction.UseSkill(skillIndex);
         }
         else if (href.Substring(0, 10) == "skilllock=")
         {
             int skillIndex;
             if (!int.TryParse(href.Substring(10), out skillIndex))
             {
                 return;
             }
             m_World.Interaction.ChangeSkillLock(PlayerState.Skills.SkillEntryByIndex(skillIndex));
         }
     }
     else if (e == MouseEvent.DragBegin)
     {
         if (href.Length >= 9 && href.Substring(0, 9) == "skillbtn=")
         {
             int skillIndex;
             if (!int.TryParse(href.Substring(9), out skillIndex))
             {
                 return;
             }
             SkillEntry         skill = PlayerState.Skills.SkillEntryByIndex(skillIndex);
             InputManager       input = ServiceRegistry.GetService <InputManager>();
             UseSkillButtonGump gump  = new UseSkillButtonGump(skill);
             UserInterface.AddControl(gump, input.MousePosition.X - 60, input.MousePosition.Y - 20);
             UserInterface.AttemptDragControl(gump, input.MousePosition, true);
         }
     }
 }
Exemplo n.º 3
0
 public override void OnHtmlInputEvent(string href, MouseEvent e)
 {
     if (e == MouseEvent.Click)
     {
         if (href.Substring(0, 6) == "skill=" || href.Substring(0, 9) == "skillbtn=")
         {
             int skillIndex;
             if (!int.TryParse(href.Substring(href.IndexOf('=') + 1), out skillIndex))
                 return;
             m_World.Interaction.UseSkill(skillIndex);
         }
         else if (href.Substring(0, 10) == "skilllock=")
         {
             int skillIndex;
             if (!int.TryParse(href.Substring(10), out skillIndex))
                 return;
             m_World.Interaction.ChangeSkillLock(PlayerState.Skills.SkillEntryByIndex(skillIndex));
         }
     }
     else if (e == MouseEvent.DragBegin)
     {
         if (href.Length >= 9 && href.Substring(0, 9) == "skillbtn=")
         {
             int skillIndex;
             if (!int.TryParse(href.Substring(9), out skillIndex))
                 return;
             SkillEntry skill = PlayerState.Skills.SkillEntryByIndex(skillIndex);
             InputManager input = ServiceRegistry.GetService<InputManager>();
             UseSkillButtonGump gump = new UseSkillButtonGump(skill);
             UserInterface.AddControl(gump, input.MousePosition.X - 60, input.MousePosition.Y - 20);
             UserInterface.AttemptDragControl(gump, input.MousePosition, true);
         }
     }
 }
Exemplo n.º 4
0
 private void OnSkillDrag(string href)
 {
     if (href.Length >= 9 && href.Substring(0, 9) == "skillbtn=")
     {
         int skillIndex;
         if (!int.TryParse(href.Substring(9), out skillIndex))
             return;
         SkillEntry skill = PlayerState.Skills.SkillEntryByIndex(skillIndex);
         InputManager input = ServiceRegistry.GetService<InputManager>();
         UseSkillButtonGump gump = new UseSkillButtonGump(skill);
         UserInterface.AddControl(gump, input.MousePosition.X - 60, input.MousePosition.Y - 20);
         UserInterface.AttemptDragControl(gump, input.MousePosition, true);
     }
 }