Merge branch 'master' of https://git.magicalgirl.moe/KartKrew/Kart.git into toast_hardcode

This commit is contained in:
toaster 2018-10-25 19:07:32 +01:00
commit 4595328e6d
15 changed files with 159 additions and 131 deletions

View file

@ -134,11 +134,15 @@ static CV_PossibleValue_t backpic_cons_t[] = {{0, "translucent"}, {1, "picture"}
// whether to use console background picture, or translucent mode // 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 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, "Gray"}, {2, "Brown"}, static CV_PossibleValue_t backcolor_cons_t[] = {{0, "White"}, {1, "Black"}, {2, "Sepia"},
{3, "Red"}, {4, "Orange"}, {5, "Yellow"}, {3, "Brown"}, {4, "Pink"}, {5, "Raspberry"},
{6, "Green"}, {7, "Blue"}, {8, "Cyan"}, {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}}; {0, NULL}};
consvar_t cons_backcolor = {"con_backcolor", "Green", CV_CALL|CV_SAVE, backcolor_cons_t, CONS_backcolor_Change, 0, NULL, NULL, 0, 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};
static CV_PossibleValue_t menuhighlight_cons_t[] = static CV_PossibleValue_t menuhighlight_cons_t[] =
{ {
@ -255,21 +259,32 @@ void CON_SetupBackColormap(void)
UINT16 i, palsum; UINT16 i, palsum;
UINT8 j, palindex; UINT8 j, palindex;
UINT8 *pal = W_CacheLumpName(GetPalette(), PU_CACHE); UINT8 *pal = W_CacheLumpName(GetPalette(), PU_CACHE);
INT32 shift = 6;
if (!consolebgmap) if (!consolebgmap)
consolebgmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL); consolebgmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
switch (cons_backcolor.value) switch (cons_backcolor.value)
{ {
case 0: palindex = 15; break; // White case 0: palindex = 15; break; // White
case 1: palindex = 31; break; // Gray case 1: palindex = 31; break; // Gray
case 2: palindex = 63; break; // Brown case 2: palindex = 47; break; // Sepia
case 3: palindex = 143; break; // Red case 3: palindex = 63; break; // Brown
case 4: palindex = 95; break; // Orange case 4: palindex = 150; shift = 7; break; // Pink
case 5: palindex = 111; break; // Yellow case 5: palindex = 127; shift = 7; break; // Raspberry
case 6: palindex = 175; break; // Green case 6: palindex = 143; break; // Red
case 7: palindex = 239; break; // Blue case 7: palindex = 86; shift = 7; break; // Creamsicle
case 8: palindex = 219; break; // Cyan 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 green
default: palindex = 175; break; default: palindex = 175; break;
} }
@ -277,7 +292,7 @@ void CON_SetupBackColormap(void)
// setup background colormap // setup background colormap
for (i = 0, j = 0; i < 768; i += 3, j++) for (i = 0, j = 0; i < 768; i += 3, j++)
{ {
palsum = (pal[i] + pal[i+1] + pal[i+2]) >> 6; palsum = (pal[i] + pal[i+1] + pal[i+2]) >> shift;
consolebgmap[j] = (UINT8)(palindex - palsum); consolebgmap[j] = (UINT8)(palindex - palsum);
} }
} }

View file

