private void ChangeView(ControlPanelButtonType controlPanelButtonType) { switch (controlPanelButtonType) { case ControlPanelButtonType.Economy: researchPanel.Refresh(ConstructionType.Economy); graphPanel.Refresh(ConstructionType.Economy); break; case ControlPanelButtonType.Environment: researchPanel.Refresh(ConstructionType.Environment); graphPanel.Refresh(ConstructionType.Environment); break; case ControlPanelButtonType.Energy: researchPanel.Refresh(ConstructionType.Energy); graphPanel.Refresh(ConstructionType.Energy); break; case ControlPanelButtonType.Education: researchPanel.Refresh(ConstructionType.Education); graphPanel.Refresh(ConstructionType.Education); break; case ControlPanelButtonType.Food: researchPanel.Refresh(ConstructionType.Food); graphPanel.Refresh(ConstructionType.Food); break; case ControlPanelButtonType.Health: researchPanel.Refresh(ConstructionType.Health); graphPanel.Refresh(ConstructionType.Health); break; } }
public ControlPanelButton(Game game, ControlPanelButtonType type) : base(game) { this.type = type; isSelected = false; switch (type) { case ControlPanelButtonType.Research: visual = new Sprite(game, GraphicsCollection.GetPack("control-button-research")); tooltipText = "Research"; AddChild(visual); break; case ControlPanelButtonType.Graph: visual = new Sprite(game, GraphicsCollection.GetPack("control-button-graph")); tooltipText = "Evolution graph"; AddChild(visual); break; case ControlPanelButtonType.Close: visual = new Sprite(game, GraphicsCollection.GetPack("control-button-close")); AddChild(visual); break; case ControlPanelButtonType.Economy: visual = new Sprite(game, GraphicsCollection.GetPack("control-mg-economy")); tooltipText = "Economy"; AddChild(visual); break; case ControlPanelButtonType.Education: visual = new Sprite(game, GraphicsCollection.GetPack("control-mg-education")); tooltipText = "Education"; AddChild(visual); break; case ControlPanelButtonType.Energy: visual = new Sprite(game, GraphicsCollection.GetPack("control-mg-energy")); tooltipText = "Energy"; AddChild(visual); break; case ControlPanelButtonType.Environment: visual = new Sprite(game, GraphicsCollection.GetPack("control-mg-environment")); tooltipText = "Environment"; AddChild(visual); break; case ControlPanelButtonType.Food: visual = new Sprite(game, GraphicsCollection.GetPack("control-mg-food")); tooltipText = "Food"; AddChild(visual); break; case ControlPanelButtonType.Health: visual = new Sprite(game, GraphicsCollection.GetPack("control-mg-health")); tooltipText = "Health"; AddChild(visual); break; case ControlPanelButtonType.ResearchIcon: visual = new Sprite(game, GraphicsCollection.GetPack("control-research-icon")); AddChild(visual); break; case ControlPanelButtonType.ResearchOK: visual = new Sprite(game, GraphicsCollection.GetPack("control-research-ok")); AddChild(visual); break; } }