コード例 #1
0
        public void DrawFaces()
        {
            using (DrawingContext dc = picFaces.RenderOpen())
            {
                for (int i = 0; i < CharName.Count; i++)
                {
                    string   s   = CharName[i];
                    Vector2D pos = Skillnodes.First(nd => nd.Value.Name.ToUpperInvariant() == s).Value.Position;
                    dc.DrawRectangle(StartBackgrounds[false].Value, null,
                                     new Rect(
                                         pos - new Vector2D(StartBackgrounds[false].Key.Width, StartBackgrounds[false].Key.Height),
                                         pos + new Vector2D(StartBackgrounds[false].Key.Width, StartBackgrounds[false].Key.Height)));
                    if (_chartype == i)
                    {
                        dc.DrawRectangle(FacesBrush[i].Value, null,
                                         new Rect(pos - new Vector2D(FacesBrush[i].Key.Width, FacesBrush[i].Key.Height),
                                                  pos + new Vector2D(FacesBrush[i].Key.Width, FacesBrush[i].Key.Height)));

                        var charBaseAttr = CharBaseAttributes[Chartype];

                        var text = CreateAttributeText(charBaseAttr["+# to Intelligence"].ToString(), Brushes.DodgerBlue);
                        dc.DrawText(text, pos - new Vector2D(19, 117));

                        text = CreateAttributeText(charBaseAttr["+# to Strength"].ToString(), Brushes.IndianRed);
                        dc.DrawText(text, pos - new Vector2D(102, -32));

                        text = CreateAttributeText(charBaseAttr["+# to Dexterity"].ToString(), Brushes.MediumSeaGreen);
                        dc.DrawText(text, pos - new Vector2D(-69, -32));
                    }
                }
            }
        }
コード例 #2
0
        public void Reset()
        {
            SkilledNodes.Clear();
            KeyValuePair <ushort, SkillNode> node = Skillnodes.First(nd => nd.Value.Name.ToUpper() == CharName[_chartype]);

            SkilledNodes.Add(node.Value.Id);
            UpdateAvailNodes();
        }
 public void DrawFaces()
 {
     using (DrawingContext dc = picFaces.RenderOpen())
     {
         for (int i = 0; i < CharName.Count; i++)
         {
             var s   = CharName[i];
             var pos = Skillnodes.First(nd => nd.Value.name.ToUpper() == s.ToUpper()).Value.Position;
             dc.DrawRectangle(StartBackgrounds[false].Value, null, new Rect(pos - new Vector2D(StartBackgrounds[false].Key.Width, StartBackgrounds[false].Key.Height), pos + new Vector2D(StartBackgrounds[false].Key.Width, StartBackgrounds[false].Key.Height)));
             if (chartype == i)
             {
                 dc.DrawRectangle(FacesBrush[i].Value, null, new Rect(pos - new Vector2D(FacesBrush[i].Key.Width, FacesBrush[i].Key.Height), pos + new Vector2D(FacesBrush[i].Key.Width, FacesBrush[i].Key.Height)));
             }
         }
     }
 }
コード例 #4
0
        public static void DecodeURL(string url, out HashSet <ushort> skillednodes, out int chartype)
        {
            skillednodes = new HashSet <ushort>();
            url          = Regex.Replace(url, @"\t| |\n|\r", "");
            string s =
                url.Substring(TreeAddress.Length + (url.StartsWith("https") ? 1 : 0))
                .Replace("-", "+")
                .Replace("_", "/");

            byte[] decbuff = Convert.FromBase64String(s);
            int    i       = BitConverter.ToInt32(new[] { decbuff[3], decbuff[2], decbuff[1], decbuff[1] }, 0);
            byte   b       = decbuff[4];
            long   j       = 0L;

            if (i > 0)
            {
                j = decbuff[5];
            }
            var nodes = new List <UInt16>();

            for (int k = 6; k < decbuff.Length; k += 2)
            {
                byte[] dbff = { decbuff[k + 1], decbuff[k + 0] };
                if (Skillnodes.Keys.Contains(BitConverter.ToUInt16(dbff, 0)))
                {
                    nodes.Add((BitConverter.ToUInt16(dbff, 0)));
                }
            }
            chartype = b;


            SkillNode startnode = Skillnodes.First(nd => nd.Value.Name.ToUpper() == CharName[b].ToUpper()).Value;

            skillednodes.Add(startnode.Id);
            foreach (ushort node in nodes)
            {
                skillednodes.Add(node);
            }
        }