/// <summary> /// Adds all buttons to the shortcut bar /// </summary> /// <param name="shortcutBar">The ShortcutBar to add the buttons to</param> public static void AssembleShortcutBarButtons(Widgets.ShortcutBar shortcutBar) { AddShowMenuButtonToBar(shortcutBar); AddShowInvButtonToBar(shortcutBar); AddShowMovesButtonToBar(shortcutBar); //AddUseRecoveryItemButtonToBar(shortcutBar); AddShowOnlineListButtonToBar(shortcutBar); AddShowOptionsButtonToBar(shortcutBar); }
/// <summary> /// Adds the 'Show Moves' button to the specified ShortcutBar /// </summary> /// <param name="shortcutBar">The ShortcutBar to add the button to</param> public static void AddShowMovesButtonToBar(Widgets.ShortcutBar shortcutBar) { Widgets.ShortcutButton button = new Widgets.ShortcutButton("showMovesButton"); button.BackColor = Color.Transparent; button.Image = Skins.SkinManager.LoadGuiElement("Game Window/ShortcutBar", "showmoves.png"); button.HighlightImage = Skins.SkinManager.LoadGuiElement("Game Window/ShortcutBar", "showmoves-h.png"); button.Click += new EventHandler <SdlDotNet.Widgets.MouseButtonEventArgs>(showMovesButton_Click); shortcutBar.AddButton(button); }
public winGame() { //this.Windowed = false; //this.Size = SdlDotNet.Graphics.Video.Screen.Size; //this.Location = new System.Drawing.Point(0, 0); //this.BackColor = Color.SteelBlue; pnlTeam = new ActiveTeamPanel("pnlTeam"); pnlTeam.Size = new Size(SdlDotNet.Graphics.Video.Screen.Width/* - 50*/, 100); pnlTeam.Location = new Point(SdlDotNet.Widgets.DrawingSupport.GetCenter(SdlDotNet.Graphics.Video.Screen.Size, pnlTeam.Size).X, 0); lblStats = new StatLabel("lblStats"); lblStats.Size = new System.Drawing.Size(400, 30); lblStats.Location = new Point(pnlTeam.X + 10, 70); mapViewer = new Widgets.MapViewer("mapViewer"); mapViewer.Size = new Size(640, 480); mapViewer.Location = new Point(SdlDotNet.Graphics.Video.Screen.Width - mapViewer.Width, pnlTeam.Y + pnlTeam.Height + 1); mapViewer.ActiveMap = null; mapViewer.BackColor = Color.Gray; mapViewer.KeyRepeatInterval = 1; //mapViewer.BeforeKeyDown += new EventHandler<SdlDotNet.Widgets.BeforeKeyDownEventArgs>(mapViewer_BeforeKeyDown); mapViewer.KeyDown += new EventHandler<SdlDotNet.Input.KeyboardEventArgs>(mapViewer_KeyDown); mapViewer.KeyUp += new EventHandler<SdlDotNet.Input.KeyboardEventArgs>(mapViewer_KeyUp); mapViewer.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(mapViewer_Click); mapViewer.MouseMotion += new EventHandler<SdlDotNet.Input.MouseMotionEventArgs>(mapViewer_MouseMotion); menuManager = new Menus.Core.MenuManager("menuManager", mapViewer); menuManager.Location = mapViewer.Location; menuManager.Size = mapViewer.Size; menuManager.Visible = false; menuManager.KeyDown += new EventHandler<SdlDotNet.Input.KeyboardEventArgs>(menuManager_KeyDown); menuManager.KeyUp += new EventHandler<SdlDotNet.Input.KeyboardEventArgs>(menuManager_KeyUp); menuManager.KeyRepeatInterval = 0; menuManager.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(menuManager_Click); battleLog = new BattleLog("battleLog"); battleLog.Size = new System.Drawing.Size(mapViewer.Width - 10, 100); battleLog.Location = new Point(mapViewer.X + 5, mapViewer.Y + mapViewer.Height - battleLog.Height); battleLog.Visible = false; shortcutBar = new ShortcutBar("shortcutBar"); shortcutBar.Location = new Point(SdlDotNet.Graphics.Video.Screen.Width - shortcutBar.Width, mapViewer.Y + mapViewer.Height); ShortcutBarBuilder.AssembleShortcutBarButtons(shortcutBar); pnlTeam.Hide(); lblStats.Hide(); mapViewer.Hide(); menuManager.Hide(); shortcutBar.Hide(); SdlDotNet.Widgets.Screen.AddWidget(pnlTeam); SdlDotNet.Widgets.Screen.AddWidget(mapViewer); SdlDotNet.Widgets.Screen.AddWidget(lblStats); SdlDotNet.Widgets.Screen.AddWidget(battleLog); SdlDotNet.Widgets.Screen.AddWidget(menuManager); SdlDotNet.Widgets.Screen.AddWidget(shortcutBar); InitMapEditorWidgets(); // Add the events pnlTeam.ActiveRecruitChanged += new EventHandler<Events.ActiveRecruitChangedEventArgs>(pnlTeam_ActiveRecruitChanged); //this.LoadComplete(); SdlDotNet.Core.Events.Tick += new EventHandler<SdlDotNet.Core.TickEventArgs>(winGame_Tick); //base.Tick += new EventHandler<SdlDotNet.Core.TickEventArgs>(winGame_Tick); }