Skip to content
Snippets Groups Projects
Commit a04361a1 authored by Sal's avatar Sal
Browse files

Check supported skins by name instead of number, so we can have bonuschars images

parent 9f4ad130
No related branches found
No related tags found
No related merge requests found
......@@ -287,13 +287,70 @@ void DRPC_UpdatePresence(void)
// Character info
if (Playing() && playeringame[consoleplayer] && !players[consoleplayer].spectator)
{
if (players[consoleplayer].skin < 5) // supported skins
// Supported skin names
static const char *supportedSkins[] = {
// base game
"sonic",
"tails",
"knuckles",
"eggman",
"metalsonic",
// bonus chars
"flicky",
"motobug",
"amy",
"mighty",
"ray",
"espio",
"vector",
"chao",
"gamma",
"chaos",
"shadow",
"rouge",
"herochao",
"darkchao",
"cream",
"omega",
"blaze",
"silver",
"wonderboy",
"arle",
"nights",
"sakura",
"ulala",
"beat",
"vyse",
"aiai",
"kiryu",
"aigis",
"miku",
"doom",
NULL
};
boolean customChar = true;
UINT8 checkSkin = 0;
// Character image
while (supportedSkins[checkSkin] != NULL)
{
snprintf(charimg, 21, "char%s", skins[players[consoleplayer].skin].name);
discordPresence.smallImageKey = charimg; // Character image
if (!strcmp(skins[players[consoleplayer].skin].name, supportedSkins[checkSkin]))
{
snprintf(charimg, 21, "char%s", supportedSkins[checkSkin]);
discordPresence.smallImageKey = charimg;
customChar = false;
break;
}
checkSkin++;
}
if (customChar == true)
{
// Use the custom character icon!
discordPresence.smallImageKey = "charcustom";
}
else
discordPresence.smallImageKey = "charnull"; // Just so that you can still see the name of custom chars
snprintf(charname, 28, "Character: %s", skins[players[consoleplayer].skin].realname);
discordPresence.smallImageText = charname; // Character name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment