Extension to the get/setuserdef CON commands to support ud.msgdisptime, and support for setting the crosshair's size to either 25% or 50% of the regular size by setting the crosshair value to something greater than 1.

git-svn-id: https://svn.eduke32.com/eduke32@89 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-04-22 07:00:31 +00:00
parent 0df6714942
commit 428bff1b34
8 changed files with 29 additions and 19 deletions

View file

@ -224,7 +224,7 @@ void CONFIG_SetDefaults( void )
ud.detail = 1;
ud.lockout = 0;
ud.pwlockout[0] = '\0';
ud.crosshair = 0;
ud.crosshair = 1;
ud.m_marker = 1;
ud.m_ffire = 1;
ud.levelstats = 0;
@ -250,7 +250,7 @@ void CONFIG_SetDefaults( void )
Bstrcpy(ud.ridecule[9], "AARRRGHHHHH!!!");
// JBF 20031211
memset(KeyboardKeys, 0xff, sizeof(KeyboardKeys));
Bmemset(KeyboardKeys, 0xff, sizeof(KeyboardKeys));
for (i=0; i < (int32)(sizeof(keydefaults)/sizeof(keydefaults[0]))/3; i++) {
f = CONFIG_FunctionNameToNum( keydefaults[3*i+0] );
if (f == -1) continue;
@ -261,7 +261,7 @@ void CONFIG_SetDefaults( void )
KeyboardKeys[f][1] = k2;
}
memset(MouseFunctions, -1, sizeof(MouseFunctions));
Bmemset(MouseFunctions, -1, sizeof(MouseFunctions));
for (i=0; i<MAXMOUSEBUTTONS; i++) {
MouseFunctions[i][0] = CONFIG_FunctionNameToNum( mousedefaults[i] );
@ -270,7 +270,7 @@ void CONFIG_SetDefaults( void )
MouseFunctions[i][1] = CONFIG_FunctionNameToNum( mouseclickeddefaults[i] );
}
memset(MouseDigitalFunctions, -1, sizeof(MouseDigitalFunctions));
Bmemset(MouseDigitalFunctions, -1, sizeof(MouseDigitalFunctions));
for (i=0; i<MAXMOUSEAXES; i++) {
MouseAnalogueScale[i] = 65536;
@ -281,13 +281,13 @@ void CONFIG_SetDefaults( void )
}
CONTROL_SetMouseSensitivity(32768);
memset(JoystickFunctions, -1, sizeof(JoystickFunctions));
Bmemset(JoystickFunctions, -1, sizeof(JoystickFunctions));
for (i=0; i<MAXJOYBUTTONS; i++) {
JoystickFunctions[i][0] = CONFIG_FunctionNameToNum( joystickdefaults[i] );
JoystickFunctions[i][1] = CONFIG_FunctionNameToNum( joystickclickeddefaults[i] );
}
memset(JoystickDigitalFunctions, -1, sizeof(JoystickDigitalFunctions));
Bmemset(JoystickDigitalFunctions, -1, sizeof(JoystickDigitalFunctions));
for (i=0; i<MAXJOYAXES; i++) {
JoystickAnalogueScale[i] = 65536;
JoystickAnalogueDead[i] = 1000;

View file

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

View file

@ -2898,7 +2898,7 @@ void displayrest(long smoothratio)
OnEvent(EVENT_DISPLAYCROSSHAIR, ps[screenpeek].i, screenpeek, -1);
if(GetGameVarID(g_iReturnVarID,ps[screenpeek].i,screenpeek) == 0)
rotatesprite((160L-(ps[myconnectindex].look_ang>>1))<<16,100L<<16,65536L,0,CROSSHAIR,0,0,2+1,windowx1,windowy1,windowx2,windowy2);
rotatesprite((160L-(ps[myconnectindex].look_ang>>1))<<16,100L<<16,ud.crosshair>1?65536L>>(ud.crosshair-1):65536L,0,CROSSHAIR,0,0,2+1,windowx1,windowy1,windowx2,windowy2);
}
if(ps[myconnectindex].gm&MODE_TYPE)
typemode();

View file

@ -800,6 +800,7 @@ LABELS userdefslabels[]= {
{ "brightskins", USERDEFS_BRIGHTSKINS, 0, 0 },
{ "democams", USERDEFS_DEMOCAMS, 0, 0 },
{ "color", USERDEFS_COLOR, 0, 0 },
{ "msgdisptime", USERDEFS_MSGDISPTIME, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST
};

View file

@ -285,7 +285,8 @@ enum userdefslabels {
USERDEFS_WEAPONSWITCH,
USERDEFS_BRIGHTSKINS,
USERDEFS_DEMOCAMS,
USERDEFS_COLOR
USERDEFS_COLOR,
USERDEFS_MSGDISPTIME
};
enum sectorlabels {

View file

@ -611,6 +611,13 @@ void DoUserDef(char bSet, long lVar1, long lLabelID, long lVar2, short sActor, s
SetGameVarID((int)lVar2, ud.color, sActor, sPlayer);
break;
case USERDEFS_MSGDISPTIME:
if(bSet)
ud.msgdisptime = lValue;
else
SetGameVarID((int)lVar2, ud.msgdisptime, sActor, sPlayer);
break;
default:
break;
}

View file

@ -797,7 +797,7 @@ void menus(void)
for(i=0;i<10;i++)
{
if(current_menu == 20005 && i == last_probey) continue;
gametextpal(25,40+(8*i),ud.ridecule[i],MENUHIGHLIGHT(i),0);
gametextpal(25,40+(i<<3),ud.ridecule[i],MENUHIGHLIGHT(i),0);
}
break;

View file

@ -428,6 +428,7 @@ struct cvarmappings {
{ "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 },
{ "cl_autoaim", "cl_autoaim: enable/disable weapon autoaim", (void*)&AutoAim, CVAR_INT|256, 0, 0, 2 },
{ "cl_messagetime", "cl_messagetime: length of time to display multiplayer chat messages\n", (void*)&ud.msgdisptime, CVAR_INT, 0, 0, 3600 },
@ -625,7 +626,7 @@ int registerosdcommands(void)
OSD_RegisterFunction("give","give <all|health|weapons|ammo|armor|keys|inventory>: gives requested item", osdcmd_give);
OSD_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip);
OSD_RegisterFunction("setstatusbarscale","setstatusbarscale <percent>: changes the status bar scale", osdcmd_setstatusbarscale);
OSD_RegisterFunction("cl_statusbarscale","cl_statusbarscale: changes the status bar scale", osdcmd_setstatusbarscale);
OSD_RegisterFunction("sensitivity","sensitivity <value>: changes the mouse sensitivity", osdcmd_sensitivity);
OSD_RegisterFunction("spawn","spawn <picnum> [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",osdcmd_spawn);
OSD_RegisterFunction("setvar","setvar <gamevar> <value>: sets the value of a gamevar", osdcmd_setvar);