@ -2804,7 +2804,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
msg = KICK_MSG_CON_FAIL; msg = KICK_MSG_CON_FAIL;
} }
CONS_Printf("\x82%s ", player_names[pnum]); //CONS_Printf("\x82%s ", player_names[pnum]);
// If a verified admin banned someone, the server needs to know about it. // If a verified admin banned someone, the server needs to know about it.
// If the playernum isn't zero (the server) then the server needs to record the ban. // If the playernum isn't zero (the server) then the server needs to record the ban.
@ -2821,15 +2821,15 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
switch (msg) switch (msg)
{ {
case KICK_MSG_GO_AWAY: case KICK_MSG_GO_AWAY:
CONS_Printf(M_GetText("has been kicked (Go away)\n")); HU_AddChatText(va("\x82*%s has been kicked (Go away)", player_names[pnum]), false);
break; break;
#ifdef NEWPING #ifdef NEWPING
case KICK_MSG_PING_HIGH: case KICK_MSG_PING_HIGH:
CONS_Printf(M_GetText("left the game (Broke ping limit)\n")); HU_AddChatText(va("\x82*%s left the game (Broke ping limit)", player_names[pnum]), false);
break; break;
#endif #endif
case KICK_MSG_CON_FAIL: case KICK_MSG_CON_FAIL:
CONS_Printf(M_GetText("left the game (Synch failure)\n")); HU_AddChatText(va("\x82*%s left the game (Synch Failure)", player_names[pnum]), false);
if (M_CheckParm("-consisdump")) // Helps debugging some problems if (M_CheckParm("-consisdump")) // Helps debugging some problems
{ {
@ -2865,22 +2865,22 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
} }
break; break;
case KICK_MSG_TIMEOUT: case KICK_MSG_TIMEOUT:
CONS_Printf(M_GetText("left the game (Connection timeout)\n")); HU_AddChatText(va("\x82*%s left the game (Connection timeout)", player_names[pnum]), false);
break; break;
case KICK_MSG_PLAYER_QUIT: case KICK_MSG_PLAYER_QUIT:
if (netgame) // not splitscreen/bots if (netgame) // not splitscreen/bots
CONS_Printf(M_GetText("left the game\n")); HU_AddChatText(va("\x82*%s left the game", player_names[pnum]), false);
break; break;
case KICK_MSG_BANNED: case KICK_MSG_BANNED:
CONS_Printf(M_GetText("has been banned (Don't come back)\n")); HU_AddChatText(va("\x82*%s has been banned (Don't come back)", player_names[pnum]), false);
break; break;
case KICK_MSG_CUSTOM_KICK: case KICK_MSG_CUSTOM_KICK:
READSTRINGN(*p, reason, MAX_REASONLENGTH+1); READSTRINGN(*p, reason, MAX_REASONLENGTH+1);
CONS_Printf(M_GetText("has been kicked (%s)\n"), reason); HU_AddChatText(va("\x82*%s has been kicked (%s)", player_names[pnum], reason), false);
break; break;
case KICK_MSG_CUSTOM_BAN: case KICK_MSG_CUSTOM_BAN:
READSTRINGN(*p, reason, MAX_REASONLENGTH+1); READSTRINGN(*p, reason, MAX_REASONLENGTH+1);
CONS_Printf(M_GetText("has been banned (%s)\n"), reason); HU_AddChatText(va("\x82*%s has been banned (%s)", player_names[pnum], reason), false);
break; break;
} }
@ -3184,9 +3184,6 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
if (newplayernum+1 > doomcom->numslots) if (newplayernum+1 > doomcom->numslots)
doomcom->numslots = (INT16)(newplayernum+1); doomcom->numslots = (INT16)(newplayernum+1);
if (netgame)
CONS_Printf(M_GetText("Player %d has joined the game (node %d)\n"), newplayernum+1, node);
// the server is creating my player // the server is creating my player
if (node == mynode) if (node == mynode)
{ {
@ -3245,11 +3242,17 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
D_SendPlayerConfig(); D_SendPlayerConfig();
addedtogame = true; addedtogame = true;
} }
else if (server && netgame && cv_showjoinaddress.value)
if (netgame)
{ {
const char *address; if (server && netgame && cv_showjoinaddress.value)
if (I_GetNodeAddress && (address = I_GetNodeAddress(node)) != NULL) {
CONS_Printf(M_GetText("Player Address is %s\n"), address); const char *address;
if (I_GetNodeAddress && (address = I_GetNodeAddress(node)) != NULL)
HU_AddChatText(va("\x82*Player %d has joined the game (node %d) (%s)", newplayernum+1, node, address), false); // merge join notification + IP to avoid clogging console/chat.
}
else
HU_AddChatText(va("\x82*Player %d has joined the game (node %d)", newplayernum+1, node), false);
} }
if (server && multiplayer && motd[0] != '\0') if (server && multiplayer && motd[0] != '\0')

View file

