- disabled the message entering code.

This needs to be replaced with the game independent ZDoom version and hooked up properly, but it of low priority because it's a multiplayer only feature.
This commit is contained in:
Christoph Oelckers 2019-12-24 13:21:36 +01:00
parent a870df840e
commit 1b9a2f5932
27 changed files with 237 additions and 476 deletions

View file

@ -828,7 +828,6 @@ set (PCH_SOURCES
#common/input/i_joystick.cpp
#common/input/i_input.cpp
common/input/m_joy.cpp
common/input/input.cpp
common/rendering/v_video.cpp
common/rendering/v_framebuffer.cpp

View file

@ -107,14 +107,6 @@ void ctrlGetInput(void)
if (gQuitRequest)
gInput.keyFlags.quit = 1;
if (gGameStarted && gInputMode != kInputMessage
&& buttonMap.ButtonDown(gamefunc_SendMessage))
{
buttonMap.ClearButton(gamefunc_SendMessage);
inputState.keyFlushScans();
gInputMode = kInputMessage;
}
if (buttonMap.ButtonDown(gamefunc_Map_Toggle))
{
buttonMap.ClearButton(gamefunc_Map_Toggle);
@ -365,4 +357,15 @@ void ctrlGetInput(void)
gInput.strafe = strafe;
}
#if 0
if (gGameStarted && gInputMode != kInputMessage
&& buttonMap.ButtonDown(gamefunc_SendMessage))
{
buttonMap.ClearButton(gamefunc_SendMessage);
inputState.keyFlushScans();
gInputMode = kInputMessage;
}
#endif
END_BLD_NS

View file

@ -1,136 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 2010 EDuke32 developers and contributors
This file is part of EDuke32.
EDuke32 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#include "gamecontrol.h"
#include "input.h"
#include "inputstate.h"
char typebuf[TYPEBUFSIZE];
bool mouseInactiveConditional(bool condition)
{
return condition;
}
int32_t I_TextSubmit(void)
{
return
inputState.GetKeyStatus(sc_Enter)
|| inputState.GetKeyStatus(sc_kpad_Enter)
|| inputState.GetKeyStatus(KEY_MOUSE1)
/*|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_A))*/;
}
void I_TextSubmitClear(void)
{
inputState.keyFlushChars();
inputState.ClearKeyStatus(sc_kpad_Enter);
inputState.ClearKeyStatus(sc_Enter);
inputState.ClearKeyStatus(KEY_MOUSE1);
//JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_A);
}
int32_t I_AdvanceTrigger(void)
{
return
I_TextSubmit()
|| inputState.GetKeyStatus(sc_Space);
}
void I_AdvanceTriggerClear(void)
{
I_TextSubmitClear();
inputState.ClearKeyStatus(sc_Space);
}
int32_t I_ReturnTrigger(void)
{
return
inputState.GetKeyStatus(sc_Escape)
|| inputState.GetKeyStatus(KEY_MOUSE2)
/*|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_B))*/;
}
void I_ReturnTriggerClear(void)
{
inputState.keyFlushChars();
inputState.ClearKeyStatus(sc_Escape);
inputState.ClearKeyStatus(KEY_MOUSE2);
//JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_B);
}
int32_t I_EnterText(char *t, int32_t maxlength, int32_t flags)
{
char ch;
int32_t inputloc = strlen(typebuf);
while ((ch = inputState.keyGetChar()) != 0)
{
if (ch == asc_BackSpace)
{
if (inputloc > 0)
{
inputloc--;
*(t+inputloc) = 0;
}
}
else
{
if (ch == asc_Enter)
{
I_AdvanceTriggerClear();
return 1;
}
else if (ch == asc_Escape)
{
I_ReturnTriggerClear();
return -1;
}
else if (ch >= 32 && inputloc < maxlength && ch < 127)
{
if (!(flags & INPUT_NUMERIC) || (ch >= '0' && ch <= '9'))
{
// JBF 20040508: so we can have numeric only if we want
*(t+inputloc) = ch;
*(t+inputloc+1) = 0;
inputloc++;
}
}
}
}
if (I_TextSubmit())
{
I_TextSubmitClear();
return 1;
}
if (I_ReturnTrigger())
{
I_ReturnTriggerClear();
return -1;
}
return 0;
}

View file

@ -1,49 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 2010 EDuke32 developers and contributors
This file is part of EDuke32.
EDuke32 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#ifndef input_h_
#define input_h_
enum {
TYPEBUFSIZE = 141
};
extern char typebuf[TYPEBUFSIZE];
// Advance = Selecting a menu option || Saying "Yes" || Going forward in Help/Credits
// Return = Closing a sub-menu || Saying "No"
// General = Advance + Return = Skipping screens
// Escape = Opening the menu in-game (should not be any gamefuncs)
extern int32_t I_AdvanceTrigger(void);
extern void I_AdvanceTriggerClear(void);
enum EnterTextFlags_t {
INPUT_NUMERIC = 0x00000001,
};
extern int32_t I_EnterText(char *t, int32_t maxlength, int32_t flags);
#endif

View file

@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "duke3d.h"
#include "animlib.h"
#include "compat.h"
#include "input.h"
#include "anim.h"

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "demo.h"
#include "duke3d.h"
#include "input.h"
#include "menus.h"
#include "osdcmds.h"
#include "savegame.h"

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "demo.h"
#include "duke3d.h"
#include "input.h"
#include "menus.h"
#include "savegame.h"
#include "screens.h"
@ -879,13 +879,6 @@ nextdemo_nomenu:
{
ControlInfo noshareinfo;
CONTROL_GetInput(&noshareinfo);
if (buttonMap.ButtonDown(gamefunc_SendMessage))
{
inputState.keyFlushChars();
buttonMap.ClearButton(gamefunc_SendMessage);
g_player[myconnectindex].ps->gm = MODE_TYPE;
typebuf[0] = 0;
}
}
}

View file

@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "savegame.h"
#include "anim.h"
#include "demo.h"
#include "input.h"
#include "colmatch.h"
#include "cheats.h"
#include "sbar.h"
@ -4637,14 +4637,6 @@ void G_HandleLocalKeys(void)
}
else
{
if ((g_netServer || ud.multimode > 1) && buttonMap.ButtonDown(gamefunc_SendMessage))
{
inputState.keyFlushChars();
buttonMap.ClearButton(gamefunc_SendMessage);
myplayer.gm |= MODE_TYPE;
typebuf[0] = 0;
}
if (buttonMap.ButtonDown(gamefunc_Third_Person_View))
{
buttonMap.ClearButton(gamefunc_Third_Person_View);
@ -6431,6 +6423,56 @@ void A_SpawnRandomGlass(int spriteNum, int wallNum, int glassCnt)
}
#endif
#if 0
void GameInterface::SendMessage(const char* msg)
{
if ((g_netServer || ud.multimode > 1) && buttonMap.ButtonDown(gamefunc_SendMessage))
{
inputState.keyFlushChars();
buttonMap.ClearButton(gamefunc_SendMessage);
myplayer.gm |= MODE_TYPE;
typebuf[0] = 0;
}
}
else
{
int32_t const hitstate = I_EnterText(typebuf, 120, 0);
int32_t const y = ud.screen_size > 1 ? (200 - 58) << 16 : (200 - 35) << 16;
int32_t const width = mpgametextsize(typebuf, TEXT_LITERALESCAPE).x;
int32_t const fullwidth = width + textsc((tilesiz[SPINNINGNUKEICON].x << 15) + (2 << 16));
int32_t const text_x = fullwidth >= (320 << 16) ? (320 << 16) - fullwidth : mpgametext_x;
mpgametext(text_x, y, typebuf, 1, 2 | 8 | 16 | ROTATESPRITE_FULL16, 0, TEXT_YCENTER | TEXT_LITERALESCAPE);
int32_t const cursor_x = text_x + width + textsc((tilesiz[SPINNINGNUKEICON].x << 14) + (1 << 16));
rotatesprite_fs(cursor_x, y, textsc(32768), 0, SPINNINGNUKEICON + (((int32_t)totalclock >> 3) % 7),
4 - (sintable[((int32_t)totalclock << 4) & 2047] >> 11), 0, 2 | 8);
if (hitstate == 1)
{
inputState.ClearKeyStatus(sc_Enter);
if (Bstrlen(typebuf) == 0)
{
g_player[myconnectindex].ps->gm &= ~(MODE_TYPE | MODE_SENDTOWHOM);
return;
}
if (cl_automsg)
{
if (SHIFTS_IS_PRESSED)
g_chatPlayer = -1;
else
g_chatPlayer = ud.multimode;
}
g_player[myconnectindex].ps->gm |= MODE_SENDTOWHOM;
}
else if (hitstate == -1)
g_player[myconnectindex].ps->gm &= ~(MODE_TYPE | MODE_SENDTOWHOM);
else
pub = NUMPAGES;
}
#endif
::GameInterface* CreateInterface()
{
return new GameInterface;

View file

@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "colmatch.h"
#include "compat.h"
#include "duke3d.h"
#include "input.h"
#include "menus.h"
#include "osdcmds.h"
#include "savegame.h"

View file

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "demo.h"
#include "duke3d.h"
#include "input.h"
#include "menus.h"
#include "osdcmds.h"
#include "savegame.h"

View file

@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "network.h"
#include "premap.h"
#include "savegame.h"
#include "input.h"
#include "gamecvars.h"
#include "mapinfo.h"
@ -4998,6 +4998,7 @@ void Net_SendClientUpdate(void)
void Net_SendMessage(void)
{
#if 0
if (g_player[myconnectindex].ps->gm & MODE_SENDTOWHOM)
{
int32_t i, j;
@ -5110,42 +5111,7 @@ void Net_SendMessage(void)
}
}
}
else
{
int32_t const hitstate = I_EnterText(typebuf, 120, 0);
int32_t const y = ud.screen_size > 1 ? (200 - 58) << 16 : (200 - 35) << 16;
int32_t const width = mpgametextsize(typebuf, TEXT_LITERALESCAPE).x;
int32_t const fullwidth = width + textsc((tilesiz[SPINNINGNUKEICON].x << 15) + (2 << 16));
int32_t const text_x = fullwidth >= (320 << 16) ? (320 << 16) - fullwidth : mpgametext_x;
mpgametext(text_x, y, typebuf, 1, 2 | 8 | 16 | ROTATESPRITE_FULL16, 0, TEXT_YCENTER | TEXT_LITERALESCAPE);
int32_t const cursor_x = text_x + width + textsc((tilesiz[SPINNINGNUKEICON].x << 14) + (1 << 16));
rotatesprite_fs(cursor_x, y, textsc(32768), 0, SPINNINGNUKEICON + (((int32_t) totalclock >> 3) % 7),
4 - (sintable[((int32_t) totalclock << 4) & 2047] >> 11), 0, 2 | 8);
if (hitstate == 1)
{
inputState.ClearKeyStatus(sc_Enter);
if (Bstrlen(typebuf) == 0)
{
g_player[myconnectindex].ps->gm &= ~(MODE_TYPE | MODE_SENDTOWHOM);
return;
}
if (cl_automsg)
{
if (SHIFTS_IS_PRESSED)
g_chatPlayer = -1;
else
g_chatPlayer = ud.multimode;
}
g_player[myconnectindex].ps->gm |= MODE_SENDTOWHOM;
}
else if (hitstate == -1)
g_player[myconnectindex].ps->gm &= ~(MODE_TYPE | MODE_SENDTOWHOM);
else
pub = NUMPAGES;
}
#endif
}

View file

@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "demo.h"
#include "duke3d.h"
#include "input.h"
#include "mdsprite.h"
#include "sbar.h"
#include "screens.h"

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define sector_c_
#include "duke3d.h"
#include "input.h"
#include "printf.h"
#include "secrets.h"

View file

@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "duke3d.h"
#include "animlib.h"
#include "compat.h"
#include "input.h"
#include "anim.h"

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "demo.h"
#include "duke3d.h"
#include "input.h"
#include "menus.h"
#include "osdcmds.h"
#include "savegame.h"

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "demo.h"
#include "duke3d.h"
#include "input.h"
#include "menus.h"
#include "savegame.h"
#include "screens.h"
@ -884,13 +884,6 @@ nextdemo_nomenu:
{
ControlInfo noshareinfo;
CONTROL_GetInput(&noshareinfo);
if (buttonMap.ButtonDown(gamefunc_SendMessage))
{
inputState.keyFlushChars();
buttonMap.ClearButton(gamefunc_SendMessage);
g_player[myconnectindex].ps->gm = MODE_TYPE;
typebuf[0] = 0;
}
}
}

View file

@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "savegame.h"
#include "anim.h"
#include "demo.h"
#include "input.h"
#include "colmatch.h"
#include "cheats.h"
#include "sbar.h"
@ -6190,15 +6190,6 @@ void G_HandleLocalKeys(void)
}
else
{
if ((g_netServer || ud.multimode > 1) && buttonMap.ButtonDown(gamefunc_SendMessage))
{
inputState.keyFlushChars();
buttonMap.ClearButton(gamefunc_SendMessage);
g_player[myconnectindex].ps->gm |= MODE_TYPE;
typebuf[0] = 0;
}
if (buttonMap.ButtonDown(gamefunc_Third_Person_View))
{
buttonMap.ClearButton(gamefunc_Third_Person_View);

View file

@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "duke3d.h"
#include "anim.h"
#include "input.h"
#include "menus.h"
#include "osdcmds.h"
#include "savegame.h"

View file

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "osdcmds.h"
#include "savegame.h"
#include "demo.h"
#include "input.h"
#include "menus.h"
#include "cheats.h"
#include "gamecvars.h"

View file

@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "net.h"
#include "premap.h"
#include "savegame.h"
#include "input.h"
#include "m_crc32.h"
#include "mapinfo.h"
@ -3188,7 +3188,7 @@ void Net_ReceiveUserMapName(uint8_t *pbuf, int32_t packbufleng)
void Net_SendMessage(void)
{
#if 0
if (g_player[myconnectindex].ps->gm&MODE_SENDTOWHOM)
{
int32_t i, j;
@ -3299,40 +3299,7 @@ void Net_SendMessage(void)
}
}
}
else
{
#define MAXCHATLENGTH 120
EDUKE32_STATIC_ASSERT(MAXCHATLENGTH < TYPEBUFSIZE);
int32_t const hitstate = I_EnterText(typebuf, MAXCHATLENGTH, 0);
int32_t const y = ud.screen_size > 1 ? (200-58)<<16 : (200-35)<<16;
int32_t const width = mpgametextsize(typebuf, TEXT_LITERALESCAPE).x;
int32_t const fullwidth = width + textsc((tilesiz[SPINNINGNUKEICON].x<<15)+(2<<16));
int32_t const text_x = fullwidth >= (320<<16) ? (320<<16) - fullwidth : mpgametext_x;
mpgametext(text_x, y, typebuf, 1, 2|8|16|ROTATESPRITE_FULL16, 0, TEXT_YCENTER|TEXT_LITERALESCAPE);
int32_t const cursor_x = text_x + width + textsc((tilesiz[SPINNINGNUKEICON].x<<14)+(1<<16));
rotatesprite_fs(cursor_x, y, textsc(32768), 0, SPINNINGNUKEICON+(((int32_t) totalclock>>3)%7), 4-(sintable[((int32_t) totalclock<<4)&2047]>>11), 0, 2|8);
if (hitstate == 1)
{
inputState.ClearKeyStatus(sc_Enter);
if (Bstrlen(typebuf) == 0)
{
g_player[myconnectindex].ps->gm &= ~(MODE_TYPE|MODE_SENDTOWHOM);
return;
}
if (cl_automsg)
{
if (SHIFTS_IS_PRESSED) g_chatPlayer = -1;
else g_chatPlayer = ud.multimode;
}
g_player[myconnectindex].ps->gm |= MODE_SENDTOWHOM;
}
else if (hitstate == -1)
g_player[myconnectindex].ps->gm &= ~(MODE_TYPE|MODE_SENDTOWHOM);
else pub = NUMPAGES;
}
#endif
}
void Net_ReceiveMessage(uint8_t *pbuf, int32_t packbufleng)

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "screens.h"
#include "colmatch.h"
#include "input.h"
#include "anim.h"
#include "sbar.h"
#include "menus.h"

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define sector_c_
#include "duke3d.h"
#include "input.h"
#include "secrets.h"
BEGIN_RR_NS

View file

@ -42,7 +42,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "animlib.h"
#include "anim.h"
#include "input.h"
#include "common_game.h"

View file

@ -60,7 +60,7 @@ Things required to make savegames work:
#include "lists.h"
#include "network.h"
#include "pal.h"
#include "input.h"
#include "mytypes.h"
//#include "config.h"
@ -3121,160 +3121,6 @@ void PauseKey(PLAYERp pp)
}
}
void GetMessageInput(PLAYERp pp)
{
int pnum = myconnectindex;
short w,h;
static SWBOOL cur_show;
static SWBOOL TeamSendAll, TeamSendTeam;
#define TEAM_MENU "A - Send to ALL, T - Send to TEAM"
static char HoldMessageInputString[256];
int i;
if (!MessageInputMode && !ConInputMode)
{
if (buttonMap.ButtonDown(gamefunc_SendMessage))
{
buttonMap.ClearButton(gamefunc_SendMessage);
inputState.keyFlushChars();
MessageInputMode = TRUE;
InputMode = TRUE;
TeamSendTeam = FALSE;
TeamSendAll = FALSE;
if (MessageInputMode)
{
memset(MessageInputString, '\0', sizeof(MessageInputString));
}
}
}
#if 0 // the message input needs to be moved out of the game code!
else if (MessageInputMode && !ConInputMode)
{
if (gs.BorderNum > BORDER_BAR+1)
SetRedrawScreen(pp);
// get input
switch (MNU_InputSmallString(MessageInputString, 320-20))
{
case -1: // Cancel Input (pressed ESC) or Err
MessageInputMode = FALSE;
InputMode = FALSE;
inputState.ClearKeysDown();
inputState.keyFlushChars();
break;
case FALSE: // Input finished (RETURN)
if (MessageInputString[0] == '\0')
{
// no input
MessageInputMode = FALSE;
InputMode = FALSE;
inputState.ClearKeysDown();
inputState.keyFlushChars();
buttonMap.ClearButton(gamefunc_Inventory);
}
else
{
if (gNet.TeamPlay)
{
if (memcmp(MessageInputString, TEAM_MENU, sizeof(TEAM_MENU)) != 0)
{
// see if its a command
if (IsCommand(MessageInputString))
{
TeamSendAll = TRUE;
}
else
{
strcpy(HoldMessageInputString, MessageInputString);
strcpy(MessageInputString, TEAM_MENU);
break;
}
}
else if (memcmp(MessageInputString, TEAM_MENU, sizeof(TEAM_MENU)) == 0)
{
strcpy(MessageInputString, HoldMessageInputString);
TeamSendAll = TRUE;
}
}
SEND_MESSAGE:
// broadcast message
MessageInputMode = FALSE;
InputMode = FALSE;
inputState.ClearKeysDown();
inputState.keyFlushChars();
buttonMap.ClearButton(gamefunc_Inventory);
CON_ProcessUserCommand(); // Check to see if it's a cheat or command
for (i = 0; i < NUMGAMEFUNCTIONS; i++)
buttonMap.ClearButton(i);
// Put who sent this
sprintf(ds,"%s: %s",pp->PlayerName,MessageInputString);
if (gNet.TeamPlay)
{
TRAVERSE_CONNECT(pnum)
{
if (pnum != myconnectindex)
{
if (TeamSendAll)
SW_SendMessage(pnum, ds);
else if (User[pp->PlayerSprite]->spal == User[Player[pnum].PlayerSprite]->spal)
SW_SendMessage(pnum, ds);
}
}
}
else
TRAVERSE_CONNECT(pnum)
{
if (pnum != myconnectindex)
{
SW_SendMessage(pnum, ds);
}
}
adduserquote(MessageInputString);
quotebot += 8;
quotebotgoal = quotebot;
}
break;
case TRUE: // Got input
if (gNet.TeamPlay)
{
if (memcmp(MessageInputString, TEAM_MENU "a", sizeof(TEAM_MENU)+1) == 0)
{
strcpy(MessageInputString, HoldMessageInputString);
TeamSendAll = TRUE;
goto SEND_MESSAGE;
}
else if (memcmp(MessageInputString, TEAM_MENU "t", sizeof(TEAM_MENU)+1) == 0)
{
strcpy(MessageInputString, HoldMessageInputString);
TeamSendTeam = TRUE;
goto SEND_MESSAGE;
}
else
{
// reset the string if anything else is typed
if (strlen(MessageInputString)+1 > sizeof(TEAM_MENU))
{
strcpy(MessageInputString, TEAM_MENU);
}
}
}
break;
}
}
#endif
}
short MirrorDelay;
void getinput(SW_PACKET *loc)
@ -3344,11 +3190,6 @@ void getinput(SW_PACKET *loc)
if (PauseKeySet)
return;
if (!M_Active())
{
GetMessageInput(pp);
}
// MAP KEY
if (buttonMap.ButtonDown(gamefunc_Map))
{
@ -4194,6 +4035,157 @@ GameStats GameInterface::getStats()
return { pp->Kills, TotalKillable, pp->SecretsFound, LevelSecrets, PlayClock / 120, 0 };
}
#if 0 // the message input needs to be moved out of the game code!
void GetMessageInput(PLAYERp pp)
{
int pnum = myconnectindex;
short w, h;
static SWBOOL cur_show;
static SWBOOL TeamSendAll, TeamSendTeam;
#define TEAM_MENU "A - Send to ALL, T - Send to TEAM"
static char HoldMessageInputString[256];
int i;
if (!MessageInputMode && !ConInputMode)
{
if (buttonMap.ButtonDown(gamefunc_SendMessage))
{
buttonMap.ClearButton(gamefunc_SendMessage);
inputState.keyFlushChars();
MessageInputMode = TRUE;
InputMode = TRUE;
TeamSendTeam = FALSE;
TeamSendAll = FALSE;
if (MessageInputMode)
{
memset(MessageInputString, '\0', sizeof(MessageInputString));
}
}
}
else if (MessageInputMode && !ConInputMode)
{
if (gs.BorderNum > BORDER_BAR + 1)
SetRedrawScreen(pp);
// get input
switch (MNU_InputSmallString(MessageInputString, 320 - 20))
{
case -1: // Cancel Input (pressed ESC) or Err
MessageInputMode = FALSE;
InputMode = FALSE;
inputState.ClearKeysDown();
inputState.keyFlushChars();
break;
case FALSE: // Input finished (RETURN)
if (MessageInputString[0] == '\0')
{
// no input
MessageInputMode = FALSE;
InputMode = FALSE;
inputState.ClearKeysDown();
inputState.keyFlushChars();
buttonMap.ClearButton(gamefunc_Inventory);
}
else
{
if (gNet.TeamPlay)
{
if (memcmp(MessageInputString, TEAM_MENU, sizeof(TEAM_MENU)) != 0)
{
// see if its a command
if (IsCommand(MessageInputString))
{
TeamSendAll = TRUE;
}
else
{
strcpy(HoldMessageInputString, MessageInputString);
strcpy(MessageInputString, TEAM_MENU);
break;
}
}
else if (memcmp(MessageInputString, TEAM_MENU, sizeof(TEAM_MENU)) == 0)
{
strcpy(MessageInputString, HoldMessageInputString);
TeamSendAll = TRUE;
}
}
SEND_MESSAGE:
// broadcast message
MessageInputMode = FALSE;
InputMode = FALSE;
inputState.ClearKeysDown();
inputState.keyFlushChars();
buttonMap.ClearButton(gamefunc_Inventory);
CON_ProcessUserCommand(); // Check to see if it's a cheat or command
for (i = 0; i < NUMGAMEFUNCTIONS; i++)
buttonMap.ClearButton(i);
// Put who sent this
sprintf(ds, "%s: %s", pp->PlayerName, MessageInputString);
if (gNet.TeamPlay)
{
TRAVERSE_CONNECT(pnum)
{
if (pnum != myconnectindex)
{
if (TeamSendAll)
SW_SendMessage(pnum, ds);
else if (User[pp->PlayerSprite]->spal == User[Player[pnum].PlayerSprite]->spal)
SW_SendMessage(pnum, ds);
}
}
}
else
TRAVERSE_CONNECT(pnum)
{
if (pnum != myconnectindex)
{
SW_SendMessage(pnum, ds);
}
}
adduserquote(MessageInputString);
quotebot += 8;
quotebotgoal = quotebot;
}
break;
case TRUE: // Got input
if (gNet.TeamPlay)
{
if (memcmp(MessageInputString, TEAM_MENU "a", sizeof(TEAM_MENU) + 1) == 0)
{
strcpy(MessageInputString, HoldMessageInputString);
TeamSendAll = TRUE;
goto SEND_MESSAGE;
}
else if (memcmp(MessageInputString, TEAM_MENU "t", sizeof(TEAM_MENU) + 1) == 0)
{
strcpy(MessageInputString, HoldMessageInputString);
TeamSendTeam = TRUE;
goto SEND_MESSAGE;
}
else
{
// reset the string if anything else is typed
if (strlen(MessageInputString) + 1 > sizeof(TEAM_MENU))
{
strcpy(MessageInputString, TEAM_MENU);
}
}
}
break;
}
}
}
#endif
END_SW_NS

View file

@ -42,7 +42,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "sw_strs.h"
#include "pal.h"
#include "demo.h"
#include "input.h"
#include "keydef.h"
#include "gamecontrol.h"