From 5fcd240827d5995dbd9824bf747eca128688e064 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 18 Apr 2006 16:30:15 +0000 Subject: [PATCH] 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 --- polymer/eduke32/source/actors.c | 6 +++++- polymer/eduke32/source/config.c | 2 +- polymer/eduke32/source/menus.c | 20 ++++++++++++++++---- polymer/eduke32/source/osdcmds.c | 2 +- polymer/eduke32/source/premap.c | 13 ++++++++++++- 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 7e85243a3..c446ea011 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -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 ) { diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index f3d27f8a0..7182f7c01 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -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) { diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index b33718776..22f02e465 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -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); } diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index 70db53163..c9a405758 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -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) diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 652b9852e..44c98e138 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1218,9 +1218,20 @@ void resetpspritevars(char g) { if(s->pal == 0) { + int k; + + for(k=0;k= 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];