void btnBuilding_Click(object sender, ToWSpikeSpike.Entities.UIElementEventArgs e) { UIElement btn = (UIElement)sender; Factory b = (Factory)btn.Tag; b = (Factory)b.Clone(); b.Location = UnitPlacementLocation; b.MyArena = this; this.AllItems.Add(b); UnitSelectionPanel.isVisible = false; }
void ControlPanel_Click(object sender, ToWSpikeSpike.Entities.UIElementEventArgs e) { if (!UnitSelectionPanel.isVisible) { Location l = new Location() { Screen = new Vector2(e.MouseState.X, e.MouseState.Y) }; l = new Location() { Grid = new Vector2(l.Grid.X - 10, l.Grid.Y) }; UnitSelectionPanel.isVisible = true; UnitPlacementLocation = l; } }
void DesignMode_Click(object sender, ToWSpikeSpike.Entities.UIElementEventArgs e) { isDesignMode = !isDesignMode; UnitPlacementPanel.isVisible = isDesignMode; UnitSelectionPanel.isVisible = false; }