mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Spectate / enter game in chat + New console colours + Highlight chat scroll arrow + small cleanup for consolefill
This commit is contained in:
parent
612ff4059c
commit
35f576c166
8 changed files with 78 additions and 81 deletions
|
|
@ -134,12 +134,13 @@ static CV_PossibleValue_t backpic_cons_t[] = {{0, "translucent"}, {1, "picture"}
|
|||
// whether to use console background picture, or translucent mode
|
||||
static consvar_t cons_backpic = {"con_backpic", "translucent", CV_SAVE, backpic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t backcolor_cons_t[] = {{0, "White"}, {1, "Black"}, {2, "Brown"},
|
||||
{3, "Pink"}, {4, "Rose"}, {5, "Red"},
|
||||
{6, "Orange"}, {7, "Gold"}, {8, "Yellow"},
|
||||
{9, "Emerald"}, {10,"Green"}, {11,"Cyan"},
|
||||
{12,"Steel"}, {13,"Blue"}, {14,"Purple"},
|
||||
{15,"Lavender"},
|
||||
static CV_PossibleValue_t backcolor_cons_t[] = {{0, "White"}, {1, "Black"}, {2, "Sepia"},
|
||||
{3, "Brown"}, {4, "Pink"}, {5, "Raspberry"},
|
||||
{6, "Red"}, {7, "Creamsicle"}, {8, "Orange"},
|
||||
{9, "Gold"}, {10,"Yellow"}, {11,"Emerald"},
|
||||
{12,"Green"}, {13,"Cyan"}, {14,"Steel"},
|
||||
{15,"Periwinkle"}, {16,"Blue"}, {17,"Purple"},
|
||||
{18,"Lavender"},
|
||||
{0, NULL}};
|
||||
consvar_t cons_backcolor = {"con_backcolor", "Black", CV_CALL|CV_SAVE, backcolor_cons_t, CONS_backcolor_Change, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
|
|
@ -265,22 +266,25 @@ void CON_SetupBackColormap(void)
|
|||
|
||||
switch (cons_backcolor.value)
|
||||
{
|
||||
case 0: palindex = 15; break; // White
|
||||
case 1: palindex = 31; break; // Gray
|
||||
case 2: palindex = 63; break; // Brown
|
||||
case 3: palindex = 150; shift = 7; break; // Pink
|
||||
case 4: palindex = 127; shift = 7; break; // Rose
|
||||
case 5: palindex = 143; break; // Red
|
||||
case 6: palindex = 95; break; // Orange
|
||||
case 7: palindex = 119; shift = 7; break; // Gold
|
||||
case 8: palindex = 111; break; // Yellow
|
||||
case 9: palindex = 191; shift = 7; break; // Emerald
|
||||
case 10: palindex = 175; break; // Green
|
||||
case 11: palindex = 219; break; // Cyan
|
||||
case 12: palindex = 207; shift = 7; break; // Steel
|
||||
case 13: palindex = 239; break; // Blue
|
||||
case 14: palindex = 199; shift = 7; break; // Purple
|
||||
case 15: palindex = 255; shift = 7; break; // Lavender
|
||||
case 0: palindex = 15; break; // White
|
||||
case 1: palindex = 31; break; // Gray
|
||||
case 2: palindex = 47; break; // Sepia
|
||||
case 3: palindex = 63; break; // Brown
|
||||
case 4: palindex = 150; shift = 7; break; // Pink
|
||||
case 5: palindex = 127; shift = 7; break; // Raspberry
|
||||
case 6: palindex = 143; break; // Red
|
||||
case 7: palindex = 86; shift = 7; break; // Creamsicle
|
||||
case 8: palindex = 95; break; // Orange
|
||||
case 9: palindex = 119; shift = 7; break; // Gold
|
||||
case 10: palindex = 111; break; // Yellow
|
||||
case 11: palindex = 191; shift = 7; break; // Emerald
|
||||
case 12: palindex = 175; break; // Green
|
||||
case 13: palindex = 219; break; // Cyan
|
||||
case 14: palindex = 207; shift = 7; break; // Steel
|
||||
case 15: palindex = 230; shift = 7; break; // Periwinkle
|
||||
case 16: palindex = 239; break; // Blue
|
||||
case 17: palindex = 199; shift = 7; break; // Purple
|
||||
case 18: palindex = 255; shift = 7; break; // Lavender
|
||||
// Default green
|
||||
default: palindex = 175; break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3315,12 +3315,10 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
else
|
||||
CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[playernum], '\x84', M_GetText("Blue Team"), '\x80');
|
||||
}
|
||||
else if (NetPacket.packet.newteam == 3)
|
||||
CON_LogMessage(va(M_GetText("%s entered the game.\n"), player_names[playernum]));
|
||||
else if (players[playernum].pflags & PF_WANTSTOJOIN)
|
||||
players[playernum].pflags &= ~PF_WANTSTOJOIN;
|
||||
else
|
||||
CON_LogMessage(va(M_GetText("%s became a spectator.\n"), player_names[playernum]));
|
||||
HU_AddChatText(va("\x82*%s became a spectator.", player_names[playernum]), false);
|
||||
|
||||
//reset view if you are changed, or viewing someone who was changed.
|
||||
if (playernum == consoleplayer || displayplayer == playernum)
|
||||
|
|
|
|||
|
|
@ -1503,12 +1503,12 @@ static void HU_drawChatLog(INT32 offset)
|
|||
if (chat_scroll > 0)
|
||||
{
|
||||
V_DrawCharacter(chatx-9, ((justscrolledup) ? (chat_topy-1) : (chat_topy)),
|
||||
'\x1A' | V_SNAPTOBOTTOM | V_SNAPTOLEFT, false); // up arrow
|
||||
'\x1A' | V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlightflags, false); // up arrow
|
||||
}
|
||||
if (chat_scroll < chat_maxscroll)
|
||||
{
|
||||
V_DrawCharacter(chatx-9, chat_bottomy-((justscrolleddown) ? 5 : 6),
|
||||
'\x1B' | V_SNAPTOBOTTOM | V_SNAPTOLEFT, false); // down arrow
|
||||
'\x1B' | V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlightflags, false); // down arrow
|
||||
}
|
||||
|
||||
justscrolleddown = false;
|
||||
|
|
|
|||
|
|
@ -5434,6 +5434,8 @@ void K_CheckSpectateStatus(void)
|
|||
UINT8 respawnlist[MAXPLAYERS];
|
||||
UINT8 i, numingame = 0, numjoiners = 0;
|
||||
|
||||
if (!cv_allowteamchange.value) return;
|
||||
|
||||
// Get the number of players in game, and the players to be de-spectated.
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1586,7 +1586,7 @@ menu_t MISC_HelpDef = IMAGEDEF(MISC_HelpMenu);
|
|||
// See also G_GetGametypeColor.
|
||||
//
|
||||
|
||||
static INT32 highlightflags, recommendedflags, warningflags;
|
||||
static INT32 recommendedflags, warningflags;
|
||||
|
||||
inline static void M_GetGametypeColor(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -228,6 +228,9 @@ void Screenshot_option_Onchange(void);
|
|||
// Addons menu updating
|
||||
void Addons_option_Onchange(void);
|
||||
|
||||
// This is now defined here so that the chat arrows can also benefit from the highlight to look good.
|
||||
INT32 highlightflags;
|
||||
|
||||
// These defines make it a little easier to make menus
|
||||
#define DEFAULTMENUSTYLE(header, source, prev, x, y)\
|
||||
{\
|
||||
|
|
|
|||
|
|
@ -8687,7 +8687,7 @@ boolean P_SpectatorJoinGame(player_t *player)
|
|||
if (P_IsLocalPlayer(player) && displayplayer != consoleplayer)
|
||||
displayplayer = consoleplayer;
|
||||
|
||||
CON_LogMessage(va(M_GetText("%s entered the game.\n"), player_names[player-players]));
|
||||
HU_AddChatText(va(M_GetText("\x82*%s entered the game."), player_names[player-players]), false);
|
||||
return true; // no more player->mo, cannot continue.
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -952,6 +952,39 @@ void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HWRENDER
|
||||
// This is now a function since it's otherwise repeated 2 times and honestly looks retarded:
|
||||
static UINT32 V_GetHWConsBackColor(void)
|
||||
{
|
||||
UINT32 hwcolor;
|
||||
switch (cons_backcolor.value)
|
||||
{
|
||||
case 0: hwcolor = 0xffffff00; break; // White
|
||||
case 1: hwcolor = 0x80808000; break; // Gray
|
||||
case 2: hwcolor = 0xdeb88700; break; // Sepia
|
||||
case 3: hwcolor = 0x40201000; break; // Brown
|
||||
case 4: hwcolor = 0xfa807200; break; // Pink
|
||||
case 5: hwcolor = 0xff69b400; break; // Raspberry
|
||||
case 6: hwcolor = 0xff000000; break; // Red
|
||||
case 7: hwcolor = 0xffd68300; break; // Creamsicle
|
||||
case 8: hwcolor = 0xff800000; break; // Orange
|
||||
case 9: hwcolor = 0xdaa52000; break; // Gold
|
||||
case 10: hwcolor = 0x80800000; break; // Yellow
|
||||
case 11: hwcolor = 0x00ff0000; break; // Emerald
|
||||
case 12: hwcolor = 0x00800000; break; // Green
|
||||
case 13: hwcolor = 0x4080ff00; break; // Cyan
|
||||
case 14: hwcolor = 0x4682b400; break; // Steel
|
||||
case 15: hwcolor = 0x1e90ff00; break; // Periwinkle
|
||||
case 16: hwcolor = 0x0000ff00; break; // Blue
|
||||
case 17: hwcolor = 0xff00ff00; break; // Purple
|
||||
case 18: hwcolor = 0xee82ee00; break; // Lavender
|
||||
// Default green
|
||||
default: hwcolor = 0x00800000; break;
|
||||
}
|
||||
return hwcolor;
|
||||
}
|
||||
#endif
|
||||
|
||||
// THANK YOU MPC!!!
|
||||
|
||||
void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
|
||||
|
|
@ -966,28 +999,7 @@ void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
|
|||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft && rendermode != render_none)
|
||||
{
|
||||
UINT32 hwcolor;
|
||||
switch (cons_backcolor.value)
|
||||
{
|
||||
case 0: hwcolor = 0xffffff00; break; // White
|
||||
case 1: hwcolor = 0x80808000; break; // Gray
|
||||
case 2: hwcolor = 0x40201000; break; // Brown
|
||||
case 3: hwcolor = 0xfa807200; break; // Pink
|
||||
case 4: hwcolor = 0xff69b400; break; // Rose
|
||||
case 5: hwcolor = 0xff000000; break; // Red
|
||||
case 6: hwcolor = 0xff800000; break; // Orange
|
||||
case 7: hwcolor = 0xdaa52000; break; // Gold
|
||||
case 8: hwcolor = 0x80800000; break; // Yellow
|
||||
case 9: hwcolor = 0x00ff0000; break; // Emerald
|
||||
case 10: hwcolor = 0x00800000; break; // Green
|
||||
case 11: hwcolor = 0x4080ff00; break; // Cyan
|
||||
case 12: hwcolor = 0x4682b400; break; // Steel
|
||||
case 13: hwcolor = 0x0000ff00; break; // Blue
|
||||
case 14: hwcolor = 0xff00ff00; break; // Purple
|
||||
case 15: hwcolor = 0xee82ee00; break; // Lavender
|
||||
// Default green
|
||||
default: hwcolor = 0x00800000; break;
|
||||
}
|
||||
UINT32 hwcolor = V_GetHWConsBackColor();
|
||||
HWR_DrawConsoleFill(x, y, w, h, hwcolor, c); // we still use the regular color stuff but only for flags. actual draw color is "hwcolor" for this.
|
||||
return;
|
||||
}
|
||||
|
|
@ -1233,29 +1245,7 @@ void V_DrawFadeConsBack(INT32 plines)
|
|||
#ifdef HWRENDER // not win32 only 19990829 by Kin
|
||||
if (rendermode != render_soft && rendermode != render_none)
|
||||
{
|
||||
UINT32 hwcolor;
|
||||
switch (cons_backcolor.value)
|
||||
{
|
||||
case 0: hwcolor = 0xffffff00; break; // White
|
||||
case 1: hwcolor = 0x80808000; break; // Gray
|
||||
case 2: hwcolor = 0x40201000; break; // Brown
|
||||
case 3: hwcolor = 0xfa807200; break; // Pink
|
||||
case 4: hwcolor = 0xff69b400; break; // Rose
|
||||
case 5: hwcolor = 0xff000000; break; // Red
|
||||
case 6: hwcolor = 0xff800000; break; // Orange
|
||||
case 7: hwcolor = 0xdaa52000; break; // Gold
|
||||
case 8: hwcolor = 0x80800000; break; // Yellow
|
||||
case 9: hwcolor = 0x00ff0000; break; // Emerald
|
||||
case 10: hwcolor = 0x00800000; break; // Green
|
||||
case 11: hwcolor = 0x4080ff00; break; // Cyan
|
||||
case 12: hwcolor = 0x4682b400; break; // Steel
|
||||
case 13: hwcolor = 0x0000ff00; break; // Blue
|
||||
case 14: hwcolor = 0xff00ff00; break; // Purple
|
||||
case 15: hwcolor = 0xee82ee00; break; // Lavender
|
||||
|
||||
// Default green
|
||||
default: hwcolor = 0x00800000; break;
|
||||
}
|
||||
UINT32 hwcolor = V_GetHWConsBackColor();
|
||||
HWR_DrawConsoleBack(hwcolor, plines);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue