fix bogosity in SpecialPowerBinWidget (manifests as crash after mod change)
This commit is contained in:
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
{
|
{
|
||||||
class SpecialPowerBinWidget : Widget
|
class SpecialPowerBinWidget : Widget
|
||||||
{
|
{
|
||||||
static Dictionary<string, Sprite> spsprites;
|
Dictionary<string, Sprite> spsprites;
|
||||||
Animation ready;
|
Animation ready;
|
||||||
Animation clock;
|
Animation clock;
|
||||||
readonly List<Pair<Rectangle, Action<MouseInput>>> buttons = new List<Pair<Rectangle,Action<MouseInput>>>();
|
readonly List<Pair<Rectangle, Action<MouseInput>>> buttons = new List<Pair<Rectangle,Action<MouseInput>>>();
|
||||||
@@ -38,12 +38,11 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
if (spsprites == null)
|
spsprites = Rules.Info.Values.SelectMany( u => u.Traits.WithInterface<SupportPowerInfo>() )
|
||||||
spsprites = Rules.Info.Values.SelectMany( u => u.Traits.WithInterface<SupportPowerInfo>() )
|
.Select(u => u.Image).Distinct()
|
||||||
.Select(u => u.Image).Distinct()
|
.ToDictionary(
|
||||||
.ToDictionary(
|
u => u,
|
||||||
u => u,
|
u => Game.modData.SpriteLoader.LoadAllSprites(u)[0]);
|
||||||
u => Game.modData.SpriteLoader.LoadAllSprites(u)[0]);
|
|
||||||
|
|
||||||
ready = new Animation("pips");
|
ready = new Animation("pips");
|
||||||
ready.PlayRepeating("ready");
|
ready.PlayRepeating("ready");
|
||||||
|
|||||||
Reference in New Issue
Block a user