add hook for stance change notifications
This commit is contained in:
@@ -188,7 +188,10 @@ namespace OpenRA.Network
|
|||||||
var oldStance = p.Stances[target];
|
var oldStance = p.Stances[target];
|
||||||
p.Stances[target] = s;
|
p.Stances[target] = s;
|
||||||
if (target == w.LocalPlayer)
|
if (target == w.LocalPlayer)
|
||||||
w.WorldActor.Trait<Shroud>().UpdatePlayerStance(w, p, oldStance, s);
|
w.WorldActor.Trait<Shroud>().UpdatePlayerStance(w, p, oldStance, s);
|
||||||
|
|
||||||
|
foreach (var nsc in w.Queries.WithTrait<INotifyStanceChanged>())
|
||||||
|
nsc.Trait.StanceChanged(p, target, oldStance, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,5 +228,6 @@ namespace OpenRA.Traits
|
|||||||
bool TargetableBy(Actor self, Actor byActor);
|
bool TargetableBy(Actor self, Actor byActor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface INotifyKeyPress { bool KeyPressed(Actor self, KeyInput e); }
|
public interface INotifyKeyPress { bool KeyPressed(Actor self, KeyInput e); }
|
||||||
|
public interface INotifyStanceChanged { void StanceChanged(Player a, Player b, Stance oldStance, Stance newStance); }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user