@ -1138,8 +1138,8 @@ static void SetPlayerName(INT32 playernum, char *newname)
if (strcasecmp(newname, player_names[playernum]) != 0) if (strcasecmp(newname, player_names[playernum]) != 0)
{ {
if (netgame) if (netgame)
CONS_Printf(M_GetText("%s renamed to %s\n"), HU_AddChatText(va("\x82*%s renamed to %s", player_names[playernum], newname), false);
player_names[playernum], newname);
strcpy(player_names[playernum], newname); strcpy(player_names[playernum], newname);
} }
} }
@ -3315,12 +3315,10 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
else else
CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[playernum], '\x84', M_GetText("Blue Team"), '\x80'); 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) else if (players[playernum].pflags & PF_WANTSTOJOIN)
players[playernum].pflags &= ~PF_WANTSTOJOIN; players[playernum].pflags &= ~PF_WANTSTOJOIN;
else 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. //reset view if you are changed, or viewing someone who was changed.
if (playernum == consoleplayer || displayplayer == playernum) if (playernum == consoleplayer || displayplayer == playernum)
@ -5262,13 +5260,17 @@ static void Color4_OnChange(void)
*/ */
static void Mute_OnChange(void) static void Mute_OnChange(void)
{ {
if (server || (IsPlayerAdmin(consoleplayer))) /*if (server || (IsPlayerAdmin(consoleplayer)))
return; return;*/
// Kinda dumb IMO, you should be able to see confirmation for having muted the chat as the host or admin.
if (leveltime <= 1)
return; // avoid having this notification put in our console / log when we boot the server.
if (cv_mute.value) if (cv_mute.value)
CONS_Printf(M_GetText("Chat has been muted.\n")); HU_AddChatText(M_GetText("\x82*Chat has been muted."), false);
else else
CONS_Printf(M_GetText("Chat is no longer muted.\n")); HU_AddChatText(M_GetText("\x82*Chat is no longer muted."), false);
} }
/** Hack to clear all changed flags after game start. /** Hack to clear all changed flags after game start.

View file

@ -424,7 +424,7 @@ consvar_t cv_chatspamprotection = {"chatspamprotection", "On", CV_SAVE, CV_OnOff
consvar_t cv_chatbacktint = {"chatbacktint", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_chatbacktint = {"chatbacktint", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// old shit console chat. (mostly exists for stuff like terminal, not because I cared if anyone liked the old chat.) // old shit console chat. (mostly exists for stuff like terminal, not because I cared if anyone liked the old chat.)
static CV_PossibleValue_t consolechat_cons_t[] = {{0, "Window"}, {1, "Console"}, {0, NULL}}; static CV_PossibleValue_t consolechat_cons_t[] = {{0, "Window"}, {1, "Console"}, {2, "Window (Hidden)"}, {0, NULL}};
consvar_t cv_consolechat = {"chatmode", "Window", CV_SAVE, consolechat_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_consolechat = {"chatmode", "Window", CV_SAVE, consolechat_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
/*consvar_t cv_crosshair = {"crosshair", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; /*consvar_t cv_crosshair = {"crosshair", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};

View file

@ -386,12 +386,11 @@ static void HU_removeChatText_Log(void)
chat_nummsg_log--; // lost 1 msg. chat_nummsg_log--; // lost 1 msg.
} }
void HU_AddChatText(const char *text) void HU_AddChatText(const char *text, boolean playsound)
{ {
if (cv_chatnotifications.value) if (playsound && cv_consolechat.value != 2) // Don't play the sound if we're using hidden chat.
S_StartSound(NULL, sfx_radio); S_StartSound(NULL, sfx_radio);
// reguardless of our preferences, put all of this in the chat buffer in case we decide to change from oldchat mid-game.
// TODO: check if we're oversaturating the log (we can only log CHAT_BUFSIZE messages.)
if (chat_nummsg_log >= CHAT_BUFSIZE) if (chat_nummsg_log >= CHAT_BUFSIZE)
HU_removeChatText_Log(); HU_removeChatText_Log();
@ -405,6 +404,11 @@ void HU_AddChatText(const char *text)
strcpy(chat_mini[chat_nummsg_min], text); strcpy(chat_mini[chat_nummsg_min], text);
chat_timers[chat_nummsg_min] = TICRATE*cv_chattime.value; chat_timers[chat_nummsg_min] = TICRATE*cv_chattime.value;
chat_nummsg_min++; chat_nummsg_min++;
if (OLDCHAT) // if we're using oldchat, print directly in console
CONS_Printf("%s\n", text);
else // if we aren't, still save the message to log.txt
CON_LogMessage(va("%s\n", text));
} }
/** Runs a say command, sending an ::XD_SAY message. /** Runs a say command, sending an ::XD_SAY message.
@ -437,7 +441,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
if (CHAT_MUTE) // TODO: Per Player mute. if (CHAT_MUTE) // TODO: Per Player mute.
{ {
HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85")); HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"), false);
return; return;
} }
@ -478,7 +482,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
// let it slide // let it slide
else else
{ {
HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm<node> \'."); HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm<node> \'.", false);
return; return;
} }
} }
@ -487,7 +491,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
{ {
if (msg[5] != ' ') if (msg[5] != ' ')
{ {
HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm<node> \'."); HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm<node> \'.", false);
return; return;
} }
} }
@ -500,7 +504,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work! target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work!
else else
{ {
HU_AddChatText(va("\x82NOTICE: \x80Player %d does not exist.", target)); // same HU_AddChatText(va("\x82NOTICE: \x80Player %d does not exist.", target), false); // same
return; return;
} }
buf[0] = target; buf[0] = target;
@ -716,7 +720,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|| target == 0 // To everyone || target == 0 // To everyone
|| consoleplayer == target-1) // To you || consoleplayer == target-1) // To you
{ {
const char *prefix = "", *cstart = "", *cend = "", *adminchar = "\x82~\x83", *remotechar = "\x82@\x83", *fmt, *fmt2, *textcolor = "\x80"; const char *prefix = "", *cstart = "", *cend = "", *adminchar = "\x82~\x83", *remotechar = "\x82@\x83", *fmt2, *textcolor = "\x80";
char *tempchar = NULL; char *tempchar = NULL;
// player is a spectator? // player is a spectator?
@ -796,16 +800,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
// name, color end, and the message itself. // name, color end, and the message itself.
// '\4' makes the message yellow and beeps; '\3' just beeps. // '\4' makes the message yellow and beeps; '\3' just beeps.
if (action) if (action)
{
fmt = "\3* %s%s%s%s \x82%s%s\n"; // don't make /me yellow, yellow will be for mentions and PMs!
fmt2 = "* %s%s%s%s \x82%s%s"; fmt2 = "* %s%s%s%s \x82%s%s";
}
else if (target-1 == consoleplayer) // To you else if (target-1 == consoleplayer) // To you
{ {
prefix = "\x82[PM]"; prefix = "\x82[PM]";
cstart = "\x82"; cstart = "\x82";
textcolor = "\x82"; textcolor = "\x82";
fmt = "\4%s<%s%s>%s\x80 %s%s\n"; // make this yellow, however.
fmt2 = "%s<%s%s>%s\x80 %s%s"; fmt2 = "%s<%s%s>%s\x80 %s%s";
} }
else if (target > 0) // By you, to another player else if (target > 0) // By you, to another player
@ -814,15 +814,11 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
dispname = player_names[target-1]; dispname = player_names[target-1];
prefix = "\x82[TO]"; prefix = "\x82[TO]";
cstart = "\x82"; cstart = "\x82";
fmt = "\4%s<%s%s>%s\x80 %s%s\n"; // make this yellow, however.
fmt2 = "%s<%s%s>%s\x80 %s%s"; fmt2 = "%s<%s%s>%s\x80 %s%s";
} }
else // To everyone or sayteam, it doesn't change anything. else // To everyone or sayteam, it doesn't change anything.
{
fmt = "\3%s<%s%s%s>\x80 %s%s\n";
fmt2 = "%s<%s%s%s>\x80 %s%s"; fmt2 = "%s<%s%s%s>\x80 %s%s";
}
/*else // To your team /*else // To your team
{ {
if (players[playernum].ctfteam == 1) // red if (players[playernum].ctfteam == 1) // red
@ -836,12 +832,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
fmt2 = "%s<%s%s>\x80%s %s%s"; fmt2 = "%s<%s%s>\x80%s %s%s";
}*/ }*/
HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg)); // add it reguardless, in case we decide to change our mind about our chat type. HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg), cv_chatnotifications.value); // add to chat
if OLDCHAT
CONS_Printf(fmt, prefix, cstart, dispname, cend, textcolor, msg);
else
CON_LogMessage(va(fmt, prefix, cstart, dispname, cend, textcolor, msg)); // save to log.txt
if (tempchar) if (tempchar)
Z_Free(tempchar); Z_Free(tempchar);
@ -968,7 +959,7 @@ static void HU_queueChatChar(INT32 c)
// last minute mute check // last minute mute check
if (CHAT_MUTE) if (CHAT_MUTE)
{ {
HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85")); HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"), false);
return; return;
} }
@ -983,7 +974,7 @@ static void HU_queueChatChar(INT32 c)
// teamtalk can't send PMs, just don't send it, else everyone would be able to see it, and no one wants to see your sex RP sicko. // teamtalk can't send PMs, just don't send it, else everyone would be able to see it, and no one wants to see your sex RP sicko.
if (teamtalk) if (teamtalk)
{ {
HU_AddChatText(va("%sCannot send sayto in Say-Team.", "\x85")); HU_AddChatText(va("%sCannot send sayto in Say-Team.", "\x85"), false);
return; return;
} }
@ -999,7 +990,7 @@ static void HU_queueChatChar(INT32 c)
// let it slide // let it slide
else else
{ {
HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm<node> \'."); HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm<node> \'.", false);
return; return;
} }
} }
@ -1008,7 +999,7 @@ static void HU_queueChatChar(INT32 c)
{ {
if (msg[5] != ' ') if (msg[5] != ' ')
{ {
HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm<node> \'."); HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm<node> \'.", false);
return; return;
} }
} }
@ -1021,7 +1012,7 @@ static void HU_queueChatChar(INT32 c)
target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work! target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work!
else else
{ {
HU_AddChatText(va("\x82NOTICE: \x80Player %d does not exist.", target)); // same HU_AddChatText(va("\x82NOTICE: \x80Player %d does not exist.", target), false); // same
return; return;
} }
// we need to get rid of the /pm<node> // we need to get rid of the /pm<node>
@ -1435,6 +1426,7 @@ static void HU_drawChatLog(INT32 offset)
INT32 x = chatx+2, y, dx = 0, dy = 0; INT32 x = chatx+2, y, dx = 0, dy = 0;
UINT32 i = 0; UINT32 i = 0;
INT32 chat_topy, chat_bottomy; INT32 chat_topy, chat_bottomy;
INT32 highlight = HU_GetHighlightColor();
boolean atbottom = false; boolean atbottom = false;
// make sure that our scroll position isn't "illegal"; // make sure that our scroll position isn't "illegal";
@ -1532,12 +1524,12 @@ static void HU_drawChatLog(INT32 offset)
if (chat_scroll > 0) if (chat_scroll > 0)
{ {
V_DrawCharacter(chatx-9, ((justscrolledup) ? (chat_topy-1) : (chat_topy)), V_DrawCharacter(chatx-9, ((justscrolledup) ? (chat_topy-1) : (chat_topy)),
'\x1A' | V_SNAPTOBOTTOM | V_SNAPTOLEFT, false); // up arrow '\x1A' | V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight, false); // up arrow
} }
if (chat_scroll < chat_maxscroll) if (chat_scroll < chat_maxscroll)
{ {
V_DrawCharacter(chatx-9, chat_bottomy-((justscrolleddown) ? 5 : 6), V_DrawCharacter(chatx-9, chat_bottomy-((justscrolleddown) ? 5 : 6),
'\x1B' | V_SNAPTOBOTTOM | V_SNAPTOLEFT, false); // down arrow '\x1B' | V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight, false); // down arrow
} }
justscrolleddown = false; justscrolleddown = false;
@ -1732,6 +1724,7 @@ static void HU_DrawChat(void)
} }
// why the fuck would you use this... // why the fuck would you use this...
static void HU_DrawChat_Old(void) static void HU_DrawChat_Old(void)
@ -2071,7 +2064,7 @@ void HU_Drawer(void)
{ {
chat_scrolltime = 0; // do scroll anyway. chat_scrolltime = 0; // do scroll anyway.
typelines = 1; // make sure that the chat doesn't have a weird blinking huge ass square if we typed a lot last time. typelines = 1; // make sure that the chat doesn't have a weird blinking huge ass square if we typed a lot last time.
if (!OLDCHAT) if (!OLDCHAT && cv_consolechat.value < 2) // Don't display minimized chat if you set the mode to Window (Hidden)
HU_drawMiniChat(); // draw messages in a cool fashion. HU_drawMiniChat(); // draw messages in a cool fashion.
} }
} }

View file

@ -80,12 +80,12 @@ extern patch_t *iconprefix[MAXSKINS];
#define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand. #define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand.
#define OLDCHAT (cv_consolechat.value || dedicated || vid.width < 640) #define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640)
#define CHAT_MUTE (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot. #define CHAT_MUTE (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot.
#define OLD_MUTE (OLDCHAT && cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted. #define OLD_MUTE (OLDCHAT && cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted.
// some functions // some functions
void HU_AddChatText(const char *text); void HU_AddChatText(const char *text, boolean playsound);
// set true when entering a chat message // set true when entering a chat message
extern boolean chat_on; extern boolean chat_on;

View file

@ -15628,8 +15628,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate S_NULL, // xdeathstate
sfx_s3k5d, // deathsound sfx_s3k5d, // deathsound
64*FRACUNIT, // speed 64*FRACUNIT, // speed
16*FRACUNIT, // radius 24*FRACUNIT, // radius
32*FRACUNIT, // height 48*FRACUNIT, // height
0, // display offset 0, // display offset
100, // mass 100, // mass
1, // damage 1, // damage
@ -17410,7 +17410,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate S_NULL, // xdeathstate
sfx_None, // deathsound sfx_None, // deathsound
0, // speed 0, // speed
26*FRACUNIT, // radius 24*FRACUNIT, // radius
52*FRACUNIT, // height 52*FRACUNIT, // height
-1, // display offset -1, // display offset
0, // mass 0, // mass

View file

@ -5434,6 +5434,8 @@ void K_CheckSpectateStatus(void)
UINT8 respawnlist[MAXPLAYERS]; UINT8 respawnlist[MAXPLAYERS];
UINT8 i, numingame = 0, numjoiners = 0; 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. // Get the number of players in game, and the players to be de-spectated.
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
@ -6521,7 +6523,7 @@ static void K_drawKartBumpersOrKarma(void)
if (stplyr->kartstuff[k_bumper] <= 0) if (stplyr->kartstuff[k_bumper] <= 0)
{ {
V_DrawMappedPatch(LAPS_X, LAPS_Y-1, V_HUDTRANS|splitflags, kp_splitkarmabomb, colormap); V_DrawMappedPatch(LAPS_X, LAPS_Y-1, V_HUDTRANS|splitflags, kp_splitkarmabomb, colormap);
V_DrawString(LAPS_X+13, LAPS_Y+1, V_HUDTRANS|splitflags, va("%d/3", stplyr->kartstuff[k_comebackpoints])); V_DrawString(LAPS_X+13, LAPS_Y+1, V_HUDTRANS|splitflags, va("%d/2", stplyr->kartstuff[k_comebackpoints]));
} }
else else
{ {
@ -6534,7 +6536,7 @@ static void K_drawKartBumpersOrKarma(void)
if (stplyr->kartstuff[k_bumper] <= 0) if (stplyr->kartstuff[k_bumper] <= 0)
{ {
V_DrawMappedPatch(LAPS_X, LAPS_Y, V_HUDTRANS|splitflags, kp_karmasticker, colormap); V_DrawMappedPatch(LAPS_X, LAPS_Y, V_HUDTRANS|splitflags, kp_karmasticker, colormap);
V_DrawKartString(LAPS_X+59, LAPS_Y+3, V_HUDTRANS|splitflags, va("%d/3", stplyr->kartstuff[k_comebackpoints])); V_DrawKartString(LAPS_X+59, LAPS_Y+3, V_HUDTRANS|splitflags, va("%d/2", stplyr->kartstuff[k_comebackpoints]));
} }
else else
{ {

View file

@ -92,6 +92,7 @@ static int lib_print(lua_State *L)
static int lib_chatprint(lua_State *L) static int lib_chatprint(lua_State *L)
{ {
const char *str = luaL_checkstring(L, 1); // retrieve string const char *str = luaL_checkstring(L, 1); // retrieve string
boolean sound = luaL_checkboolean(L, 2); // retrieve sound boolean
int len; int len;
if (str == NULL) // error if we don't have a string! if (str == NULL) // error if we don't have a string!
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprint")); return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprint"));
@ -99,12 +100,7 @@ static int lib_chatprint(lua_State *L)
if (len > 255) // string is too long!!! if (len > 255) // string is too long!!!
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer."); return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
HU_AddChatText(str); HU_AddChatText(str, sound);
if OLDCHAT
CONS_Printf("%s\n", str);
else
CON_LogMessage(str); // save to log.txt
return 0; return 0;
} }
@ -115,6 +111,7 @@ static int lib_chatprintf(lua_State *L)
int n = lua_gettop(L); /* number of arguments */ int n = lua_gettop(L); /* number of arguments */
player_t *plr; player_t *plr;
const char *str; const char *str;
boolean sound = luaL_checkboolean(L, 3);
int len; int len;
if (n < 2) if (n < 2)
return luaL_error(L, "chatprintf requires at least two arguments: player and text."); return luaL_error(L, "chatprintf requires at least two arguments: player and text.");
@ -132,12 +129,7 @@ static int lib_chatprintf(lua_State *L)
if (len > 255) // string is too long!!! if (len > 255) // string is too long!!!
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer."); return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
HU_AddChatText(str); HU_AddChatText(str, sound);
if OLDCHAT
CONS_Printf("%s\n", str);
else
CON_LogMessage(str); // save to log.txt
return 0; return 0;
} }

View file

@ -1646,6 +1646,13 @@ inline static void M_GetGametypeColor(void)
highlightflags = V_YELLOWMAP; // FALLBACK highlightflags = V_YELLOWMAP; // FALLBACK
} }
// excuse me but I'm extremely lazy:
INT32 HU_GetHighlightColor(void)
{
M_GetGametypeColor(); // update flag colour reguardless of the menu being opened or not.
return highlightflags;
}
// Sky Room // Sky Room
menu_t SR_PandoraDef = menu_t SR_PandoraDef =
{ {
@ -7410,7 +7417,7 @@ static void M_StartServer(INT32 choice)
if (cv_maxplayers.value < ssplayers+1) if (cv_maxplayers.value < ssplayers+1)
CV_SetValue(&cv_maxplayers, ssplayers+1); CV_SetValue(&cv_maxplayers, ssplayers+1);
if (splitscreen != ssplayers) if (splitscreen != ssplayers)
{ {
splitscreen = ssplayers; splitscreen = ssplayers;

View file

@ -228,6 +228,8 @@ void Screenshot_option_Onchange(void);
// Addons menu updating // Addons menu updating
void Addons_option_Onchange(void); void Addons_option_Onchange(void);
INT32 HU_GetHighlightColor(void);
// These defines make it a little easier to make menus // These defines make it a little easier to make menus
#define DEFAULTMENUSTYLE(header, source, prev, x, y)\ #define DEFAULTMENUSTYLE(header, source, prev, x, y)\
{\ {\

View file

@ -519,8 +519,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
special->target->player->kartstuff[k_comebackpoints]++; special->target->player->kartstuff[k_comebackpoints]++;
} }
special->target->player->kartstuff[k_comebackpoints] += 2 * (K_IsPlayerWanted(player) ? 2 : 1); special->target->player->kartstuff[k_comebackpoints] += (K_IsPlayerWanted(player) ? 2 : 1);
if (special->target->player->kartstuff[k_comebackpoints] >= 3) if (special->target->player->kartstuff[k_comebackpoints] >= 2)
K_StealBumper(special->target->player, player, true); K_StealBumper(special->target->player, player, true);
special->target->player->kartstuff[k_comebacktimer] = comebacktime; special->target->player->kartstuff[k_comebacktimer] = comebacktime;
@ -535,7 +535,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
special->target->player->kartstuff[k_comebackmode] = 0; special->target->player->kartstuff[k_comebackmode] = 0;
special->target->player->kartstuff[k_comebackpoints]++; special->target->player->kartstuff[k_comebackpoints]++;
if (special->target->player->kartstuff[k_comebackpoints] >= 3) if (special->target->player->kartstuff[k_comebackpoints] >= 2)
K_StealBumper(special->target->player, player, true); K_StealBumper(special->target->player, player, true);
special->target->player->kartstuff[k_comebacktimer] = comebacktime; special->target->player->kartstuff[k_comebacktimer] = comebacktime;
@ -559,14 +559,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
numingame++; numingame++;
} }
if (numingame <= 2) // If so, then an extra two karma points so they are 100% certain to switch places; it's annoying to end matches with a fake kill if (numingame <= 2) // If so, then an extra karma point so they are 100% certain to switch places; it's annoying to end matches with a fake kill
special->target->player->kartstuff[k_comebackpoints] += 2; special->target->player->kartstuff[k_comebackpoints]++;
} }
special->target->player->kartstuff[k_comebackmode] = 0; special->target->player->kartstuff[k_comebackmode] = 0;
special->target->player->kartstuff[k_comebackpoints]++; special->target->player->kartstuff[k_comebackpoints]++;
if (special->target->player->kartstuff[k_comebackpoints] >= 3) if (special->target->player->kartstuff[k_comebackpoints] >= 2)
K_StealBumper(special->target->player, player, true); K_StealBumper(special->target->player, player, true);
special->target->player->kartstuff[k_comebacktimer] = comebacktime; special->target->player->kartstuff[k_comebacktimer] = comebacktime;

