示例#1
0
 public static TemplateXpBar Bar(User user, Server server) => new TemplateXpBar
 {
     Color  = Rgba32.BlueViolet,
     Length = 446,
     LocA   = new TemplateLoc
     {
         X = 38.5f,
         Y = 213f
     },
     LocB = new TemplateLoc
     {
         X = 37.5f,
         Y = 253.5f
     },
     TopLeftText = new TemplateText
     {
         Color = Rgba32.LightCoral,
         Loc   = new TemplateLoc
         {
             X = 44,
             Y = 216
         },
         Font        = ImageBase.Font(18),
         HasStroke   = true,
         Show        = true,
         StrokeColor = Rgba32.WhiteSmoke,
         StrokeWidth = 1,
         Text        = "Server Level"
     },
     BottomRightText = new TemplateText
     {
         Color = Rgba32.LightCoral,
         Loc   = new TemplateLoc
         {
             X = 335,
             Y = 230
         },
         Font        = ImageBase.Font(20),
         HasStroke   = true,
         Show        = true,
         StrokeColor = Rgba32.WhiteSmoke,
         StrokeWidth = 1,
         Text        = $"{user.ServerExp(server).ToAbbreviatedForm()} / {user.NextServerLevelExp(server).ToAbbreviatedForm()}"
     },
     CenterText = new TemplateText
     {
         Color = Rgba32.LightCoral,
         Loc   = new TemplateLoc
         {
             X = 185,
             Y = 224
         },
         Font        = ImageBase.Font(22),
         HasStroke   = true,
         Show        = true,
         StrokeColor = Color.WhiteSmoke,
         StrokeWidth = 1,
         Text        = $"Lvl {Math.Floor(user.ServerLevel(server))}: {user.PercentToNextServerLevel(server) * 100:N1}%"
     }
 };
示例#2
0
        public static TemplateIcon ProfileIcon(SocketGuildUser user)
        {
            string name            = user.Username.IsNullOrEmpty() ? $"User Id: {user.Id}" : user.Username;
            string writtenUsername = "";

            foreach (char c in name)
            {
                if (!c.ToString().ContainsEmoji())
                {
                    writtenUsername += c;
                }
            }

            if (string.IsNullOrWhiteSpace(writtenUsername))
            {
                writtenUsername = $"User Id: {user.Id}";
            }

            return(new TemplateIcon
            {
                Loc = new TemplateLoc
                {
                    X = 79,
                    Y = 80
                },
                ProfileUrl = user.GetAvatarUrl(ImageFormat.Png, 137),
                Show = true,
                UsernameText = new TemplateText
                {
                    Color = Rgba32.Orange,
                    Font = ImageBase.Font(user.Username, 40, 20),
                    Loc = new TemplateLoc
                    {
                        X = 133,
                        Y = 10
                    },
                    Show = true,
                    Text = writtenUsername,
                    HasStroke = true,
                    StrokeWidth = 2
                },
                UserDiscriminatorText = new TemplateText
                {
                    Color = Rgba32.DarkOrange,
                    Font = ImageBase.Font(22),
                    Loc = new TemplateLoc
                    {
                        X = 145,
                        Y = 57
                    },
                    Show = true,
                    Text = $"#{user.Discriminator}",
                    HasStroke = true,
                    StrokeWidth = 0.5f
                }
            });
        }
示例#3
0
 public static async Task <ProfileTemplatePanel> LeftPanel(User user, Server server) => new ProfileTemplatePanel
 {
     TopTextHeader = new TemplateText
     {
         Color     = _headerColor,
         Font      = ImageBase.Font(HeaderFontSize),
         HasStroke = false,
         Loc       = new TemplateLoc
         {
             X = 182,
             Y = 87
         },
         Show = true,
         Text = $"Global Rank"
     },
     TopTextBody = new TemplateText
     {
         Color     = _bodyColor,
         Font      = ImageBase.Font(BodyFontSize),
         HasStroke = false,
         Loc       = new TemplateLoc
         {
             X = 178,
             Y = 98
         },
         Show = true,
         Text =
             $"#{(await user.GetGlobalXpRankAsync()).Item1.ToAbbreviatedForm()} / {(await user.GetGlobalXpRankAsync()).Item2.ToAbbreviatedForm()}"
     },
     BottomTextHeader = new TemplateText
     {
         Color     = _headerColor,
         Font      = ImageBase.Font(HeaderFontSize),
         HasStroke = false,
         Loc       = new TemplateLoc
         {
             X = 175,
             Y = 115
         },
         Show = true,
         Text = "Server Rank"
     },
     BottomTextBody = new TemplateText
     {
         Color     = _bodyColor,
         Font      = ImageBase.Font(BodyFontSize),
         HasStroke = false,
         Loc       = new TemplateLoc
         {
             X = 171,
             Y = 126
         },
         Show = true,
         Text = $"#{user.GetServerXpRank(server).Item1.ToAbbreviatedForm()} / {user.GetServerXpRank(server).Item2.ToAbbreviatedForm()}"
     }
 };
