Added .rip command again :^)

This commit is contained in:
Master Kwoth
2017-10-15 11:48:29 +02:00
parent febbb8e36b
commit 099ae62c0b
10 changed files with 229 additions and 114 deletions

View File

@ -0,0 +1,38 @@
using SixLabors.Fonts;
using System.IO;
namespace NadekoBot.Core.Services.Impl
{
public class FontProvider : INService
{
private readonly FontCollection _fonts;
public FontProvider()
{
_fonts = new FontCollection();
if (Directory.Exists("data/fonts"))
foreach (var file in Directory.GetFiles("data/fonts"))
{
_fonts.Install(file);
}
UsernameFontFamily = _fonts.Find("Whitney-Bold");
ClubFontFamily = _fonts.Find("Whitney-Bold");
LevelFont = _fonts.Find("Whitney-Bold").CreateFont(45);
XpFont = _fonts.Find("Whitney-Bold").CreateFont(50);
AwardedFont = _fonts.Find("Whitney-Bold").CreateFont(25);
RankFont = _fonts.Find("Uni Sans Thin CAPS").CreateFont(30);
TimeFont = _fonts.Find("Whitney-Bold").CreateFont(20);
RipNameFont = _fonts.Find("Whitney-Bold").CreateFont(20);
}
public Font LevelFont { get; }
public Font XpFont { get; }
public Font AwardedFont { get; }
public Font RankFont { get; }
public Font TimeFont { get; }
public FontFamily UsernameFontFamily { get; }
public FontFamily ClubFontFamily { get; }
public Font RipNameFont { get; }
}
}

View File

@ -27,6 +27,9 @@ namespace NadekoBot.Core.Services.Impl
private const string _xpCardPath = _basePath + "xp/xp.png";
private const string _ripPath = _basePath + "rip/rip.png";
private const string _ripFlowersPath = _basePath + "rip/rose_overlay.png";
public ImmutableArray<byte> Heads { get; private set; }
public ImmutableArray<byte> Tails { get; private set; }
@ -44,6 +47,9 @@ namespace NadekoBot.Core.Services.Impl
public ImmutableArray<byte> XpCard { get; private set; }
public ImmutableArray<byte> Rip { get; private set; }
public ImmutableArray<byte> FlowerCircle { get; private set; }
public ImagesService()
{
_log = LogManager.GetCurrentClassLogger();
@ -82,6 +88,9 @@ namespace NadekoBot.Core.Services.Impl
RategirlDot = File.ReadAllBytes(_rategirlDot).ToImmutableArray();
XpCard = File.ReadAllBytes(_xpCardPath).ToImmutableArray();
Rip = File.ReadAllBytes(_ripPath).ToImmutableArray();
FlowerCircle = File.ReadAllBytes(_ripFlowersPath).ToImmutableArray();
}
catch (Exception ex)
{