1
Fork 0
mirror of https://github.com/Quackster/Minerva.git synced 2025-06-29 12:57:45 +00:00

add explicit render options

This commit is contained in:
Alex 2023-02-16 22:01:12 +10:00
parent 68636725ec
commit b0cdd8e6cb
2 changed files with 46 additions and 1 deletions

View file

@ -22,6 +22,12 @@ namespace Minerva.Controllers
if (badgeCode != null && badgeCode.Length > 0)
{
var badge = GetFromServer.ParseBadgeData(badgeCode);
badge.Parts.ForEach(x =>
{
x.IsShockwaveBadge = Program.SHOCKWAVE_BADGE_RENDER;
});
//var avatar = new Avatar(figure, size, bodyDirection, headDirection, figuredataReader, action: action, gesture: gesture, headOnly: headOnly, frame: frame, carryDrink: carryDrink, cropImage: cropImage);
if (badgeCode.EndsWith(".gif"))
@ -49,8 +55,14 @@ namespace Minerva.Controllers
if (badgeCode != null && badgeCode.Length > 0)
{
var badge = GetFromServer.ParseBadgeData(badgeCode);
badge.Parts.ForEach(x =>
{
x.IsShockwaveBadge = Program.SHOCKWAVE_BADGE_RENDER;
});
//var avatar = new Avatar(figure, size, bodyDirection, headDirection, figuredataReader, action: action, gesture: gesture, headOnly: headOnly, frame: frame, carryDrink: carryDrink, cropImage: cropImage);
var badgeData = badge.Render(gifEncoder: true, forceWhiteBackground: true);
if (badgeData != null)

View file

@ -5,8 +5,41 @@ namespace Minerva
{
public class Program
{
public static bool SHOCKWAVE_BADGE_RENDER = true;
public static bool FLASH_BADGE_RENDER = false;
public static void Main(string[] args)
{
var argsList = args.ToList();
if (!argsList.Contains("--shockwave-badge-render") &&
!argsList.Contains("--flash-badge-render"))
{
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Warning!");
Console.ResetColor();
Console.WriteLine("Needs to be started with either parameter included for finer tuning:");
Console.WriteLine("--shockwave-badge-render (for Habbo versions using the Shockwave client)");
Console.WriteLine("--flash-badge-render (for Habbo versions using the Flash client in 2013+)");
Console.WriteLine();
}
if (argsList.Contains("--shockwave-badge-render"))
{
Console.WriteLine("Shockwave badge rendering enabled");
SHOCKWAVE_BADGE_RENDER = true;
}
else
{
Console.WriteLine("Flash (client versions above and including 2013+) badge rendering enabled");
FLASH_BADGE_RENDER = false;
}
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.