choose a random map with MapStub.UseAsShellmap as the shellmap, rather than hardcoding a sha1 in mod.yaml; add editor support for the new flag too.

This commit is contained in:
Chris Forbes
2010-12-28 19:13:56 +13:00
parent aecf19ed64
commit 44e668e804
9 changed files with 146 additions and 122 deletions

View File

@@ -238,9 +238,9 @@ namespace OpenRA
PerfHistory.items["text"].hasNormalTick = false;
PerfHistory.items["cursor"].hasNormalTick = false;
JoinLocal();
StartGame(modData.Manifest.ShellmapUid);
StartGame(ChooseShellmap());
// TODO: unhardcode this
modData.WidgetLoader.LoadWidget( new Dictionary<string,object>(), Widget.RootWidget, "PERF_BG" );
@@ -249,6 +249,13 @@ namespace OpenRA
Game.orderManager.LastTickTime = Environment.TickCount;
}
static string ChooseShellmap()
{
return modData.AvailableMaps
.Where(m => m.Value.UseAsShellmap)
.Random(CosmeticRandom).Key;
}
static bool quit;
internal static void Run()
{
@@ -274,7 +281,7 @@ namespace OpenRA
server.Shutdown();
orderManager.Dispose();
var shellmap = modData.Manifest.ShellmapUid;
var shellmap = ChooseShellmap();
JoinLocal();
StartGame(shellmap);