mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 21:01:04 +00:00
Add distinct images for map hell & normal custom maps
This commit is contained in:
parent
a04361a151
commit
da5bda72ee
1 changed files with 19 additions and 7 deletions
|
@ -176,10 +176,11 @@ static const char *DRPC_GetServerIP(void)
|
||||||
//
|
//
|
||||||
void DRPC_UpdatePresence(void)
|
void DRPC_UpdatePresence(void)
|
||||||
{
|
{
|
||||||
char mapimg[8];
|
char mapimg[8+1];
|
||||||
char mapname[48];
|
char mapname[5+21+21+2+1];
|
||||||
char charimg[21];
|
|
||||||
char charname[28];
|
char charimg[4+SKINNAMESIZE+1];
|
||||||
|
char charname[11+SKINNAMESIZE+1];
|
||||||
|
|
||||||
DiscordRichPresence discordPresence;
|
DiscordRichPresence discordPresence;
|
||||||
memset(&discordPresence, 0, sizeof(discordPresence));
|
memset(&discordPresence, 0, sizeof(discordPresence));
|
||||||
|
@ -244,11 +245,22 @@ void DRPC_UpdatePresence(void)
|
||||||
strlwr(mapimg);
|
strlwr(mapimg);
|
||||||
discordPresence.largeImageKey = mapimg; // Map image
|
discordPresence.largeImageKey = mapimg; // Map image
|
||||||
}
|
}
|
||||||
else // Fallback, since no image looks crappy!
|
else if (mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU)
|
||||||
discordPresence.largeImageKey = "miscdice";
|
{
|
||||||
|
// Hell map, use the method that got you here :P
|
||||||
|
discordPresence.largeImageKey = "maphell";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// This is probably a custom map!
|
||||||
|
discordPresence.largeImageKey = "mapcustom";
|
||||||
|
}
|
||||||
|
|
||||||
if (mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU) // hell map, hide the name
|
if (mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU)
|
||||||
|
{
|
||||||
|
// Hell map, hide the name
|
||||||
discordPresence.largeImageText = "Map: ???";
|
discordPresence.largeImageText = "Map: ???";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(mapname, 48, "Map: %s%s%s",
|
snprintf(mapname, 48, "Map: %s%s%s",
|
||||||
|
|
Loading…
Reference in a new issue