Merge pull request #4023 from pchote/map-fixes

Map changes
This commit is contained in:
Matthias Mailänder
2013-10-30 15:45:37 -07:00
8 changed files with 7 additions and 295 deletions

View File

@@ -65,9 +65,10 @@ namespace OpenRA.Widgets
return w;
}
public static ScrollItemWidget Setup(string key, ScrollItemWidget template, Func<bool> isSelected, Action onClick)
public static ScrollItemWidget Setup(string key, ScrollItemWidget template, Func<bool> isSelected, Action onClick, Action onDoubleClick)
{
var w = Setup(template, isSelected, onClick);
w.OnDoubleClick = onDoubleClick;
w.ItemKey = key;
return w;
}

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
{
var item = ScrollItemWidget.Setup(template,
() => gameMode == ii.First,
() => { gameMode = ii.First; EnumerateMaps(); });
() => { gameMode = ii.First; EnumerateMaps(onSelect); });
item.Get<LabelWidget>("LABEL").GetText = () => showItem(ii);
return item;
};
@@ -83,10 +83,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
randomMapButton.IsDisabled = () => visibleMaps == null || visibleMaps.Count == 0;
}
EnumerateMaps();
EnumerateMaps(onSelect);
}
void EnumerateMaps()
void EnumerateMaps(Action<Map> onSelect)
{
var maps = Game.modData.AvailableMaps
.Where(kv => kv.Value.Selectable)
@@ -98,7 +98,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
foreach (var kv in maps)
{
var m = kv.Value;
var item = ScrollItemWidget.Setup(kv.Key, itemTemplate, () => m == map, () => map = m);
var item = ScrollItemWidget.Setup(kv.Key, itemTemplate, () => m == map, () => map = m, () => { Ui.CloseWindow(); onSelect(m); });
var titleLabel = item.Get<LabelWidget>("TITLE");
titleLabel.GetText = () => m.Title;

View File

@@ -98,7 +98,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
currentSong = song;
// TODO: We leak the currentSong MusicInfo across map load, so compare the Filename instead.
var item = ScrollItemWidget.Setup(song.Filename, itemTemplate, () => currentSong.Filename == song.Filename, () => { currentSong = song; Play(); });
var item = ScrollItemWidget.Setup(song.Filename, itemTemplate, () => currentSong.Filename == song.Filename, () => { currentSong = song; Play(); }, () => {});
item.Get<LabelWidget>("TITLE").GetText = () => song.Title;
item.Get<LabelWidget>("LENGTH").GetText = () => SongLengthLabel(song);
musicList.AddChild(item);

Binary file not shown.

Binary file not shown.

View File

@@ -1,289 +0,0 @@
Selectable: True
MapFormat: 5
RequiresMod: cnc
Title: East vs West 3
Description: 3v3 Team Map
Author: Paul Chote
Tileset: WINTER
MapSize: 96,56
Bounds: 8,8,76,40
UseAsShellmap: False
Type: Conquest
Players:
PlayerReference@Neutral:
Name: Neutral
Palette: neutral
OwnsWorld: True
NonCombatant: True
Race: gdi
PlayerReference@Multi0:
Name: Multi0
Playable: True
DefaultStartingUnits: True
Race: Random
Enemies: Creeps
PlayerReference@Multi1:
Name: Multi1
Playable: True
DefaultStartingUnits: True
Race: Random
Enemies: Creeps
PlayerReference@Multi2:
Name: Multi2
Playable: True
DefaultStartingUnits: True
Race: Random
Enemies: Creeps
PlayerReference@Multi3:
Name: Multi3
Playable: True
DefaultStartingUnits: True
Race: Random
Enemies: Creeps
PlayerReference@Multi4:
Name: Multi4
Playable: True
DefaultStartingUnits: True
Race: Random
Enemies: Creeps
PlayerReference@Multi5:
Name: Multi5
Playable: True
DefaultStartingUnits: True
Race: Random
Enemies: Creeps
PlayerReference@Creeps:
Name: Creeps
NonCombatant: True
Race: Random
Enemies: Multi0,Multi1,Multi2,Multi3,Multi4,Multi5
Actors:
wp7: mpspawn
Location: 73,33
Owner: Neutral
Actor5: mpspawn
Location: 17,20
Owner: Neutral
wp1: mpspawn
Location: 73,20
Owner: Neutral
Actor7: mpspawn
Location: 63,27
Owner: Neutral
Actor8: mpspawn
Location: 17,33
Owner: Neutral
Actor40: mpspawn
Location: 27,27
Owner: Neutral
Actor0: bio
Location: 45,34
Owner: Neutral
Actor1: split3
Location: 15,12
Owner: Neutral
Actor2: split3
Location: 15,41
Owner: Neutral
Actor3: split3
Location: 33,18
Owner: Neutral
Actor4: split3
Location: 33,35
Owner: Neutral
Actor6: split3
Location: 58,35
Owner: Neutral
Actor9: split3
Location: 58,18
Owner: Neutral
Actor10: split3
Location: 75,12
Owner: Neutral
Actor11: split3
Location: 75,41
Owner: Neutral
Actor50: tc04
Location: 41,16
Owner: Neutral
Actor18: brik
Location: 43,32
Owner: Neutral
Actor12: gtwr
Location: 44,33
Owner: Creeps
Actor15: brik
Location: 41,32
Owner: Neutral
Actor16: brik
Location: 42,32
Owner: Neutral
Actor14: brik
Location: 40,32
Owner: Neutral
Actor13: gtwr
Location: 47,33
Owner: Creeps
Actor51: tc04
Location: 49,16
Owner: Neutral
Actor20: brik
Location: 48,32
Owner: Neutral
Actor21: brik
Location: 49,32
Owner: Neutral
Actor22: brik
Location: 50,32
Owner: Neutral
Actor23: brik
Location: 51,32
Owner: Neutral
Actor34: t16
Location: 48,35
Owner: Neutral
Actor30: t14
Location: 49,33
Owner: Neutral
Actor25: tc04
Location: 42,36
Owner: Neutral
Actor24: tc04
Location: 40,37
Owner: Neutral
Actor26: t02
Location: 41,35
Owner: Neutral
Actor31: brik
Location: 45,36
Owner: Neutral
Actor32: brik
Location: 44,36
Owner: Neutral
Actor33: brik
Location: 46,36
Owner: Neutral
Actor29: t11
Location: 49,35
Owner: Neutral
Actor27: t10
Location: 42,34
Owner: Neutral
Actor28: t11
Location: 41,33
Owner: Neutral
Actor37: brik
Location: 47,36
Owner: Neutral
Actor38: brik
Location: 48,33
Owner: Neutral
Actor39: brik
Location: 48,34
Owner: Neutral
Actor41: brik
Location: 47,34
Owner: Neutral
Actor42: brik
Location: 44,34
Owner: Neutral
Actor43: brik
Location: 43,34
Owner: Neutral
Actor44: brik
Location: 43,33
Owner: Neutral
Actor46: brik
Location: 44,35
Owner: Neutral
Actor47: brik
Location: 47,35
Owner: Neutral
Actor48: tc04
Location: 45,36
Owner: Neutral
Actor49: tc04
Location: 48,36
Owner: Neutral
Actor35: tc02
Location: 49,38
Owner: Neutral
Actor36: v17
Location: 43,22
Owner: Neutral
Actor45: v16
Location: 43,21
Owner: Neutral
Actor17: tc02
Location: 40,15
Owner: Neutral
Actor53: tc02
Location: 45,17
Owner: Neutral
Actor52: tc04
Location: 43,16
Owner: Neutral
Actor19: tc02
Location: 50,15
Owner: Neutral
Actor54: tc04
Location: 47,16
Owner: Neutral
Actor55: tc03
Location: 49,19
Owner: Neutral
Actor56: tc01
Location: 41,18
Owner: Neutral
Actor57: tc04
Location: 43,18
Owner: Neutral
Actor58: tc05
Location: 46,18
Owner: Neutral
Actor59: v01
Location: 45,20
Owner: Neutral
Actor60: v06
Location: 41,20
Owner: Neutral
Actor62: v17
Location: 42,22
Owner: Neutral
Actor66: v11
Location: 48,21
Owner: Neutral
Actor65: v17
Location: 41,22
Owner: Neutral
Actor63: v16
Location: 41,21
Owner: Neutral
Actor64: v03
Location: 49,21
Owner: Neutral
Actor61: v16
Location: 42,21
Owner: Neutral
Smudges:
Rules:
Sequences:
Weapons:
Voices:

Binary file not shown.