new map format introduced: 4. format3 player colors are automatically upgraded to ColorRamp
This commit is contained in:
@@ -27,8 +27,8 @@ namespace OpenRA.FileFormats
|
|||||||
public string Race;
|
public string Race;
|
||||||
|
|
||||||
public bool LockColor = false;
|
public bool LockColor = false;
|
||||||
[Obsolete] public Color Color = Color.FromArgb(238,238,238);
|
public Color Color = Color.FromArgb(238,238,238);
|
||||||
[Obsolete] public Color Color2 = Color.FromArgb(44,28,24);
|
public Color Color2 = Color.FromArgb(44,28,24);
|
||||||
public ColorRamp ColorRamp = new ColorRamp(75, 255, 180, 25);
|
public ColorRamp ColorRamp = new ColorRamp(75, 255, 180, 25);
|
||||||
|
|
||||||
public int InitialCash = 0;
|
public int InitialCash = 0;
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ namespace OpenRA
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
case 4:
|
||||||
{
|
{
|
||||||
foreach (var kv in yaml.NodesDict["Players"].NodesDict)
|
foreach (var kv in yaml.NodesDict["Players"].NodesDict)
|
||||||
{
|
{
|
||||||
@@ -170,6 +171,15 @@ namespace OpenRA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Color1/Color2 -> ColorRamp
|
||||||
|
if (MapFormat == 3)
|
||||||
|
foreach (var mp in Players)
|
||||||
|
mp.Value.ColorRamp = new ColorRamp(
|
||||||
|
(byte)((mp.Value.Color.GetHue() / 360.0f) * 255),
|
||||||
|
(byte)(mp.Value.Color.GetSaturation() * 255),
|
||||||
|
(byte)(mp.Value.Color.GetBrightness() * 255),
|
||||||
|
(byte)(mp.Value.Color2.GetBrightness() * 255));
|
||||||
|
|
||||||
// Smudges
|
// Smudges
|
||||||
foreach (var kv in yaml.NodesDict["Smudges"].NodesDict)
|
foreach (var kv in yaml.NodesDict["Smudges"].NodesDict)
|
||||||
{
|
{
|
||||||
@@ -198,7 +208,7 @@ namespace OpenRA
|
|||||||
{
|
{
|
||||||
Console.WriteLine("Saving map to path {0}",toPath);
|
Console.WriteLine("Saving map to path {0}",toPath);
|
||||||
// Todo: save to a zip file in the support dir by default
|
// Todo: save to a zip file in the support dir by default
|
||||||
MapFormat = 3;
|
MapFormat = 4;
|
||||||
|
|
||||||
var root = new List<MiniYamlNode>();
|
var root = new List<MiniYamlNode>();
|
||||||
foreach (var field in new string[] {"Selectable", "MapFormat", "Title", "Description", "Author", "PlayerCount", "Tileset", "MapSize", "TopLeft", "BottomRight", "UseAsShellmap", "Type"})
|
foreach (var field in new string[] {"Selectable", "MapFormat", "Title", "Description", "Author", "PlayerCount", "Tileset", "MapSize", "TopLeft", "BottomRight", "UseAsShellmap", "Type"})
|
||||||
|
|||||||
Reference in New Issue
Block a user