#2051 fixed -- Widget.Get() throws by default

This commit is contained in:
Chris Forbes
2012-04-27 19:39:07 +12:00
parent 5d1a071287
commit c30d46c014
52 changed files with 409 additions and 398 deletions

View File

@@ -28,9 +28,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public DiplomacyLogic(World world)
{
this.world = world;
var root = Ui.Root.GetWidget("INGAME_ROOT");
var diplomacyBG = root.GetWidget("DIPLOMACY_BG");
var diplomacy = root.GetWidget<ButtonWidget>("INGAME_DIPLOMACY_BUTTON");
var root = Ui.Root.Get("INGAME_ROOT");
var diplomacyBG = root.Get("DIPLOMACY_BG");
var diplomacy = root.Get<ButtonWidget>("INGAME_DIPLOMACY_BUTTON");
diplomacy.OnClick = () =>
{
@@ -129,7 +129,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
() => s == world.LocalPlayer.Stances[ p ],
() => SetStance(dropdown, p, s));
item.GetWidget<LabelWidget>("LABEL").GetText = () => s.ToString();
item.Get<LabelWidget>("LABEL").GetText = () => s.ToString();
return item;
};