diff --git a/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs b/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs index f6532a83cc..48d60f1715 100755 --- a/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Cnc.Widgets readonly WorldRenderer worldRenderer; readonly SupportPowerManager spm; - Dictionary iconSprites; + Animation icon; Animation clock; Dictionary icons = new Dictionary(); @@ -52,12 +52,7 @@ namespace OpenRA.Mods.Cnc.Widgets tooltipContainer = Lazy.New(() => Ui.Root.Get(TooltipContainer)); - iconSprites = Rules.Info.Values.SelectMany(u => u.Traits.WithInterface()) - .Select(u => u.Image).Distinct() - .ToDictionary( - u => u, - u => Game.modData.SpriteLoader.LoadAllSprites(u)[0]); - + icon = new Animation("icon"); clock = new Animation("clock"); } @@ -78,11 +73,12 @@ namespace OpenRA.Mods.Cnc.Widgets foreach (var p in powers) { var rect = new Rectangle(rb.X + 1, rb.Y + i * (48 + Spacing) + 1, 64, 48); + icon.Play(p.Info.Icon); var power = new SupportPowerIcon() { Power = p, Pos = new float2(rect.Location), - Sprite = iconSprites[p.Info.Image] + Sprite = icon.Image }; icons.Add(rect, power); diff --git a/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs b/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs index 6623770895..3c17aec827 100644 --- a/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs +++ b/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs @@ -69,104 +69,7 @@ namespace OpenRA.Mods.D2k.Widgets.Logic new string[] { "--r8", pathToDataR8, pathToPalette, "130", "145", Path.Combine(pathToSHPs, "rockcrater2") }, new string[] { "--r8", pathToDataR8, pathToPalette, "146", "161", Path.Combine(pathToSHPs, "sandcrater1") }, new string[] { "--r8", pathToDataR8, pathToPalette, "162", "177", Path.Combine(pathToSHPs, "sandcrater2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4011", "4011", Path.Combine(pathToSHPs, "rifleicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4012", "4012", Path.Combine(pathToSHPs, "bazookaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4013", "4013", Path.Combine(pathToSHPs, "engineericon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4014", "4014", Path.Combine(pathToSHPs, "thumpericon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4015", "4015", Path.Combine(pathToSHPs, "sardaukaricon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4016", "4016", Path.Combine(pathToSHPs, "trikeicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4017", "4017", Path.Combine(pathToSHPs, "raidericon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4018", "4018", Path.Combine(pathToSHPs, "quadicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4019", "4019", Path.Combine(pathToSHPs, "harvestericon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4020", "4020", Path.Combine(pathToSHPs, "combataicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4021", "4021", Path.Combine(pathToSHPs, "combathicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4022", "4022", Path.Combine(pathToSHPs, "combatoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4023", "4023", Path.Combine(pathToSHPs, "mcvicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4024", "4024", Path.Combine(pathToSHPs, "missiletankicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4025", "4025", Path.Combine(pathToSHPs, "deviatortankicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4026", "4026", Path.Combine(pathToSHPs, "siegetankicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4027", "4027", Path.Combine(pathToSHPs, "sonictankicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4028", "4028", Path.Combine(pathToSHPs, "devasticon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4029", "4029", Path.Combine(pathToSHPs, "carryallicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4030", "4030", Path.Combine(pathToSHPs, "carryallicon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4031", "4031", Path.Combine(pathToSHPs, "orniicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4032", "4032", Path.Combine(pathToSHPs, "fremenicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4033", "4033", Path.Combine(pathToSHPs, "fremenicon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4034", "4034", Path.Combine(pathToSHPs, "saboteuricon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4035", "4035", Path.Combine(pathToSHPs, "deathhandicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4036", "4036", Path.Combine(pathToSHPs, "rifleicon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4037", "4037", Path.Combine(pathToSHPs, "bazookaicon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4038", "4038", Path.Combine(pathToSHPs, "engineericon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4039", "4039", Path.Combine(pathToSHPs, "thumpericon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4040", "4040", Path.Combine(pathToSHPs, "sardaukaricon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4041", "4041", Path.Combine(pathToSHPs, "trikeicon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4042", "4042", Path.Combine(pathToSHPs, "raidericon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4043", "4043", Path.Combine(pathToSHPs, "quadicon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4044", "4044", Path.Combine(pathToSHPs, "harvestericon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4045", "4045", Path.Combine(pathToSHPs, "combataicon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4046", "4046", Path.Combine(pathToSHPs, "conyardaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4047", "4047", Path.Combine(pathToSHPs, "conyardhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4048", "4048", Path.Combine(pathToSHPs, "conyardoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4049", "4049", Path.Combine(pathToSHPs, "conyardaicon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4050", "4050", Path.Combine(pathToSHPs, "4plateaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4051", "4051", Path.Combine(pathToSHPs, "4platehicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4052", "4052", Path.Combine(pathToSHPs, "4plateoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4053", "4053", Path.Combine(pathToSHPs, "6plateaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4054", "4054", Path.Combine(pathToSHPs, "6platehicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4055", "4055", Path.Combine(pathToSHPs, "6plateoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4056", "4056", Path.Combine(pathToSHPs, "pwraicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4057", "4057", Path.Combine(pathToSHPs, "pwrhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4058", "4058", Path.Combine(pathToSHPs, "pwroicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4059", "4059", Path.Combine(pathToSHPs, "barraicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4060", "4060", Path.Combine(pathToSHPs, "barrhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4061", "4061", Path.Combine(pathToSHPs, "barroicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4062", "4062", Path.Combine(pathToSHPs, "orniicon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4063", "4063", Path.Combine(pathToSHPs, "wallaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4064", "4064", Path.Combine(pathToSHPs, "wallhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4065", "4065", Path.Combine(pathToSHPs, "walloicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4066", "4066", Path.Combine(pathToSHPs, "refaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4067", "4067", Path.Combine(pathToSHPs, "refhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4068", "4068", Path.Combine(pathToSHPs, "refoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4069", "4069", Path.Combine(pathToSHPs, "guntoweraicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4070", "4070", Path.Combine(pathToSHPs, "guntowerhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4071", "4071", Path.Combine(pathToSHPs, "guntoweroicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4072", "4072", Path.Combine(pathToSHPs, "radaraicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4073", "4073", Path.Combine(pathToSHPs, "radarhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4074", "4074", Path.Combine(pathToSHPs, "radaroicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4075", "4075", Path.Combine(pathToSHPs, "rockettoweraicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4076", "4076", Path.Combine(pathToSHPs, "rockettowerhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4077", "4077", Path.Combine(pathToSHPs, "rockettoweroicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4078", "4078", Path.Combine(pathToSHPs, "hightechaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4079", "4079", Path.Combine(pathToSHPs, "hightechhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4080", "4080", Path.Combine(pathToSHPs, "hightechoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4081", "4081", Path.Combine(pathToSHPs, "lightaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4082", "4082", Path.Combine(pathToSHPs, "lighthicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4083", "4083", Path.Combine(pathToSHPs, "lightoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4084", "4084", Path.Combine(pathToSHPs, "siloaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4085", "4085", Path.Combine(pathToSHPs, "silohicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4086", "4086", Path.Combine(pathToSHPs, "silooicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4087", "4087", Path.Combine(pathToSHPs, "heavyaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4088", "4088", Path.Combine(pathToSHPs, "heavyhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4089", "4089", Path.Combine(pathToSHPs, "heavyoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4090", "4090", Path.Combine(pathToSHPs, "orniicon3") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4091", "4091", Path.Combine(pathToSHPs, "heavyhicon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4092", "4092", Path.Combine(pathToSHPs, "starportaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4093", "4093", Path.Combine(pathToSHPs, "starporthicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4094", "4094", Path.Combine(pathToSHPs, "starportoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4095", "4095", Path.Combine(pathToSHPs, "orniicon4") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4096", "4096", Path.Combine(pathToSHPs, "repairaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4097", "4097", Path.Combine(pathToSHPs, "repairhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4098", "4098", Path.Combine(pathToSHPs, "repairoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4099", "4099", Path.Combine(pathToSHPs, "researchaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4100", "4100", Path.Combine(pathToSHPs, "researchhicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4101", "4101", Path.Combine(pathToSHPs, "researchoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4102", "4102", Path.Combine(pathToSHPs, "palaceaicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4103", "4103", Path.Combine(pathToSHPs, "palacehicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4104", "4104", Path.Combine(pathToSHPs, "palaceoicon") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4105", "4105", Path.Combine(pathToSHPs, "orniicon5") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4106", "4106", Path.Combine(pathToSHPs, "radaraicon2") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4107", "4107", Path.Combine(pathToSHPs, "radaraicon3") }, - new string[] { "--r8", pathToDataR8, pathToPalette, "4108", "4108", Path.Combine(pathToSHPs, "conyardaicon3") }, + new string[] { "--r8", Path.Combine(Platform.SupportDir, "Content/d2k/BLOXBASE.R8"), pathToPalette, "0", "799", Path.Combine(pathToTilesets, "BASE"), "--tileset" }, new string[] { "--r8", Path.Combine(Platform.SupportDir, "Content/d2k/BLOXBASE.R8"), pathToPalette, "748", "749", Path.Combine(pathToSHPs, "spice0") }, new string[] { "--r8", Path.Combine(Platform.SupportDir, "Content/d2k/BLOXBAT.R8"), pathToPalette, "0", "799", Path.Combine(pathToTilesets, "BAT"), "--tileset" }, @@ -183,83 +86,6 @@ namespace OpenRA.Mods.D2k.Widgets.Logic new string[] { "--shp", Path.Combine(pathToSHPs, "rockcrater2.png"), "32" }, new string[] { "--shp", Path.Combine(pathToSHPs, "sandcrater1.png"), "32" }, new string[] { "--shp", Path.Combine(pathToSHPs, "sandcrater2.png"), "32" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "rifleicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "bazookaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "engineericon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "thumpericon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "sardaukaricon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "trikeicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "raidericon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "quadicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "harvestericon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "combataicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "combathicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "combatoicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "mcvicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "missiletankicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "deviatortankicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "siegetankicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "sonictankicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "devasticon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "carryallicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "orniicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "fremenicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "saboteuricon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "deathhandicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "conyardaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "conyardhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "conyardoicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "4plateaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "4platehicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "4plateoicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "6plateaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "6platehicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "6plateoicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "pwraicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "pwrhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "pwroicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "barraicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "barrhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "barroicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "wallaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "wallhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "walloicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "refaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "refhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "refoicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "guntoweraicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "guntowerhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "guntoweroicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "radaraicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "radarhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "radaroicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "rockettoweraicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "rockettowerhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "rockettoweroicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "hightechaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "hightechhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "hightechoicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "lightaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "lighthicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "lightoicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "siloaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "silohicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "silooicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "heavyaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "heavyhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "heavyoicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "starportaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "starporthicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "starportoicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "repairaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "repairhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "repairoicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "researchaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "researchhicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "researchoicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "palaceaicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "palacehicon.png"), "60" }, - new string[] { "--shp", Path.Combine(pathToSHPs, "palaceoicon.png"), "60" }, new string[] { "--shp", Path.Combine(pathToSHPs, "spice0.png"), "32" }, }; diff --git a/OpenRA.Mods.RA/SupportPowers/SupportPower.cs b/OpenRA.Mods.RA/SupportPowers/SupportPower.cs index e7fecd849e..2580a5769f 100755 --- a/OpenRA.Mods.RA/SupportPowers/SupportPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/SupportPower.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.RA public abstract class SupportPowerInfo : ITraitInfo { public readonly int ChargeTime = 0; - public readonly string Image = null; + public readonly string Icon = null; public readonly string Description = ""; public readonly string LongDesc = ""; public readonly bool AllowMultiple = false; diff --git a/OpenRA.Mods.RA/Widgets/ObserverSupportPowerIconsWidget.cs b/OpenRA.Mods.RA/Widgets/ObserverSupportPowerIconsWidget.cs index 5b1a03aca7..ea2b607338 100644 --- a/OpenRA.Mods.RA/Widgets/ObserverSupportPowerIconsWidget.cs +++ b/OpenRA.Mods.RA/Widgets/ObserverSupportPowerIconsWidget.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA.Widgets public class ObserverSupportPowerIconsWidget : Widget { public Func GetPlayer; - Dictionary iconSprites; + Animation icon; World world; WorldRenderer worldRenderer; Dictionary clocks; @@ -29,21 +29,18 @@ namespace OpenRA.Mods.RA.Widgets public ObserverSupportPowerIconsWidget(World world, WorldRenderer worldRenderer) : base() { - iconSprites = Rules.Info.Values.SelectMany(u => u.Traits.WithInterface()) - .Select(u => u.Image).Distinct() - .ToDictionary( - u => u, - u => Game.modData.SpriteLoader.LoadAllSprites(u)[0]); + this.world = world; this.worldRenderer = worldRenderer; clocks = new Dictionary(); + icon = new Animation("icon"); } protected ObserverSupportPowerIconsWidget(ObserverSupportPowerIconsWidget other) : base(other) { GetPlayer = other.GetPlayer; - iconSprites = other.iconSprites; + icon = other.icon; world = other.world; worldRenderer = other.worldRenderer; clocks = other.clocks; @@ -68,12 +65,12 @@ namespace OpenRA.Mods.RA.Widgets foreach (var power in powers) { var item = power.a.Value; - if (item == null || item.Info == null || item.Info.Image == null) + if (item == null || item.Info == null || item.Info.Icon == null) continue; - var sprite = iconSprites[item.Info.Image]; - var size = sprite.size / new float2(2, 2); + icon.Play(item.Info.Icon); + var size = icon.Image.size / new float2(2, 2); var location = new float2(RenderBounds.Location) + new float2(power.i * (int)size.Length, 0); - WidgetUtils.DrawSHP(sprite, location, worldRenderer, size); + WidgetUtils.DrawSHP(icon.Image, location, worldRenderer, size); var clock = clocks[power.a.Key]; clock.PlayFetchIndex("idle", diff --git a/OpenRA.Mods.RA/Widgets/SupportPowerBinWidget.cs b/OpenRA.Mods.RA/Widgets/SupportPowerBinWidget.cs index 52b2fc5768..c33529618d 100755 --- a/OpenRA.Mods.RA/Widgets/SupportPowerBinWidget.cs +++ b/OpenRA.Mods.RA/Widgets/SupportPowerBinWidget.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA.Widgets public string ReadyText = ""; public string HoldText = ""; - Dictionary spsprites; + Animation icon; Animation clock; readonly List>> buttons = new List>>(); @@ -41,12 +41,7 @@ namespace OpenRA.Mods.RA.Widgets { base.Initialize(args); - spsprites = Rules.Info.Values.SelectMany( u => u.Traits.WithInterface() ) - .Select(u => u.Image).Distinct() - .ToDictionary( - u => u, - u => Game.modData.SpriteLoader.LoadAllSprites(u)[0]); - + icon = new Animation("icon"); clock = new Animation("clock"); } @@ -88,7 +83,7 @@ namespace OpenRA.Mods.RA.Widgets WidgetUtils.DrawRGBA(WidgetUtils.GetChromeImage(world, "specialbin-middle"), new float2(rectBounds.X, rectBounds.Y + i * 51)); WidgetUtils.DrawRGBA(WidgetUtils.GetChromeImage(world, "specialbin-bottom"), new float2(rectBounds.X, rectBounds.Y + numPowers * 51)); - // Hack Hack Hack + // HACK: Hack Hack Hack rectBounds.Width = 69; rectBounds.Height = 10 + numPowers * 51 + 21; @@ -96,7 +91,7 @@ namespace OpenRA.Mods.RA.Widgets foreach (var kv in powers) { var sp = kv.Value; - var image = spsprites[sp.Info.Image]; + icon.Play(sp.Info.Icon); var drawPos = new float2(rectBounds.X + 5, y); var rect = new Rectangle(rectBounds.X + 5, y, 64, 48); @@ -142,7 +137,7 @@ namespace OpenRA.Mods.RA.Widgets } } - WidgetUtils.DrawSHP(image, drawPos, worldRenderer); + WidgetUtils.DrawSHP(icon.Image, drawPos, worldRenderer); clock.PlayFetchIndex("idle", () => sp.TotalTime == 0 ? clock.CurrentSequence.Length - 1 : (sp.TotalTime - sp.RemainingTime) diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index 15884f469a..1f71570662 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -373,7 +373,7 @@ HQ: DetectCloaked: Range: 8 AirstrikePower: - Image: bombicnh + Icon: airstrike ChargeTime: 180 Description: Air Strike LongDesc: Deploy an aerial napalm strike.\nBurns buildings and infantry along a line. @@ -434,7 +434,7 @@ EYE: DetectCloaked: Range: 8 IonCannonPower: - Image: ionicnh + Icon: ioncannon ChargeTime: 180 Description: Ion Cannon LongDesc: Initiate an Ion Cannon strike.\nApplies instant damage to a small area. @@ -469,7 +469,7 @@ TMPL: Range: 6 Bib: NukePower: - Image: atomicnh + Icon: abomb ChargeTime: 300 Description: Nuclear Strike LongDesc: Launch a tactical nuke.\nApplies heavy damage over a large area. diff --git a/mods/cnc/sequences/misc.yaml b/mods/cnc/sequences/misc.yaml index 0617455d36..7328ce4543 100644 --- a/mods/cnc/sequences/misc.yaml +++ b/mods/cnc/sequences/misc.yaml @@ -296,4 +296,12 @@ poweroff: offline: Start: 0 Length: * - Tick: 160 \ No newline at end of file + Tick: 160 + +icon: + airstrike: bombicnh + Start: 0 + ioncannon: ionicnh + Start: 0 + abomb: atomicnh + Start: 0 \ No newline at end of file diff --git a/mods/d2k/rules/atreides.yaml b/mods/d2k/rules/atreides.yaml index 5f7a328a2b..a1e81b9751 100644 --- a/mods/d2k/rules/atreides.yaml +++ b/mods/d2k/rules/atreides.yaml @@ -42,7 +42,7 @@ PALACEA: Buildable: Owner: atreides AirstrikePower: - Image: orniicon + Icon: ornistrike Description: Air Strike ChargeTime: 180 LongDesc: Ornithopter drops a load of parachuted\nbombs on your target diff --git a/mods/d2k/rules/harkonnen.yaml b/mods/d2k/rules/harkonnen.yaml index f81561214c..dd5732eab5 100644 --- a/mods/d2k/rules/harkonnen.yaml +++ b/mods/d2k/rules/harkonnen.yaml @@ -74,7 +74,7 @@ PALACEH: Tooltip: Description: Provides elite infantry\n Special Ability: Death Hand Missile NukePower: - Image: deathhandicon + Icon: deathhand ChargeTime: 300 Description: Death Hand LongDesc: Launches a nuclear missile at a target location diff --git a/mods/d2k/rules/ordos.yaml b/mods/d2k/rules/ordos.yaml index 2afd63f80e..94843403dd 100644 --- a/mods/d2k/rules/ordos.yaml +++ b/mods/d2k/rules/ordos.yaml @@ -71,7 +71,7 @@ PALACEO: Buildable: Owner: ordos AirstrikePower: - Image: orniicon + Icon: ornistrike Description: Air Strike ChargeTime: 180 LongDesc: Ornithopter drops a load of parachuted\nbombs on your target diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index 16cda12cd0..7781258ef5 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -543,7 +543,7 @@ WALL: Name: IX Research Center Description: Unlocks experimental tanks\n Special Ability: Carryall Combat Drop ParatroopersPower: - Image: carryallicon + Icon: paratroopers UnitType: carryall.infantry FlareTime: 0 ChargeTime: 180 diff --git a/mods/d2k/sequences/aircraft.yaml b/mods/d2k/sequences/aircraft.yaml index c98a23e5fc..bdbf974858 100644 --- a/mods/d2k/sequences/aircraft.yaml +++ b/mods/d2k/sequences/aircraft.yaml @@ -5,6 +5,10 @@ carryall: unload: DATA.R8 Start: 1923 Facings: -32 + icon: DATA.R8 + Start: 4029 + Offset: -30,-24 + orni: idle: DATA.R8 @@ -13,6 +17,9 @@ orni: Length: 3 Tick: 120 Transpose: true + icon: DATA.R8 + Start: 4031 + Offset: -30,-24 frigate: idle: DATA.R8 diff --git a/mods/d2k/sequences/misc.yaml b/mods/d2k/sequences/misc.yaml index 71c1c40a9b..e9d1097590 100644 --- a/mods/d2k/sequences/misc.yaml +++ b/mods/d2k/sequences/misc.yaml @@ -217,3 +217,14 @@ doubleblast: idle: DATA.R8 Start: 3279 Facings: -16 + +icon: + paratroopers: DATA.R8 + Start: 4029 + Offset: -30,-24 + ornistrike: DATA.R8 + Start: 4031 + Offset: -30,-24 + deathhand: DATA.R8 + Start: 4035 + Offset: -30,-24 \ No newline at end of file diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index 3f9558178a..63e7951f0d 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -24,7 +24,7 @@ MSLO: Range: 5 IronCurtainable: NukePower: - Image: atomicon + Icon: abomb ChargeTime: 540 Description: Atom Bomb LongDesc: Launches a devastating atomic bomb\nat a target location. @@ -213,7 +213,7 @@ IRON: Range: 10 IronCurtainable: IronCurtainPower: - Image: infxicon + Icon: invuln ChargeTime: 120 Description: Invulnerability LongDesc: Makes a group of units invulnerable\nfor 20 seconds. @@ -251,7 +251,7 @@ PDOX: Range: 10 IronCurtainable: ChronoshiftPower: - Image: warpicon + Icon: chrono ChargeTime: 120 Description: Chronoshift LongDesc: Teleports a group of units across\nthe map for 20 seconds. @@ -851,7 +851,7 @@ ATEK: Bib: IronCurtainable: GpsPower: - Image: gpssicon + Icon: gps OneShot: yes ChargeTime: 480 Description: GPS Satellite @@ -1074,14 +1074,14 @@ AFLD: Reservable: IronCurtainable: SpyPlanePower: - Image: smigicon + Icon: spyplane ChargeTime: 180 Description: Spy Plane LongDesc: Reveals an area of the map. SelectTargetSound: slcttgt1.aud EndChargeSound: spypln1.aud ParatroopersPower: - Image: pinficon + Icon: paratroopers ChargeTime: 360 Description: Paratroopers LongDesc: A Badger drops a squad of Riflemen \nanywhere on the map @@ -1307,6 +1307,7 @@ FACF: Hotkey: c Queue: Defense Tooltip: + Icon: fake-icon Name: Fake Construction Yard Description: Looks like a Construction Yard. Building: @@ -1336,6 +1337,7 @@ WEAF: Hotkey: x Queue: Defense Tooltip: + Icon: fake-icon Name: Fake War Factory Description: Looks like a War Factory. Building: @@ -1366,6 +1368,7 @@ SYRF: Hotkey: z Queue: Defense Tooltip: + Icon: fake-icon Name: Fake Shipyard Description: Looks like a Shipyard TargetableBuilding: @@ -1399,6 +1402,7 @@ SPEF: Hotkey: z Queue: Defense Tooltip: + Icon: fake-icon Name: Fake Sub Pen Description: Looks like a Sub Pen Building: @@ -1422,6 +1426,7 @@ DOMF: Valued: Cost: 50 Tooltip: + Icon: fake-icon Name: Fake Radar Dome Description: Looks like a Radar Dome Buildable: diff --git a/mods/ra/sequences/misc.yaml b/mods/ra/sequences/misc.yaml index f45fe3f9ed..3b34749e0f 100644 --- a/mods/ra/sequences/misc.yaml +++ b/mods/ra/sequences/misc.yaml @@ -396,3 +396,17 @@ gpsdot: Start: 5 Structure: Start: 6 + +icon: + abomb: atomicon + Start: 0 + invuln: infxicon + Start: 0 + chrono: warpicon + Start: 0 + spyplane: smigicon + Start: 0 + paratroopers: pinficon + Start: 0 + gps: gpssicon + Start: 0 diff --git a/mods/ra/sequences/structures.yaml b/mods/ra/sequences/structures.yaml index e43eda7f1a..2d9e9e2426 100644 --- a/mods/ra/sequences/structures.yaml +++ b/mods/ra/sequences/structures.yaml @@ -62,6 +62,8 @@ fact: Length: * icon: facticon Start: 0 + fake-icon: facficon + Start: 0 proc: idle: @@ -180,6 +182,8 @@ dome: Length: * icon: domeicon Start: 0 + fake-icon: domficon + Start: 0 atek: idle: @@ -236,6 +240,8 @@ weap: Length: * icon: weapicon Start: 0 + fake-icon: weaficon + Start: 0 hpad: idle: @@ -298,6 +304,8 @@ spen: Length: * icon: spenicon Start: 0 + fake-icon: speficon + Start: 0 syrd: idle: @@ -309,6 +317,8 @@ syrd: Length: * icon: syrdicon Start: 0 + fake-icon: syrficon + Start: 0 fix: idle: