public LeftMenu(Game game) : base(game) { frame = new Sprite(game, GraphicsCollection.GetPack("left-menu-frame")); frame.StackOrder = 1; AddChild(frame); minimize = new PanelButton(game, PanelButtonType.ResourcesMinimize); minimize.StackOrder = 2; minimize.XRelative = 60; minimize.YRelative = 11; minimize.OnMousePress += new EventHandler <Operation_Cronos.Input.MouseEventArgs>(minimize_OnMousePress); AddChild(minimize); parameters = new ParametersPanel(game); parameters.XRelative = ParametersPanel.ClosedPosition; parameters.YRelative = 15; parameters.StackOrder = 0; AddChild(parameters); alert = new PanelButton(game, PanelButtonType.ResourcesAlert); alert.XRelative = buttonsX; alert.YRelative = 25; alert.StackOrder = 3; alert.OnMouseOver += new EventHandler <ButtonEventArgs>(LeftButton_OnMouseOver); alert.OnMouseLeave += new EventHandler <ButtonEventArgs>(LeftButton_OnMouseLeave); alert.OnRelease += new EventHandler <ButtonEventArgs>(button_OnRelease); AddChild(alert); mission = new PanelButton(game, PanelButtonType.ResourcesMission); mission.StackOrder = 3; mission.XRelative = buttonsX; mission.YRelative = 60; mission.OnMouseOver += new EventHandler <ButtonEventArgs>(LeftButton_OnMouseOver); mission.OnMouseLeave += new EventHandler <ButtonEventArgs>(LeftButton_OnMouseLeave); mission.OnRelease += new EventHandler <ButtonEventArgs>(button_OnRelease); AddChild(mission); control = new PanelButton(game, PanelButtonType.ResourcesControl); control.StackOrder = 3; control.XRelative = buttonsX; control.YRelative = 89; control.OnMouseOver += new EventHandler <ButtonEventArgs>(LeftButton_OnMouseOver); control.OnMouseLeave += new EventHandler <ButtonEventArgs>(LeftButton_OnMouseLeave); control.OnRelease += new EventHandler <ButtonEventArgs>(button_OnRelease); AddChild(control); save = new PanelButton(game, PanelButtonType.ResourcesSave); save.StackOrder = 3; save.XRelative = buttonsX + 3; save.YRelative = 123; save.OnMouseOver += new EventHandler <ButtonEventArgs>(LeftButton_OnMouseOver); save.OnMouseLeave += new EventHandler <ButtonEventArgs>(LeftButton_OnMouseLeave); save.OnRelease += new EventHandler <ButtonEventArgs>(button_OnRelease); AddChild(save); exit = new PanelButton(game, PanelButtonType.ResourcesExit); exit.StackOrder = 3; exit.XRelative = buttonsX + 2; exit.YRelative = 155; exit.OnMouseOver += new EventHandler <ButtonEventArgs>(LeftButton_OnMouseOver); exit.OnMouseLeave += new EventHandler <ButtonEventArgs>(LeftButton_OnMouseLeave); exit.OnRelease += new EventHandler <ButtonEventArgs>(button_OnRelease); AddChild(exit); #region ControlPanel controlPanel = new ControlPanel(game); controlPanel.StackOrder = 3; controlPanel.Visible = false; controlPanel.Enabled = false; AddChild(controlPanel); #endregion #region MissionPannel missionPanel = new MissionPanel(game); missionPanel.StackOrder = 3; missionPanel.XRelative = 300; missionPanel.YRelative = 200; missionPanel.Visible = false; missionPanel.Enabled = false; AddChild(missionPanel); #endregion #region AlertPannel alertPanel = new AlertPanel(game); alertPanel.StackOrder = 3; alertPanel.XRelative = 300; alertPanel.YRelative = 200; alertPanel.Visible = false; alertPanel.Enabled = false; alertPanel.On_Blink += new EventHandler(alertPanel_On_Blink); AddChild(alertPanel); #endregion tooltip = new Tooltip(game, 2); tooltip.XRelative = buttonsX + exit.Width + 5; tooltip.StackOrder = 2; tooltip.YRelative = 0; AddChild(tooltip); tooltip.Visible = false; }
public LeftMenu(Game game) : base(game) { frame = new Sprite(game, GraphicsCollection.GetPack("left-menu-frame")); frame.StackOrder = 1; AddChild(frame); minimize = new PanelButton(game, PanelButtonType.ResourcesMinimize); minimize.StackOrder = 2; minimize.XRelative = 60; minimize.YRelative = 11; minimize.OnMousePress += new EventHandler<Operation_Cronos.Input.MouseEventArgs>(minimize_OnMousePress); AddChild(minimize); parameters = new ParametersPanel(game); parameters.XRelative = ParametersPanel.ClosedPosition; parameters.YRelative = 15; parameters.StackOrder = 0; AddChild(parameters); alert = new PanelButton(game, PanelButtonType.ResourcesAlert); alert.XRelative = buttonsX; alert.YRelative = 25; alert.StackOrder = 3; alert.OnMouseOver += new EventHandler<ButtonEventArgs>(LeftButton_OnMouseOver); alert.OnMouseLeave += new EventHandler<ButtonEventArgs>(LeftButton_OnMouseLeave); alert.OnRelease += new EventHandler<ButtonEventArgs>(button_OnRelease); AddChild(alert); mission = new PanelButton(game, PanelButtonType.ResourcesMission); mission.StackOrder = 3; mission.XRelative = buttonsX; mission.YRelative = 60; mission.OnMouseOver += new EventHandler<ButtonEventArgs>(LeftButton_OnMouseOver); mission.OnMouseLeave += new EventHandler<ButtonEventArgs>(LeftButton_OnMouseLeave); mission.OnRelease += new EventHandler<ButtonEventArgs>(button_OnRelease); AddChild(mission); control = new PanelButton(game, PanelButtonType.ResourcesControl); control.StackOrder = 3; control.XRelative = buttonsX; control.YRelative = 89; control.OnMouseOver += new EventHandler<ButtonEventArgs>(LeftButton_OnMouseOver); control.OnMouseLeave += new EventHandler<ButtonEventArgs>(LeftButton_OnMouseLeave); control.OnRelease += new EventHandler<ButtonEventArgs>(button_OnRelease); AddChild(control); save = new PanelButton(game, PanelButtonType.ResourcesSave); save.StackOrder = 3; save.XRelative = buttonsX + 3; save.YRelative = 123; save.OnMouseOver += new EventHandler<ButtonEventArgs>(LeftButton_OnMouseOver); save.OnMouseLeave += new EventHandler<ButtonEventArgs>(LeftButton_OnMouseLeave); save.OnRelease += new EventHandler<ButtonEventArgs>(button_OnRelease); AddChild(save); exit = new PanelButton(game, PanelButtonType.ResourcesExit); exit.StackOrder = 3; exit.XRelative = buttonsX+2; exit.YRelative = 155; exit.OnMouseOver += new EventHandler<ButtonEventArgs>(LeftButton_OnMouseOver); exit.OnMouseLeave += new EventHandler<ButtonEventArgs>(LeftButton_OnMouseLeave); exit.OnRelease+=new EventHandler<ButtonEventArgs>(button_OnRelease); AddChild(exit); #region ControlPanel controlPanel = new ControlPanel(game); controlPanel.StackOrder = 3; controlPanel.Visible = false; controlPanel.Enabled = false; AddChild(controlPanel); #endregion #region MissionPannel missionPanel = new MissionPanel(game); missionPanel.StackOrder = 3; missionPanel.XRelative = 300; missionPanel.YRelative = 200; missionPanel.Visible = false; missionPanel.Enabled = false; AddChild(missionPanel); #endregion #region AlertPannel alertPanel = new AlertPanel(game); alertPanel.StackOrder = 3; alertPanel.XRelative = 300; alertPanel.YRelative = 200; alertPanel.Visible = false; alertPanel.Enabled = false; alertPanel.On_Blink += new EventHandler(alertPanel_On_Blink); AddChild(alertPanel); #endregion tooltip = new Tooltip(game, 2); tooltip.XRelative = buttonsX + exit.Width + 5; tooltip.StackOrder = 2; tooltip.YRelative = 0; AddChild(tooltip); tooltip.Visible = false; }