Merge pull request #8851 from penev92/bleed_rename

Some more renaming from "race" to "faction"
This commit is contained in:
Paul Chote
2015-08-02 15:34:41 +01:00
13 changed files with 125 additions and 107 deletions

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
public readonly Player Player;
public readonly string Label;
public readonly Color Color;
public readonly string Race;
public readonly string Faction;
public readonly Func<bool> IsSelected;
public readonly Action OnClick;
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Player = p;
Label = p.PlayerName;
Color = p.Color.RGB;
Race = p.Faction.InternalName;
Faction = p.Faction.InternalName;
IsSelected = () => p.World.RenderPlayer == p;
OnClick = () => { p.World.RenderPlayer = p; logic.selected = this; p.World.Selection.Clear(); };
}
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Player = p;
Label = label;
Color = Color.White;
Race = null;
Faction = null;
IsSelected = () => w.RenderPlayer == p;
OnClick = () => { w.RenderPlayer = p; logic.selected = this; };
}
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Func<CameraOption, ScrollItemWidget, ScrollItemWidget> setupItem = (option, template) =>
{
var item = ScrollItemWidget.Setup(template, option.IsSelected, option.OnClick);
var showFlag = option.Race != null;
var showFlag = option.Faction != null;
var label = item.Get<LabelWidget>("LABEL");
label.IsVisible = () => showFlag;
@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var flag = item.Get<ImageWidget>("FLAG");
flag.IsVisible = () => showFlag;
flag.GetImageCollection = () => "flags";
flag.GetImageName = () => option.Race;
flag.GetImageName = () => option.Faction;
var labelAlt = item.Get<LabelWidget>("NOFLAG_LABEL");
labelAlt.IsVisible = () => !showFlag;
@@ -109,17 +109,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic
};
var shroudLabel = shroudSelector.Get<LabelWidget>("LABEL");
shroudLabel.IsVisible = () => selected.Race != null;
shroudLabel.IsVisible = () => selected.Faction != null;
shroudLabel.GetText = () => selected.Label;
shroudLabel.GetColor = () => selected.Color;
var shroudFlag = shroudSelector.Get<ImageWidget>("FLAG");
shroudFlag.IsVisible = () => selected.Race != null;
shroudFlag.IsVisible = () => selected.Faction != null;
shroudFlag.GetImageCollection = () => "flags";
shroudFlag.GetImageName = () => selected.Race;
shroudFlag.GetImageName = () => selected.Faction;
var shroudLabelAlt = shroudSelector.Get<LabelWidget>("NOFLAG_LABEL");
shroudLabelAlt.IsVisible = () => selected.Race == null;
shroudLabelAlt.IsVisible = () => selected.Faction == null;
shroudLabelAlt.GetText = () => selected.Label;
shroudLabelAlt.GetColor = () => selected.Color;

View File

@@ -301,7 +301,7 @@ namespace OpenRA.Mods.Common.Widgets
var ks = Game.Settings.Keys;
var rb = RenderBounds;
var race = producer.Trait.Race;
var faction = producer.Trait.Faction;
foreach (var item in AllBuildables.Skip(IconRowOffset * Columns).Take(MaxIconRowOffset * Columns))
{
@@ -310,7 +310,7 @@ namespace OpenRA.Mods.Common.Widgets
var rect = new Rectangle(rb.X + x * (IconSize.X + IconMargin.X), rb.Y + y * (IconSize.Y + IconMargin.Y), IconSize.X, IconSize.Y);
var rsi = item.Traits.Get<RenderSpritesInfo>();
var icon = new Animation(World, rsi.GetImage(item, World.Map.SequenceProvider, race));
var icon = new Animation(World, rsi.GetImage(item, World.Map.SequenceProvider, faction));
icon.Play(item.Traits.Get<TooltipInfo>().Icon);
var bi = item.Traits.Get<BuildableInfo>();