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:
@@ -332,6 +332,7 @@ namespace OpenRA.Editor
|
||||
pd.desc.Text = surface1.Map.Description;
|
||||
pd.author.Text = surface1.Map.Author;
|
||||
pd.selectable.Checked = surface1.Map.Selectable;
|
||||
pd.useAsShellmap.Checked = surface1.Map.UseAsShellmap;
|
||||
|
||||
if (DialogResult.OK != pd.ShowDialog())
|
||||
return;
|
||||
@@ -340,6 +341,7 @@ namespace OpenRA.Editor
|
||||
surface1.Map.Description = pd.desc.Text;
|
||||
surface1.Map.Author = pd.author.Text;
|
||||
surface1.Map.Selectable = pd.selectable.Checked;
|
||||
surface1.Map.UseAsShellmap = pd.useAsShellmap.Checked;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
13
OpenRA.Editor/PropertiesDialog.Designer.cs
generated
13
OpenRA.Editor/PropertiesDialog.Designer.cs
generated
@@ -37,6 +37,7 @@
|
||||
this.selectable = new System.Windows.Forms.CheckBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.author = new System.Windows.Forms.TextBox();
|
||||
this.useAsShellmap = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button2
|
||||
@@ -119,6 +120,16 @@
|
||||
this.author.Size = new System.Drawing.Size(286, 20);
|
||||
this.author.TabIndex = 17;
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.useAsShellmap.AutoSize = true;
|
||||
this.useAsShellmap.Location = new System.Drawing.Point(118, 161);
|
||||
this.useAsShellmap.Name = "checkBox1";
|
||||
this.useAsShellmap.Size = new System.Drawing.Size(105, 17);
|
||||
this.useAsShellmap.TabIndex = 18;
|
||||
this.useAsShellmap.Text = "Use as Shellmap";
|
||||
this.useAsShellmap.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// PropertiesDialog
|
||||
//
|
||||
this.AcceptButton = this.button2;
|
||||
@@ -126,6 +137,7 @@
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.button1;
|
||||
this.ClientSize = new System.Drawing.Size(370, 228);
|
||||
this.Controls.Add(this.useAsShellmap);
|
||||
this.Controls.Add(this.selectable);
|
||||
this.Controls.Add(this.author);
|
||||
this.Controls.Add(this.label3);
|
||||
@@ -155,5 +167,6 @@
|
||||
public System.Windows.Forms.CheckBox selectable;
|
||||
private System.Windows.Forms.Label label3;
|
||||
public System.Windows.Forms.TextBox author;
|
||||
public System.Windows.Forms.CheckBox useAsShellmap;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.FileFormats
|
||||
Mods, Folders, Packages, Rules, ServerTraits,
|
||||
Sequences, Cursors, Chrome, Assemblies, ChromeLayout,
|
||||
Weapons, Voices, Music, Movies, TileSets;
|
||||
public readonly string ShellmapUid, LoadScreen;
|
||||
public readonly string LoadScreen;
|
||||
public readonly int TileSize = 24;
|
||||
|
||||
public Manifest(string[] mods)
|
||||
@@ -47,7 +47,6 @@ namespace OpenRA.FileFormats
|
||||
Movies = YamlList(yaml, "Movies");
|
||||
TileSets = YamlList(yaml, "TileSets");
|
||||
|
||||
ShellmapUid = yaml.First( x => x.Key == "ShellmapUid" ).Value.Value;
|
||||
LoadScreen = yaml.First( x => x.Key == "LoadScreen" ).Value.Value;
|
||||
|
||||
if (yaml.FirstOrDefault( x => x.Key == "TileSize" ) != null)
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace OpenRA.FileFormats
|
||||
// Yaml map data
|
||||
public string Uid { get; protected set; }
|
||||
[FieldLoader.Load] public bool Selectable;
|
||||
[FieldLoader.Load] public bool UseAsShellmap;
|
||||
|
||||
[FieldLoader.Load] public string Title;
|
||||
[FieldLoader.Load] public string Type = "Conquest";
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ TopLeft: 8,1
|
||||
|
||||
BottomRight: 88,46
|
||||
|
||||
UseAsShellmap: yes
|
||||
|
||||
Players:
|
||||
PlayerReference@Nod:
|
||||
Name: Nod
|
||||
|
||||
@@ -84,7 +84,6 @@ TileSets:
|
||||
mods/cnc/tilesets/snow.yaml
|
||||
|
||||
LoadScreen: CncLoadScreen
|
||||
ShellmapUid:2cc2a95c89dc6594acec52d7acbc720f45fc5d9e
|
||||
ServerTraits:
|
||||
PlayerCommands
|
||||
LobbyCommands
|
||||
|
||||
@@ -2,7 +2,7 @@ Selectable: False
|
||||
|
||||
MapFormat: 3
|
||||
|
||||
Title: <none>
|
||||
Title: OpenRA Shellmap
|
||||
|
||||
Author: Westwood Studios
|
||||
|
||||
@@ -16,6 +16,8 @@ TopLeft: 26,36
|
||||
|
||||
BottomRight: 118,93
|
||||
|
||||
UseAsShellmap: yes
|
||||
|
||||
Players:
|
||||
PlayerReference@Neutral:
|
||||
Name: Neutral
|
||||
|
||||
@@ -78,7 +78,6 @@ Movies:
|
||||
mods/ra/movies2.yaml
|
||||
|
||||
LoadScreen: RALoadScreen
|
||||
ShellmapUid:a628d8d09c2275ca22e1dc84e41491978a96a71e
|
||||
ServerTraits:
|
||||
PlayerCommands
|
||||
LobbyCommands
|
||||
|
||||
Reference in New Issue
Block a user