//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Reflection; using System.CodeDom.Compiler; using System.CodeDom; using System.IO; using System.Xml; using Microsoft.Win32; using Microsoft.Xna; using Microsoft.Xna.Framework; using DarkWynter.Stream; using DarkWynter.Engine.Globals; using DarkWynter.Engine.Utilities; using DarkWynter.Engine.GameObjects; using System.Threading; namespace DarkWynter.Shell { /// /// GameForm controls the game entry point as well as the compiler entry /// points for the Game2Learn system /// public partial class GameForm : Form { public static Installer installer; public static GameForm parentForm; /// /// MDI-child form which can be used to load usercontrols into a floating mdi form. /// public static Form childForm; /// Initializes a new DarkWynter host form public GameForm() { // Post a public static accessor to this, for UCAD to control. parentForm = this; // Post a public static accessor to childform, for UCAD to control. childForm = new Form(); childForm.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); childForm.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; childForm.ClientSize = new System.Drawing.Size(367, 292); // Make childForm an MDI child form of GameForm. //parentForm.IsMdiContainer = true; //childForm.MdiParent = parentForm; InitializeComponent(); this.WindowState = FormWindowState.Maximized; this.MinimizeBox = false; this.MaximizeBox = false; this.ControlBox = false; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; // Get the Form name from UCAD this.Text = UCAD._UCAD_FormName; //GameForm.dwGameControl = this.darkWynterGameControl; //compilerPanel.Hide(); //dialogueGroupPanel.Hide(); //saveButton.Hide(); //runButton.Hide(); //compileButton.Hide(); //fileToolStrip.Visible = true; CheckSupport(); } private void CheckSupport() { installer = new Installer(); installer.Controls.Clear(); installer.Controls.Add(installer.labelInstall); installer.Controls.Add(installer.labelDirections); installer.Hide(); // Check .Net 2.0 Support RegistryKey RK = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727"); if (RK == null) { installer.Controls.Add(installer.buttonDownloadDotNet); installer.Show(); this.Controls.Clear(); this.Controls.Add(installer); } // Check DirectX Support RK = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\DirectX"); if (RK == null) { installer.Controls.Add(installer.buttonDownloadDirectX); installer.Show(); this.Controls.Clear(); this.Controls.Add(installer); } // Check XNA Support RK = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\XNA\\Framework\\v2.0"); if (RK == null) { installer.Controls.Add(installer.buttonDownloadXNA); installer.Show(); this.Controls.Clear(); this.Controls.Add(installer); } } private void rotateText(object sender, EventArgs e) { } #region Quit, Enter, Load (Mostly Not Used) /// /// Executed when the user clicks the quit button /// /// Quit button that has been clicked /// Not used private void quitClicked(object sender, FormClosingEventArgs e) { //string name = Logging.CreateFileName(); // Logging.writeG2LLog(name); // Logging.writeG2LSurvey(name); // Logging.writeG2LPositionalLog(name); Application.Exit(); } # endregion } }