1
0
forked from mirrors/0ad

Use (civ-specific) standards to show formations.

Since we can have battalion-style formations (a70a20fd42), it is nice to
show a TW-style banner for them.
Code adapted from @Silier at
https://wildfiregames.com/forum/topic/68008-formation-standards-total-war-style-flags-over-battalions/.

Differential revision: https://code.wildfiregames.com/D4467
Comments by: @asterix, @Silier
Refs. #4545

This was SVN commit r26326.
This commit is contained in:
Freagarach
2022-02-09 06:54:12 +00:00
parent ed70f931ba
commit d0549d7994
2 changed files with 8 additions and 6 deletions
@@ -981,6 +981,8 @@ Formation.prototype.OnGlobalOwnershipChanged = function(msg)
// controlled by this formation.
if (this.members.indexOf(msg.entity) != -1)
this.RemoveMembers([msg.entity]);
if (msg.entity === this.entity && msg.to !== INVALID_PLAYER)
Engine.QueryInterface(this.entity, IID_Visual)?.SetVariant("animationVariant", QueryPlayerIDInterface(msg.to, IID_Identity).GetCiv());
};
Formation.prototype.OnGlobalEntityRenamed = function(msg)
@@ -14,12 +14,6 @@
</Texture>
</Overlay>
</Selectable>
<VisualActor>
<Actor>props/special/common/waypoint_flag.xml</Actor>
<SilhouetteDisplay>true</SilhouetteDisplay>
<SilhouetteOccluder>false</SilhouetteOccluder>
<VisibleInAtlasOnly>false</VisibleInAtlasOnly>
</VisualActor>
-->
<Formation>
<RequiredMemberCount>2</RequiredMemberCount>
@@ -76,4 +70,10 @@
<PassabilityClass>large</PassabilityClass>
<Weight>100</Weight>
</UnitMotion>
<VisualActor>
<Actor>props/special/common/waypoint_flag.xml</Actor>
<SilhouetteDisplay>true</SilhouetteDisplay>
<SilhouetteOccluder>false</SilhouetteOccluder>
<VisibleInAtlasOnly>false</VisibleInAtlasOnly>
</VisualActor>
</Entity>