1
AUTHORS
1
AUTHORS
@@ -66,6 +66,7 @@ Also thanks to:
|
||||
* Matthew Uzzell (MUzzell)
|
||||
* Max621
|
||||
* Max Ugrumov (katzsmile)
|
||||
* Michael Sztolcman (s1w_)
|
||||
* Mustafa Alperen Seki (MustaphaTR)
|
||||
* Neil Shivkar (havok13888)
|
||||
* Nukem
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
ScrollPanelWidget scrollpanel;
|
||||
ScrollItemWidget itemTemplate;
|
||||
string mapFilter;
|
||||
string gameMode;
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
@@ -32,8 +33,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
selectedUid = WidgetUtils.ChooseInitialMap(initialMap);
|
||||
|
||||
widget.Get<ButtonWidget>("BUTTON_OK").OnClick = () => { Ui.CloseWindow(); onSelect(selectedUid); };
|
||||
widget.Get<ButtonWidget>("BUTTON_CANCEL").OnClick = () => { Ui.CloseWindow(); onExit(); };
|
||||
var approving = new Action(() => { Ui.CloseWindow(); onSelect(selectedUid); });
|
||||
var canceling = new Action(() => { Ui.CloseWindow(); onExit(); });
|
||||
|
||||
widget.Get<ButtonWidget>("BUTTON_OK").OnClick = approving;
|
||||
widget.Get<ButtonWidget>("BUTTON_CANCEL").OnClick = canceling;
|
||||
|
||||
scrollpanel = widget.Get<ScrollPanelWidget>("MAP_LIST");
|
||||
scrollpanel.Layout = new GridLayout(scrollpanel);
|
||||
@@ -69,6 +73,26 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
gameModeDropdown.GetText = () => showItem(gameModes.First(m => m.First == gameMode));
|
||||
}
|
||||
|
||||
var mapfilterInput = widget.GetOrNull<TextFieldWidget>("MAPFILTER_INPUT");
|
||||
if (mapfilterInput != null)
|
||||
{
|
||||
mapfilterInput.TakeKeyboardFocus();
|
||||
mapfilterInput.OnEscKey = () =>
|
||||
{
|
||||
if (mapfilterInput.Text.Length == 0)
|
||||
canceling();
|
||||
else
|
||||
{
|
||||
mapFilter = mapfilterInput.Text = null;
|
||||
EnumerateMaps(onSelect);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
mapfilterInput.OnEnterKey = () => { approving(); return true; };
|
||||
mapfilterInput.OnTextEdited = () =>
|
||||
{ mapFilter = mapfilterInput.Text; EnumerateMaps(onSelect); };
|
||||
}
|
||||
|
||||
var randomMapButton = widget.GetOrNull<ButtonWidget>("RANDOMMAP_BUTTON");
|
||||
if (randomMapButton != null)
|
||||
{
|
||||
@@ -88,7 +112,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
var maps = Game.modData.MapCache
|
||||
.Where(m => m.Status == MapStatus.Available && m.Map.Selectable)
|
||||
.Where(m => m.Type == gameMode || gameMode == null)
|
||||
.Where(m => gameMode == null || m.Type == gameMode)
|
||||
.Where(m => mapFilter == null || m.Title.IndexOf(mapFilter, StringComparison.OrdinalIgnoreCase) >= 0 || m.Author.IndexOf(mapFilter, StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
.OrderBy(m => m.PlayerCount)
|
||||
.ThenBy(m => m.Title);
|
||||
|
||||
|
||||
@@ -17,14 +17,27 @@ Container@MAPCHOOSER_PANEL:
|
||||
Height: 500
|
||||
Background: panel-black
|
||||
Children:
|
||||
Label@GAMEMODE_DESC:
|
||||
X: PARENT_RIGHT - WIDTH - 220
|
||||
Label@FILTER_DESC:
|
||||
X: PARENT_RIGHT - WIDTH - 401
|
||||
Y: 10
|
||||
Width: 200
|
||||
Width: 60
|
||||
Height: 25
|
||||
Font: Bold
|
||||
Align: Right
|
||||
Text: Filter:
|
||||
TextField@MAPFILTER_INPUT:
|
||||
X: PARENT_RIGHT - WIDTH - 245
|
||||
Y: 10
|
||||
Width: 150
|
||||
Height: 25
|
||||
Label@FILTER_DESC_JOINER:
|
||||
X: PARENT_RIGHT - WIDTH - 215
|
||||
Y: 10
|
||||
Width: 30
|
||||
Height: 25
|
||||
Font: Bold
|
||||
Align: Center
|
||||
Text: in
|
||||
DropDownButton@GAMEMODE_FILTER:
|
||||
X: PARENT_RIGHT - WIDTH - 15
|
||||
Y: 10
|
||||
|
||||
@@ -3,11 +3,11 @@ Background@MAPCHOOSER_PANEL:
|
||||
Y: (WINDOW_BOTTOM - HEIGHT)/2
|
||||
Logic: MapChooserLogic
|
||||
Width: 858
|
||||
Height: 600
|
||||
Height: 618
|
||||
Children:
|
||||
Label@MAPCHOOSER_TITLE:
|
||||
X: 0
|
||||
Y: 17
|
||||
Y: 15
|
||||
Align: Center
|
||||
Width: 858
|
||||
Height: 20
|
||||
@@ -15,7 +15,7 @@ Background@MAPCHOOSER_PANEL:
|
||||
Font: Bold
|
||||
ScrollPanel@MAP_LIST:
|
||||
X: 20
|
||||
Y: 47
|
||||
Y: 76
|
||||
Width: PARENT_RIGHT - 40
|
||||
Height: 474
|
||||
Children:
|
||||
@@ -56,9 +56,30 @@ Background@MAPCHOOSER_PANEL:
|
||||
Y: PARENT_BOTTOM-10
|
||||
Align: Center
|
||||
Font: Tiny
|
||||
Label@FILTER_DESC:
|
||||
X: PARENT_RIGHT - 467
|
||||
Y: 48
|
||||
Width: 60
|
||||
Height: 24
|
||||
Font: Bold
|
||||
Align: Right
|
||||
Text: Filter:
|
||||
TextField@MAPFILTER_INPUT:
|
||||
X: PARENT_RIGHT - 401
|
||||
Y: 48
|
||||
Width: 150
|
||||
Height: 25
|
||||
Label@FILTER_DESC_JOINER:
|
||||
X: PARENT_RIGHT - 250
|
||||
Y: 48
|
||||
Width: 30
|
||||
Height: 24
|
||||
Font: Bold
|
||||
Align: Center
|
||||
Text: in
|
||||
DropDownButton@GAMEMODE_FILTER:
|
||||
X: PARENT_RIGHT - 220
|
||||
Y: 17
|
||||
Y: 48
|
||||
Width: 200
|
||||
Height: 25
|
||||
Button@RANDOMMAP_BUTTON:
|
||||
|
||||
Reference in New Issue
Block a user