More player setup stuff; the "map" color was changed to "auto" and the mechanism which determines player colors on map load was modified to avoid choosing colors that other players have manually specified

git-svn-id: https://svn.eduke32.com/eduke32@56 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-04-18 16:30:15 +00:00
parent 4af83bd423
commit 5fcd240827
5 changed files with 35 additions and 8 deletions

View file

@ -4521,7 +4521,11 @@ DETONATEB:
spritesound(DUKE_GET,ps[p].i);
if( ps[p].gotweapon[HANDBOMB_WEAPON] == 0 || s->owner == ps[p].i )
addweapon(&ps[p],HANDBOMB_WEAPON);
{
/* addweapon(&ps[p],HANDBOMB_WEAPON); */
if (!(ps[p].weaponswitch & 1)) addweaponnoswitch(&ps[p],HANDBOMB_WEAPON);
else addweapon( &ps[p],HANDBOMB_WEAPON);
}
if( sprite[s->owner].picnum != APLAYER )
{

View file

@ -591,7 +591,7 @@ void CONFIG_ReadSetup( void )
SCRIPT_GetNumber( scripthandle, "Misc", "DemoCams",&ud.democams);
SCRIPT_GetNumber( scripthandle, "Misc", "ShowFPS",&ud.tickrate);
SCRIPT_GetNumber( scripthandle, "Misc", "Color",&ud.color);
ps[0].palookup = ud.color;
ud.pcolor[0] = ud.color;
dummy = useprecache; SCRIPT_GetNumber( scripthandle, "Misc", "UsePrecache",&dummy); useprecache = dummy != 0;
if(ud.wchoice[0][0] == 0 && ud.wchoice[0][1] == 0)
{

View file

@ -599,12 +599,12 @@ void menus(void)
if (current_menu == 20002) {
x = probe(46,50,20,4);
switch(x) {
case -1:
cmenu(202);
probey = 3;
break;
case 0:
strcpy(buf, myname);
inputloc = strlen(buf);
@ -614,6 +614,7 @@ void menus(void)
KB_ClearKeyDown(sc_kpad_Enter);
KB_FlushKeyboardQueue();
break;
case 2:
AutoAim = (AutoAim == 2) ? 0 : AutoAim+1;
goto player_menu_update;
@ -626,7 +627,7 @@ void menus(void)
case 4:
player_menu_update:
if(numplayers > 1)
if(ud.multimode > 1)
{
// send update
for(l=0;myname[l];l++)
@ -650,6 +651,7 @@ player_menu_update:
buf[l++] = ps[myconnectindex].aim_mode = ud.mouseaiming;
buf[l++] = ps[myconnectindex].auto_aim = AutoAim;
buf[l++] = ps[myconnectindex].weaponswitch = ud.weaponswitch;
buf[l++] = ps[myconnectindex].palookup = ud.pcolor[myconnectindex] = ud.color;
if(sprite[ps[myconnectindex].i].picnum == APLAYER)
sprite[ps[myconnectindex].i].pal = ud.color;
@ -660,6 +662,16 @@ player_menu_update:
if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
}
}
else
{
ps[myconnectindex].aim_mode = ud.mouseaiming;
ps[myconnectindex].auto_aim = AutoAim;
ps[myconnectindex].weaponswitch = ud.weaponswitch;
ps[myconnectindex].palookup = ud.pcolor[myconnectindex] = ud.color;
if(sprite[ps[myconnectindex].i].picnum == APLAYER)
sprite[ps[myconnectindex].i].pal = ud.color;
}
break;
}
} else {
@ -712,8 +724,8 @@ player_menu_update:
if (current_menu == 20002) {
gametext(200,50-9,myname,0,2+8+16); }
{ char *s[] = { "Map","","","Blue","","","","","","","Dark red","Green","Gray","Dark gray","Dark green","Brown",
"Dark blue","","","","","Red","","Yellow","","" };
{ char *s[] = { "Auto","","","Blue","","","","","","","Dk red","Green","Gray","Dk gray","Dk green","Brown",
"Dk blue","","","","","Red","","Yellow","","" };
gametext(200,50+20-9,s[ud.color],0,2+8+16); }
{ char *s[] = { "Off", "Full", "Hitscan" };
gametext(200,50+20+20-9,s[AutoAim],0,2+8+16); }

View file

@ -442,7 +442,7 @@ struct cvarmappings {
{ "showcoords", "showcoords: show your position in the game world", (void*)&ud.coords, CVAR_BOOL, 0 },
{ "useprecache", "useprecache: enable/disable the pre-level caching routine", (void*)&useprecache, CVAR_BOOL, 0 },
{ "drawweapon", "drawweapon: enable/disable weapon drawing", (void*)&ud.drawweapon, CVAR_INT, 0 },
{ "name", "name: change your multiplayer nickname", (void*)&myname[0], CVAR_STRING, sizeof(myname) }
{ "name", "name: change your multiplayer nickname", (void*)&myname[0], CVAR_STRING|128, sizeof(myname) }
};
int osdcmd_cvar_set(const osdfuncparm_t *parm)

View file

@ -1218,9 +1218,20 @@ void resetpspritevars(char g)
{
if(s->pal == 0)
{
int k;
for(k=0;k<MAXPLAYERS-1;k++) {
if(which_palookup == ud.pcolor[k]) {
which_palookup++;
if( which_palookup >= 17 )
which_palookup = 9;
k=0;
}
}
s->pal = ps[j].palookup = which_palookup;
which_palookup++;
if( which_palookup >= 17 ) which_palookup = 9;
if( which_palookup >= 17 )
which_palookup = 9;
}
else ps[j].palookup = s->pal;
} else s->pal = ps[j].palookup = ud.pcolor[j];