Ejemplo n.º 1
0
        public override void DoAction(IEventArgs args)
        {
            FreeRuleEventArgs fr = (FreeRuleEventArgs)args;

            if (items != null)
            {
                foreach (FreeItem fi in items)
                {
                    if (!FreeItemManager.ContainsItem(args.Rule.FreeType, FreeUtil.ReplaceVar(fi.GetKey(), args)))
                    {
                        FreeGameItem gi = (FreeGameItem)fi.Clone();
                        gi.SetItemStack(FreeUtil.ReplaceVar(gi.GetItemStackVar(), args));
                        gi.SetKey(FreeUtil.ReplaceVar(gi.GetKey(), args));
                        gi.SetImg(FreeUtil.ReplaceVar(gi.GetImg(), args));
                        gi.SetName(FreeUtil.ReplaceVar(gi.GetName(), args));
                        gi.SetDesc(FreeUtil.ReplaceVar(gi.GetDesc(), args));
                        gi.SetCat(FreeUtil.ReplaceVar(gi.GetCat(), args));
                        gi.SetIconSize(FreeUtil.ReplaceVar(gi.GetIconSize(), args));
                        gi.SetWidth(FreeUtil.ReplaceNumber(gi.GetWidth(), args));
                        gi.SetHeight(FreeUtil.ReplaceNumber(gi.GetHeight(), args));
                        gi.Created(fr);
                        FreeItemManager.AddItem(args, args.Rule.FreeType, gi);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public override object GetValue(IEventArgs args)
 {
     if (autoStatus > 0)
     {
         return(FreeUtil.ReplaceNumber(url, args));
     }
     else
     {
         return(FreeUtil.ReplaceVar(url, args));
     }
 }
Ejemplo n.º 3
0
        public override string GetStyle(IEventArgs args)
        {
            string[] ss = StringUtil.Split(font, "_");
            string   s  = scale;

            if (StringUtil.IsNullOrEmpty(s))
            {
                s = "1";
            }
            return(FreeUtil.ReplaceNumber(number, args) + "_" + ss[0] + "_" + ss[1] + "_" + ss[2] + "_" + length + "_" + align + "_" + showZero + "_" + s);
        }
Ejemplo n.º 4
0
 public override string ToConfig(IEventArgs args)
 {
     if (!StringUtil.IsNullOrEmpty(id))
     {
         return("point|" + FreeUtil.ReplaceNumber(id, args) + "," + FreeUtil.ReplaceVar(xyz, args) + "|" + FreeUtil.ReplaceVar(delta, args));
     }
     else
     {
         return("point|" + FreeUtil.ReplaceVar(xyz, args) + "|" + FreeUtil.ReplaceVar(delta, args));
     }
 }
Ejemplo n.º 5
0
        private void SetArg(FuncArg arg, IList <ArgValue> funcArgs, IEventArgs args)
        {
            ArgValue fa = GetArgValue(arg, funcArgs, args);

            if (fa != null)
            {
                IPara para = ParaUtil.GetPara(arg.GetType());
                if (para != null)
                {
                    try
                    {
                        IPara old = new ParaExp(fa.GetValue()).GetSourcePara(args);
                        if (old != null)
                        {
                            if (old.GetValue() != null)
                            {
                                para = para.Initial("=", old.GetValue().ToString());
                            }
                            else
                            {
                                para = para.Initial("=", string.Empty);
                            }
                        }
                        else
                        {
                            para = para.Initial("=", FreeUtil.ReplaceNumber(fa.GetValue(), args));
                        }
                    }
                    catch (Exception)
                    {
                        para = para.Initial("=", FreeUtil.ReplaceNumber(fa.GetValue(), args));
                    }
                    para.SetName("arg_" + arg.GetName());
                    args.GetDefault().GetParameters().TempUse(para);
                    IPara p = (IPara)para.Borrow();
                    p.SetName(arg.GetName());
                    if (para.GetValue() != null)
                    {
                        p.SetValue("=", para);
                    }
                    args.GetDefault().GetParameters().TempUse(p);
                    FreeLog.FuncArg(p.ToString());
                }
                else
                {
                    // 非简单变量
                    ((BaseEventArgs)args).TempUse(arg.GetName(), args.GetUnit(fa.GetValue()));
                }
            }
        }
Ejemplo n.º 6
0
        protected override void BuildMessage(IEventArgs args)
        {
            if (show == null)
            {
                show = new FreeUISimpleShow();
            }

            builder.Key = 51;
            builder.Ks.Add(0);
            builder.Ss.Add(FreeUtil.ReplaceNumber(key, args));
            builder.Ks.Add(show.GetKey());
            builder.Ks.Add(FreeUtil.ReplaceInt(time, args));
            show.Handle(args, builder);
        }
Ejemplo n.º 7
0
 public override string ToConfig(IEventArgs args)
 {
     if (distance == null)
     {
         distance = "0";
     }
     if (height == null)
     {
         height = "0";
     }
     if (pitch == null)
     {
         pitch = "0";
     }
     if (angle == null)
     {
         angle = "0";
     }
     return("position|" + GetID(args) + "|" + FreeUtil.ReplaceNumber(distance, args) + "|" + FreeUtil.ReplaceNumber(height, args) + "|" + FreeUtil.ReplaceNumber(pitch, args) + "|" + FreeUtil.ReplaceNumber(angle, args));
 }
Ejemplo n.º 8
0
 protected internal virtual string GetValue(IEventArgs args, string value)
 {
     return(FreeUtil.ReplaceNumber(value, args));
 }
Ejemplo n.º 9
0
 public override string ToConfig(IEventArgs args)
 {
     return("time-auto|" + unit + "|" + FreeUtil.ReplaceNumber(scale, args) + "|" + desc);
 }
Ejemplo n.º 10
0
 public override string ToConfig(IEventArgs args)
 {
     if (distance == null)
     {
         distance = "0";
     }
     if (height == null)
     {
         height = "0";
     }
     return("tposition|" + FreeUtil.ReplaceVar(source, args) + "|" + FreeUtil.ReplaceVar(target, args) + "|" + FreeUtil.ReplaceNumber(distance, args) + "|" + FreeUtil.ReplaceNumber(height, args) + "|" + toSource);
 }
Ejemplo n.º 11
0
        protected override void BuildMessage(IEventArgs args)
        {
            builder.Key = 52;
            builder.Ss.Add(FreeUtil.ReplaceNumber(key, args));
            builder.Ks.Add(0);
            if (values != null)
            {
                foreach (IFreeUIValue com in values)
                {
                    builder.Ks.Add(com.GetSeq(args));
                    builder.Ins.Add(com.GetAutoStatus() * 100 + com.GetAutoIndex());
                }
                foreach (IFreeUIValue com_1 in values)
                {
                    switch (com_1.GetType())
                    {
                    case AbstractFreeUIValue.STRING:
                    {
                        object obj = com_1.GetValue(args);
                        if (obj == null)
                        {
                            builder.Ss.Add("null");
                        }
                        else
                        {
                            builder.Ss.Add(obj.ToString());
                        }
                        break;
                    }

                    case AbstractFreeUIValue.INT:
                    {
                        builder.Ins.Add(int.Parse(com_1.GetValue(args).ToString()));
                        break;
                    }

                    case AbstractFreeUIValue.BOOL:
                    {
                        builder.Bs.Add(bool.Parse(com_1.GetValue(args).ToString()));
                        break;
                    }

                    case AbstractFreeUIValue.FLOAT:
                    {
                        builder.Fs.Add(float.Parse(com_1.GetValue(args).ToString()));
                        break;
                    }

                    case AbstractFreeUIValue.COMPLEX:
                    {
                        SimpleProto[]  list   = (SimpleProto[])com_1.GetValue(args);
                        IList <string> orders = new List <string>();
                        for (int i = builder.Ps.Count; i < builder.Ps.Count + list.Length; i++)
                        {
                            orders.Add(i.ToString());
                        }
                        builder.Ss.Add(StringUtil.GetStringFromStrings(orders, "_"));
                        foreach (SimpleProto sp in list)
                        {
                            builder.Ps.Add(sp);
                        }
                        break;
                    }

                    default:
                    {
                        break;
                    }
                    }
                }
            }
        }
Ejemplo n.º 12
0
 public override string ToConfig(IEventArgs args)
 {
     return("const|" + FreeUtil.ReplaceNumber(value, args));
 }
Ejemplo n.º 13
0
 public override string GetStyle(IEventArgs args)
 {
     return(FreeUtil.ReplaceNumber(column, args) + "_" + FreeUtil.ReplaceNumber(row, args));
 }