PrimaryBuilding is no longer necessary in cnc; remove cruft from BuildPaletteWidget
This commit is contained in:
@@ -29,14 +29,15 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
List<ProductionQueue> visibleTabs = new List<ProductionQueue>();
|
List<ProductionQueue> visibleTabs = new List<ProductionQueue>();
|
||||||
|
|
||||||
bool paletteOpen = false;
|
bool paletteOpen = false;
|
||||||
Dictionary<string, string[]> tabImageNames;
|
|
||||||
Dictionary<string, Sprite> iconSprites;
|
Dictionary<string, Sprite> iconSprites;
|
||||||
|
|
||||||
static float2 paletteOpenOrigin = new float2(Game.viewport.Width - 215, 280);
|
static float2 paletteOpenOrigin = new float2(Game.viewport.Width - 215, 280);
|
||||||
static float2 paletteClosedOrigin = new float2(Game.viewport.Width - 16, 280);
|
static float2 paletteClosedOrigin = new float2(Game.viewport.Width - 16, 280);
|
||||||
static float2 paletteOrigin = paletteClosedOrigin;
|
static float2 paletteOrigin = paletteClosedOrigin;
|
||||||
const int paletteAnimationLength = 7;
|
const int paletteAnimationLength = 7;
|
||||||
int paletteAnimationFrame = 0;
|
int paletteAnimationFrame = 0;
|
||||||
bool paletteAnimating = false;
|
bool paletteAnimating = false;
|
||||||
|
|
||||||
List<Pair<Rectangle, Action<MouseInput>>> buttons = new List<Pair<Rectangle,Action<MouseInput>>>();
|
List<Pair<Rectangle, Action<MouseInput>>> buttons = new List<Pair<Rectangle,Action<MouseInput>>>();
|
||||||
List<Pair<Rectangle, Action<MouseInput>>> tabs = new List<Pair<Rectangle, Action<MouseInput>>>();
|
List<Pair<Rectangle, Action<MouseInput>>> tabs = new List<Pair<Rectangle, Action<MouseInput>>>();
|
||||||
Animation cantBuild;
|
Animation cantBuild;
|
||||||
@@ -63,15 +64,7 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
.ToDictionary(
|
.ToDictionary(
|
||||||
u => u.Name,
|
u => u.Name,
|
||||||
u => SpriteSheetBuilder.LoadAllSprites(u.Traits.Get<TooltipInfo>().Icon ?? (u.Name + "icon"))[0]);
|
u => SpriteSheetBuilder.LoadAllSprites(u.Traits.Get<TooltipInfo>().Icon ?? (u.Name + "icon"))[0]);
|
||||||
|
|
||||||
var groups = Rules.Categories();
|
|
||||||
|
|
||||||
tabImageNames = groups.Select(
|
|
||||||
(g, i) => Pair.New(g,
|
|
||||||
OpenRA.Graphics.Util.MakeArray(3,
|
|
||||||
n => i.ToString())))
|
|
||||||
.ToDictionary(a => a.First, a => a.Second);
|
|
||||||
|
|
||||||
IsVisible = () => { return CurrentQueue != null || (CurrentQueue == null && !paletteOpen); };
|
IsVisible = () => { return CurrentQueue != null || (CurrentQueue == null && !paletteOpen); };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,7 +330,6 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
|
|
||||||
void HandleBuildPalette( World world, string item, bool isLmb )
|
void HandleBuildPalette( World world, string item, bool isLmb )
|
||||||
{
|
{
|
||||||
var player = world.LocalPlayer;
|
|
||||||
var unit = Rules.Info[item];
|
var unit = Rules.Info[item];
|
||||||
var eva = world.WorldActor.Info.Traits.Get<EvaAlertsInfo>();
|
var eva = world.WorldActor.Info.Traits.Get<EvaAlertsInfo>();
|
||||||
var producing = CurrentQueue.AllItems().FirstOrDefault( a => a.Item == item );
|
var producing = CurrentQueue.AllItems().FirstOrDefault( a => a.Item == item );
|
||||||
|
|||||||
@@ -181,7 +181,6 @@ PYLE:
|
|||||||
Produces: Infantry
|
Produces: Infantry
|
||||||
SpawnOffsets: -10,2, 7,7
|
SpawnOffsets: -10,2, 7,7
|
||||||
ExitCells: 0,1, 1,1
|
ExitCells: 0,1, 1,1
|
||||||
PrimaryBuilding:
|
|
||||||
ProductionQueue@Vehicle:
|
ProductionQueue@Vehicle:
|
||||||
Type: Infantry
|
Type: Infantry
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
@@ -215,7 +214,6 @@ HAND:
|
|||||||
Produces: Infantry
|
Produces: Infantry
|
||||||
SpawnOffsets: 12,24
|
SpawnOffsets: 12,24
|
||||||
ExitCells:1,2
|
ExitCells:1,2
|
||||||
PrimaryBuilding:
|
|
||||||
ProductionQueue@Infantry:
|
ProductionQueue@Infantry:
|
||||||
Type: Infantry
|
Type: Infantry
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
@@ -251,7 +249,6 @@ AFLD:
|
|||||||
Produces: Vehicle
|
Produces: Vehicle
|
||||||
SpawnOffsets: -24,0
|
SpawnOffsets: -24,0
|
||||||
ExitCells:3,1
|
ExitCells:3,1
|
||||||
PrimaryBuilding:
|
|
||||||
ProductionQueue@Vehicle:
|
ProductionQueue@Vehicle:
|
||||||
Type: Vehicle
|
Type: Vehicle
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
@@ -288,7 +285,6 @@ WEAP:
|
|||||||
Produces: Vehicle
|
Produces: Vehicle
|
||||||
SpawnOffsets: -8,-8
|
SpawnOffsets: -8,-8
|
||||||
ExitCells: 0,2
|
ExitCells: 0,2
|
||||||
PrimaryBuilding:
|
|
||||||
ProductionQueue@Vehicle:
|
ProductionQueue@Vehicle:
|
||||||
Type: Vehicle
|
Type: Vehicle
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
@@ -401,7 +397,6 @@ HPAD:
|
|||||||
SpawnOffsets: 0,-6
|
SpawnOffsets: 0,-6
|
||||||
ExitCells: 0,0
|
ExitCells: 0,0
|
||||||
Produces: Plane
|
Produces: Plane
|
||||||
PrimaryBuilding:
|
|
||||||
BelowUnits:
|
BelowUnits:
|
||||||
Reservable:
|
Reservable:
|
||||||
RepairsUnits:
|
RepairsUnits:
|
||||||
|
|||||||
Reference in New Issue
Block a user