View file

@ -8420,6 +8420,13 @@ void P_MobjThinker(mobj_t *mobj)
mobj->color = mobj->target->color; mobj->color = mobj->target->color;
mobj->colorized = true; mobj->colorized = true;
// Give items an item-sized hitbox
if (mobj->target->player->kartstuff[k_comebackmode] == 1)
mobj->radius = 36*mobj->target->scale;
else
mobj->radius = 24*mobj->target->scale;
mobj->height = 2*mobj->radius;
if (mobj->target->player->kartstuff[k_comebacktimer] > 0) if (mobj->target->player->kartstuff[k_comebacktimer] > 0)
{ {
if (state < mobj->info->spawnstate || state > mobj->info->spawnstate+19) if (state < mobj->info->spawnstate || state > mobj->info->spawnstate+19)

View file

@ -1179,7 +1179,7 @@ boolean P_EndingMusic(player_t *player)
bestlocalplayer = player; bestlocalplayer = player;
bestlocalpos = ((player->pflags & PF_TIMEOVER) ? MAXPLAYERS+1 : player->kartstuff[k_position]); bestlocalpos = ((player->pflags & PF_TIMEOVER) ? MAXPLAYERS+1 : player->kartstuff[k_position]);
} }
if (G_RaceGametype() && bestlocalpos == MAXPLAYERS+1) if (G_RaceGametype() && bestlocalpos == MAXPLAYERS+1)
sprintf(buffer, "k*fail"); // F-Zero death results theme sprintf(buffer, "k*fail"); // F-Zero death results theme
else else
@ -8687,7 +8687,7 @@ boolean P_SpectatorJoinGame(player_t *player)
if (P_IsLocalPlayer(player) && displayplayer != consoleplayer) if (P_IsLocalPlayer(player) && displayplayer != consoleplayer)
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 true; // no more player->mo, cannot continue.
} }
return false; return false;

