~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to src/engine/ePlayer.cpp

  • Committer: SwagTron
  • Date: 2019-03-05 03:34:38 UTC
  • Revision ID: swagtron-20190305033438-p761k9ev4m2tzse3
- Removed old player_random_color command.
- Removed player_unique_color command.
- Added individual player_random_color commands. To use these commands outside of the menu, use PLAYER_RANDOM_COLOR_ID(1-4)  0 = None, 1 = Random, 2 = Unique
- Added menu item for player_random_color under the RGB items. (Idea by DrAg, Menu item name / location by Nelg)
- Edited the README.txt file in armageronad\win32 a bit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1331
1331
    StoreConfitem(tNEW(tConfItem<int>) (confname,
1332
1332
                                        "$color_r_help",
1333
1333
                                        rgb[0]));
 
1334
 
 
1335
    confname.Clear();
 
1336
    confname << "PLAYER_RANDOM_COLOR_"<< id+1;
 
1337
    colorRandomization=0;
 
1338
    StoreConfitem(tNEW(tConfItem<int>) (confname,
 
1339
                                         "$player_random_color_help",
 
1340
                                         colorRandomization));
1334
1341
    confname.Clear();
1335
1342
#endif
1336
1343
 
8396
8403
}
8397
8404
 
8398
8405
 
8399
 
bool se_randomizeColor = false;
8400
 
static tSettingItem< bool > se_randomizeColorConf( "PLAYER_RANDOM_COLOR", se_randomizeColor );
8401
 
 
8402
 
bool se_uniqueColor = false;
8403
 
static tSettingItem< bool > se_uniqueColorConf( "PLAYER_UNIQUE_COLOR", se_uniqueColor );
8404
 
 
8405
 
 
8406
8406
//This seems more random. Stolen from the old randomize color, but no comparing. Also another bonus, generates multi colored cycle / tails with the limit increase to 32.
8407
8407
static void se_RandomizeColor(ePlayer * l)
8408
8408
{
8598
8598
                p->favoriteNumberOfPlayersPerTeam=ePlayer::PlayerConfig(i)->favoriteNumberOfPlayersPerTeam;
8599
8599
                p->nameTeamAfterMe=ePlayer::PlayerConfig(i)->nameTeamAfterMe;
8600
8600
 
8601
 
                if ( se_randomizeColor )
8602
 
                {
8603
 
                    se_RandomizeColor(local_p);
8604
 
                }
8605
 
 
8606
 
                if ( se_uniqueColor )
8607
 
                {
8608
 
                    se_UniqueColor(local_p,p);
8609
 
                }
 
8601
                //Does the player want color randomization?
 
8602
                switch(ePlayer::PlayerConfig(i)->colorRandomization)
 
8603
                    {
 
8604
                        case COLORRANDOMIZATIONOFF:
 
8605
                            break;
 
8606
                        case COLORRANDOMIZATIONRANDOM:
 
8607
                        se_RandomizeColor(local_p);
 
8608
                            break;
 
8609
                        case COLORRANDOMIZATIONUNIQUE:
 
8610
                        se_UniqueColor(local_p,p);
 
8611
                            break;
 
8612
                        default:
 
8613
                        //Number not in the range of 0-2? Oh well, no color randomization for you.
 
8614
                            break;
 
8615
                    }
8610
8616
 
8611
8617
 
8612
8618
                p->r=ePlayer::PlayerConfig(i)->rgb[0];