diff --git a/Galactic Colors Control GUI/Content/Content.mgcb b/Galactic Colors Control GUI/Content/Content.mgcb index ddc4c36..e38ff20 100644 --- a/Galactic Colors Control GUI/Content/Content.mgcb +++ b/Galactic Colors Control GUI/Content/Content.mgcb @@ -13,3 +13,45 @@ #---------------------------------- Content ---------------------------------# +#begin Fonts/basic.spritefont +/importer:FontDescriptionImporter +/processor:FontDescriptionProcessor +/processorParam:TextureFormat=Compressed +/build:Fonts/basic.spritefont + +#begin Fonts/small.spritefont +/importer:FontDescriptionImporter +/processor:FontDescriptionProcessor +/processorParam:TextureFormat=Compressed +/build:Fonts/small.spritefont + +#begin Fonts/title.spritefont +/importer:FontDescriptionImporter +/processor:FontDescriptionProcessor +/processorParam:TextureFormat=Compressed +/build:Fonts/title.spritefont + +#begin Sounds/alert.mp3 +/importer:Mp3Importer +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sounds/alert.mp3 + +#begin Sounds/bip.mp3 +/importer:Mp3Importer +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sounds/bip.mp3 + +#begin Sounds/change.mp3 +/importer:Mp3Importer +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sounds/change.mp3 + +#begin Sounds/valid.mp3 +/importer:Mp3Importer +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sounds/valid.mp3 + diff --git a/Galactic Colors Control GUI/Content/Textures/Hub/pointer0.png b/Galactic Colors Control GUI/Content/Textures/Hub/pointer0.png new file mode 100644 index 0000000..0c44a50 Binary files /dev/null and b/Galactic Colors Control GUI/Content/Textures/Hub/pointer0.png differ diff --git a/Galactic Colors Control GUI/Galactic Colors Control GUI.csproj b/Galactic Colors Control GUI/Galactic Colors Control GUI.csproj index 72dac9c..581d356 100644 --- a/Galactic Colors Control GUI/Galactic Colors Control GUI.csproj +++ b/Galactic Colors Control GUI/Galactic Colors Control GUI.csproj @@ -57,6 +57,9 @@ + + PreserveNewest + Always diff --git a/Galactic Colors Control GUI/Game1.cs b/Galactic Colors Control GUI/Game1.cs index 13a10bd..8361fea 100644 --- a/Galactic Colors Control GUI/Game1.cs +++ b/Galactic Colors Control GUI/Game1.cs @@ -1,6 +1,11 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; +using System; +using System.IO; +using System.Reflection; namespace Galactic_Colors_Control_GUI { @@ -11,11 +16,39 @@ namespace Galactic_Colors_Control_GUI { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; + ContentManager content; + + private SoundEffect[] effects = new SoundEffect[4]; + + private SpriteFont smallFont; + private SpriteFont basicFont; + private SpriteFont titleFont; + + private Texture2D nullSprite; + private Texture2D[] pointerSprites = new Texture2D[1]; + + Version version; + + private MouseState oldState; + private MouseState newState; + private int mouseX; + private int mouseY; + private bool haveOverButton = false; + + private string skinName; + + private enum GameStatus { Home, Options, Game, Pause, End, Thanks } + private GameStatus gameStatus; public Game1() { graphics = new GraphicsDeviceManager(this); + graphics.PreferredBackBufferWidth = 1280; + graphics.PreferredBackBufferHeight = 720; + graphics.IsFullScreen = false; + graphics.ApplyChanges(); Content.RootDirectory = "Content"; + content = Content; } /// @@ -26,7 +59,9 @@ namespace Galactic_Colors_Control_GUI /// protected override void Initialize() { - // TODO: Add your initialization logic here + version = Assembly.GetEntryAssembly().GetName().Version; + nullSprite = new Texture2D(GraphicsDevice, 1, 1); + nullSprite.SetData(new Color[1 * 1] { Color.White }); base.Initialize(); } @@ -40,6 +75,33 @@ namespace Galactic_Colors_Control_GUI // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); + //effects[0] = content.Load("Sounds/alert"); + //effects[1] = content.Load("Sounds/bip"); + //effects[2] = content.Load("Sounds/change"); + //effects[3] = content.Load("Sounds/valid"); + + smallFont = content.Load("Fonts/small"); + basicFont = content.Load("Fonts/basic"); + titleFont = content.Load("Fonts/title"); + + for (int i = 0; i < pointerSprites.Length; i++) { + Console.WriteLine("Load pointer" + i); + pointerSprites[i] = content.Load("Textures/Hub/pointer" + i); + } + + if (Directory.Exists("Skin/" + skinName)) + { + if (File.Exists("Skin/" + skinName + "/Sounds/alert.mp3")) using (FileStream fileStream = new FileStream("Skin/" + skinName + "/Sounds/alert.mp3", FileMode.Open)) { effects[0] = SoundEffect.FromStream(fileStream); } + if (File.Exists("Skin/" + skinName + "/Sounds/bip.mp3")) using (FileStream fileStream = new FileStream("Skin/" + skinName + "/Sounds/bip.mp3", FileMode.Open)) { effects[1] = SoundEffect.FromStream(fileStream); } + if (File.Exists("Skin/" + skinName + "/Sounds/change.mp3")) using (FileStream fileStream = new FileStream("Skin/" + skinName + "/Sounds/change.mp3", FileMode.Open)) { effects[2] = SoundEffect.FromStream(fileStream); } + if (File.Exists("Skin/" + skinName + "/Sounds/valid.mp3")) using (FileStream fileStream = new FileStream("Skin/" + skinName + "/Sounds/valid.mp3", FileMode.Open)) { effects[3] = SoundEffect.FromStream(fileStream); } + + for (int i = 0; i < pointerSprites.Length; i++) + { + if (File.Exists("Skin/" + skinName + "/Textures/Hub/pointer" + i + ".png")) using (FileStream fileStream = new FileStream("Skin/" + skinName + "/Textures/Hub/pointer" + i + ".png", FileMode.Open)) { pointerSprites[i] = Texture2D.FromStream(GraphicsDevice, fileStream); } + } + } + // TODO: use this.Content to load your game content here } @@ -62,8 +124,40 @@ namespace Galactic_Colors_Control_GUI if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) Exit(); - // TODO: Add your update logic here + mouseX = Mouse.GetState().X; + mouseY = Mouse.GetState().Y; + if (IsActive) + { + } + + switch (gameStatus) + { + case GameStatus.Home: + + break; + + case GameStatus.Options: + + break; + + case GameStatus.Game: + + break; + + case GameStatus.Pause: + + break; + + case GameStatus.End: + + break; + + case GameStatus.Thanks: + + break; + } + base.Update(gameTime); } @@ -75,7 +169,38 @@ namespace Galactic_Colors_Control_GUI { GraphicsDevice.Clear(Color.CornflowerBlue); - // TODO: Add your drawing code here + spriteBatch.Begin(); + + switch (gameStatus) + { + case GameStatus.Home: + + break; + + case GameStatus.Options: + + break; + + case GameStatus.Game: + + break; + + case GameStatus.Pause: + + break; + + case GameStatus.End: + + break; + + case GameStatus.Thanks: + + break; + } + + spriteBatch.Draw(pointerSprites[0], new Rectangle(mouseX - 10, mouseY - 10, 20, 20), Color.Red); + + spriteBatch.End(); base.Draw(gameTime); } diff --git a/Galactic Colors Control GUI/Properties/AssemblyInfo.cs b/Galactic Colors Control GUI/Properties/AssemblyInfo.cs index 24abb85..3f6f76e 100644 --- a/Galactic Colors Control GUI/Properties/AssemblyInfo.cs +++ b/Galactic Colors Control GUI/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyProduct("Galactic Colors Control GUI")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("sheychen")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.0.1")] +[assembly: AssemblyFileVersion("1.0.0.1")] diff --git a/Galactic Colors Control.sln b/Galactic Colors Control.sln index 2680dda..8fb8b73 100644 --- a/Galactic Colors Control.sln +++ b/Galactic Colors Control.sln @@ -17,26 +17,28 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|Any CPU.Build.0 = Release|Any CPU {9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|x86.ActiveCfg = Debug|Any CPU {9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Debug|x86.Build.0 = Debug|Any CPU {9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Release|Any CPU.ActiveCfg = Release|Any CPU {9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Release|Any CPU.Build.0 = Release|Any CPU {9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Release|x86.ActiveCfg = Release|Any CPU {9E3AF4E1-88C6-4139-A15C-B4F633E80612}.Release|x86.Build.0 = Release|Any CPU - {93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|Any CPU.Build.0 = Debug|Any CPU + {93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|Any CPU.Build.0 = Release|Any CPU {93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|x86.ActiveCfg = Debug|Any CPU {93582CE8-C8C8-4E19-908B-D671ECBADE25}.Debug|x86.Build.0 = Debug|Any CPU {93582CE8-C8C8-4E19-908B-D671ECBADE25}.Release|Any CPU.ActiveCfg = Release|Any CPU {93582CE8-C8C8-4E19-908B-D671ECBADE25}.Release|Any CPU.Build.0 = Release|Any CPU {93582CE8-C8C8-4E19-908B-D671ECBADE25}.Release|x86.ActiveCfg = Release|Any CPU {93582CE8-C8C8-4E19-908B-D671ECBADE25}.Release|x86.Build.0 = Release|Any CPU - {F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Debug|Any CPU.ActiveCfg = Debug|x86 + {F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Debug|Any CPU.ActiveCfg = Release|x86 + {F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Debug|Any CPU.Build.0 = Release|x86 {F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Debug|x86.ActiveCfg = Debug|x86 {F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Debug|x86.Build.0 = Debug|x86 {F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Release|Any CPU.ActiveCfg = Release|x86 + {F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Release|Any CPU.Build.0 = Release|x86 {F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Release|x86.ActiveCfg = Release|x86 {F6CDDF1B-5A57-4A84-B57C-749FFF9AE031}.Release|x86.Build.0 = Release|x86 EndGlobalSection diff --git a/Galactic Colors Control/Properties/AssemblyInfo.cs b/Galactic Colors Control/Properties/AssemblyInfo.cs index 8684608..70f1170 100644 --- a/Galactic Colors Control/Properties/AssemblyInfo.cs +++ b/Galactic Colors Control/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Galactic Colors Control")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("sheychen")] [assembly: AssemblyProduct("Galactic Colors Control")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut // en utilisant '*', comme indiqué ci-dessous : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.0.1")] +[assembly: AssemblyFileVersion("1.0.0.1")]