View file

@ -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!!! // THANK YOU MPC!!!
void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
@ -966,21 +999,7 @@ void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
#ifdef HWRENDER #ifdef HWRENDER
if (rendermode != render_soft && rendermode != render_none) if (rendermode != render_soft && rendermode != render_none)
{ {
UINT32 hwcolor; UINT32 hwcolor = V_GetHWConsBackColor();
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 = 0xff000000; break; // Red
case 4: hwcolor = 0xff800000; break; // Orange
case 5: hwcolor = 0x80800000; break; // Yellow
case 6: hwcolor = 0x00800000; break; // Green
case 7: hwcolor = 0x0000ff00; break; // Blue
case 8: hwcolor = 0x4080ff00; break; // Cyan
// Default green
default: hwcolor = 0x00800000; break;
}
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. 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; return;
} }
@ -1226,21 +1245,7 @@ void V_DrawFadeConsBack(INT32 plines)
#ifdef HWRENDER // not win32 only 19990829 by Kin #ifdef HWRENDER // not win32 only 19990829 by Kin
if (rendermode != render_soft && rendermode != render_none) if (rendermode != render_soft && rendermode != render_none)
{ {
UINT32 hwcolor; UINT32 hwcolor = V_GetHWConsBackColor();
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 = 0xff000000; break; // Red
case 4: hwcolor = 0xff800000; break; // Orange
case 5: hwcolor = 0x80800000; break; // Yellow
case 6: hwcolor = 0x00800000; break; // Green
case 7: hwcolor = 0x0000ff00; break; // Blue
case 8: hwcolor = 0x4080ff00; break; // Cyan
// Default green
default: hwcolor = 0x00800000; break;
}
HWR_DrawConsoleBack(hwcolor, plines); HWR_DrawConsoleBack(hwcolor, plines);
return; return;
} }
@ -1347,10 +1352,10 @@ void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UI
w = (vid.width < 640 ) ? (SHORT(hu_font[c]->width)/2) : (SHORT(hu_font[c]->width)); // use normal sized characters if we're using a terribly low resolution. w = (vid.width < 640 ) ? (SHORT(hu_font[c]->width)/2) : (SHORT(hu_font[c]->width)); // use normal sized characters if we're using a terribly low resolution.
if (x + w > vid.width) if (x + w > vid.width)
return; return;
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, (vid.width < 640) ? (FRACUNIT) : (FRACUNIT/2), flags, hu_font[c], colormap); V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, (vid.width < 640) ? (FRACUNIT) : (FRACUNIT/2), flags, hu_font[c], colormap);
} }
// Precompile a wordwrapped string to any given width. // Precompile a wordwrapped string to any given width.