예제 #1
0
 private ActionHandler(string action, string name, ParamNode[] parms, Client.Plugin plugin)
 {
     this.m_Action = action;
     this.m_Name = name;
     this.m_Params = parms;
     this.m_Plugin = plugin;
 }
예제 #2
0
 public static string Find(string toFind, ParamNode n)
 {
     if (n.Param == toFind)
     {
         return(n.Name);
     }
     return(Find(toFind, n.Nodes));
 }
예제 #3
0
 private string FindFirst(ParamNode node)
 {
     if (node.Param != null)
     {
         return node.Param;
     }
     return this.FindFirst(node.Nodes);
 }
예제 #4
0
 private string FindFirst(ParamNode node)
 {
     if (node.Param != null)
     {
         return(node.Param);
     }
     return(this.FindFirst(node.Nodes));
 }
예제 #5
0
파일: Exposer.cs 프로젝트: uotools/PlayUO
 public void RegisterAsMacro(string action, params string[] list)
 {
     ParamNode[] options = new ParamNode[list.Length];
     for (int i = 0; i < options.Length; i++)
     {
         options[i] = new ParamNode(list[i], list[i]);
     }
     this.RegisterAsMacro(action, options);
 }
예제 #6
0
 private string FindFirst(ParamNode[] nodes)
 {
     string str = null;
     for (int i = 0; ((nodes != null) && (str == null)) && (i < nodes.Length); i++)
     {
         str = this.FindFirst(nodes[i]);
     }
     return str;
 }
예제 #7
0
파일: Exposer.cs 프로젝트: uotools/PlayUO
 public void RegisterAsMacro(string action, string[,] list)
 {
     ParamNode[] options = new ParamNode[list.GetLength(0)];
     for (int i = 0; i < options.Length; i++)
     {
         options[i] = new ParamNode(list[i, 0], list[i, 1]);
     }
     this.RegisterAsMacro(action, options);
 }
예제 #8
0
 public static ParamNode[] Count(int start, int count, string format)
 {
     ParamNode[] nodeArray = new ParamNode[count];
     for (int i = 0; i < count; i++)
     {
         string name = string.Format(format, 1 + i);
         nodeArray[i] = new ParamNode(name, i.ToString());
     }
     return(nodeArray);
 }
예제 #9
0
 public GParamMenu(ParamNode param, ActionHandler handler, Client.Action action) : base(param.Name)
 {
     this.m_Param   = param;
     this.m_Handler = handler;
     this.m_Action  = action;
     if (this.m_Action == null)
     {
         base.Tooltip = new Tooltip(string.Format("Click here to add the instruction:\n{0} {1}", handler.Name, param.Name), true);
     }
     else
     {
         base.Tooltip = new Tooltip("Click here to change the parameter", true);
     }
     base.Tooltip.Delay = 3f;
 }
예제 #10
0
 public GParamMenu(ParamNode param, ActionHandler handler, Client.Action action)
     : base(param.Name)
 {
     this.m_Param = param;
     this.m_Handler = handler;
     this.m_Action = action;
     if (this.m_Action == null)
     {
         base.Tooltip = new Tooltip(string.Format("Click here to add the instruction:\n{0} {1}", handler.Name, param.Name), true);
     }
     else
     {
         base.Tooltip = new Tooltip("Click here to change the parameter", true);
     }
     base.Tooltip.Delay = 3f;
 }
예제 #11
0
        private GMenuItem GetMenuFrom(ParamNode n, Action a, ActionHandler ah)
        {
            GMenuItem item;

            if (n.Param != null)
            {
                item = new GParamMenu(n, ah, a);
            }
            else
            {
                item = new GMenuItem(n.Name);
            }
            if (n.Nodes != null)
            {
                for (int i = 0; i < n.Nodes.Length; i++)
                {
                    item.Add(this.GetMenuFrom(n.Nodes[i], a, ah));
                }
            }
            return(this.FormatMenu(item));
        }
예제 #12
0
 public ParamNode(string name, ParamNode[] nodes)
     : this(name, null, nodes)
 {
 }
예제 #13
0
 public static string Find(string toFind, ParamNode n)
 {
     if (n.Param == toFind)
     {
         return n.Name;
     }
     return Find(toFind, n.Nodes);
 }
예제 #14
0
 public static void Register(string action, ParamNode[] parms, Client.Plugin plugin)
 {
     string str;
     if (m_Table == null)
     {
         m_Table = new Hashtable();
     }
     if (m_List == null)
     {
         m_List = new ArrayList();
     }
     if (m_RootNode == null)
     {
         m_RootNode = new ActionNode("-root-");
     }
     string[] strArray = action.Split(new char[] { '|' });
     ActionNode rootNode = m_RootNode;
     for (int i = 0; i < (strArray.Length - 1); i++)
     {
         ActionNode node = rootNode.GetNode(strArray[i]);
         if (node == null)
         {
             rootNode.Nodes.Add(node = new ActionNode(strArray[i]));
             rootNode.Nodes.Sort();
         }
         rootNode = node;
     }
     action = strArray[strArray.Length - 1];
     int index = action.IndexOf('@');
     if (index >= 0)
     {
         str = action.Substring(index + 1);
         action = action.Substring(0, index);
     }
     else
     {
         str = action;
     }
     ActionHandler handler = new ActionHandler(action, str, parms, plugin);
     rootNode.Handlers.Add(handler);
     rootNode.Handlers.Sort();
     m_Table[action] = handler;
     m_List.Add(handler);
 }
예제 #15
0
 private GMenuItem GetMenuFrom(ParamNode n, Action a, ActionHandler ah)
 {
     GMenuItem item;
     if (n.Param != null)
     {
         item = new GParamMenu(n, ah, a);
     }
     else
     {
         item = new GMenuItem(n.Name);
     }
     if (n.Nodes != null)
     {
         for (int i = 0; i < n.Nodes.Length; i++)
         {
             item.Add(this.GetMenuFrom(n.Nodes[i], a, ah));
         }
     }
     return this.FormatMenu(item);
 }
예제 #16
0
 public void RegisterAsMacro(string action, params string[] list)
 {
     ParamNode[] options = new ParamNode[list.Length];
     for (int i = 0; i < options.Length; i++)
     {
         options[i] = new ParamNode(list[i], list[i]);
     }
     this.RegisterAsMacro(action, options);
 }
예제 #17
0
 public void RegisterAsMacro(string action, string[,] list)
 {
     ParamNode[] options = new ParamNode[list.GetLength(0)];
     for (int i = 0; i < options.Length; i++)
     {
         options[i] = new ParamNode(list[i, 0], list[i, 1]);
     }
     this.RegisterAsMacro(action, options);
 }
예제 #18
0
 public static ParamNode[] Count(int start, int count, string format)
 {
     ParamNode[] nodeArray = new ParamNode[count];
     for (int i = 0; i < count; i++)
     {
         string name = string.Format(format, 1 + i);
         nodeArray[i] = new ParamNode(name, i.ToString());
     }
     return nodeArray;
 }
예제 #19
0
 private ParamNode(string name, string param, ParamNode[] nodes)
 {
     this.m_Name = name;
     this.m_Param = param;
     this.m_Nodes = nodes;
 }
예제 #20
0
 public static string Find(string toFind, ParamNode[] nodes)
 {
     for (int i = 0; (nodes != null) && (i < nodes.Length); i++)
     {
         string str = Find(toFind, nodes[i]);
         if (str != null)
         {
             return str;
         }
     }
     return null;
 }