mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
Merge branch 'map-names-everywhere' into 'master'
Map name on pause menu and intermission; current song credit on pause menu; server name in medium font Closes #769 and #402 See merge request KartKrew/Kart!1892
This commit is contained in:
commit
0e8f35a5ce
8 changed files with 186 additions and 27 deletions
|
|
@ -883,7 +883,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||||
|
|
||||||
void HU_TickSongCredits(void)
|
void HU_TickSongCredits(void)
|
||||||
{
|
{
|
||||||
if (cursongcredit.def == NULL) // No def
|
if (cursongcredit.text == NULL) // No def
|
||||||
{
|
{
|
||||||
cursongcredit.x = cursongcredit.old_x = 0;
|
cursongcredit.x = cursongcredit.old_x = 0;
|
||||||
cursongcredit.anim = 0;
|
cursongcredit.anim = 0;
|
||||||
|
|
@ -1991,7 +1991,7 @@ static void HU_DrawDemoInfo(void)
|
||||||
//
|
//
|
||||||
void HU_DrawSongCredits(void)
|
void HU_DrawSongCredits(void)
|
||||||
{
|
{
|
||||||
if (!cursongcredit.def || cursongcredit.trans >= NUMTRANSMAPS) // No def
|
if (!cursongcredit.text || cursongcredit.trans >= NUMTRANSMAPS) // No def
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
#include "k_grandprix.h" // K_CanChangeRules
|
#include "k_grandprix.h" // K_CanChangeRules
|
||||||
#include "k_rank.h" // K_GetGradeColor
|
#include "k_rank.h" // K_GetGradeColor
|
||||||
#include "k_zvote.h" // K_GetMidVoteLabel
|
#include "k_zvote.h" // K_GetMidVoteLabel
|
||||||
|
#include "k_boss.h"
|
||||||
|
|
||||||
#include "y_inter.h" // Y_RoundQueueDrawer
|
#include "y_inter.h" // Y_RoundQueueDrawer
|
||||||
|
|
||||||
|
|
@ -912,8 +913,10 @@ static void M_DrawPausedText(INT32 x)
|
||||||
patch_t *pausebg = W_CachePatchName("M_STRIPU", PU_CACHE);
|
patch_t *pausebg = W_CachePatchName("M_STRIPU", PU_CACHE);
|
||||||
patch_t *pausetext = W_CachePatchName("M_PAUSET", PU_CACHE);
|
patch_t *pausetext = W_CachePatchName("M_PAUSET", PU_CACHE);
|
||||||
|
|
||||||
V_DrawFixedPatch(x, 0, FRACUNIT, V_SNAPTOLEFT|V_SNAPTOTOP|V_ADD, pausebg, NULL);
|
INT32 snapFlags = menuactive ? 0 : (V_SNAPTOLEFT|V_SNAPTOTOP);
|
||||||
V_DrawFixedPatch(x, 0, FRACUNIT, V_SNAPTOLEFT|V_SNAPTOTOP, pausetext, NULL);
|
|
||||||
|
V_DrawFixedPatch(x, -5*FRACUNIT, FRACUNIT, snapFlags|V_ADD, pausebg, NULL);
|
||||||
|
V_DrawFixedPatch(x, -5*FRACUNIT, FRACUNIT, snapFlags, pausetext, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -5328,9 +5331,12 @@ void M_DrawPause(void)
|
||||||
INT16 ypos = -50; // Draw 3 items from selected item (y=100 - 3 items spaced by 50 px each... you get the idea.)
|
INT16 ypos = -50; // Draw 3 items from selected item (y=100 - 3 items spaced by 50 px each... you get the idea.)
|
||||||
INT16 dypos;
|
INT16 dypos;
|
||||||
|
|
||||||
fixed_t t = M_DueFrac(pausemenu.openoffset.start, 6);
|
fixed_t mt = M_DueFrac(pausemenu.openoffset.start, 6);
|
||||||
INT16 offset = menutransition.tics ? floor(pow(2, (double)menutransition.tics)) :
|
|
||||||
(pausemenu.openoffset.dist ? Easing_InQuad(t, 0, 256) : Easing_OutQuad(t, 256, 0));
|
if (pausemenu.openoffset.dist)
|
||||||
|
mt = FRACUNIT - mt;
|
||||||
|
|
||||||
|
INT16 offset = menutransition.tics ? floor(pow(2, (double)menutransition.tics)) : Easing_OutQuad(mt, 256, 0);
|
||||||
INT16 arrxpos = 150 + 2*offset; // To draw the background arrow.
|
INT16 arrxpos = 150 + 2*offset; // To draw the background arrow.
|
||||||
|
|
||||||
INT16 j = 0;
|
INT16 j = 0;
|
||||||
|
|
@ -5339,10 +5345,69 @@ void M_DrawPause(void)
|
||||||
patch_t *arrstart = W_CachePatchName("M_PTIP", PU_CACHE);
|
patch_t *arrstart = W_CachePatchName("M_PTIP", PU_CACHE);
|
||||||
patch_t *arrfill = W_CachePatchName("M_PFILL", PU_CACHE);
|
patch_t *arrfill = W_CachePatchName("M_PFILL", PU_CACHE);
|
||||||
|
|
||||||
t = M_DueFrac(pausemenu.offset.start, 3);
|
fixed_t t = M_DueFrac(pausemenu.offset.start, 3);
|
||||||
|
|
||||||
//V_DrawFadeScreen(0xFF00, 16);
|
//V_DrawFadeScreen(0xFF00, 16);
|
||||||
|
|
||||||
|
{
|
||||||
|
INT32 x = Easing_OutQuad(mt, -BASEVIDWIDTH, 0);
|
||||||
|
INT32 y = 56;
|
||||||
|
|
||||||
|
if (g_realsongcredit)
|
||||||
|
{
|
||||||
|
V_DrawThinString(x + 2, y, 0, g_realsongcredit);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamestate == GS_LEVEL)
|
||||||
|
{
|
||||||
|
const char *name = bossinfo.valid && bossinfo.enemyname ?
|
||||||
|
bossinfo.enemyname : mapheaderinfo[gamemap-1]->menuttl;
|
||||||
|
char *buf = NULL;
|
||||||
|
|
||||||
|
if (!name[0])
|
||||||
|
{
|
||||||
|
buf = G_BuildMapTitle(gamemap);
|
||||||
|
name = buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT32 width = V_StringScaledWidth(
|
||||||
|
FRACUNIT,
|
||||||
|
FRACUNIT,
|
||||||
|
FRACUNIT,
|
||||||
|
0,
|
||||||
|
MED_FONT,
|
||||||
|
name
|
||||||
|
) / FRACUNIT;
|
||||||
|
|
||||||
|
y += 11;
|
||||||
|
|
||||||
|
V_DrawFill(x + 1, y + 8, width + 20, 3, 31);
|
||||||
|
|
||||||
|
V_DrawStringScaled(
|
||||||
|
(x + 19) * FRACUNIT,
|
||||||
|
y * FRACUNIT,
|
||||||
|
FRACUNIT,
|
||||||
|
FRACUNIT,
|
||||||
|
FRACUNIT,
|
||||||
|
V_AQUAMAP,
|
||||||
|
NULL,
|
||||||
|
MED_FONT,
|
||||||
|
name
|
||||||
|
);
|
||||||
|
|
||||||
|
K_DrawMapThumbnail(
|
||||||
|
(x + 1) * FRACUNIT,
|
||||||
|
(y - 1) * FRACUNIT,
|
||||||
|
16 * FRACUNIT,
|
||||||
|
0,
|
||||||
|
gamemap - 1,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
Z_Free(buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// "PAUSED"
|
// "PAUSED"
|
||||||
if (!paused && !demo.playback && !modeattacking && !netgame) // as close to possible as P_AutoPause, but not dependent on menuactive
|
if (!paused && !demo.playback && !modeattacking && !netgame) // as close to possible as P_AutoPause, but not dependent on menuactive
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ void TuneManager::tick()
|
||||||
// Only stop the music credit if the song actually
|
// Only stop the music credit if the song actually
|
||||||
// changed.
|
// changed.
|
||||||
S_StopMusicCredit();
|
S_StopMusicCredit();
|
||||||
|
S_UnloadMusicCredit();
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_credit_ = false;
|
stop_credit_ = false;
|
||||||
|
|
@ -91,6 +92,8 @@ void TuneManager::tick()
|
||||||
adjust_volume();
|
adjust_volume();
|
||||||
I_SetSongSpeed(tune->speed());
|
I_SetSongSpeed(tune->speed());
|
||||||
|
|
||||||
|
S_LoadMusicCredit();
|
||||||
|
|
||||||
if (tune->credit && !tune->resume)
|
if (tune->credit && !tune->resume)
|
||||||
{
|
{
|
||||||
S_ShowMusicCredit();
|
S_ShowMusicCredit();
|
||||||
|
|
|
||||||
|
|
@ -7629,8 +7629,7 @@ static void P_InitLevelSettings(void)
|
||||||
g_quakes = NULL;
|
g_quakes = NULL;
|
||||||
|
|
||||||
// song credit init
|
// song credit init
|
||||||
Z_Free(cursongcredit.text);
|
S_StopMusicCredit();
|
||||||
memset(&cursongcredit,0,sizeof(struct cursongcredit));
|
|
||||||
cursongcredit.trans = NUMTRANSMAPS;
|
cursongcredit.trans = NUMTRANSMAPS;
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
|
|
||||||
|
|
@ -1244,6 +1244,7 @@ void S_AttemptToRestoreMusic(void)
|
||||||
|
|
||||||
musicdef_t *musicdefstart = NULL;
|
musicdef_t *musicdefstart = NULL;
|
||||||
struct cursongcredit cursongcredit; // Currently displayed song credit info
|
struct cursongcredit cursongcredit; // Currently displayed song credit info
|
||||||
|
char *g_realsongcredit;
|
||||||
struct soundtest soundtest; // Sound Test (sound test)
|
struct soundtest soundtest; // Sound Test (sound test)
|
||||||
|
|
||||||
static void S_InsertMusicAtSoundTestSequenceTail(const char *musname, UINT16 map, UINT8 altref, musicdef_t ***tail)
|
static void S_InsertMusicAtSoundTestSequenceTail(const char *musname, UINT16 map, UINT8 altref, musicdef_t ***tail)
|
||||||
|
|
@ -2093,11 +2094,11 @@ void S_InitMusicDefs(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// S_ShowMusicCredit
|
// S_LoadMusicCredit
|
||||||
//
|
//
|
||||||
// Display current song's credit on screen
|
// Load the current song's credit into memory
|
||||||
//
|
//
|
||||||
void S_ShowMusicCredit(void)
|
void S_LoadMusicCredit(void)
|
||||||
{
|
{
|
||||||
UINT8 i = 0;
|
UINT8 i = 0;
|
||||||
musicdef_t *def = S_FindMusicDef(Music_CurrentSong(), &i);
|
musicdef_t *def = S_FindMusicDef(Music_CurrentSong(), &i);
|
||||||
|
|
@ -2107,18 +2108,13 @@ void S_ShowMusicCredit(void)
|
||||||
size_t len = 128, worklen;
|
size_t len = 128, worklen;
|
||||||
INT32 widthused = (3*BASEVIDWIDTH/4) - 7, workwidth;
|
INT32 widthused = (3*BASEVIDWIDTH/4) - 7, workwidth;
|
||||||
|
|
||||||
if (!cv_songcredits.value)
|
S_UnloadMusicCredit();
|
||||||
return;
|
|
||||||
|
|
||||||
if (!def) // No definitions
|
if (!def) // No definitions
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!def->title)
|
if (!def->title)
|
||||||
{
|
|
||||||
// Like showing a blank credit.
|
|
||||||
S_StopMusicCredit();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
work = va("\x1F %s", def->title);
|
work = va("\x1F %s", def->title);
|
||||||
worklen = strlen(work);
|
worklen = strlen(work);
|
||||||
|
|
@ -2166,9 +2162,34 @@ void S_ShowMusicCredit(void)
|
||||||
if (credittext[0] == '\0')
|
if (credittext[0] == '\0')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cursongcredit.def = def;
|
g_realsongcredit = Z_StrDup(credittext);
|
||||||
|
}
|
||||||
|
|
||||||
|
void S_UnloadMusicCredit(void)
|
||||||
|
{
|
||||||
|
Z_Free(g_realsongcredit);
|
||||||
|
g_realsongcredit = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// S_ShowMusicCredit
|
||||||
|
//
|
||||||
|
// Display current song's credit on screen
|
||||||
|
//
|
||||||
|
void S_ShowMusicCredit(void)
|
||||||
|
{
|
||||||
|
if (!cv_songcredits.value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!g_realsongcredit)
|
||||||
|
{
|
||||||
|
// Like showing a blank credit.
|
||||||
|
S_StopMusicCredit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Z_Free(cursongcredit.text);
|
Z_Free(cursongcredit.text);
|
||||||
cursongcredit.text = Z_StrDup(credittext);
|
cursongcredit.text = Z_StrDup(g_realsongcredit);
|
||||||
cursongcredit.anim = 5*TICRATE;
|
cursongcredit.anim = 5*TICRATE;
|
||||||
cursongcredit.x = cursongcredit.old_x = 0;
|
cursongcredit.x = cursongcredit.old_x = 0;
|
||||||
cursongcredit.trans = NUMTRANSMAPS;
|
cursongcredit.trans = NUMTRANSMAPS;
|
||||||
|
|
@ -2176,7 +2197,8 @@ void S_ShowMusicCredit(void)
|
||||||
|
|
||||||
void S_StopMusicCredit(void)
|
void S_StopMusicCredit(void)
|
||||||
{
|
{
|
||||||
cursongcredit.def = NULL;
|
Z_Free(cursongcredit.text);
|
||||||
|
memset(&cursongcredit,0,sizeof(struct cursongcredit));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ------------------------
|
/// ------------------------
|
||||||
|
|
|
||||||
|
|
@ -174,9 +174,9 @@ struct musicdef_t
|
||||||
soundtestsequence_t sequence;
|
soundtestsequence_t sequence;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// For HUD, doesn't always appear
|
||||||
extern struct cursongcredit
|
extern struct cursongcredit
|
||||||
{
|
{
|
||||||
musicdef_t *def;
|
|
||||||
char *text;
|
char *text;
|
||||||
UINT16 anim;
|
UINT16 anim;
|
||||||
UINT8 trans;
|
UINT8 trans;
|
||||||
|
|
@ -184,6 +184,9 @@ extern struct cursongcredit
|
||||||
fixed_t old_x;
|
fixed_t old_x;
|
||||||
} cursongcredit;
|
} cursongcredit;
|
||||||
|
|
||||||
|
// For menu, always appears
|
||||||
|
extern char *g_realsongcredit;
|
||||||
|
|
||||||
extern struct soundtest
|
extern struct soundtest
|
||||||
{
|
{
|
||||||
UINT8 tune; // Tune used for music system
|
UINT8 tune; // Tune used for music system
|
||||||
|
|
@ -216,6 +219,8 @@ extern musicdef_t *musicdefstart;
|
||||||
void S_LoadMusicDefs(UINT16 wadnum);
|
void S_LoadMusicDefs(UINT16 wadnum);
|
||||||
void S_InitMusicDefs(void);
|
void S_InitMusicDefs(void);
|
||||||
musicdef_t *S_FindMusicDef(const char *name, UINT8 *i);
|
musicdef_t *S_FindMusicDef(const char *name, UINT8 *i);
|
||||||
|
void S_LoadMusicCredit(void);
|
||||||
|
void S_UnloadMusicCredit(void);
|
||||||
void S_ShowMusicCredit(void);
|
void S_ShowMusicCredit(void);
|
||||||
void S_StopMusicCredit(void);
|
void S_StopMusicCredit(void);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1459,10 +1459,19 @@ void ST_DrawServerSplash(boolean timelimited)
|
||||||
|
|
||||||
fixed_t textX = (BASEVIDWIDTH - 16 - 36) * FRACUNIT;
|
fixed_t textX = (BASEVIDWIDTH - 16 - 36) * FRACUNIT;
|
||||||
fixed_t textY = (24 - 8) * FRACUNIT;
|
fixed_t textY = (24 - 8) * FRACUNIT;
|
||||||
|
fixed_t textW = V_StringScaledWidth(
|
||||||
V_DrawRightAlignedStringAtFixed(
|
FRACUNIT, FRACUNIT, FRACUNIT,
|
||||||
textX, textY,
|
|
||||||
(V_SNAPTORIGHT|V_SNAPTOTOP) | opacityFlag,
|
(V_SNAPTORIGHT|V_SNAPTOTOP) | opacityFlag,
|
||||||
|
MED_FONT,
|
||||||
|
connectedservername
|
||||||
|
);
|
||||||
|
|
||||||
|
V_DrawStringScaled(
|
||||||
|
textX - textW, textY,
|
||||||
|
FRACUNIT, FRACUNIT, FRACUNIT,
|
||||||
|
(V_SNAPTORIGHT|V_SNAPTOTOP) | opacityFlag,
|
||||||
|
NULL,
|
||||||
|
MED_FONT,
|
||||||
connectedservername
|
connectedservername
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ static INT32 replayprompttic;
|
||||||
|
|
||||||
static fixed_t mqscroll = 0;
|
static fixed_t mqscroll = 0;
|
||||||
static fixed_t chkscroll = 0;
|
static fixed_t chkscroll = 0;
|
||||||
|
static fixed_t ttlscroll = 0;
|
||||||
|
|
||||||
intertype_t intertype = int_none;
|
intertype_t intertype = int_none;
|
||||||
|
|
||||||
|
|
@ -1523,6 +1524,55 @@ void Y_DrawIntermissionHeader(fixed_t x, fixed_t y, boolean gotthrough, const ch
|
||||||
V_ClearClipRect();
|
V_ClearClipRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Y_DrawMapTitleString(fixed_t x, const char *name)
|
||||||
|
{
|
||||||
|
V_DrawStringScaled(
|
||||||
|
x - ttlscroll,
|
||||||
|
(BASEVIDHEIGHT - 73) * FRACUNIT,
|
||||||
|
FRACUNIT,
|
||||||
|
FRACUNIT,
|
||||||
|
FRACUNIT,
|
||||||
|
V_SUBTRACT | V_60TRANS,
|
||||||
|
NULL,
|
||||||
|
LSHI_FONT,
|
||||||
|
name
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static fixed_t Y_DrawMapTitle(void)
|
||||||
|
{
|
||||||
|
const char *name = bossinfo.valid && bossinfo.enemyname ?
|
||||||
|
bossinfo.enemyname : mapheaderinfo[prevmap]->menuttl;
|
||||||
|
char *buf = NULL;
|
||||||
|
|
||||||
|
if (!name[0])
|
||||||
|
{
|
||||||
|
buf = G_BuildMapTitle(prevmap + 1);
|
||||||
|
name = buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
fixed_t w = V_StringScaledWidth(
|
||||||
|
FRACUNIT,
|
||||||
|
FRACUNIT,
|
||||||
|
FRACUNIT,
|
||||||
|
0,
|
||||||
|
LSHI_FONT,
|
||||||
|
name
|
||||||
|
) + (16 * FRACUNIT);
|
||||||
|
|
||||||
|
fixed_t x = BASEVIDWIDTH * FRACUNIT;
|
||||||
|
|
||||||
|
while (x > -w)
|
||||||
|
{
|
||||||
|
Y_DrawMapTitleString(x, name);
|
||||||
|
x -= w;
|
||||||
|
}
|
||||||
|
|
||||||
|
Z_Free(buf);
|
||||||
|
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Y_IntermissionDrawer
|
// Y_IntermissionDrawer
|
||||||
//
|
//
|
||||||
|
|
@ -1565,6 +1615,8 @@ void Y_IntermissionDrawer(void)
|
||||||
V_DrawFixedPatch(chkscroll, 0, FRACUNIT, V_SUBTRACT, rbgchk, NULL);
|
V_DrawFixedPatch(chkscroll, 0, FRACUNIT, V_SUBTRACT, rbgchk, NULL);
|
||||||
V_DrawFixedPatch(chkscroll - chkloop, 0, FRACUNIT, V_SUBTRACT, rbgchk, NULL);
|
V_DrawFixedPatch(chkscroll - chkloop, 0, FRACUNIT, V_SUBTRACT, rbgchk, NULL);
|
||||||
|
|
||||||
|
fixed_t ttlloop = Y_DrawMapTitle();
|
||||||
|
|
||||||
// Animate scrolling elements if relevant
|
// Animate scrolling elements if relevant
|
||||||
if (!paused && !P_AutoPause())
|
if (!paused && !P_AutoPause())
|
||||||
{
|
{
|
||||||
|
|
@ -1575,6 +1627,10 @@ void Y_IntermissionDrawer(void)
|
||||||
chkscroll += renderdeltatics;
|
chkscroll += renderdeltatics;
|
||||||
if (chkscroll > chkloop)
|
if (chkscroll > chkloop)
|
||||||
chkscroll %= chkloop;
|
chkscroll %= chkloop;
|
||||||
|
|
||||||
|
ttlscroll += renderdeltatics * 2;
|
||||||
|
if (ttlscroll > ttlloop)
|
||||||
|
ttlscroll %= ttlloop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (renderisnewtic)
|
if (renderisnewtic)
|
||||||
|
|
@ -1618,7 +1674,7 @@ skiptallydrawer:
|
||||||
{
|
{
|
||||||
if (speedscramble != -1 && speedscramble != gamespeed)
|
if (speedscramble != -1 && speedscramble != gamespeed)
|
||||||
{
|
{
|
||||||
V_DrawCenteredThinString(BASEVIDWIDTH/2, 154, highlightflags|V_SNAPTOBOTTOM,
|
V_DrawCenteredThinString(BASEVIDWIDTH/2, 154, highlightflags,
|
||||||
va(M_GetText("Next race will be %s Speed!"), kartspeed_cons_t[1+speedscramble].strvalue));
|
va(M_GetText("Next race will be %s Speed!"), kartspeed_cons_t[1+speedscramble].strvalue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue