Add an option to automatically send messages to all players instead of prompting; shift bypasses this behavior. I've also added a few more cvars and whatnot.

git-svn-id: https://svn.eduke32.com/eduke32@150 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-05-05 01:20:19 +00:00
parent c26cc6fad6
commit 1409799e0e
8 changed files with 87 additions and 54 deletions

View file

@ -236,6 +236,7 @@ void CONFIG_SetDefaults( void )
ud.brightness = 16;
ud.statusbarmode = 0;
ud.autovote = 0;
ud.automsg = 0;
ShowOpponentWeapons = 0;
Bstrcpy(ud.rtsname, "DUKE.RTS");
@ -616,6 +617,7 @@ void CONFIG_ReadSetup( void )
SCRIPT_GetNumber( scripthandle, "Misc", "MPMessageDisplayTime",&ud.msgdisptime);
SCRIPT_GetNumber( scripthandle, "Misc", "StatusBarMode",&ud.statusbarmode);
SCRIPT_GetNumber( scripthandle, "Misc", "AutoVote",&ud.autovote);
SCRIPT_GetNumber( scripthandle, "Misc", "AutoMsg",&ud.automsg);
dummy = useprecache; SCRIPT_GetNumber( scripthandle, "Misc", "UsePrecache",&dummy); useprecache = dummy != 0;
@ -698,58 +700,63 @@ void CONFIG_WriteSetup( void )
if (scripthandle < 0)
scripthandle = SCRIPT_Init(setupfilename);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Shadows",ud.shadows,false,false);
SCRIPT_PutString( scripthandle, "Screen Setup", "Password",ud.pwlockout);
SCRIPT_PutNumber( scripthandle, "Controls","AimingFlag",(long) myaimmode,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","AutoAim",AutoAim,false,false);
// SCRIPT_PutNumber( scripthandle, "Controls","GameMouseAiming",(int32) ps[myconnectindex].aim_mode,false,false);
SCRIPT_PutNumber( scripthandle, "Controls", "MouseAimingFlipped",ud.mouseflip,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","MouseAiming",ud.mouseaiming,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "AutoMsg",ud.automsg,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "AutoVote",ud.autovote,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "BrightSkins",ud.brightskins,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "Color",ud.color,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "Crosshairs",ud.crosshair,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "DemoCams",ud.democams,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "Executions",ud.executions,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "MPMessageDisplayTime",ud.msgdisptime,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "RunMode",RunMode,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "ShowFPS",ud.tickrate,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "ShowLevelStats",ud.levelstats,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "ShowOpponentWeapons",ShowOpponentWeapons,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "ShowViewWeapon",ud.drawweapon,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "StatusBarMode",ud.statusbarmode,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "StatusBarScale",ud.statusbarscale,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "UsePrecache",useprecache,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Detail",ud.detail,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Tilt",ud.screen_tilting,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Messages",ud.fta_on,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Out",ud.lockout,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenWidth",ScreenWidth,false,false); // JBF 20031206
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenHeight",ScreenHeight,false,false); // JBF 20031206
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenMode",ScreenMode,false,false); // JBF 20031206
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenBPP",ScreenBPP,false,false); // JBF 20040523
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLRatioCorrection",glratiocorrection,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCacheCompression", glusetexcachecompression,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,false,false);
#ifdef RENDERTYPEWIN
SCRIPT_PutNumber( scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false);
#endif
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLRatioCorrection",glratiocorrection,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCacheCompression", glusetexcachecompression,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "UseModels",usemodels,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Messages",ud.fta_on,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Out",ud.lockout,false,false);
SCRIPT_PutString( scripthandle, "Screen Setup", "Password",ud.pwlockout);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenBPP",ScreenBPP,false,false); // JBF 20040523
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenGamma",ud.brightness,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenHeight",ScreenHeight,false,false); // JBF 20031206
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenMode",ScreenMode,false,false); // JBF 20031206
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenSize",ud.screen_size,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenWidth",ScreenWidth,false,false); // JBF 20031206
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Shadows",ud.shadows,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Tilt",ud.screen_tilting,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "UseHightile",usehightile,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "UseModels",usemodels,false,false);
SCRIPT_PutNumber( scripthandle, "Sound Setup", "AmbienceToggle",AmbienceToggle,false,false);
SCRIPT_PutNumber( scripthandle, "Sound Setup", "FXVolume",FXVolume,false,false);
SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicToggle",MusicToggle,false,false);
SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicVolume",MusicVolume,false,false);
SCRIPT_PutNumber( scripthandle, "Sound Setup", "ReverseStereo",ReverseStereo,false,false);
SCRIPT_PutNumber( scripthandle, "Sound Setup", "SoundToggle",SoundToggle,false,false);
SCRIPT_PutNumber( scripthandle, "Sound Setup", "VoiceToggle",VoiceToggle,false,false);
SCRIPT_PutNumber( scripthandle, "Sound Setup", "AmbienceToggle",AmbienceToggle,false,false);
SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicToggle",MusicToggle,false,false);
SCRIPT_PutNumber( scripthandle, "Sound Setup", "ReverseStereo",ReverseStereo,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenSize",ud.screen_size,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenGamma",ud.brightness,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "Executions",ud.executions,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "RunMode",RunMode,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "Crosshairs",ud.crosshair,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "ShowLevelStats",ud.levelstats,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "StatusBarScale",ud.statusbarscale,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "ShowOpponentWeapons",ShowOpponentWeapons,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "UsePrecache",useprecache,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "ShowViewWeapon",ud.drawweapon,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "BrightSkins",ud.brightskins,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "DemoCams",ud.democams,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "ShowFPS",ud.tickrate,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "Color",ud.color,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "MPMessageDisplayTime",ud.msgdisptime,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "StatusBarMode",ud.statusbarmode,false,false);
SCRIPT_PutNumber( scripthandle, "Misc", "AutoVote",ud.autovote,false,false);
SCRIPT_PutNumber( scripthandle, "Controls", "MouseAimingFlipped",ud.mouseflip,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","MouseAiming",ud.mouseaiming,false,false);
//SCRIPT_PutNumber( scripthandle, "Controls","GameMouseAiming",(int32) ps[myconnectindex].aim_mode,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","AimingFlag",(long) myaimmode,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","AutoAim",AutoAim,false,false);
SCRIPT_PutNumber( scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,false,false);
// JBF 20031211
for(dummy=0;dummy<NUMGAMEFUNCTIONS;dummy++) {

View file

@ -340,7 +340,7 @@ struct user_defs {
int32 runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125
int32 brightskins,democams,color,pcolor[MAXPLAYERS],msgdisptime,statusbarmode;
int32 m_noexits,noexits,autovote;
int32 m_noexits,noexits,autovote,automsg;
int32 entered_name,screen_tilting,shadows,fta_on,executions,auto_run;
int32 coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair;

View file

@ -2433,6 +2433,11 @@ void typemode(void)
if(hitstate == 1)
{
KB_ClearKeyDown(sc_Enter);
if(ud.automsg)
{
if(SHIFTS_IS_PRESSED) sendmessagecommand = -1;
else sendmessagecommand = ud.multimode;
}
ps[myconnectindex].gm |= MODE_SENDTOWHOM;
}
else if(hitstate == -1)

View file

@ -806,6 +806,7 @@ LABELS userdefslabels[]= {
{ "m_noexits", USERDEFS_M_NOEXITS, 0, 0 },
{ "noexits", USERDEFS_NOEXITS, 0, 0 },
{ "autovote", USERDEFS_AUTOVOTE, 0, 0 },
{ "automsg", USERDEFS_AUTOMSG, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST
};

View file

@ -288,7 +288,8 @@ enum userdefslabels {
USERDEFS_STATUSBARMODE,
USERDEFS_M_NOEXITS,
USERDEFS_NOEXITS,
USERDEFS_AUTOVOTE
USERDEFS_AUTOVOTE,
USERDEFS_AUTOMSG
};
enum sectorlabels {

View file

@ -645,6 +645,13 @@ void DoUserDef(char bSet, long lLabelID, long lVar2, short sActor, short sPlayer
SetGameVarID((int)lVar2, ud.autovote, sActor, sPlayer);
break;
case USERDEFS_AUTOMSG:
if(bSet)
ud.automsg = lValue;
else
SetGameVarID((int)lVar2, ud.automsg, sActor, sPlayer);
break;
default:
break;
}

View file

@ -2304,8 +2304,7 @@ cheat_for_port_credits:
"FPS counter",
"-",
"Automatic voting",
"-",
"-",
"Send MP messages to all",
"-",
"-",
"-",
@ -2361,7 +2360,10 @@ cheat_for_port_credits:
modval(0,2,(int *)&ud.autovote,1,probey==io);
{ char *s[] = { "Off", "Vote No", "Vote Yes" };
gametextpal(d,yy, s[ud.autovote], MENUHIGHLIGHT(io), 0); break; }
case 4: if (x==io) cmenu(200); break;
case 4: if (x==io) ud.automsg = 1-ud.automsg;
modval(0,1,(int *)&ud.automsg,1,probey==io);
gametextpal(d,yy, ud.automsg ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 5: if (x==io) cmenu(200); break;
default: break;
}
gametextpal(c,yy, opts[ii], enabled?MENUHIGHLIGHT(io):15, 2);

View file

@ -434,15 +434,25 @@ struct cvarmappings {
int max;
} cvar[] =
{
{ "cl_showfps", "cl_showfps: show the frame rate counter", (void*)&ud.tickrate, CVAR_BOOL, 0, 0, 1 },
{ "cl_showcoords", "cl_showcoords: show your position in the game world", (void*)&ud.coords, CVAR_BOOL, 0, 0, 1 },
{ "r_precache", "r_precache: enable/disable the pre-level caching routine", (void*)&useprecache, CVAR_BOOL, 0, 0, 1 },
{ "cl_drawweapon", "cl_drawweapon: enable/disable weapon drawing", (void*)&ud.drawweapon, CVAR_INT, 0, 0, 2 },
{ "crosshair", "crosshair: enable/disable crosshair", (void*)&ud.crosshair, CVAR_INT, 0, 0, 3 },
{ "cl_weaponswitch", "cl_weaponswitch: enable/disable auto weapon switching", (void*)&ud.weaponswitch, CVAR_INT|256, 0, 0, 3 },
{ "name", "name: change your multiplayer nickname", (void*)&myname[0], CVAR_STRING|256, 11, 0, 0 },
{ "cl_autoaim", "cl_autoaim: enable/disable weapon autoaim", (void*)&AutoAim, CVAR_INT|256, 0, 0, 2 },
{ "cl_automsg", "cl_automsg: enable/disable automatically sending messages to all players", (void*)&ud.automsg, CVAR_BOOL, 0, 0, 1 },
{ "cl_autovote", "cl_autovote: enable/disable automatic voting", (void*)&ud.autovote, CVAR_INT|256, 0, 0, 2 },
{ "cl_democams", "cl_democams: enable/disable demo playback cameras", (void*)&ud.democams, CVAR_BOOL, 0, 0, 1 },
{ "cl_drawweapon", "cl_drawweapon: enable/disable weapon drawing", (void*)&ud.drawweapon, CVAR_INT, 0, 0, 2 },
{ "cl_messagetime", "cl_messagetime: length of time to display multiplayer chat messages\n", (void*)&ud.msgdisptime, CVAR_INT, 0, 0, 3600 },
{ "name", "name: change your multiplayer nickname", (void*)&myname[0], CVAR_STRING|256, 11, 0, 0 }
{ "cl_showcoords", "cl_showcoords: show your position in the game world", (void*)&ud.coords, CVAR_BOOL, 0, 0, 1 },
{ "cl_showfps", "cl_showfps: show the frame rate counter", (void*)&ud.tickrate, CVAR_BOOL, 0, 0, 1 },
{ "cl_weaponswitch", "cl_weaponswitch: enable/disable auto weapon switching", (void*)&ud.weaponswitch, CVAR_INT|256, 0, 0, 3 },
{ "r_brightskins", "r_brightskins: enable/disable bright players", (void*)&ud.brightskins, CVAR_BOOL, 0, 0, 1 },
{ "r_precache", "r_precache: enable/disable the pre-level caching routine", (void*)&useprecache, CVAR_BOOL, 0, 0, 1 }
};
int osdcmd_cvar_set(const osdfuncparm_t *parm)