Merge pull request #7873 from penev92/bleed_raceToFaction
Replace old "country" and "race" name in the code with the generic "faction"
This commit is contained in:
@@ -147,10 +147,10 @@ namespace OpenRA
|
||||
public bool IsHuman;
|
||||
public bool IsBot;
|
||||
|
||||
// The faction name (aka Country)
|
||||
// The faction's display name.
|
||||
public string FactionName;
|
||||
|
||||
// The faction id (aka Country, aka Race)
|
||||
// The faction ID, a.k.a. the faction's internal name.
|
||||
public string FactionId;
|
||||
public HSLColor Color;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA
|
||||
|
||||
public MapPlayers(Ruleset rules, int playerCount)
|
||||
{
|
||||
var firstRace = rules.Actors["world"].Traits
|
||||
var firstFaction = rules.Actors["world"].Traits
|
||||
.WithInterface<FactionInfo>().First(f => f.Selectable).InternalName;
|
||||
|
||||
Players = new Dictionary<string, PlayerReference>
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA
|
||||
"Neutral", new PlayerReference
|
||||
{
|
||||
Name = "Neutral",
|
||||
Faction = firstRace,
|
||||
Faction = firstFaction,
|
||||
OwnsWorld = true,
|
||||
NonCombatant = true
|
||||
}
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA
|
||||
"Creeps", new PlayerReference
|
||||
{
|
||||
Name = "Creeps",
|
||||
Faction = firstRace,
|
||||
Faction = firstFaction,
|
||||
NonCombatant = true,
|
||||
Enemies = Exts.MakeArray(playerCount, i => "Multi{0}".F(i))
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
this.info = info;
|
||||
var self = init.Self;
|
||||
var race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;
|
||||
var faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;
|
||||
|
||||
quantizedFacings = Exts.Lazy(() =>
|
||||
{
|
||||
@@ -73,7 +73,7 @@ namespace OpenRA.Traits
|
||||
if (qboi == null)
|
||||
throw new InvalidOperationException("Actor type '" + self.Info.Name + "' does not define a quantized body orientation.");
|
||||
|
||||
return qboi.QuantizedBodyFacings(self.Info, self.World.Map.SequenceProvider, race);
|
||||
return qboi.QuantizedBodyFacings(self.Info, self.World.Map.SequenceProvider, faction);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ namespace OpenRA.Traits
|
||||
WRot QuantizeOrientation(WRot orientation, int facings);
|
||||
}
|
||||
|
||||
public interface IQuantizeBodyOrientationInfo { int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race); }
|
||||
public interface IQuantizeBodyOrientationInfo { int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction); }
|
||||
|
||||
public interface ITargetableInfo
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
public ProductionAirdrop(ActorInitializer init, ProductionAirdropInfo info)
|
||||
: base(init, info) { }
|
||||
|
||||
public override bool Produce(Actor self, ActorInfo producee, string raceVariant)
|
||||
public override bool Produce(Actor self, ActorInfo producee, string factionVariant)
|
||||
{
|
||||
var owner = self.Owner;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
foreach (var cargo in self.TraitsImplementing<INotifyDelivery>())
|
||||
cargo.Delivered(self);
|
||||
|
||||
self.World.AddFrameEndTask(ww => DoProduction(self, producee, exit, raceVariant));
|
||||
self.World.AddFrameEndTask(ww => DoProduction(self, producee, exit, factionVariant));
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||
}));
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
public override object Create(ActorInitializer init) { return new WithGunboatBody(init, this); }
|
||||
|
||||
public override int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race)
|
||||
public override int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -41,10 +41,10 @@ namespace OpenRA.Mods.Common.Lint
|
||||
|
||||
var worldActor = map.Rules.Actors["world"];
|
||||
|
||||
var races = worldActor.Traits.WithInterface<FactionInfo>().Select(f => f.InternalName).ToHashSet();
|
||||
var factions = worldActor.Traits.WithInterface<FactionInfo>().Select(f => f.InternalName).ToHashSet();
|
||||
foreach (var player in players.Values)
|
||||
if (!string.IsNullOrWhiteSpace(player.Faction) && !races.Contains(player.Faction))
|
||||
emitError("Invalid race {0} chosen for player {1}.".F(player.Faction, player.Name));
|
||||
if (!string.IsNullOrWhiteSpace(player.Faction) && !factions.Contains(player.Faction))
|
||||
emitError("Invalid faction {0} chosen for player {1}.".F(player.Faction, player.Name));
|
||||
|
||||
if (worldActor.Traits.Contains<MPStartLocationsInfo>())
|
||||
{
|
||||
|
||||
@@ -36,21 +36,21 @@ namespace OpenRA.Mods.Common.Lint
|
||||
Game.ModData.Manifest.Sequences.Select(MiniYaml.FromFile).Aggregate(MiniYaml.MergeLiberal));
|
||||
|
||||
var rules = map == null ? Game.ModData.DefaultRules : map.Rules;
|
||||
var races = rules.Actors["world"].Traits.WithInterface<FactionInfo>().Select(f => f.InternalName).ToArray();
|
||||
var factions = rules.Actors["world"].Traits.WithInterface<FactionInfo>().Select(f => f.InternalName).ToArray();
|
||||
var sequenceProviders = map == null ? rules.Sequences.Values : new[] { rules.Sequences[map.Tileset] };
|
||||
|
||||
foreach (var actorInfo in rules.Actors)
|
||||
{
|
||||
foreach (var renderInfo in actorInfo.Value.Traits.WithInterface<RenderSpritesInfo>())
|
||||
{
|
||||
foreach (var race in races)
|
||||
foreach (var faction in factions)
|
||||
{
|
||||
foreach (var sequenceProvider in sequenceProviders)
|
||||
{
|
||||
var image = renderInfo.GetImage(actorInfo.Value, sequenceProvider, race);
|
||||
var image = renderInfo.GetImage(actorInfo.Value, sequenceProvider, faction);
|
||||
if (sequenceDefinitions.All(s => s.Key != image.ToLowerInvariant()) && !actorInfo.Value.Name.Contains("^"))
|
||||
emitWarning("Sprite image {0} from actor {1} using race {2} has no sequence definition."
|
||||
.F(image, actorInfo.Value.Name, race));
|
||||
emitWarning("Sprite image {0} from actor {1} using faction {2} has no sequence definition."
|
||||
.F(image, actorInfo.Value.Name, faction));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
if (renderInfo == null)
|
||||
continue;
|
||||
|
||||
foreach (var race in races)
|
||||
foreach (var faction in factions)
|
||||
{
|
||||
var sequenceReference = field.GetCustomAttributes<SequenceReferenceAttribute>(true).FirstOrDefault();
|
||||
if (sequenceReference != null && !string.IsNullOrEmpty(sequenceReference.ImageReference))
|
||||
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
if (!string.IsNullOrEmpty(imageOverride) && sequenceDefinitions.All(s => s.Key != imageOverride.ToLowerInvariant()))
|
||||
emitWarning("Custom sprite image {0} from actor {1} has no sequence definition.".F(imageOverride, actorInfo.Value.Name));
|
||||
else
|
||||
CheckDefintions(imageOverride, sequenceReference, actorInfo, sequence, race, field, traitInfo);
|
||||
CheckDefintions(imageOverride, sequenceReference, actorInfo, sequence, faction, field, traitInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,8 +93,8 @@ namespace OpenRA.Mods.Common.Lint
|
||||
{
|
||||
foreach (var sequenceProvider in sequenceProviders)
|
||||
{
|
||||
var image = renderInfo.GetImage(actorInfo.Value, sequenceProvider, race);
|
||||
CheckDefintions(image, sequenceReference, actorInfo, sequence, race, field, traitInfo);
|
||||
var image = renderInfo.GetImage(actorInfo.Value, sequenceProvider, faction);
|
||||
CheckDefintions(image, sequenceReference, actorInfo, sequence, faction, field, traitInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
}
|
||||
|
||||
void CheckDefintions(string image, SequenceReferenceAttribute sequenceReference,
|
||||
KeyValuePair<string, ActorInfo> actorInfo, string sequence, string race, FieldInfo field, ITraitInfo traitInfo)
|
||||
KeyValuePair<string, ActorInfo> actorInfo, string sequence, string faction, FieldInfo field, ITraitInfo traitInfo)
|
||||
{
|
||||
var definitions = sequenceDefinitions.FirstOrDefault(n => n.Key == image.ToLowerInvariant());
|
||||
if (definitions != null)
|
||||
@@ -157,12 +157,12 @@ namespace OpenRA.Mods.Common.Lint
|
||||
{
|
||||
if (!definitions.Value.Nodes.Any(n => n.Key.StartsWith(sequence)))
|
||||
emitWarning("Sprite image {0} from actor {1} of faction {2} does not define sequence prefix {3} from field {4} of {5}"
|
||||
.F(image, actorInfo.Value.Name, race, sequence, field.Name, traitInfo));
|
||||
.F(image, actorInfo.Value.Name, faction, sequence, field.Name, traitInfo));
|
||||
}
|
||||
else if (definitions.Value.Nodes.All(n => n.Key != sequence))
|
||||
{
|
||||
emitWarning("Sprite image {0} from actor {1} of faction {2} does not define sequence {3} from field {4} of {5}"
|
||||
.F(image, actorInfo.Value.Name, race, sequence, field.Name, traitInfo));
|
||||
.F(image, actorInfo.Value.Name, faction, sequence, field.Name, traitInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,13 +33,13 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
|
||||
[ScriptActorPropertyActivity]
|
||||
[Desc("Build a unit, ignoring the production queue. The activity will wait if the exit is blocked.")]
|
||||
public void Produce(string actorType, string raceVariant = null)
|
||||
public void Produce(string actorType, string factionVariant = null)
|
||||
{
|
||||
ActorInfo actorInfo;
|
||||
if (!Self.World.Map.Rules.Actors.TryGetValue(actorType, out actorInfo))
|
||||
throw new LuaException("Unknown actor type '{0}'".F(actorType));
|
||||
|
||||
Self.QueueActivity(new WaitFor(() => p.Produce(Self, actorInfo, raceVariant)));
|
||||
Self.QueueActivity(new WaitFor(() => p.Produce(Self, actorInfo, factionVariant)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -738,7 +738,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
return true;
|
||||
}
|
||||
},
|
||||
{ "race",
|
||||
{ "faction",
|
||||
s =>
|
||||
{
|
||||
var parts = s.Split(' ');
|
||||
@@ -748,7 +748,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
if (targetClient.Index != client.Index && !client.IsAdmin)
|
||||
return true;
|
||||
|
||||
// Map has disabled race changes
|
||||
// Map has disabled faction changes
|
||||
if (server.LobbyInfo.Slots[targetClient.Slot].LockFaction)
|
||||
return true;
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (captor.World.LocalPlayer != captor.Owner)
|
||||
return;
|
||||
|
||||
var race = info.NewOwnerVoice ? newOwner.Faction.InternalName : oldOwner.Faction.InternalName;
|
||||
Sound.PlayNotification(self.World.Map.Rules, captor.World.LocalPlayer, "Speech", info.Notification, race);
|
||||
var faction = info.NewOwnerVoice ? newOwner.Faction.InternalName : oldOwner.Faction.InternalName;
|
||||
Sound.PlayNotification(self.World.Map.Rules, captor.World.LocalPlayer, "Speech", info.Notification, faction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
// The free unit crate requires same race and the actor needs to be mobile.
|
||||
// The free unit crate requires same faction and the actor needs to be mobile.
|
||||
// We want neither of these properties for crate power proxies.
|
||||
public override void Activate(Actor collector)
|
||||
{
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale);
|
||||
}
|
||||
|
||||
public virtual int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race)
|
||||
public virtual int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction)
|
||||
{
|
||||
return sequenceProvider.GetSequence(GetImage(ai, sequenceProvider, race), Sequence).Facings;
|
||||
return sequenceProvider.GetSequence(GetImage(ai, sequenceProvider, faction), Sequence).Facings;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,9 +57,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public IEnumerable<IActorPreview> RenderPreview(ActorPreviewInitializer init)
|
||||
{
|
||||
var sequenceProvider = init.World.Map.SequenceProvider;
|
||||
var race = init.Get<FactionInit, string>();
|
||||
var faction = init.Get<FactionInit, string>();
|
||||
var ownerName = init.Get<OwnerInit>().PlayerName;
|
||||
var image = GetImage(init.Actor, sequenceProvider, race);
|
||||
var image = GetImage(init.Actor, sequenceProvider, faction);
|
||||
var palette = init.WorldRenderer.Palette(Palette ?? PlayerPalette + ownerName);
|
||||
|
||||
var facings = 0;
|
||||
@@ -71,7 +71,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (facings == -1)
|
||||
{
|
||||
var qbo = init.Actor.Traits.GetOrDefault<IQuantizeBodyOrientationInfo>();
|
||||
facings = qbo != null ? qbo.QuantizedBodyFacings(init.Actor, sequenceProvider, race) : 1;
|
||||
facings = qbo != null ? qbo.QuantizedBodyFacings(init.Actor, sequenceProvider, faction) : 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,13 +80,13 @@ namespace OpenRA.Mods.Common.Traits
|
||||
yield return preview;
|
||||
}
|
||||
|
||||
public string GetImage(ActorInfo actor, SequenceProvider sequenceProvider, string race)
|
||||
public string GetImage(ActorInfo actor, SequenceProvider sequenceProvider, string faction)
|
||||
{
|
||||
if (FactionImages != null && !string.IsNullOrEmpty(race))
|
||||
if (FactionImages != null && !string.IsNullOrEmpty(faction))
|
||||
{
|
||||
string raceImage = null;
|
||||
if (FactionImages.TryGetValue(race, out raceImage) && sequenceProvider.HasSequence(raceImage))
|
||||
return raceImage;
|
||||
string factionImage = null;
|
||||
if (FactionImages.TryGetValue(faction, out factionImage) && sequenceProvider.HasSequence(factionImage))
|
||||
return factionImage;
|
||||
}
|
||||
|
||||
return (Image ?? actor.Name).ToLowerInvariant();
|
||||
|
||||
@@ -48,12 +48,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public virtual IEnumerable<IActorPreview> RenderPreview(ActorPreviewInitializer init)
|
||||
{
|
||||
var body = init.Actor.Traits.Get<BodyOrientationInfo>();
|
||||
var race = init.Get<FactionInit, string>();
|
||||
var faction = init.Get<FactionInit, string>();
|
||||
var ownerName = init.Get<OwnerInit>().PlayerName;
|
||||
var sequenceProvider = init.World.Map.SequenceProvider;
|
||||
var image = Image ?? init.Actor.Name;
|
||||
var facings = body.QuantizedFacings == -1 ?
|
||||
init.Actor.Traits.Get<IQuantizeBodyOrientationInfo>().QuantizedBodyFacings(init.Actor, sequenceProvider, race) :
|
||||
init.Actor.Traits.Get<IQuantizeBodyOrientationInfo>().QuantizedBodyFacings(init.Actor, sequenceProvider, faction) :
|
||||
body.QuantizedFacings;
|
||||
var palette = init.WorldRenderer.Palette(Palette ?? PlayerPalette + ownerName);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale);
|
||||
}
|
||||
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race) { return 1; }
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 1; }
|
||||
}
|
||||
|
||||
class WithCrateBody : INotifyParachuteLanded
|
||||
|
||||
@@ -31,10 +31,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale);
|
||||
}
|
||||
|
||||
public override int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race)
|
||||
public override int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction)
|
||||
{
|
||||
var rsi = ai.Traits.Get<RenderSpritesInfo>();
|
||||
return sequenceProvider.GetSequence(rsi.GetImage(ai, sequenceProvider, race), Sequence).Facings;
|
||||
return sequenceProvider.GetSequence(rsi.GetImage(ai, sequenceProvider, faction), Sequence).Facings;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,10 +41,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale);
|
||||
}
|
||||
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race)
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction)
|
||||
{
|
||||
var rsi = ai.Traits.Get<RenderSpritesInfo>();
|
||||
return sequenceProvider.GetSequence(rsi.GetImage(ai, sequenceProvider, race), StandSequences.First()).Facings;
|
||||
return sequenceProvider.GetSequence(rsi.GetImage(ai, sequenceProvider, faction), StandSequences.First()).Facings;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale);
|
||||
}
|
||||
|
||||
public virtual int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race)
|
||||
public virtual int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
() => false, () => 0);
|
||||
}
|
||||
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race) { return 0; }
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 0; }
|
||||
}
|
||||
|
||||
public class WithVoxelBody : IAutoSelectionSize
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public MusicInfo[] AvailablePlaylist()
|
||||
{
|
||||
// TO-DO: add filter options for Race-specific music
|
||||
// TODO: add filter options for faction-specific music
|
||||
return playlist;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
.RandomOrDefault(w.SharedRandom);
|
||||
|
||||
if (unitGroup == null)
|
||||
throw new InvalidOperationException("No starting units defined for country {0} with class {1}".F(p.Faction.InternalName, spawnClass));
|
||||
throw new InvalidOperationException("No starting units defined for faction {0} with class {1}".F(p.Faction.InternalName, spawnClass));
|
||||
|
||||
if (unitGroup.BaseActor != null)
|
||||
{
|
||||
|
||||
@@ -450,48 +450,48 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
void LoadPlayer(IniFile file, string section, bool isRA)
|
||||
{
|
||||
string c;
|
||||
string race;
|
||||
string faction;
|
||||
switch (section)
|
||||
{
|
||||
case "Spain":
|
||||
c = "gold";
|
||||
race = "allies";
|
||||
faction = "allies";
|
||||
break;
|
||||
case "England":
|
||||
c = "green";
|
||||
race = "allies";
|
||||
faction = "allies";
|
||||
break;
|
||||
case "Ukraine":
|
||||
c = "orange";
|
||||
race = "soviet";
|
||||
faction = "soviet";
|
||||
break;
|
||||
case "Germany":
|
||||
c = "black";
|
||||
race = "allies";
|
||||
faction = "allies";
|
||||
break;
|
||||
case "France":
|
||||
c = "teal";
|
||||
race = "allies";
|
||||
faction = "allies";
|
||||
break;
|
||||
case "Turkey":
|
||||
c = "salmon";
|
||||
race = "allies";
|
||||
faction = "allies";
|
||||
break;
|
||||
case "Greece":
|
||||
case "GoodGuy":
|
||||
c = isRA ? "blue" : "gold";
|
||||
race = isRA ? "allies" : "gdi";
|
||||
faction = isRA ? "allies" : "gdi";
|
||||
break;
|
||||
case "USSR":
|
||||
case "BadGuy":
|
||||
c = "red";
|
||||
race = isRA ? "soviet" : "nod";
|
||||
faction = isRA ? "soviet" : "nod";
|
||||
break;
|
||||
case "Special":
|
||||
case "Neutral":
|
||||
default:
|
||||
c = "neutral";
|
||||
race = isRA ? "allies" : "gdi";
|
||||
faction = isRA ? "allies" : "gdi";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
Name = section,
|
||||
OwnsWorld = section == "Neutral",
|
||||
NonCombatant = section == "Neutral",
|
||||
Faction = race,
|
||||
Faction = faction,
|
||||
Color = namedColorMapping[c]
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var cachedWidth = 0;
|
||||
var labelText = "";
|
||||
var showOwner = false;
|
||||
var flagRace = "";
|
||||
var flagFaction = "";
|
||||
var ownerName = "";
|
||||
var ownerColor = Color.White;
|
||||
var extraText = "";
|
||||
@@ -102,7 +102,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
if (showOwner)
|
||||
{
|
||||
flagRace = o.Faction.InternalName;
|
||||
flagFaction = o.Faction.InternalName;
|
||||
ownerName = o.PlayerName;
|
||||
ownerColor = o.Color.RGB;
|
||||
widget.Bounds.Height = doubleHeight;
|
||||
@@ -126,7 +126,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
label.GetText = () => labelText;
|
||||
flag.IsVisible = () => showOwner;
|
||||
flag.GetImageCollection = () => "flags";
|
||||
flag.GetImageName = () => flagRace;
|
||||
flag.GetImageName = () => flagFaction;
|
||||
owner.IsVisible = () => showOwner;
|
||||
owner.GetText = () => ownerName;
|
||||
owner.GetColor = () => ownerColor;
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
var item = ScrollItemWidget.Setup(itemTemplate,
|
||||
() => client.Faction == factionId,
|
||||
() => orderManager.IssueOrder(Order.Command("race {0} {1}".F(client.Index, factionId))));
|
||||
() => orderManager.IssueOrder(Order.Command("faction {0} {1}".F(client.Index, factionId))));
|
||||
var faction = factions[factionId];
|
||||
item.Get<LabelWidget>("LABEL").GetText = () => faction.Name;
|
||||
var flag = item.Get<ImageWidget>("FLAG");
|
||||
@@ -124,7 +124,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var options = factions.Where(f => f.Value.Selectable).GroupBy(f => f.Value.Side)
|
||||
.ToDictionary(g => g.Key ?? "", g => g.Select(f => f.Key));
|
||||
|
||||
dropdown.ShowDropDown("RACE_DROPDOWN_TEMPLATE", 150, options, setupItem);
|
||||
dropdown.ShowDropDown("FACTION_DROPDOWN_TEMPLATE", 150, options, setupItem);
|
||||
}
|
||||
|
||||
public static void ShowColorDropDown(DropDownButtonWidget color, Session.Client client,
|
||||
|
||||
@@ -67,13 +67,13 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
if (current == null)
|
||||
continue;
|
||||
|
||||
var race = queue.Trait.Actor.Owner.Faction.InternalName;
|
||||
var faction = queue.Trait.Actor.Owner.Faction.InternalName;
|
||||
var actor = queue.Trait.AllItems().FirstOrDefault(a => a.Name == current.Item);
|
||||
if (actor == null)
|
||||
continue;
|
||||
|
||||
var rsi = actor.Traits.Get<RenderSpritesInfo>();
|
||||
var icon = new Animation(world, rsi.GetImage(actor, world.Map.SequenceProvider, race));
|
||||
var icon = new Animation(world, rsi.GetImage(actor, world.Map.SequenceProvider, faction));
|
||||
icon.Play(actor.Traits.Get<TooltipInfo>().Icon);
|
||||
var bi = actor.Traits.Get<BuildableInfo>();
|
||||
var location = new float2(RenderBounds.Location) + new float2(queue.i * (IconWidth + IconSpacing), 0);
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
public ProductionFromMapEdge(ActorInitializer init, ProductionInfo info)
|
||||
: base(init, info) { }
|
||||
|
||||
public override bool Produce(Actor self, ActorInfo producee, string raceVariant)
|
||||
public override bool Produce(Actor self, ActorInfo producee, string factionVariant)
|
||||
{
|
||||
var location = self.World.Map.ChooseClosestEdgeCell(self.Location);
|
||||
var pos = self.World.Map.CenterOfCell(location);
|
||||
@@ -49,8 +49,8 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
new FacingInit(initialFacing)
|
||||
};
|
||||
|
||||
if (raceVariant != null)
|
||||
td.Add(new FactionInit(raceVariant));
|
||||
if (factionVariant != null)
|
||||
td.Add(new FactionInit(factionVariant));
|
||||
|
||||
var newUnit = self.World.CreateActor(producee.Name, td);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.TS.Traits
|
||||
() => false, () => 0);
|
||||
}
|
||||
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race) { return 0; }
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 0; }
|
||||
}
|
||||
|
||||
public class WithVoxelUnloadBody : IAutoSelectionSize
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.TS.Traits
|
||||
public readonly int TickRate = 5;
|
||||
public object Create(ActorInitializer init) { return new WithVoxelWalkerBody(init.Self, this); }
|
||||
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race) { return 0; }
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 0; }
|
||||
}
|
||||
|
||||
public class WithVoxelWalkerBody : IAutoSelectionSize, ITick
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.TS.Traits
|
||||
() => false, () => 0);
|
||||
}
|
||||
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race) { return 0; }
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 0; }
|
||||
}
|
||||
|
||||
public class WithVoxelWaterBody : IAutoSelectionSize
|
||||
|
||||
@@ -26,7 +26,7 @@ ScrollPanel@LABEL_DROPDOWN_TEMPLATE:
|
||||
Width: PARENT_RIGHT-20
|
||||
Height: 25
|
||||
|
||||
ScrollPanel@RACE_DROPDOWN_TEMPLATE:
|
||||
ScrollPanel@FACTION_DROPDOWN_TEMPLATE:
|
||||
Width: DROPDOWN_WIDTH
|
||||
Background: panel-black
|
||||
Children:
|
||||
|
||||
@@ -36,7 +36,7 @@ Container@SKIRMISH_STATS:
|
||||
Height: 25
|
||||
Text: Player
|
||||
Font: Bold
|
||||
Label@RACE:
|
||||
Label@FACTION:
|
||||
X: 150
|
||||
Width: 80
|
||||
Height: 25
|
||||
|
||||
@@ -36,7 +36,7 @@ Container@SKIRMISH_STATS:
|
||||
Height: 25
|
||||
Text: Player
|
||||
Font: Bold
|
||||
Label@RACE:
|
||||
Label@FACTION:
|
||||
X: 150
|
||||
Width: 80
|
||||
Height: 25
|
||||
|
||||
@@ -329,7 +329,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
|
||||
X: 190
|
||||
Y: 0
|
||||
|
||||
ScrollPanel@RACE_DROPDOWN_TEMPLATE:
|
||||
ScrollPanel@FACTION_DROPDOWN_TEMPLATE:
|
||||
Width: DROPDOWN_WIDTH
|
||||
Children:
|
||||
ScrollItem@HEADER:
|
||||
|
||||
@@ -36,7 +36,7 @@ Container@SKIRMISH_STATS:
|
||||
Height: 25
|
||||
Text: Player
|
||||
Font: Bold
|
||||
Label@RACE:
|
||||
Label@FACTION:
|
||||
X: 150
|
||||
Width: 80
|
||||
Height: 25
|
||||
|
||||
@@ -329,7 +329,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
|
||||
X: 190
|
||||
Y: 0
|
||||
|
||||
ScrollPanel@RACE_DROPDOWN_TEMPLATE:
|
||||
ScrollPanel@FACTION_DROPDOWN_TEMPLATE:
|
||||
Width: DROPDOWN_WIDTH
|
||||
Children:
|
||||
ScrollItem@HEADER:
|
||||
|
||||
Reference in New Issue
Block a user