Faction dropdown flags.
This commit is contained in:
@@ -157,7 +157,7 @@ namespace OpenRA.Widgets
|
|||||||
ww.OnMouseUp = mi => { var result = origMouseUp(mi); HideDropDown(); return result; };
|
ww.OnMouseUp = mi => { var result = origMouseUp(mi); HideDropDown(); return result; };
|
||||||
ww.ClickThrough = false;
|
ww.ClickThrough = false;
|
||||||
ww.IsVisible = () => true;
|
ww.IsVisible = () => true;
|
||||||
ww.Bounds = new Rectangle(0, y, ww.Bounds.Width, ww.Bounds.Height);
|
ww.Bounds = new Rectangle(1, y, ww.Bounds.Width, ww.Bounds.Height);
|
||||||
|
|
||||||
ww.OnMouseMove = mi =>
|
ww.OnMouseMove = mi =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -253,17 +253,28 @@ namespace OpenRA.Widgets.Delegates
|
|||||||
foreach (var c in CountryNames)
|
foreach (var c in CountryNames)
|
||||||
{
|
{
|
||||||
var cc = c;
|
var cc = c;
|
||||||
dropDownOptions.Add(new Pair<string, Action>( cc.Value,
|
dropDownOptions.Add(new Pair<string, Action>( cc.Key,
|
||||||
() => orderManager.IssueOrder( Order.Command("race "+cc.Key) )) );
|
() => orderManager.IssueOrder( Order.Command("race "+cc.Key) )) );
|
||||||
};
|
};
|
||||||
|
|
||||||
DropDownButtonWidget.ShowDropDown( race,
|
DropDownButtonWidget.ShowDropDown( race,
|
||||||
dropDownOptions,
|
dropDownOptions,
|
||||||
(ac, w) => new LabelWidget
|
(ac, w) =>
|
||||||
{
|
{
|
||||||
Bounds = new Rectangle(0, 0, w, 24),
|
var ret = new LabelWidget
|
||||||
Text = " {0}".F(ac.First),
|
{
|
||||||
OnMouseUp = mi => { ac.Second(); return true; },
|
Bounds = new Rectangle(0, 0, w, 24),
|
||||||
|
Text = " {0}".F(CountryNames[ac.First]),
|
||||||
|
OnMouseUp = mi => { ac.Second(); return true; },
|
||||||
|
};
|
||||||
|
|
||||||
|
ret.AddChild(new ImageWidget
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(5, 5, 40, 15),
|
||||||
|
GetImageName = () => ac.First,
|
||||||
|
GetImageCollection = () => "flags",
|
||||||
|
});
|
||||||
|
return ret;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user