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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user