示例#1
0
 public void SetContent(Transform content, GameObject obj, List <DuelModel> models, List <DuelInfo> infos)
 {
     foreach (DuelModel item in models)
     {
         DuelInfo newInfo = Instantiate(obj, content).GetComponent <DuelInfo>();
         newInfo.SetDuelPanel(item);
         infos.Add(newInfo);
     }
 }
示例#2
0
        public override bool OnMoveOver(Mobile from)
        {
            DuelInfo info = DuelCore.GetInfoNoCreate(from);

            if (info != null && info.Last != Point3D.Zero)
            {
                from.MoveToWorld(info.Last, Map.Felucca);
                info.Last = Point3D.Zero;
            }
            else
            {
                from.SendMessage("This does not work for you.");
            }

            return(false);
        }
示例#3
0
        public Image <Rgba32> GetDuelCardImage(DuelInfo info, DuelImage image, Image <Rgba32> win, Image <Rgba32> los)
        {
            int Xiw = 76;
            int Yt  = 780;
            int Yi  = 131;
            int Xil = 876;

            if (info.Side == DuelInfo.WinnerSide.Right)
            {
                Xiw = 876;
                Xil = 76;
            }

            var nameFont = new Font(_latoBold, 34);
            var img      = (image != null) ? Image.Load(image.Uri((int)info.Side)) : Image.Load((DuelImage.DefaultUri((int)info.Side)));

            win.Mutate(x => x.Resize(new ResizeOptions
            {
                Mode = ResizeMode.Max,
                Size = new Size(450, 0)
            }));

            los.Mutate(x => x.Resize(new ResizeOptions
            {
                Mode = ResizeMode.Max,
                Size = new Size(450, 0)
            }));

            if (info.Side != DuelInfo.WinnerSide.Draw)
            {
                los.Mutate(x => x.Grayscale());
            }

            img.Mutate(x => x.DrawImage(win, new Point(Xiw, Yi), 1));
            img.Mutate(x => x.DrawImage(los, new Point(Xil, Yi), 1));

            var options = new TextGraphicsOptions()
            {
                HorizontalAlignment = HorizontalAlignment.Center, WrapTextWidth = win.Width
            };

            img.Mutate(x => x.DrawText(options, info.Winner.Name, nameFont, Rgba32.FromHex(image != null ? image.Color : DuelImage.DefaultColor()), new Point(Xiw, Yt)));
            img.Mutate(x => x.DrawText(options, info.Loser.Name, nameFont, Rgba32.FromHex(image != null ? image.Color : DuelImage.DefaultColor()), new Point(Xil, Yt)));

            return(img);
        }