예제 #1
0
 //hotkey=potion_enabled,alt,e
 private static object ParseLine(String l, ActionPrioriyList a)
 {
     if (l.StartsWith("hotkeys+="))
     {
         var       m   = hotkeyReg.Match(l);
         APLHotkey ahk = new APLHotkey();
         Keys      k;
         Keys.TryParse(m.Groups["key"].ToString(), out k);
         ahk.Key = k;
         ModifierKeys mk = ModifierKeys.NoRepeat;
         if (m.Groups["mod"].ToString().Equals("alt"))
         {
             mk = ModifierKeys.Alt;
         }
         if (m.Groups["mod"].ToString().Equals("ctrl"))
         {
             mk = ModifierKeys.Control;
         }
         if (m.Groups["mod"].ToString().Equals("shift"))
         {
             mk = ModifierKeys.Shift;
         }
         if (m.Groups["mod"].ToString().Equals("none"))
         {
             mk = ModifierKeys.NoRepeat;
         }
         ahk.Key  = k;
         ahk.Mod  = mk;
         ahk.Name = m.Groups["name"].ToString();
         //SimcraftImpl.Write(ahk.Name+" "+ahk.Mod+" "+ahk.Key);
         return(ahk);
     }
     if (l.StartsWith("talent_"))
     {
         return new Comment {
                    Content = l
         }
     }
     ;
     if (l.StartsWith("#"))
     {
         return new Comment {
                    Content = l
         }
     }
     ;
     if (l.StartsWith("action"))
     {
         return(ParseAction(l, a));
     }
     if (items.IsMatch(l))
     {
         return(ParseItem(l));
     }
     return(default(AplExpr));
 }
예제 #2
0
 //hotkey=potion_enabled,alt,e
 private static object ParseLine(String l, ActionPrioriyList a)
 {
     if (l.StartsWith("hotkeys+="))
     {
         var m = hotkeyReg.Match(l);
         APLHotkey ahk = new APLHotkey();
         Keys k;
         Keys.TryParse(m.Groups["key"].ToString(),out  k);
         ahk.Key = k;
         ModifierKeys mk = ModifierKeys.NoRepeat;
         if (m.Groups["mod"].ToString().Equals("alt")) mk = ModifierKeys.Alt;
         if (m.Groups["mod"].ToString().Equals("ctrl")) mk = ModifierKeys.Control;
         if (m.Groups["mod"].ToString().Equals("shift")) mk = ModifierKeys.Shift;
         if (m.Groups["mod"].ToString().Equals("none")) mk = ModifierKeys.NoRepeat;
         ahk.Key = k;
         ahk.Mod = mk;
         ahk.Name = m.Groups["name"].ToString();
         //SimcraftImpl.Write(ahk.Name+" "+ahk.Mod+" "+ahk.Key);
         return ahk;
     }
     if (l.StartsWith("talent_")) return new Comment { Content = l };
     if (l.StartsWith("#")) return new Comment{Content = l};
     if (l.StartsWith("action")) return ParseAction(l,a);
     if (items.IsMatch(l)) return ParseItem(l);
     return default(AplExpr);
 }