mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-18 07:22:03 +00:00
Merge branch 'sonicitems' of https://git.magicalgirl.moe/KartKrew/Kart into sonicitems
This commit is contained in:
commit
bf4f85fcca
21 changed files with 1446 additions and 177 deletions
|
@ -1037,7 +1037,17 @@ boolean CON_Responder(event_t *ev)
|
|||
else if (key == KEY_KPADSLASH)
|
||||
key = '/';
|
||||
|
||||
if (shiftdown)
|
||||
// capslock
|
||||
if (key == KEY_CAPSLOCK) // it's a toggle.
|
||||
{
|
||||
if (capslock)
|
||||
capslock = false;
|
||||
else
|
||||
capslock = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (capslock ^ shiftdown) // gets capslock to work because capslock is cool
|
||||
key = shiftxform[key];
|
||||
|
||||
// enter a char into the command prompt
|
||||
|
@ -1045,7 +1055,7 @@ boolean CON_Responder(event_t *ev)
|
|||
return true; // even if key can't be printed, eat it anyway
|
||||
|
||||
// add key to cmd line here
|
||||
if (key >= 'A' && key <= 'Z' && !shiftdown) //this is only really necessary for dedicated servers
|
||||
if (key >= 'A' && key <= 'Z' && !(shiftdown ^ capslock)) //this is only really necessary for dedicated servers
|
||||
key = key + 'a' - 'A';
|
||||
|
||||
if (input_sel != input_cur)
|
||||
|
@ -1432,7 +1442,7 @@ static void CON_DrawHudlines(void)
|
|||
if (con_hudlines <= 0)
|
||||
return;
|
||||
|
||||
if (chat_on)
|
||||
if (chat_on && OLDCHAT)
|
||||
y = charheight; // leave place for chat input in the first row of text
|
||||
else
|
||||
y = 0;
|
||||
|
|
|
@ -186,6 +186,7 @@ void D_PostEvent_end(void) {};
|
|||
UINT8 shiftdown = 0; // 0x1 left, 0x2 right
|
||||
UINT8 ctrldown = 0; // 0x1 left, 0x2 right
|
||||
UINT8 altdown = 0; // 0x1 left, 0x2 right
|
||||
boolean capslock = 0; // jeez i wonder what this does.
|
||||
//
|
||||
// D_ModifierKeyResponder
|
||||
// Sets global shift/ctrl/alt variables, never actually eats events
|
||||
|
|
|
@ -432,7 +432,7 @@ consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NUL
|
|||
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_inttime = {"inttime", "20", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Off"}, {1, "Next"}, {2, "Random"}, {3, "Vote"}, {0, NULL}};
|
||||
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Same"}, {1, "Next"}, {2, "Random"}, {3, "Vote"}, {0, NULL}};
|
||||
consvar_t cv_advancemap = {"advancemap", "Vote", CV_NETVAR, advancemap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "All"}, {0, NULL}};
|
||||
consvar_t cv_playersforexit = {"playersforexit", "One", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
@ -780,6 +780,13 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_usegamma);
|
||||
|
||||
// m_menu.c
|
||||
CV_RegisterVar(&cv_compactscoreboard);
|
||||
CV_RegisterVar(&cv_chatheight);
|
||||
CV_RegisterVar(&cv_chatwidth);
|
||||
CV_RegisterVar(&cv_chattime);
|
||||
CV_RegisterVar(&cv_chatspamprotection);
|
||||
CV_RegisterVar(&cv_consolechat);
|
||||
CV_RegisterVar(&cv_chatnotifications);
|
||||
CV_RegisterVar(&cv_crosshair);
|
||||
CV_RegisterVar(&cv_crosshair2);
|
||||
CV_RegisterVar(&cv_crosshair3);
|
||||
|
|
|
@ -437,6 +437,7 @@ extern INT32 cv_debug;
|
|||
|
||||
// Modifier key variables, accessible anywhere
|
||||
extern UINT8 shiftdown, ctrldown, altdown;
|
||||
extern boolean capslock;
|
||||
|
||||
// if we ever make our alloc stuff...
|
||||
#define ZZ_Alloc(x) Z_Malloc(x, PU_STATIC, NULL)
|
||||
|
|
27
src/g_game.c
27
src/g_game.c
|
@ -398,6 +398,33 @@ static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
|
|||
#endif
|
||||
#endif
|
||||
|
||||
// don't mind me putting these here, I was lazy to figure out where else I could put those without blowing up the compiler.
|
||||
|
||||
// it automatically becomes compact with 20+ players, but if you like it, I guess you can turn that on!
|
||||
consvar_t cv_compactscoreboard= {"compactscoreboard", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// chat timer thingy
|
||||
static CV_PossibleValue_t chattime_cons_t[] = {{5, "MIN"}, {999, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_chattime = {"chattime", "8", CV_SAVE, chattime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// chatwidth
|
||||
static CV_PossibleValue_t chatwidth_cons_t[] = {{64, "MIN"}, {150, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_chatwidth = {"chatwidth", "150", CV_SAVE, chatwidth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// chatheight
|
||||
static CV_PossibleValue_t chatheight_cons_t[] = {{6, "MIN"}, {22, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_chatheight = {"chatheight", "8", CV_SAVE, chatheight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// chat notifications (do you want to hear beeps? I'd understand if you didn't.)
|
||||
consvar_t cv_chatnotifications = {"chatnotifications", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// chat spam protection (why would you want to disable that???)
|
||||
consvar_t cv_chatspamprotection = {"chatspamprotection", "On", 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.)
|
||||
//static CV_PossibleValue_t consolechat_cons_t[] = {{0, "Box"}, {1, "Console"}, {0, NULL}}; -- for menu, but menu disabled...
|
||||
consvar_t cv_consolechat = {"consolechat", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_crosshair = {"crosshair", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_crosshair2 = {"crosshair2", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_crosshair3 = {"crosshair3", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
|
|
@ -54,6 +54,7 @@ extern tic_t timeinmap; // Ticker for time spent in level (used for levelcard di
|
|||
extern INT16 rw_maximums[NUM_WEAPONS];
|
||||
|
||||
// used in game menu
|
||||
extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatspamprotection, cv_compactscoreboard;
|
||||
extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4;
|
||||
extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove;
|
||||
extern consvar_t cv_turnaxis,cv_moveaxis,cv_brakeaxis,cv_aimaxis,cv_lookaxis,cv_fireaxis,cv_driftaxis;
|
||||
|
|
|
@ -904,6 +904,112 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
|||
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
|
||||
}
|
||||
|
||||
|
||||
// -------------------+
|
||||
// HWR_DrawConsoleFill : draw flat coloured transparent rectangle because that's cool, and hw sucks less than sw for that.
|
||||
// -------------------+
|
||||
void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options)
|
||||
{
|
||||
FOutVector v[4];
|
||||
FSurfaceInfo Surf;
|
||||
float fx, fy, fw, fh;
|
||||
|
||||
if (w < 0 || h < 0)
|
||||
return; // consistency w/ software
|
||||
|
||||
// 3--2
|
||||
// | /|
|
||||
// |/ |
|
||||
// 0--1
|
||||
|
||||
fx = (float)x;
|
||||
fy = (float)y;
|
||||
fw = (float)w;
|
||||
fh = (float)h;
|
||||
|
||||
if (!(options & V_NOSCALESTART))
|
||||
{
|
||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
||||
|
||||
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
|
||||
{
|
||||
RGBA_t rgbaColour = V_GetColor(color);
|
||||
FRGBAFloat clearColour;
|
||||
clearColour.red = (float)rgbaColour.s.red / 255;
|
||||
clearColour.green = (float)rgbaColour.s.green / 255;
|
||||
clearColour.blue = (float)rgbaColour.s.blue / 255;
|
||||
clearColour.alpha = 1;
|
||||
HWD.pfnClearBuffer(true, false, &clearColour);
|
||||
return;
|
||||
}
|
||||
|
||||
fx *= dupx;
|
||||
fy *= dupy;
|
||||
fw *= dupx;
|
||||
fh *= dupy;
|
||||
|
||||
if (vid.width != BASEVIDWIDTH * vid.dupx)
|
||||
{
|
||||
if (options & V_SNAPTORIGHT)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
else if (!(options & V_SNAPTOLEFT))
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
||||
}
|
||||
if (vid.height != BASEVIDHEIGHT * dupy)
|
||||
{
|
||||
// same thing here
|
||||
if (options & V_SNAPTOBOTTOM)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
else if (!(options & V_SNAPTOTOP))
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (fx >= vid.width || fy >= vid.height)
|
||||
return;
|
||||
if (fx < 0)
|
||||
{
|
||||
fw += fx;
|
||||
fx = 0;
|
||||
}
|
||||
if (fy < 0)
|
||||
{
|
||||
fh += fy;
|
||||
fy = 0;
|
||||
}
|
||||
|
||||
if (fw <= 0 || fh <= 0)
|
||||
return;
|
||||
if (fx + fw > vid.width)
|
||||
fw = (float)vid.width - fx;
|
||||
if (fy + fh > vid.height)
|
||||
fh = (float)vid.height - fy;
|
||||
|
||||
fx = -1 + fx / (vid.width / 2);
|
||||
fy = 1 - fy / (vid.height / 2);
|
||||
fw = fw / (vid.width / 2);
|
||||
fh = fh / (vid.height / 2);
|
||||
|
||||
v[0].x = v[3].x = fx;
|
||||
v[2].x = v[1].x = fx + fw;
|
||||
v[0].y = v[1].y = fy;
|
||||
v[2].y = v[3].y = fy - fh;
|
||||
|
||||
//Hurdler: do we still use this argb color? if not, we should remove it
|
||||
v[0].argb = v[1].argb = v[2].argb = v[3].argb = 0xff00ff00; //;
|
||||
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
||||
|
||||
v[0].sow = v[3].sow = 0.0f;
|
||||
v[2].sow = v[1].sow = 1.0f;
|
||||
v[0].tow = v[1].tow = 0.0f;
|
||||
v[2].tow = v[3].tow = 1.0f;
|
||||
|
||||
Surf.FlatColor.rgba = UINT2RGBA(color);
|
||||
Surf.FlatColor.s.alpha = 0x80;
|
||||
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
// HWR_DrawDiag : draw flat coloured rectangle, with no texture
|
||||
// -----------------+
|
||||
|
@ -1000,6 +1106,8 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
|
|||
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_PNG
|
||||
|
||||
#ifndef _MSC_VER
|
||||
|
|
|
@ -51,6 +51,7 @@ void HWR_CreatePlanePolygons(INT32 bspnum);
|
|||
void HWR_CreateStaticLightmaps(INT32 bspnum);
|
||||
void HWR_PrepLevelCache(size_t pnumtextures);
|
||||
void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color);
|
||||
void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options); // Lat: separate flags from color since color needs to be an uint to work right.
|
||||
void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color);
|
||||
void HWR_DrawPic(INT32 x,INT32 y,lumpnum_t lumpnum);
|
||||
|
||||
|
|
1041
src/hu_stuff.c
1041
src/hu_stuff.c
File diff suppressed because it is too large
Load diff
|
@ -78,6 +78,13 @@ extern patch_t *tagico;
|
|||
extern patch_t *tallminus;
|
||||
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 OLDCHAT (cv_consolechat.value || dedicated || vid.width < 640)
|
||||
|
||||
// some functions
|
||||
void HU_AddChatText(const char *text);
|
||||
|
||||
// set true when entering a chat message
|
||||
extern boolean chat_on;
|
||||
|
||||
|
@ -102,6 +109,9 @@ void HU_Drawer(void);
|
|||
char HU_dequeueChatChar(void);
|
||||
void HU_Erase(void);
|
||||
void HU_clearChatChars(void);
|
||||
void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext); // Lat': Ping drawer for scoreboard.
|
||||
void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
|
||||
void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
|
||||
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol);
|
||||
//void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
|
||||
//void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
|
||||
|
|
29
src/k_kart.c
29
src/k_kart.c
|
@ -1339,7 +1339,7 @@ static void K_RegularVoiceTimers(player_t *player)
|
|||
|
||||
static void K_PlayTauntSound(mobj_t *source)
|
||||
{
|
||||
#if 0
|
||||
#if 1
|
||||
sfxenum_t pick = P_RandomKey(4); // Gotta roll the RNG every time this is called for sync reasons
|
||||
boolean tasteful = (!source->player || !source->player->kartstuff[k_tauntvoices]);
|
||||
|
||||
|
@ -1362,7 +1362,7 @@ static void K_PlayTauntSound(mobj_t *source)
|
|||
|
||||
static void K_PlayOvertakeSound(mobj_t *source)
|
||||
{
|
||||
#if 0
|
||||
#if 1
|
||||
boolean tasteful = (!source->player || !source->player->kartstuff[k_voices]);
|
||||
|
||||
if (!G_RaceGametype()) // Only in race
|
||||
|
@ -5741,19 +5741,16 @@ static void K_drawBattleFullscreen(void)
|
|||
}
|
||||
else if (stplyr->kartstuff[k_bumper] <= 0 && stplyr->kartstuff[k_comebacktimer] && comeback)
|
||||
{
|
||||
INT32 t = stplyr->kartstuff[k_comebacktimer]/TICRATE;
|
||||
INT32 txoff = 0;
|
||||
UINT16 t = stplyr->kartstuff[k_comebacktimer]/(10*TICRATE);
|
||||
INT32 txoff, adjust = (splitscreen > 1) ? 4 : 6; // normal string is 8, kart string is 12, half of that for ease
|
||||
INT32 ty = (BASEVIDHEIGHT/2)+66;
|
||||
|
||||
if (t == 0)
|
||||
txoff = 8;
|
||||
else
|
||||
txoff = adjust;
|
||||
|
||||
while (t)
|
||||
{
|
||||
while (t)
|
||||
{
|
||||
txoff += 8;
|
||||
t /= 10;
|
||||
}
|
||||
txoff += adjust;
|
||||
t /= 10;
|
||||
}
|
||||
|
||||
if (splitscreen)
|
||||
|
@ -5774,7 +5771,7 @@ static void K_drawBattleFullscreen(void)
|
|||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, splitflags, kp_battlewait, NULL);
|
||||
|
||||
if (splitscreen > 1)
|
||||
V_DrawString(x-(txoff/2), ty, 0, va("%d", stplyr->kartstuff[k_comebacktimer]/TICRATE));
|
||||
V_DrawString(x-txoff, ty, 0, va("%d", stplyr->kartstuff[k_comebacktimer]/TICRATE));
|
||||
else
|
||||
{
|
||||
V_DrawFixedPatch(x<<FRACBITS, ty<<FRACBITS, scale, 0, kp_timeoutsticker, NULL);
|
||||
|
@ -6065,11 +6062,13 @@ static void K_drawCheckpointDebugger(void)
|
|||
|
||||
void K_drawKartFreePlay(UINT32 flashtime)
|
||||
{
|
||||
// no splitscreen support because it's not FREE PLAY if you have more than one player in-game
|
||||
|
||||
if ((flashtime % TICRATE) < TICRATE/2)
|
||||
return;
|
||||
|
||||
V_DrawKartString(BASEVIDWIDTH/2 - (6*9), // horizontally centered, nice
|
||||
LAPS_Y+3, V_SNAPTOBOTTOM, "FREE PLAY");
|
||||
V_DrawKartString((BASEVIDWIDTH - (LAPS_X+1)) - (12*9), // mirror the laps thingy
|
||||
LAPS_Y+3, V_SNAPTOBOTTOM|V_SNAPTORIGHT, "FREE PLAY");
|
||||
}
|
||||
|
||||
void K_drawKartHUD(void)
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
#include "m_random.h"
|
||||
#include "s_sound.h"
|
||||
#include "g_game.h"
|
||||
#include "hu_stuff.h"
|
||||
#include "console.h"
|
||||
#include "k_kart.h"
|
||||
|
||||
#include "lua_script.h"
|
||||
|
@ -86,6 +88,57 @@ static int lib_print(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Print stuff in the chat, or in the console if we can't.
|
||||
static int lib_chatprint(lua_State *L)
|
||||
{
|
||||
const char *str = luaL_checkstring(L, 1); // retrieve 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"));
|
||||
int len = strlen(str);
|
||||
if (len > 255) // string is too long!!!
|
||||
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
|
||||
|
||||
HU_AddChatText(str);
|
||||
|
||||
if OLDCHAT
|
||||
CONS_Printf("%s\n", str);
|
||||
else
|
||||
CON_LogMessage(str); // save to log.txt
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Same as above, but do it for only one player.
|
||||
static int lib_chatprintf(lua_State *L)
|
||||
{
|
||||
int n = lua_gettop(L); /* number of arguments */
|
||||
player_t *plr;
|
||||
if (n < 2)
|
||||
return luaL_error(L, "chatprintf requires at least two arguments: player and text.");
|
||||
|
||||
plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player
|
||||
if (!plr)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
if (plr != &players[consoleplayer])
|
||||
return 0;
|
||||
|
||||
const char *str = luaL_checkstring(L, 2); // retrieve 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("chatprintf"));
|
||||
int len = strlen(str);
|
||||
if (len > 255) // string is too long!!!
|
||||
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
|
||||
|
||||
HU_AddChatText(str);
|
||||
|
||||
if OLDCHAT
|
||||
CONS_Printf("%s\n", str);
|
||||
else
|
||||
CON_LogMessage(str); // save to log.txt
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_evalMath(lua_State *L)
|
||||
{
|
||||
const char *word = luaL_checkstring(L, 1);
|
||||
|
@ -2255,6 +2308,8 @@ static int lib_kGetKartFlashing(lua_State *L)
|
|||
|
||||
static luaL_Reg lib[] = {
|
||||
{"print", lib_print},
|
||||
{"chatprint", lib_chatprint},
|
||||
{"chatprintf", lib_chatprintf},
|
||||
{"EvalMath", lib_evalMath},
|
||||
|
||||
// m_random
|
||||
|
|
|
@ -74,7 +74,7 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source); // Ho
|
|||
boolean LUAh_BotTiccmd(player_t *bot, ticcmd_t *cmd); // Hook for B_BuildTiccmd
|
||||
boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_BuildTailsTiccmd by skin name
|
||||
boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors
|
||||
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages
|
||||
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute); // Hook for chat messages
|
||||
boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages
|
||||
#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer
|
||||
|
||||
|
|
|
@ -952,7 +952,9 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector)
|
|||
}
|
||||
|
||||
// Hook for player chat
|
||||
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg)
|
||||
// Added the "mute" field. It's set to true if the message was supposed to be eaten by spam protection.
|
||||
// But for netgame consistency purposes, this hook is ran first reguardless, so this boolean allows for modders to adapt if they so desire.
|
||||
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute)
|
||||
{
|
||||
hook_p hookp;
|
||||
boolean hooked = false;
|
||||
|
@ -981,14 +983,19 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg)
|
|||
LUA_PushUserdata(gL, &players[target-1], META_PLAYER); // target
|
||||
}
|
||||
lua_pushstring(gL, msg); // msg
|
||||
if (mute)
|
||||
lua_pushboolean(gL, true); // the message was supposed to be eaten by spamprotecc.
|
||||
else
|
||||
lua_pushboolean(gL, false);
|
||||
}
|
||||
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
||||
lua_gettable(gL, LUA_REGISTRYINDEX);
|
||||
lua_pushvalue(gL, -5);
|
||||
lua_pushvalue(gL, -5);
|
||||
lua_pushvalue(gL, -5);
|
||||
lua_pushvalue(gL, -5);
|
||||
if (lua_pcall(gL, 4, 1, 0)) {
|
||||
lua_pushvalue(gL, -6);
|
||||
lua_pushvalue(gL, -6);
|
||||
lua_pushvalue(gL, -6);
|
||||
lua_pushvalue(gL, -6);
|
||||
lua_pushvalue(gL, -6);
|
||||
if (lua_pcall(gL, 5, 1, 0)) {
|
||||
if (!hookp->error || cv_debug & DBG_LUA)
|
||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
||||
lua_pop(gL, 1);
|
||||
|
|
41
src/m_menu.c
41
src/m_menu.c
|
@ -1047,7 +1047,7 @@ static menuitem_t OP_MainMenu[] =
|
|||
{IT_SUBMENU|IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 30},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Sound Options...", &OP_SoundOptionsDef, 40},
|
||||
|
||||
{IT_SUBMENU|IT_STRING, NULL, "HUD Options...", &OP_HUDOptionsDef, 60},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "HUD Options...", &OP_HUDOptionsDef, 60},
|
||||
{IT_STRING|IT_CALL, NULL, "Screenshot Options...", M_ScreenshotOptions, 70},
|
||||
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Gameplay Options...", &OP_GameOptionsDef, 90},
|
||||
|
@ -1334,13 +1334,14 @@ static menuitem_t OP_SoundOptionsMenu[] =
|
|||
|
||||
{IT_STRING|IT_CALL, NULL, "Restart Audio System", M_RestartAudio, 50},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 70},
|
||||
{IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 80},
|
||||
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 65},
|
||||
{IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 75},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Chat sounds", &cv_chatnotifications, 90},
|
||||
{IT_STRING|IT_CVAR, NULL, "Character voices", &cv_kartvoices, 100},
|
||||
{IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 110},
|
||||
|
||||
{IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 130},
|
||||
{IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 125},
|
||||
};
|
||||
|
||||
/*static menuitem_t OP_DataOptionsMenu[] =
|
||||
|
@ -1393,19 +1394,27 @@ static menuitem_t OP_EraseDataMenu[] =
|
|||
|
||||
static menuitem_t OP_HUDOptionsMenu[] =
|
||||
{
|
||||
{IT_STRING | IT_CVAR, NULL, "Show HUD (F3)", &cv_showhud, 10},
|
||||
{IT_STRING | IT_CVAR, NULL, "Show HUD (F3)", &cv_showhud, 10},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
|
||||
NULL, "HUD Visibility", &cv_translucenthud, 20},
|
||||
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
|
||||
NULL, "Minimap Visibility", &cv_kartminimap, 40},
|
||||
{IT_STRING | IT_CVAR, NULL, "Speedometer Display", &cv_kartspeedometer, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 60},
|
||||
NULL, "Minimap Visibility", &cv_kartminimap, 35},
|
||||
{IT_STRING | IT_CVAR, NULL, "Speedometer Display", &cv_kartspeedometer, 45},
|
||||
{IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 55},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Console Color", &cons_backcolor, 80},
|
||||
{IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 90},
|
||||
{IT_STRING | IT_CVAR, NULL, "Menu Highlights", &cons_menuhighlight, 70},
|
||||
// highlight info - (GOOD HIGHLIGHT, WARNING HIGHLIGHT) - 80 (see M_DrawHUDOptions)
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Menu Highlights", &cons_menuhighlight, 110},
|
||||
//{IT_STRING | IT_CVAR, NULL, "Chat mode", &cv_consolechat, 95}, -- will ANYONE who doesn't know how to use the console want to touch this
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
|
||||
NULL, "Chat box width", &cv_chatwidth, 95},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
|
||||
NULL, "Chat box height", &cv_chatheight, 105},
|
||||
{IT_STRING | IT_CVAR, NULL, "Chat fadeout time", &cv_chattime, 115},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Background Color", &cons_backcolor, 130},
|
||||
{IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 140},
|
||||
};
|
||||
|
||||
static menuitem_t OP_GameOptionsMenu[] =
|
||||
|
@ -1420,7 +1429,7 @@ static menuitem_t OP_GameOptionsMenu[] =
|
|||
{IT_STRING | IT_CVAR, NULL, "Exit Countdown Timer", &cv_countdowntime, 80},
|
||||
|
||||
//{IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "Starting Bumpers", &cv_kartbumpers, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "Starting Bumpers", &cv_kartbumpers, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "Karma Comeback", &cv_kartcomeback, 110},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Force Character #", &cv_forceskin, 130},
|
||||
|
@ -1436,14 +1445,14 @@ static menuitem_t OP_ServerOptionsMenu[] =
|
|||
|
||||
{IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 40},
|
||||
{IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Advance to Next Level", &cv_advancemap, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Advance to Next Level", &cv_advancemap, 60},
|
||||
|
||||
#ifndef NONET
|
||||
{IT_STRING | IT_CVAR, NULL, "Max Player Count", &cv_maxplayers, 80},
|
||||
{IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 90},
|
||||
{IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 90},
|
||||
//{IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 100},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 110},
|
||||
#endif
|
||||
};
|
||||
|
@ -8364,7 +8373,7 @@ static void M_DrawHUDOptions(void)
|
|||
const char *str1 = " Warning highlight";
|
||||
const char *str2 = ",";
|
||||
const char *str3 = "Good highlight";
|
||||
INT32 x = BASEVIDWIDTH - currentMenu->x + 2, y = currentMenu->y + 120;
|
||||
INT32 x = BASEVIDWIDTH - currentMenu->x + 2, y = currentMenu->y + 80;
|
||||
INT32 w0 = V_StringWidth(str0, 0), w1 = V_StringWidth(str1, 0), w2 = V_StringWidth(str2, 0), w3 = V_StringWidth(str3, 0);
|
||||
M_DrawGenericMenu();
|
||||
x -= w0;
|
||||
|
|
|
@ -3492,22 +3492,25 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
break;
|
||||
}
|
||||
|
||||
target->reactiontime = 0; // we're awake now...
|
||||
|
||||
if (source && source != target)
|
||||
if (!P_MobjWasRemoved(target))
|
||||
{
|
||||
// if not intent on another player,
|
||||
// chase after this one
|
||||
P_SetTarget(&target->target, source);
|
||||
if (target->state == &states[target->info->spawnstate] && target->info->seestate != S_NULL)
|
||||
target->reactiontime = 0; // we're awake now...
|
||||
|
||||
if (source && source != target)
|
||||
{
|
||||
if (player)
|
||||
// if not intent on another player,
|
||||
// chase after this one
|
||||
P_SetTarget(&target->target, source);
|
||||
if (target->state == &states[target->info->spawnstate] && target->info->seestate != S_NULL)
|
||||
{
|
||||
if (!(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
|
||||
P_SetPlayerMobjState(target, target->info->seestate);
|
||||
if (player)
|
||||
{
|
||||
if (!(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
|
||||
P_SetPlayerMobjState(target, target->info->seestate);
|
||||
}
|
||||
else
|
||||
P_SetMobjState(target, target->info->seestate);
|
||||
}
|
||||
else
|
||||
P_SetMobjState(target, target->info->seestate);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -194,9 +194,9 @@ void P_SpawnSpinMobj(player_t *player, mobjtype_t type);
|
|||
void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range);
|
||||
|
||||
void P_PlayLivesJingle(player_t *player);
|
||||
#define P_PlayRinglossSound(s) S_StartSound(s, (mariomode) ? sfx_mario8 : sfx_altow1 + P_RandomKey(4));
|
||||
#define P_PlayDeathSound(s) S_StartSound(s, sfx_altdi1 + P_RandomKey(4));
|
||||
#define P_PlayVictorySound(s) S_StartSound(s, sfx_victr1 + P_RandomKey(4));
|
||||
void P_PlayRinglossSound(mobj_t *source);
|
||||
void P_PlayDeathSound(mobj_t *source);
|
||||
void P_PlayVictorySound(mobj_t *source);
|
||||
|
||||
|
||||
//
|
||||
|
|
35
src/p_user.c
35
src/p_user.c
|
@ -1118,6 +1118,31 @@ void P_PlayLivesJingle(player_t *player)
|
|||
}
|
||||
}
|
||||
|
||||
void P_PlayRinglossSound(mobj_t *source)
|
||||
{
|
||||
sfxenum_t key = P_RandomKey(4);
|
||||
if (cv_kartvoices.value)
|
||||
S_StartSound(source, (mariomode) ? sfx_mario8 : sfx_altow1 + key);
|
||||
else
|
||||
S_StartSound(source, sfx_slip);
|
||||
}
|
||||
|
||||
void P_PlayDeathSound(mobj_t *source)
|
||||
{
|
||||
sfxenum_t key = P_RandomKey(4);
|
||||
if (cv_kartvoices.value)
|
||||
S_StartSound(source, sfx_altdi1 + key);
|
||||
else
|
||||
S_StartSound(source, sfx_s3k35);
|
||||
}
|
||||
|
||||
void P_PlayVictorySound(mobj_t *source)
|
||||
{
|
||||
sfxenum_t key = P_RandomKey(4);
|
||||
if (cv_kartvoices.value)
|
||||
S_StartSound(source, sfx_victr1 + key);
|
||||
}
|
||||
|
||||
//
|
||||
// P_EndingMusic
|
||||
//
|
||||
|
@ -1722,8 +1747,8 @@ void P_DoPlayerExit(player_t *player)
|
|||
P_EndingMusic(player);
|
||||
|
||||
// SRB2kart 120217
|
||||
if (!countdown2)
|
||||
countdown2 = countdown + 8*TICRATE;
|
||||
//if (!countdown2)
|
||||
//countdown2 = countdown + 8*TICRATE;
|
||||
|
||||
if (P_CheckRacers())
|
||||
player->exiting = (14*TICRATE)/5 + 1;
|
||||
|
@ -9063,6 +9088,12 @@ void P_DoTimeOver(player_t *player)
|
|||
player->lives = 0;
|
||||
|
||||
P_EndingMusic(player);
|
||||
|
||||
#if 0
|
||||
// sal, when you do the f-zero explosion, this is how you make sure the map doesn't end before it's done ^u^ ~toast
|
||||
if (!countdown2)
|
||||
countdown2 = 5*TICRATE;
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
|
151
src/v_video.c
151
src/v_video.c
|
@ -303,7 +303,7 @@ void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT3
|
|||
#endif
|
||||
}
|
||||
|
||||
//static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0};
|
||||
static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0};
|
||||
static UINT8 hudminusalpha[11] = { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5};
|
||||
UINT8 hudtrans = 0;
|
||||
|
||||
|
@ -944,6 +944,129 @@ void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c)
|
|||
}
|
||||
}
|
||||
|
||||
// THANK YOU MPC!!!
|
||||
|
||||
void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
|
||||
{
|
||||
UINT8 *dest;
|
||||
INT32 u, v;
|
||||
UINT32 alphalevel = 0;
|
||||
|
||||
if (rendermode == render_none)
|
||||
return;
|
||||
|
||||
#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 = 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.
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(c & V_NOSCALESTART))
|
||||
{
|
||||
INT32 dupx = vid.dupx, dupy = vid.dupy;
|
||||
|
||||
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
|
||||
{ // Clear the entire screen, from dest to deststop. Yes, this really works.
|
||||
memset(screens[0], (UINT8)(c&255), vid.width * vid.height * vid.bpp);
|
||||
return;
|
||||
}
|
||||
|
||||
x *= dupx;
|
||||
y *= dupy;
|
||||
w *= dupx;
|
||||
h *= dupy;
|
||||
|
||||
// Center it if necessary
|
||||
if (vid.width != BASEVIDWIDTH * dupx)
|
||||
{
|
||||
// dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
|
||||
// so center this imaginary screen
|
||||
if (c & V_SNAPTORIGHT)
|
||||
x += (vid.width - (BASEVIDWIDTH * dupx));
|
||||
else if (!(c & V_SNAPTOLEFT))
|
||||
x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
|
||||
}
|
||||
if (vid.height != BASEVIDHEIGHT * dupy)
|
||||
{
|
||||
// same thing here
|
||||
if (c & V_SNAPTOBOTTOM)
|
||||
y += (vid.height - (BASEVIDHEIGHT * dupy));
|
||||
else if (!(c & V_SNAPTOTOP))
|
||||
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (x >= vid.width || y >= vid.height)
|
||||
return; // off the screen
|
||||
if (x < 0) {
|
||||
w += x;
|
||||
x = 0;
|
||||
}
|
||||
if (y < 0) {
|
||||
h += y;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
if (w <= 0 || h <= 0)
|
||||
return; // zero width/height wouldn't draw anything
|
||||
if (x + w > vid.width)
|
||||
w = vid.width-x;
|
||||
if (y + h > vid.height)
|
||||
h = vid.height-y;
|
||||
|
||||
dest = screens[0] + y*vid.width + x;
|
||||
|
||||
if ((alphalevel = ((c & V_ALPHAMASK) >> V_ALPHASHIFT)))
|
||||
{
|
||||
if (alphalevel == 13)
|
||||
alphalevel = hudminusalpha[cv_translucenthud.value];
|
||||
else if (alphalevel == 14)
|
||||
alphalevel = 10 - cv_translucenthud.value;
|
||||
else if (alphalevel == 15)
|
||||
alphalevel = hudplusalpha[cv_translucenthud.value];
|
||||
|
||||
if (alphalevel >= 10)
|
||||
return; // invis
|
||||
}
|
||||
|
||||
c &= 255;
|
||||
|
||||
if (!alphalevel) {
|
||||
for (v = 0; v < h; v++, dest += vid.width) {
|
||||
for (u = 0; u < w; u++) {
|
||||
dest[u] = consolebgmap[dest[u]];
|
||||
}
|
||||
}
|
||||
} else { // mpc 12-04-2018
|
||||
const UINT8 *fadetable = ((UINT8 *)transtables + ((alphalevel-1)<<FF_TRANSSHIFT) + (c*256));
|
||||
#define clip(x,y) (x>y) ? y : x
|
||||
w = clip(w,vid.width);
|
||||
h = clip(h,vid.height);
|
||||
for (v = 0; v < h; v++, dest += vid.width) {
|
||||
for (u = 0; u < w; u++) {
|
||||
dest[u] = fadetable[consolebgmap[dest[u]]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Fills a box of pixels using a flat texture as a pattern, scaled to screen size.
|
||||
//
|
||||
|
@ -1175,6 +1298,32 @@ void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed)
|
|||
V_DrawScaledPatch(x, y, flags, hu_font[c]);
|
||||
}
|
||||
|
||||
// Writes a single character for the chat. (draw WHITE if bit 7 set)
|
||||
// Essentially the same as the above but it's small or big depending on what resolution you've chosen to huge..
|
||||
//
|
||||
void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap)
|
||||
{
|
||||
INT32 w, flags;
|
||||
//const UINT8 *colormap = V_GetStringColormap(c);
|
||||
|
||||
flags = c & ~(V_CHARCOLORMASK | V_PARAMMASK);
|
||||
c &= 0x7f;
|
||||
if (lowercaseallowed)
|
||||
c -= HU_FONTSTART;
|
||||
else
|
||||
c = toupper(c) - HU_FONTSTART;
|
||||
if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
|
||||
return;
|
||||
|
||||
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)
|
||||
return;
|
||||
|
||||
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.
|
||||
// This is a muuuch better method than V_WORDWRAP.
|
||||
char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)
|
||||
|
|
|
@ -142,6 +142,7 @@ void V_DrawScaledPic (INT32 px1, INT32 py1, INT32 scrn, INT32 lumpnum);
|
|||
|
||||
// fill a box with a single color
|
||||
void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c);
|
||||
void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c);
|
||||
// fill a triangle with a single color
|
||||
void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c);
|
||||
// fill a box with a flat as a pattern
|
||||
|
@ -154,6 +155,8 @@ void V_DrawFadeConsBack(INT32 plines);
|
|||
|
||||
// draw a single character
|
||||
void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed);
|
||||
// draw a single character, but for the chat
|
||||
void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap);
|
||||
const UINT8 *V_GetStringColormap(INT32 colorflags);
|
||||
|
||||
void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string);
|
||||
|
|
|
@ -263,7 +263,6 @@ static void Y_CalculateMatchData(boolean rankingsmode, void (*comparison)(INT32)
|
|||
//
|
||||
void Y_IntermissionDrawer(void)
|
||||
{
|
||||
boolean forcefreeplay = false;
|
||||
INT32 i, whiteplayer = MAXPLAYERS, x = 4, hilicol = V_YELLOWMAP; // fallback
|
||||
|
||||
if (intertype == int_none || rendermode == render_none)
|
||||
|
@ -370,11 +369,7 @@ void Y_IntermissionDrawer(void)
|
|||
if (data.match.rankingsmode)
|
||||
timeheader = "RANK";
|
||||
else
|
||||
{
|
||||
timeheader = (intertype == int_race ? "TIME" : "SCORE");
|
||||
if (data.match.numplayers <= 1)
|
||||
forcefreeplay = true;
|
||||
}
|
||||
|
||||
// draw the level name
|
||||
V_DrawCenteredString(-4 + x + BASEVIDWIDTH/2, 20, 0, data.match.levelstring);
|
||||
|
@ -492,37 +487,16 @@ void Y_IntermissionDrawer(void)
|
|||
}
|
||||
|
||||
dotimer:
|
||||
|
||||
if (netgame) // FREE PLAY?
|
||||
{
|
||||
i = MAXPLAYERS;
|
||||
|
||||
if (!forcefreeplay)
|
||||
{
|
||||
// check to see if there's anyone else at all
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (i == consoleplayer)
|
||||
continue;
|
||||
if (playeringame[i] && !stplyr->spectator)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == MAXPLAYERS)
|
||||
K_drawKartFreePlay(intertic);
|
||||
}
|
||||
|
||||
if (timer)
|
||||
{
|
||||
INT32 tickdown = (timer+1)/TICRATE;
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol|V_SNAPTOBOTTOM,
|
||||
va("start in %d second%s", tickdown, (tickdown == 1 ? "" : "s")));
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol,
|
||||
va("%s in %d", cv_advancemap.string, tickdown));
|
||||
}
|
||||
|
||||
// Make it obvious that scrambling is happening next round.
|
||||
if (cv_scrambleonchange.value && cv_teamscramble.value && (intertic/TICRATE % 2 == 0))
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2, hilicol|V_SNAPTOBOTTOM, M_GetText("Teams will be scrambled next round!"));
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2, hilicol, M_GetText("Teams will be scrambled next round!"));
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -953,11 +927,11 @@ void Y_VoteDrawer(void)
|
|||
if (votetic >= voteendtic && voteendtic != -1)
|
||||
return;
|
||||
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
|
||||
if (!voteclient.loaded)
|
||||
return;
|
||||
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
|
||||
if (widebgpatch && rendermode == render_soft && vid.width / vid.dupx > 320)
|
||||
V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(widebgpatch->width)/2),
|
||||
(vid.height / vid.dupy) - SHORT(widebgpatch->height),
|
||||
|
@ -1155,8 +1129,8 @@ void Y_VoteDrawer(void)
|
|||
hilicol = V_SKYMAP;
|
||||
else //if (gametype == GT_MATCH)
|
||||
hilicol = V_REDMAP;
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol|V_SNAPTOBOTTOM,
|
||||
va("Vote ends in %d second%s", tickdown, (tickdown == 1 ? "" : "s")));
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol,
|
||||
va("Vote ends in %d", tickdown));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue