Add a news panel to each mod
This commit is contained in:
@@ -356,6 +356,14 @@ namespace OpenRA
|
||||
return fieldType.GetConstructor(new[] { innerType }).Invoke(new[] { innerValue });
|
||||
}
|
||||
|
||||
else if (fieldType == typeof(DateTime))
|
||||
{
|
||||
DateTime dt;
|
||||
if (DateTime.TryParseExact(value, "yyyy-MM-dd HH-mm-ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out dt))
|
||||
return dt;
|
||||
return InvalidValueAction(value, fieldType, fieldName);
|
||||
}
|
||||
|
||||
UnknownFieldAction("[Type] {0}".F(value), fieldType);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -82,6 +82,9 @@ namespace OpenRA
|
||||
return elems.JoinWith(",");
|
||||
}
|
||||
|
||||
if (t == typeof(DateTime))
|
||||
return ((DateTime)v).ToString("yyyy-MM-dd HH-mm-ss", CultureInfo.InvariantCulture);
|
||||
|
||||
return v.ToString();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace OpenRA
|
||||
public readonly MiniYaml LobbyDefaults;
|
||||
public readonly Dictionary<string, Pair<string, int>> Fonts;
|
||||
public readonly Size TileSize = new Size(24, 24);
|
||||
public readonly string NewsUrl;
|
||||
|
||||
public Manifest(string mod)
|
||||
{
|
||||
@@ -82,6 +83,9 @@ namespace OpenRA
|
||||
compat.Add(c.Trim());
|
||||
|
||||
MapCompatibility = compat.ToArray();
|
||||
|
||||
if (yaml.ContainsKey("NewsUrl"))
|
||||
NewsUrl = yaml["NewsUrl"].Value;
|
||||
}
|
||||
|
||||
static string[] YamlList(Dictionary<string, MiniYaml> yaml, string key)
|
||||
|
||||
@@ -138,6 +138,9 @@ namespace OpenRA
|
||||
|
||||
public bool AllowDownloading = true;
|
||||
public string MapRepository = "http://resource.openra.net/map/";
|
||||
|
||||
public bool FetchNews = true;
|
||||
public DateTime NewsFetchedDate;
|
||||
}
|
||||
|
||||
public class KeySettings
|
||||
|
||||
Reference in New Issue
Block a user