mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 04:41:23 +00:00
Check supported skins by name instead of number, so we can have bonuschars images
This commit is contained in:
parent
9f4ad1303e
commit
a04361a151
1 changed files with 62 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue