added selection-changed hook
This commit is contained in:
@@ -25,6 +25,9 @@ namespace OpenRa
|
|||||||
|
|
||||||
var voicedUnit = actors.FirstOrDefault(a => a.traits.Contains<Unit>() && a.Owner == world.LocalPlayer);
|
var voicedUnit = actors.FirstOrDefault(a => a.traits.Contains<Unit>() && a.Owner == world.LocalPlayer);
|
||||||
Sound.PlayVoice("Select", voicedUnit);
|
Sound.PlayVoice("Select", voicedUnit);
|
||||||
|
|
||||||
|
foreach (var ns in world.WorldActor.traits.WithInterface<INotifySelection>())
|
||||||
|
ns.SelectionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<Actor> Actors { get { return actors; } }
|
public IEnumerable<Actor> Actors { get { return actors; } }
|
||||||
|
|||||||
@@ -99,5 +99,7 @@ namespace OpenRa.Traits
|
|||||||
public object Create(Actor self) { return Instance.Value; }
|
public object Create(Actor self) { return Instance.Value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ITraitPrerequisite<T> { }
|
public interface ITraitPrerequisite<T> { }
|
||||||
|
|
||||||
|
public interface INotifySelection { void SelectionChanged(); }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user