Revert "Draw an icon above players when they are typing in chat or console"
This reverts commit da5136c7c1.
This commit is contained in:
1 parent
da5136c7c1
commit
b4d49c565f
8 files changed
-185
No files matched your search
@@ -253,10 +253,7 @@ void D_ProcessEvents(void)
|
||||
#endif
|
||||
|
||||
if (eaten)
|
||||
{
|
||||
hu_keystrokes = true;
|
||||
continue; // ate the event
|
||||
}
|
||||
|
||||
G_Responder(ev);
|
||||
}
|
||||
|
||||
@@ -551,10 +551,6 @@ typedef struct player_s
|
||||
UINT8 hitemvictim;
|
||||
|
||||
UINT8 splitscreenindex;
|
||||
|
||||
UINT8 typing_timer : 4; // Counts down while keystrokes are not emitted
|
||||
UINT8 typing_duration : 6; // How long since resumed timer
|
||||
|
||||
#ifdef HWRENDER
|
||||
fixed_t fovadd; // adjust FOV for hw rendering
|
||||
#endif
|
||||
|
||||
@@ -35,9 +35,6 @@ typedef enum
|
||||
|
||||
// free: 1<<7 to 1<<12
|
||||
|
||||
TICCMD_TYPING = 1<<9, /* chat window or console open */
|
||||
TICCMD_KEYSTROKE = 1<<10,/* chat character input */
|
||||
|
||||
// Lua garbage
|
||||
BT_CUSTOM1 = 1<<13,
|
||||
BT_CUSTOM2 = 1<<14,
|
||||
|
||||
@@ -1191,16 +1191,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||
camspin[forplayer] = (InputDown(gc_lookback, ssplayer) || (usejoystick && axis > 0));
|
||||
}
|
||||
|
||||
if (chat_on || CON_Ready())
|
||||
{
|
||||
cmd->buttons |= TICCMD_TYPING;
|
||||
|
||||
if (hu_keystrokes)
|
||||
{
|
||||
cmd->buttons |= TICCMD_KEYSTROKE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Lua: Allow this hook to overwrite ticcmd.
|
||||
We check if we're actually in a level because for some reason this Hook would run in menus and on the titlescreen otherwise.
|
||||
Be aware that within this hook, nothing but this player's cmd can be edited (otherwise we'd run in some pretty bad synching problems since this is clientsided, or something)
|
||||
@@ -1342,10 +1332,7 @@ boolean G_Responder(event_t *ev)
|
||||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
if (HU_Responder(ev))
|
||||
{
|
||||
hu_keystrokes = true;
|
||||
return true; // chat ate the event
|
||||
}
|
||||
if (AM_Responder(ev))
|
||||
return true; // automap ate it
|
||||
// map the event (key/mouse/joy) to a gamecontrol
|
||||
@@ -1362,10 +1349,7 @@ boolean G_Responder(event_t *ev)
|
||||
else if (gamestate == GS_CUTSCENE)
|
||||
{
|
||||
if (HU_Responder(ev))
|
||||
{
|
||||
hu_keystrokes = true;
|
||||
return true; // chat ate the event
|
||||
}
|
||||
|
||||
if (F_CutsceneResponder(ev))
|
||||
{
|
||||
@@ -1377,10 +1361,7 @@ boolean G_Responder(event_t *ev)
|
||||
else if (gamestate == GS_CREDITS)
|
||||
{
|
||||
if (HU_Responder(ev))
|
||||
{
|
||||
hu_keystrokes = true;
|
||||
return true; // chat ate the event
|
||||
}
|
||||
|
||||
if (F_CreditResponder(ev))
|
||||
{
|
||||
@@ -1400,10 +1381,7 @@ boolean G_Responder(event_t *ev)
|
||||
|
||||
else if (gamestate == GS_INTERMISSION || gamestate == GS_VOTING || gamestate == GS_WAITINGPLAYERS)
|
||||
if (HU_Responder(ev))
|
||||
{
|
||||
hu_keystrokes = true;
|
||||
return true; // chat ate the event
|
||||
}
|
||||
|
||||
// allow spy mode changes even during the demo
|
||||
if (gamestate == GS_LEVEL && ev->type == ev_keydown
|
||||
|
||||
@@ -88,8 +88,6 @@ patch_t *frameslash; // framerate stuff. Used in screen.c
|
||||
|
||||
static player_t *plr;
|
||||
boolean chat_on; // entering a chat message?
|
||||
boolean hu_keystrokes; // :)
|
||||
|
||||
static char w_chat_buf[HU_MAXMSGLEN + 1];
|
||||
static textinput_t w_chat;
|
||||
static boolean headsupactive = false;
|
||||
@@ -1161,8 +1159,6 @@ void HU_Ticker(void)
|
||||
else
|
||||
hu_showscores = false;
|
||||
|
||||
hu_keystrokes = false;
|
||||
|
||||
if (chat_on)
|
||||
{
|
||||
// count down the scroll timer.
|
||||
|
||||
@@ -85,9 +85,6 @@ void HU_AddChatText(const char *text, boolean playsound);
|
||||
// set true when entering a chat message
|
||||
extern boolean chat_on;
|
||||
|
||||
// keystrokes in the console or chat window
|
||||
extern boolean hu_keystrokes;
|
||||
|
||||
extern patch_t *hu_font[HU_FONTSIZE], *kart_font[KART_FONTSIZE], *tny_font[HU_FONTSIZE]; // SRB2kart
|
||||
extern patch_t *tallnum[10];
|
||||
extern patch_t *pingnum[10];
|
||||
|
||||
-115
@@ -7327,9 +7327,6 @@ static patch_t *kp_sadface[2];
|
||||
|
||||
static patch_t *kp_check[6];
|
||||
|
||||
static patch_t *kp_talk;
|
||||
static patch_t *kp_typdot;
|
||||
|
||||
static patch_t *kp_eggnum[4];
|
||||
|
||||
static patch_t *kp_fpview[3];
|
||||
@@ -7642,10 +7639,6 @@ void K_LoadKartHUDGraphics(void)
|
||||
kp_check[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX);
|
||||
}
|
||||
|
||||
// Typing indicator
|
||||
kp_talk = W_CachePatchName("K_TALK", PU_HUDGFX);
|
||||
kp_typdot = W_CachePatchName("K_TYPDOT", PU_HUDGFX);
|
||||
|
||||
// Eggman warning numbers
|
||||
sprintf(buffer, "K_EGGNx");
|
||||
for (i = 0; i < 4; i++)
|
||||
@@ -9385,112 +9378,6 @@ static boolean K_GetScreenCoords(vector2_t *vec, player_t *player, mobj_t *targe
|
||||
return true;
|
||||
}
|
||||
|
||||
static boolean K_DrawTypingDot(fixed_t x, fixed_t y, UINT8 duration, player_t *p, INT32 typeflags)
|
||||
{
|
||||
if (p->typing_duration > duration)
|
||||
{
|
||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, typeflags, kp_typdot, NULL);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static boolean K_DrawTypingNotifier(fixed_t x, fixed_t y, player_t *p, INT32 typeflags)
|
||||
{
|
||||
if (p->cmd.buttons & TICCMD_TYPING)
|
||||
{
|
||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, typeflags, kp_talk, NULL);
|
||||
|
||||
y += 4*FRACUNIT;
|
||||
|
||||
/* spacing closer with the last two looks a better most of the time */
|
||||
(void)
|
||||
(
|
||||
K_DrawTypingDot(x + 3*FRACUNIT, y, 15, p, typeflags) &&
|
||||
K_DrawTypingDot(x + 6*FRACUNIT - FRACUNIT/3, y, 31, p, typeflags) &&
|
||||
K_DrawTypingDot(x + 9*FRACUNIT - FRACUNIT/3, y, 47, p, typeflags)
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void K_DrawTypingStuff(void)
|
||||
{
|
||||
UINT8 i;
|
||||
vector2_t pos = {0};
|
||||
fixed_t typex,typey;
|
||||
int dup = 0;
|
||||
int vflags = 0;
|
||||
int flipped = 0;
|
||||
INT32 hudtransflag = V_LocalTransFlag();
|
||||
boolean flipcam;
|
||||
|
||||
// True if currently viewed player is flipped and has flipcam on
|
||||
flipcam = (stplyr->pflags & PF_FLIPCAM) && (stplyr->mo->eflags & MFE_VERTICALFLIP);
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
fixed_t distance = 0;
|
||||
fixed_t maxdistance = (10*cv_nametagdist.value)* mapobjectscale;
|
||||
flipped = 0;
|
||||
fixed_t z;
|
||||
|
||||
if (i > PLAYERSMASK)
|
||||
continue;
|
||||
if (!players[i].mo || P_MobjWasRemoved(players[i].mo) || players[i].spectator || !playeringame[i])
|
||||
continue;
|
||||
//if (i == displayplayers[stplyrnum])
|
||||
//continue;
|
||||
if (players[i].kartstuff[k_hyudorotimer]) // player is invisible
|
||||
continue;
|
||||
distance = R_PointToDist(players[i].mo->x, players[i].mo->y);
|
||||
if (distance > maxdistance)
|
||||
continue;
|
||||
if (!P_CheckSightFast(stplyr->mo, players[i].mo))
|
||||
continue;
|
||||
|
||||
dup = vid.dupy;
|
||||
|
||||
// If flipcam is on, other player is flipped relative to us when we have different
|
||||
// verticalflip flag value. Otherwise, they are simply flipped when verticalflip flag says
|
||||
// so
|
||||
if (flipcam)
|
||||
flipped = (players[i].mo->eflags & MFE_VERTICALFLIP) != (stplyr->mo->eflags & MFE_VERTICALFLIP);
|
||||
else
|
||||
flipped = players[i].mo->eflags & MFE_VERTICALFLIP;
|
||||
|
||||
z = players[i].mo->height;
|
||||
|
||||
//Saltyhop hehe
|
||||
if (cv_saltyhop.value)
|
||||
z += lerp(players[i].mo->old_spriteyoffset, players[i].mo->spriteyoffset);
|
||||
|
||||
if (!K_GetScreenCoords(&pos, stplyr, players[i].mo, z, false))
|
||||
continue;
|
||||
|
||||
typex = pos.x>>FRACBITS;
|
||||
typey = pos.y>>FRACBITS;
|
||||
|
||||
vflags = hudtransflag | V_NOSCALESTART | V_SPLITSCREEN;
|
||||
|
||||
if (flipped)
|
||||
typey += dup*5;
|
||||
else // small offset
|
||||
typey -= dup*16;
|
||||
|
||||
//Name
|
||||
K_DrawTypingNotifier(typex, typey, &players[i], vflags);
|
||||
}
|
||||
}
|
||||
|
||||
//Slighty fixed by Alug and further rewritten by NepDisk
|
||||
//Decided to port and highly modify sunflower version for the main nametag drawing with additions by NepDisk. My previous one was broken anyway due to the changed screencoords and noscalestart
|
||||
static void K_drawNameTags(void)
|
||||
@@ -10923,8 +10810,6 @@ void K_drawKartHUD(void)
|
||||
K_drawNameTags();
|
||||
}
|
||||
|
||||
K_DrawTypingStuff();
|
||||
|
||||
// If not splitscreen, draw...
|
||||
if (!splitscreen && !demo.title)
|
||||
{
|
||||
|
||||
@@ -4614,37 +4614,6 @@ void P_PlayerThink(player_t *player)
|
||||
player->mo->tracer->flags2 &= ~MF2_DONTDRAW;
|
||||
}*/
|
||||
|
||||
if (cmd->buttons & TICCMD_TYPING)
|
||||
{
|
||||
if (cmd->buttons & TICCMD_KEYSTROKE)
|
||||
{
|
||||
player->typing_timer = 15;
|
||||
}
|
||||
else if (player->typing_timer > 0)
|
||||
{
|
||||
player->typing_timer--;
|
||||
}
|
||||
|
||||
if (player->typing_timer + player->typing_duration > 0)
|
||||
{
|
||||
/* lag a little bit so we always get more than just a singular dot */
|
||||
if (player->typing_timer == 0 &&
|
||||
(player->typing_duration < 16 || player->typing_duration > 39))
|
||||
{
|
||||
player->typing_duration = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->typing_duration++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player->typing_timer = 0;
|
||||
player->typing_duration = 0;
|
||||
}
|
||||
|
||||
player->pflags &= ~PF_SLIDING;
|
||||
|
||||
K_KartPlayerThink(player, cmd); // SRB2kart
|
||||
|
||||
Reference in new issue
Block a user