示例#4
0
 public static ProfileTemplatePanel RightPanel(User user) => new ProfileTemplatePanel
 {
     TopTextHeader = new TemplateText
     {
         Color     = _headerColor,
         Font      = ImageBase.Font(HeaderFontSize),
         HasStroke = false,
         Loc       = new TemplateLoc
         {
             X = 368,
             Y = 87
         },
         Show = true,
         Text = $"Points"
     },
     TopTextBody = new TemplateText
     {
         Color     = _headerColor,
         Font      = ImageBase.Font(BodyFontSize),
         HasStroke = false,
         Loc       = new TemplateLoc
         {
             X = 364,
             Y = 99
         },
         Show = true,
         Text = $"{user.Points.ToAbbreviatedForm()}"
     },
     BottomTextHeader = new TemplateText
     {
         Color     = _headerColor,
         Font      = ImageBase.Font(HeaderFontSize),
         HasStroke = false,
         Loc       = new TemplateLoc
         {
             X = 362,
             Y = 116
         },
         Show = true,
         Text = $"Rep"
     },
     BottomTextBody = new TemplateText
     {
         Color     = _headerColor,
         Font      = ImageBase.Font(BodyFontSize),
         HasStroke = false,
         Loc       = new TemplateLoc
         {
             X = 363,
             Y = 127
         },
         Show = true,
         Text = $"{user.Rep.Count().ToAbbreviatedForm()}"
     }
 };
示例#5
0
        public static TemplateXpBar Bar(User user)
        {
            const float A_X = 37f;
            const float A_Y = 174.5f;
            const float B_X = A_X;
            const float B_Y = A_Y + 26;

            return(new TemplateXpBar
            {
                // What color should fill the bar?
                Color = Rgba32.BlueViolet,
                Length = 277,
                LocA = new TemplateLoc
                {
                    X = A_X,
                    Y = A_Y
                },
                LocB = new TemplateLoc
                {
                    X = B_X,
                    Y = B_Y
                },
                TopLeftText = new TemplateText
                {
                    Color = Rgba32.WhiteSmoke,
                    Loc = new TemplateLoc
                    {
                        X = 45,
                        Y = 181
                    },
                    Font = ImageBase.Font(16),
                    Show = true,
                    Text = "Global",
                    HasStroke = true,
                    StrokeWidth = 1,
                    StrokeColor = Rgba32.WhiteSmoke
                },
                BottomRightText = new TemplateText
                {
                    Color = Rgba32.WhiteSmoke,
                    Loc = new TemplateLoc
                    {
                        X = 199,
                        Y = 181
                    },
                    Font = ImageBase.Font(15),
                    Show = true,
                    Text = $"{user.Experience.ToAbbreviatedForm()} / {user.NextGlobalLevelExp().ToAbbreviatedForm()}",
                    HasStroke = true,
                    StrokeWidth = 1,
                    StrokeColor = Rgba32.WhiteSmoke
                },
                CenterText = new TemplateText
                {
                    Color = Rgba32.LightSalmon,
                    Loc = new TemplateLoc
                    {
                        X = 103,
                        Y = 181
                    },
                    Font = ImageBase.Font(16),
                    Show = true,
                    Text = $"Lvl {Math.Floor(user.GlobalLevel())}: {user.PercentToNextLevel() * 100:N0}%",
                    HasStroke = true,
                    StrokeWidth = 1,
                    StrokeColor = Rgba32.WhiteSmoke
                }
            });
        }