/// <summary> /// Initializes a new instance of the LogOnWindow class. /// </summary> /// <param name="engine">A reference to the game engine associated with this instance.</param> /// <param name="network">The network connection manager used to connect to the network.</param> public LogOnWindow(GameEngine engine, NetworkClient network) { this.InitializeComponent(); this.Dock = DockStyle.Fill; this.engine = engine; this.network = network; this.PopulateServerList(); }
/// <summary> /// Initializes a new instance of the InterfaceManager class. /// </summary> /// <param name="gameEngine">The game engine associated with this instance.</param> /// <param name="network">The network connection manager used to connect to the network.</param> /// <param name="parentControl">The control that is the parent of the user interface.</param> public InterfaceManager(GameEngine gameEngine, NetworkClient network, GameWindow parentControl) { this.GameEngine = gameEngine; this.Network = network; this.parentControl = parentControl; // Create the login screen this.parentControl.Controls.Add(this.LogOnWindow = new LogOnWindow(this.GameEngine, this.Network)); // Set up the control buttons panel this.parentControl.Controls.Add(this.ControlButtonsPanel = new ControlButtonsPanel(this.GameEngine, this.Network)); // Hook button events for control buttons panel this.ControlButtonsPanel.ButtonInventory.Click += new EventHandler(this.ControlButton_Click); this.ControlButtonsPanel.ButtonBelt.Click += new EventHandler(this.ControlButton_Click); this.ControlButtonsPanel.ButtonArts.Click += new EventHandler(this.ControlButton_Click); this.ControlButtonsPanel.ButtonCharacterDetails.Click += new EventHandler(this.ControlButton_Click); this.ControlButtonsPanel.ButtonQuestJournal.Click += new EventHandler(this.ControlButton_Click); this.ControlButtonsPanel.ButtonParty.Click += new EventHandler(this.ControlButton_Click); this.ControlButtonsPanel.ButtonSettings.Click += new EventHandler(this.ControlButton_Click); this.ControlButtonsPanel.ButtonQuit.Click += new EventHandler(this.ControlButtonQuit_Click); // Create inventory window this.parentControl.Controls.Add(this.InventoryWindow = new InventoryWindow(this.GameEngine, this.Network)); this.ControlButtonsPanel.ButtonInventory.Tag = this.InventoryWindow; // Create magic window this.parentControl.Controls.Add(this.ArtsWindow = new ArtsWindow(this.GameEngine, this.Network)); this.ControlButtonsPanel.ButtonArts.Tag = this.ArtsWindow; // Create settings window this.parentControl.Controls.Add(this.SettingsWindow = new SettingsWindow(this)); this.ControlButtonsPanel.ButtonSettings.Tag = this.SettingsWindow; // Set up the shortcut buttons panel this.parentControl.Controls.Add(this.ShortcutButtonsPanel = new ShortcutButtonsPanel(this.GameEngine, this.Network)); // Set up the message area panel this.parentControl.Controls.Add(this.MessageAreaPanel = new MessageAreaPanel(this.GameEngine, this.Network)); // Set the main GUI to be visible this.MainGuiVisible = true; // Show the login screen when we've disconnected this.Network.Authenticated += this.Network_LoggedIn; this.Network.Disconnected += this.Network_Disconnected; // Note that we've finished initializing the GUI, // and update the windows' positions on the screen this.guiInitialized = true; this.UpdateGuiPositions(); }
/// <summary> /// Initializes a new instance of the MessageAreaPanel class. /// </summary> /// <param name="gameEngine">The game engine associated with this instance.</param> /// <param name="network">The network connection manager used to connect to the network.</param> public MessageAreaPanel(GameEngine gameEngine, NetworkClient network) : base(gameEngine, network) { this.InitializeComponent(); }
/// <summary> /// Initializes a new instance of the ShortcutButtonsPanel class. /// </summary> /// <param name="engine">The game engine associated with this instance.</param> /// <param name="network">The network connection manager used to connect to the network.</param> public ShortcutButtonsPanel(GameEngine engine, NetworkClient network) : base(engine, network) { this.InitializeComponent(); }