Files
OpenRA/OpenRA.FileFormats/Map/PlayerReference.cs
Paul Chote 656476991f Replace ColorRamp with HSLColor everywhere.
Fixes:
* Nuclear-purple color exploit.
* #3247.
* Removes a bunch of unnecessary color conversions every frame.

Caveats:
* The ramp range is now defined on the palette, so ramps can no longer be set per-player (may impact maps which define custom colors).
* It's no longer possible to perfectly recreate the original WW color ramps (I doubt we care).
* The old ColorRamp setting isn't migrated, so players will lose their color settings.
2013-05-10 19:23:30 +12:00

52 lines
1.3 KiB
C#

#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Drawing;
using System;
namespace OpenRA.FileFormats
{
public class PlayerReference
{
public string Name;
public string Palette;
public bool OwnsWorld = false;
public bool NonCombatant = false;
public bool Playable = false;
public string Bot = null;
public bool DefaultStartingUnits = false;
public bool AllowBots = true;
public bool Required = false;
public bool LockRace = false;
public string Race;
// ColorRamp naming retained for backward compatibility
public bool LockColor = false;
public HSLColor ColorRamp = new HSLColor(0,0,238);
public HSLColor Color { get { return ColorRamp; } set { ColorRamp = value; }}
public bool LockSpawn = false;
public int Spawn = 0;
public bool LockTeam = false;
public int Team = 0;
public int InitialCash = 0;
public string[] Allies = {};
public string[] Enemies = {};
public PlayerReference() {}
public PlayerReference(MiniYaml my) { FieldLoader.Load(this, my); }
public override string ToString() { return Name; }
}
}