diff --git a/DangerousD/GameCore/GUI/HUD.cs b/DangerousD/GameCore/GUI/HUD.cs new file mode 100644 index 0000000..0571a1d --- /dev/null +++ b/DangerousD/GameCore/GUI/HUD.cs @@ -0,0 +1,38 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using MonogameLibrary.UI.Elements; + +namespace DangerousD.GameCore.GUI +{ + public class HUD : IDrawableObject + { + + + public HUD() + { + } + + public void Draw(SpriteBatch spriteBatch) + { + ; + } + + public void Initialize(GraphicsDevice graphicsDevice) + { + throw new NotImplementedException(); + } + + public void LoadContent() + { + var content = AppManager.Instance.Content; + + } + + public void Update(GameTime gameTime) + { + throw new NotImplementedException(); + } + } +} + diff --git a/DangerousD/GameCore/GUI/MenuGUI.cs b/DangerousD/GameCore/GUI/MenuGUI.cs index d0c7998..e363948 100644 --- a/DangerousD/GameCore/GUI/MenuGUI.cs +++ b/DangerousD/GameCore/GUI/MenuGUI.cs @@ -26,7 +26,9 @@ internal class MenuGUI : AbstractGui { AppManager.Instance.ChangeGameState(GameState.Game); }; + var butMulti = new ButtonText(Manager) { rectangle = new Rectangle((wigth - 300) / 2, 190, 300, 50), text = "Multiplayer", fontName = "ButtonFont" }; + Elements.Add(butMulti); butMulti.LeftButtonPressed += () => { @@ -37,6 +39,7 @@ internal class MenuGUI : AbstractGui butOption.LeftButtonPressed += () => { // открытие настроек + AppManager.Instance.ChangeGameState(GameState.Options); }; var butExit = new ButtonText(Manager) { rectangle = new Rectangle((wigth - 300) / 2, 310, 300, 50), text = "Exit", fontName = "ButtonFont" }; Elements.Add(butExit); diff --git a/DangerousD/GameCore/GUI/OptionsGUI.cs b/DangerousD/GameCore/GUI/OptionsGUI.cs new file mode 100644 index 0000000..812ab3e --- /dev/null +++ b/DangerousD/GameCore/GUI/OptionsGUI.cs @@ -0,0 +1,67 @@ +using System; +using Microsoft.Xna.Framework; +using MonogameLibrary.UI.Base; +using MonogameLibrary.UI.Elements; +using System.Xml.Linq; +using DangerousD.GameCore.Managers; +using DangerousD.GameCore; + +namespace DangerousD.GameCore.GUI +{ + public class OptionsGUI : AbstractGui + { + protected override void CreateUI() + { + var slider = new Slider(Manager) + { + MinValue = 0, + MaxValue = 1, + rectangle = new Rectangle(650, 150, 100, 40) + }; + + var checkBox = new CheckBox(Manager); + checkBox.rectangle = new Rectangle(690, 400, 40, 40); + checkBox.Checked += (newCheckState) => + { + SettingsManager sM = new SettingsManager(); + }; + + var cB = new CheckBox(Manager); + cB.rectangle = new Rectangle(690, 275, 40, 40); + cB.Checked += (newCheckState) => + { + SettingsManager sM = new SettingsManager(); + }; + + Label lblOptions = new Label(Manager); + lblOptions.fontName = "Font2"; + lblOptions.text = "Options"; + lblOptions.rectangle = new Rectangle(300, 20, 210, 50); + lblOptions.mainColor = Color.Transparent; + + Label lblValue = new Label(Manager); + lblValue.fontName = "Font2"; + lblValue.text = "Valume"; + lblValue.rectangle = new Rectangle(300, 150, 250, 40); + lblValue.mainColor = Color.Transparent; + + Label lblIsFullScreen = new Label(Manager); + lblIsFullScreen.fontName = "Font2"; + lblIsFullScreen.text = "Full Screen"; + lblIsFullScreen.rectangle = new Rectangle(300, 400, 250, 40); + lblIsFullScreen.mainColor = Color.Transparent; + + Label lblSwitchMode = new Label(Manager); + lblSwitchMode.fontName = "Font2"; + lblSwitchMode.text = "Left/Right Mode"; + lblSwitchMode.rectangle = new Rectangle(290, 275, 250, 40); + lblSwitchMode.mainColor = Color.Transparent; + + ButtonText bTExit = new ButtonText(Manager); + bTExit.fontName = "Font2"; + bTExit.text = "<-"; + bTExit.rectangle = new Rectangle(20 , 15, 20, 10); + bTExit.fontColor = Color.Black; + } + } +} \ No newline at end of file diff --git a/DangerousD/GameCore/Managers/AppManager.cs b/DangerousD/GameCore/Managers/AppManager.cs index d156464..9e04e65 100644 --- a/DangerousD/GameCore/Managers/AppManager.cs +++ b/DangerousD/GameCore/Managers/AppManager.cs @@ -38,13 +38,13 @@ namespace DangerousD.GameCore Content.RootDirectory = "Content"; IsMouseVisible = true; TargetElapsedTime = TimeSpan.FromMilliseconds(1000 / 30); - _graphics.PreferredBackBufferWidth = resolution.X; _graphics.PreferredBackBufferHeight = resolution.Y; //_graphics.IsFullScreen = true; gameState = GameState.Menu; MenuGUI = new MenuGUI(); LoginGUI = new LoginGUI(); + OptionsGUI = new OptionsGUI(); LobbyGUI = new LobbyGUI(); DeathGUI = new DeathGUI(); UIManager.resolution = resolution; @@ -56,6 +56,9 @@ namespace DangerousD.GameCore AnimationBuilder.LoadAnimations(); MenuGUI.Initialize(GraphicsDevice); LoginGUI.Initialize(GraphicsDevice); + + OptionsGUI.Initialize(GraphicsDevice); + LobbyGUI.Initialize(GraphicsDevice); DeathGUI.Initialize(GraphicsDevice); base.Initialize(); @@ -66,6 +69,7 @@ namespace DangerousD.GameCore _spriteBatch = new SpriteBatch(GraphicsDevice); MenuGUI.LoadContent(); LoginGUI.LoadContent(); + OptionsGUI.LoadContent(); LobbyGUI.LoadContent(); DeathGUI.LoadContent(); GameObject.debugTexture = new Texture2D(GraphicsDevice, 1, 1); diff --git a/DangerousD/GameCore/Managers/SettingsManager.cs b/DangerousD/GameCore/Managers/SettingsManager.cs index ab12904..faac612 100644 --- a/DangerousD/GameCore/Managers/SettingsManager.cs +++ b/DangerousD/GameCore/Managers/SettingsManager.cs @@ -9,5 +9,9 @@ namespace DangerousD.GameCore.Managers { internal class SettingsManager { + public void SetFullScreen(bool IsFullScreen) + { + + } } } diff --git a/gitignore b/gitignore new file mode 100644 index 0000000..e69de29