From 613efe3be04d4aaf31f832602df45c4a5af5cb91 Mon Sep 17 00:00:00 2001 From: SergoDobro Date: Sun, 13 Aug 2023 19:05:51 +0300 Subject: [PATCH] initial commit --- .gitignore | 3 + DangerousD.sln | 25 ++ DangerousD/Content/Content.mgcb | 15 + DangerousD/DangerousD.csproj | 27 ++ DangerousD/GameCore/AppManager.cs | 100 ++++++ DangerousD/GameCore/GameManager.cs | 20 ++ DangerousD/GameCore/GameObjects/GameObject.cs | 10 + DangerousD/GameCore/GraphicsComponent.cs | 10 + DangerousD/GameCore/HUD/IHUD.cs | 13 + DangerousD/GameCore/NetworkManager.cs | 10 + DangerousD/GameCore/SoundManager.cs | 10 + .../GameCore/UI/Base/MonoClassManagerUI.cs | 90 ++++++ .../GameCore/UI/Base/MonoDrawableTextedUI.cs | 109 +++++++ DangerousD/GameCore/UI/Base/MonoDrawableUI.cs | 47 +++ .../UI/Compounds/BasicDrawableCompound.cs | 105 ++++++ DangerousD/GameCore/UI/Elements/Button.cs | 67 ++++ DangerousD/GameCore/UI/Elements/CheckBox.cs | 66 ++++ DangerousD/GameCore/UI/Elements/Label.cs | 51 +++ DangerousD/GameCore/UI/Elements/Slider.cs | 71 ++++ DangerousD/GameCore/UI/Elements/TextBox.cs | 306 ++++++++++++++++++ DangerousD/GameCore/UI/Enums/Enums.cs | 11 + .../GameCore/UI/Interfaces/IInteractable.cs | 12 + DangerousD/Icon.ico | Bin 0 -> 147541 bytes DangerousD/Program.cs | 14 + DangerousD/app.manifest | 43 +++ 25 files changed, 1235 insertions(+) create mode 100644 .gitignore create mode 100644 DangerousD.sln create mode 100644 DangerousD/Content/Content.mgcb create mode 100644 DangerousD/DangerousD.csproj create mode 100644 DangerousD/GameCore/AppManager.cs create mode 100644 DangerousD/GameCore/GameManager.cs create mode 100644 DangerousD/GameCore/GameObjects/GameObject.cs create mode 100644 DangerousD/GameCore/GraphicsComponent.cs create mode 100644 DangerousD/GameCore/HUD/IHUD.cs create mode 100644 DangerousD/GameCore/NetworkManager.cs create mode 100644 DangerousD/GameCore/SoundManager.cs create mode 100644 DangerousD/GameCore/UI/Base/MonoClassManagerUI.cs create mode 100644 DangerousD/GameCore/UI/Base/MonoDrawableTextedUI.cs create mode 100644 DangerousD/GameCore/UI/Base/MonoDrawableUI.cs create mode 100644 DangerousD/GameCore/UI/Compounds/BasicDrawableCompound.cs create mode 100644 DangerousD/GameCore/UI/Elements/Button.cs create mode 100644 DangerousD/GameCore/UI/Elements/CheckBox.cs create mode 100644 DangerousD/GameCore/UI/Elements/Label.cs create mode 100644 DangerousD/GameCore/UI/Elements/Slider.cs create mode 100644 DangerousD/GameCore/UI/Elements/TextBox.cs create mode 100644 DangerousD/GameCore/UI/Enums/Enums.cs create mode 100644 DangerousD/GameCore/UI/Interfaces/IInteractable.cs create mode 100644 DangerousD/Icon.ico create mode 100644 DangerousD/Program.cs create mode 100644 DangerousD/app.manifest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f677870 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +bin +obj +.vs \ No newline at end of file diff --git a/DangerousD.sln b/DangerousD.sln new file mode 100644 index 0000000..336b535 --- /dev/null +++ b/DangerousD.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30907.101 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DangerousD", "DangerousD\DangerousD.csproj", "{1FC12F81-0E55-4142-83BD-23496EF29DC6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1FC12F81-0E55-4142-83BD-23496EF29DC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1FC12F81-0E55-4142-83BD-23496EF29DC6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1FC12F81-0E55-4142-83BD-23496EF29DC6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1FC12F81-0E55-4142-83BD-23496EF29DC6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {54250E62-AA1F-4858-BA7A-76F41EB64904} + EndGlobalSection +EndGlobal diff --git a/DangerousD/Content/Content.mgcb b/DangerousD/Content/Content.mgcb new file mode 100644 index 0000000..3c42606 --- /dev/null +++ b/DangerousD/Content/Content.mgcb @@ -0,0 +1,15 @@ + +#----------------------------- Global Properties ----------------------------# + +/outputDir:bin/$(Platform) +/intermediateDir:obj/$(Platform) +/platform:Windows +/config: +/profile:Reach +/compress:False + +#-------------------------------- References --------------------------------# + + +#---------------------------------- Content ---------------------------------# + diff --git a/DangerousD/DangerousD.csproj b/DangerousD/DangerousD.csproj new file mode 100644 index 0000000..dc5c07f --- /dev/null +++ b/DangerousD/DangerousD.csproj @@ -0,0 +1,27 @@ + + + WinExe + netcoreapp3.1 + false + false + true + + + app.manifest + Icon.ico + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DangerousD/GameCore/AppManager.cs b/DangerousD/GameCore/AppManager.cs new file mode 100644 index 0000000..8e611a4 --- /dev/null +++ b/DangerousD/GameCore/AppManager.cs @@ -0,0 +1,100 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Content; +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Xna.Framework.Input; +using DangerousD.GameCore.HUD; + +namespace DangerousD.GameCore +{ + enum GameState { Menu, Options, Lobby, Game } + public class AppManager : Game + { + private GraphicsDeviceManager _graphics; + private SpriteBatch _spriteBatch; + + GameState gameState; + GameManager GameManager; + IHUD MenuGUI; + IHUD OptionsGUI; + IHUD LobbyGUI; + public AppManager() + { + _graphics = new GraphicsDeviceManager(this); + Content.RootDirectory = "Content"; + IsMouseVisible = true; + + + gameState = GameState.Menu; + } + + protected override void Initialize() + { + base.Initialize(); + } + + protected override void LoadContent() + { + _spriteBatch = new SpriteBatch(GraphicsDevice); + + // TODO: use this.Content to load your game content here + } + + protected override void Update(GameTime gameTime) + { + if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) + Exit(); + + + switch (gameState) + { + case GameState.Menu: + MenuGUI.Update(); + break; + case GameState.Options: + OptionsGUI.Update(); + break; + case GameState.Lobby: + LobbyGUI.Update(); + break; + case GameState.Game: + GameManager.Update(gameTime); + break; + default: + break; + } + + base.Update(gameTime); + } + + protected override void Draw(GameTime gameTime) + { + GraphicsDevice.Clear(Color.CornflowerBlue); + + switch (gameState) + { + case GameState.Menu: + MenuGUI.Draw(_spriteBatch); + break; + case GameState.Options: + OptionsGUI.Draw(_spriteBatch); + break; + case GameState.Lobby: + LobbyGUI.Draw(_spriteBatch); + break; + case GameState.Game: + GameManager.Draw(_spriteBatch); + break; + default: + break; + } + + base.Draw(gameTime); + } + + + + } +} diff --git a/DangerousD/GameCore/GameManager.cs b/DangerousD/GameCore/GameManager.cs new file mode 100644 index 0000000..59a7663 --- /dev/null +++ b/DangerousD/GameCore/GameManager.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Text; + +namespace DangerousD.GameCore +{ + class GameManager + { + public void Draw(SpriteBatch _spriteBatch) + { + + } + public void Update(GameTime gameTime) + { + + } + } +} diff --git a/DangerousD/GameCore/GameObjects/GameObject.cs b/DangerousD/GameCore/GameObjects/GameObject.cs new file mode 100644 index 0000000..6a62f36 --- /dev/null +++ b/DangerousD/GameCore/GameObjects/GameObject.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace DangerousD.GameCore +{ + class GameObject + { + } +} diff --git a/DangerousD/GameCore/GraphicsComponent.cs b/DangerousD/GameCore/GraphicsComponent.cs new file mode 100644 index 0000000..2ae348b --- /dev/null +++ b/DangerousD/GameCore/GraphicsComponent.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace DangerousD.GameCore +{ + class GraphicsComponent + { + } +} diff --git a/DangerousD/GameCore/HUD/IHUD.cs b/DangerousD/GameCore/HUD/IHUD.cs new file mode 100644 index 0000000..1047c56 --- /dev/null +++ b/DangerousD/GameCore/HUD/IHUD.cs @@ -0,0 +1,13 @@ +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Text; + +namespace DangerousD.GameCore.HUD +{ + interface IHUD + { + void Update(); + void Draw(SpriteBatch _spriteBatch); + } +} diff --git a/DangerousD/GameCore/NetworkManager.cs b/DangerousD/GameCore/NetworkManager.cs new file mode 100644 index 0000000..d9941f2 --- /dev/null +++ b/DangerousD/GameCore/NetworkManager.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace DangerousD.GameCore +{ + class NetworkManager + { + } +} diff --git a/DangerousD/GameCore/SoundManager.cs b/DangerousD/GameCore/SoundManager.cs new file mode 100644 index 0000000..668b67c --- /dev/null +++ b/DangerousD/GameCore/SoundManager.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace DangerousD.GameCore +{ + class SoundManager + { + } +} diff --git a/DangerousD/GameCore/UI/Base/MonoClassManagerUI.cs b/DangerousD/GameCore/UI/Base/MonoClassManagerUI.cs new file mode 100644 index 0000000..dc0931a --- /dev/null +++ b/DangerousD/GameCore/UI/Base/MonoClassManagerUI.cs @@ -0,0 +1,90 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using MonogameLibrary.UI.Elements; +using MonogameLibrary.UI.Interfaces; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography.X509Certificates; +using static System.Net.Mime.MediaTypeNames; + +namespace MonogameLibrary.UI.Base +{ + public class MonoClassManagerUI + { + static Dictionary> layerCollection; + public static GraphicsDevice MainGraphicsDevice { get { return _graphicsDevice; } } + public static ContentManager MainContent { get { return _content; } } + public static SpriteFont MainBaseFont { get { return _baseFont; } } + static GraphicsDevice _graphicsDevice; + static ContentManager _content; + static SpriteFont _baseFont; + public void InitManager(GraphicsDevice graphicsDevice, ContentManager content, string font) + { + _graphicsDevice = graphicsDevice; + _content = content; + try + { + _baseFont = _content.Load(font); + } + catch + { + } + layerCollection = new Dictionary>(); + for (int i = -10; i < 11; i++) + { + layerCollection.Add(i, new List()); + } + } + public KeyboardState GetKeyboardState { get { return keyboardState; } } + static MouseState mouseState, prevmouseState; + static KeyboardState keyboardState; + public void Update(GameTime gameTime) + { + try + { + keyboardState = Keyboard.GetState(); + mouseState = Mouse.GetState(); + } + catch + { + + } + bool hasInteracted = false; + foreach (var collection in layerCollection) + { + foreach (var item in collection.Value) + { + if (item is IInteractable) + { + if (!hasInteracted) + { + hasInteracted = (item as IInteractable).InteractUpdate(mouseState, prevmouseState); + } + } + } + } + prevmouseState = mouseState; + } + public void Draw(SpriteBatch spriteBatch) + { + spriteBatch.Begin(); + foreach (var collection in layerCollection) + { + foreach (var item in collection.Value) + { + item.Draw(spriteBatch); + } + } + spriteBatch.End(); + } + public void Register(MonoDrawableUI monoDrawableUI, int layerIndex) + { + if (!layerCollection.ContainsKey(layerIndex)) + layerCollection.Add(layerIndex, new List()); + + layerCollection[layerIndex].Add(monoDrawableUI); + } + } +} diff --git a/DangerousD/GameCore/UI/Base/MonoDrawableTextedUI.cs b/DangerousD/GameCore/UI/Base/MonoDrawableTextedUI.cs new file mode 100644 index 0000000..f6432d3 --- /dev/null +++ b/DangerousD/GameCore/UI/Base/MonoDrawableTextedUI.cs @@ -0,0 +1,109 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using MonogameLibrary.UI.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MonogameLibrary.UI.Base +{ + public class MonoDrawableTextedUI : MonoDrawableUI + { + protected SpriteFont spriteFont; + public string text = ""; + public float scale = 0.5f; + public Color fontColor = Color.Black; + public TextAligment textAligment = TextAligment.Center; + public MonoDrawableTextedUI(MonoClassManagerUI MyUIManager = null, int layerIndex = 0) : base(MyUIManager,layerIndex) + { + } + public virtual void LoadTexture(string textureName = "", string font = "") + { + base.LoadTexture(textureName); + if (font != "") + { + try + { + spriteFont = MonoClassManagerUI.MainContent.Load(font); + } + catch + { + } + } + + } + public virtual void DrawText(SpriteBatch _spriteBatch) + { + if (text == "") + return; + + if (spriteFont != null) + { + var measured = spriteFont.MeasureString(text) * scale; + + if (textAligment == TextAligment.Center) + { + Vector2 pos = rectangle.Location.ToVector2(); + pos.Y += (int)((rectangle.Height - measured.Y) / 2); + pos.X += (int)((rectangle.Width - measured.X) / 2); + _spriteBatch.DrawString(spriteFont, text, pos, fontColor, 0, Vector2.Zero, scale, SpriteEffects.None, 0); + } + else if (textAligment == TextAligment.Center) + { + Vector2 pos = rectangle.Location.ToVector2(); + pos.Y += (int)((rectangle.Height - measured.Y) / 2); + pos.X += (int)(2 * scale); + _spriteBatch.DrawString(spriteFont, text, pos, fontColor, 0, Vector2.Zero, scale, SpriteEffects.None, 0); + } + else + { + Vector2 pos = rectangle.Location.ToVector2(); + pos.Y += (int)((rectangle.Height - measured.Y) / 2); + pos.X += (int)(rectangle.Width - measured.X - 2 * scale); + _spriteBatch.DrawString(spriteFont, text, pos, fontColor, 0, Vector2.Zero, scale, SpriteEffects.None, 0); + } + } + else + { + var measured = MonoClassManagerUI.MainBaseFont.MeasureString(text) * scale; + measured.X -= measured.X % 10; + //measured.Y *= -1; + if (textAligment == TextAligment.Center) + { + Vector2 pos = rectangle.Location.ToVector2(); + pos.Y += (int)((rectangle.Height - measured.Y) / 2); + pos.X += (int)((rectangle.Width - measured.X) / 2); + _spriteBatch.DrawString(MonoClassManagerUI.MainBaseFont, text, pos, fontColor, 0, Vector2.Zero, scale, SpriteEffects.None, 0); + } + else if (textAligment == TextAligment.Left) + { + //var rct = new Rectangle(rectangle.Location, rectangle.Size); + //rct.Width = (int)measured.X; + //rct.Height = (int)measured.Y; + //rct.Y += (int)((rectangle.Height - measured.Y) / 2); + //rct.X += (int)((rectangle.Width - measured.X) / 2); + + //_spriteBatch.Draw(texture, rct, new Color(255, 0, 0, 125)); + //_spriteBatch.DrawString(MonoClassManagerUI.MainBaseFont, text, rct.Location.ToVector2(), fontColor, 0, Vector2.Zero, scale, SpriteEffects.None, 0); + + + + Vector2 pos = rectangle.Location.ToVector2(); + pos.Y += (int)((rectangle.Height - measured.Y) / 2); + pos.X += (int)(2 * scale); + _spriteBatch.DrawString(MonoClassManagerUI.MainBaseFont, text, pos, fontColor, 0, Vector2.Zero, scale, SpriteEffects.None, 0); + } + else + { + Vector2 pos = rectangle.Location.ToVector2(); + pos.Y += (int)((rectangle.Height - measured.Y) / 2); + pos.X += (int)(rectangle.Width - measured.X - 2 * scale); + _spriteBatch.DrawString(MonoClassManagerUI.MainBaseFont, text, pos, fontColor, 0, Vector2.Zero, scale, SpriteEffects.None, 0); + } + } + + } + } +} diff --git a/DangerousD/GameCore/UI/Base/MonoDrawableUI.cs b/DangerousD/GameCore/UI/Base/MonoDrawableUI.cs new file mode 100644 index 0000000..b826eb3 --- /dev/null +++ b/DangerousD/GameCore/UI/Base/MonoDrawableUI.cs @@ -0,0 +1,47 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using MonogameLibrary.UI.Enums; +using System; +using System.Collections.Generic; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading; + +namespace MonogameLibrary.UI.Base +{ + public class MonoDrawableUI + { + protected Texture2D texture; + protected int layerIndex; + public Rectangle rectangle = new Rectangle(0, 0, 10, 10); + public Color mainColor = Color.White; + public MonoDrawableUI(MonoClassManagerUI MyUIManager = null, int layerIndex = 0) + { + MyUIManager.Register(this, layerIndex); + } + public void LoadTexture(string textureName) + { + if (textureName == "") + { + texture = new Texture2D(MonoClassManagerUI.MainGraphicsDevice, 1, 1); + texture.SetData(new Color[] { Color.White }); + } + else + { + try + { + texture = MonoClassManagerUI.MainContent.Load(textureName); + } + catch + { + texture = new Texture2D(MonoClassManagerUI.MainGraphicsDevice, 1, 1); + texture.SetData(new Color[] { Color.White }); + } + } + } + public virtual void Draw(SpriteBatch _spriteBatch) + { + _spriteBatch.Draw(texture, rectangle, mainColor); + } + } +} diff --git a/DangerousD/GameCore/UI/Compounds/BasicDrawableCompound.cs b/DangerousD/GameCore/UI/Compounds/BasicDrawableCompound.cs new file mode 100644 index 0000000..338def8 --- /dev/null +++ b/DangerousD/GameCore/UI/Compounds/BasicDrawableCompound.cs @@ -0,0 +1,105 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using MonogameLibrary.UI.Base; +using MonogameLibrary.UI.Elements; +using MonogameLibrary.UI.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Input; +using System.Xml.Linq; + +namespace MonogameLibrary.UI.Compounds +{ + public enum BasicDrawableCompound_Type { Vertical, Horizontal }; + public class BasicDrawableCompound : MonoDrawableTextedUI + { + Dictionary drawables = new Dictionary(); + public Vector2 lastPos; + Vector2 offset = new Vector2(10, 10); + public BasicDrawableCompound() + { + rectangle = new Rectangle(0, 0, 20, 20); + lastPos = new Vector2(0, offset.Y); + } + int mainWidth = 40; + public void Add(string name, MonoDrawableTextedUI element) + { + //var a = Assembly.GetExecutingAssembly().GetTypes(); + //var b = a.Where(t => t.Get().Contains(type)); + //var element = ((MonoDrawableTextedUI)Assembly.GetExecutingAssembly().GetTypes() + // .Where(t => t.GetInterfaces().Contains(type)) + // .Select(x => Activator.CreateInstance(x) as ICommand).ToArray()[0]); + if (element is Slider) + { + element.rectangle = new Rectangle(0, 0, mainWidth * 3, 30); + } + if (element is Label) + { + element.rectangle = new Rectangle(0, 0, mainWidth * 2, 30); + } + if (element is TextBox) + { + element.rectangle = new Rectangle(0, 0, mainWidth * 2, 30); + } + if (element is Button) + { + element.rectangle = new Rectangle(0, 0, mainWidth, 30); + } + element.rectangle.Location = GetPositionOfElement(element).ToPoint(); + if (drawables.ContainsKey(name)) + { + int i = 1; + while (drawables.ContainsKey(name + $"({i})")) + { + i++; + } + name += $"({i})"; + } + drawables.Add(name, element); + } + public Vector2 GetPositionOfElement(MonoDrawableTextedUI element) + { + Vector2 pos = lastPos + new Vector2(offset.X, 0); + lastPos = pos + new Vector2(element.rectangle.Width, 0); + if (lastPos.X>= rectangle.Width) + { + pos.X = offset.X; + pos.Y += offset.Y + element.rectangle.Height; + lastPos = pos + new Vector2(element.rectangle.Width, 0); + } + return rectangle.Location.ToVector2() + pos; + } + + public override void LoadTexture(string textureName = "", string font = "") + { + base.LoadTexture(textureName); + if (font != "") + { + try + { + spriteFont = MonoClassManagerUI.MainContent.Load(font); + } + catch + { + } + } + foreach (var d in drawables) + { + d.Value.LoadTexture(font: font); + } + + } + public override void Draw(SpriteBatch _spriteBatch) + { + _spriteBatch.Draw(texture, rectangle, mainColor); + foreach (var d in drawables) + { + d.Value.Draw(_spriteBatch); + } + } + } +} diff --git a/DangerousD/GameCore/UI/Elements/Button.cs b/DangerousD/GameCore/UI/Elements/Button.cs new file mode 100644 index 0000000..c0ab1c2 --- /dev/null +++ b/DangerousD/GameCore/UI/Elements/Button.cs @@ -0,0 +1,67 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using MonogameLibrary.UI.Base; +using MonogameLibrary.UI.Enums; +using MonogameLibrary.UI.Interfaces; +using System; +using System.Collections.Generic; +using System.Text; +using static MonogameLibrary.UI.Elements.Button; + +namespace MonogameLibrary.UI.Elements +{ + public class Button : MonoDrawableTextedUI, IInteractable + { + public delegate void OnButtonPressed(); + public event OnButtonPressed? RightButtonPressed; + public event OnButtonPressed? LeftButtonPressed; + protected HoverState hoverState = HoverState.None; + public bool InteractUpdate(MouseState mouseState, MouseState prevmouseState) + { + if (rectangle.Intersects(new Rectangle(mouseState.Position, Point.Zero))) + { + if (mouseState.LeftButton == ButtonState.Pressed || mouseState.RightButton == ButtonState.Pressed) + { + hoverState = HoverState.Pressing; + } + else + { + hoverState = HoverState.Hovering; + } + if (prevmouseState.LeftButton == ButtonState.Pressed) + { + if (mouseState.LeftButton != prevmouseState.LeftButton) + { + hoverState = HoverState.Pressing; + LeftButtonPressed?.Invoke(); + return true; + } + } + else if(prevmouseState.RightButton == ButtonState.Pressed) + { + if (mouseState.RightButton != prevmouseState.RightButton) + { + RightButtonPressed?.Invoke(); + return true; + } + } + } + else + { + hoverState = HoverState.None; + } + return false; + } + public override void Draw(SpriteBatch _spriteBatch) + { + if (hoverState == HoverState.None) + _spriteBatch.Draw(texture, rectangle, Color.White); + else if (hoverState == HoverState.Hovering) + _spriteBatch.Draw(texture, rectangle, new Color(211,211,211)); + else + _spriteBatch.Draw(texture, rectangle, new Color(112, 128, 144)); + DrawText(_spriteBatch); + } + } +} diff --git a/DangerousD/GameCore/UI/Elements/CheckBox.cs b/DangerousD/GameCore/UI/Elements/CheckBox.cs new file mode 100644 index 0000000..2fdf3bf --- /dev/null +++ b/DangerousD/GameCore/UI/Elements/CheckBox.cs @@ -0,0 +1,66 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using MonogameLibrary.UI.Base; +using MonogameLibrary.UI.Enums; +using MonogameLibrary.UI.Interfaces; +using System; +using System.Collections.Generic; +using System.Text; + +namespace MonogameLibrary.UI.Elements +{ + public class CheckBox : MonoDrawableTextedUI, IInteractable + { + public delegate void OnCheck(bool checkState); + public event OnCheck? Checked; + private bool isChecked; + HoverState hoverState = HoverState.None; + public bool GetChecked { get { return isChecked; } } + public bool InteractUpdate(MouseState mouseState, MouseState prevmouseState) + { + if (rectangle.Intersects(new Rectangle(mouseState.Position, Point.Zero))) + { + hoverState = HoverState.Hovering; + if (prevmouseState.LeftButton == ButtonState.Pressed) + { + hoverState = HoverState.Pressing; + if (mouseState.LeftButton != prevmouseState.LeftButton) + { + isChecked = !isChecked; + Checked?.Invoke(isChecked); + return true; + } + } + } + else + { + hoverState = HoverState.None; + } + return false; + } + public override void Draw(SpriteBatch _spriteBatch) + { + if (isChecked) + { + if (hoverState == HoverState.None) + _spriteBatch.Draw(texture, rectangle, new Color(124, 255, 0)); + else if (hoverState == HoverState.Hovering) + _spriteBatch.Draw(texture, rectangle, new Color(124, 215, 0)); + else + _spriteBatch.Draw(texture, rectangle, new Color(124, 175, 0)); + } + else + { + if (hoverState == HoverState.None) + _spriteBatch.Draw(texture, rectangle, new Color(255, 20, 0)); + else if (hoverState == HoverState.Hovering) + _spriteBatch.Draw(texture, rectangle, new Color(215, 20, 0)); + else + _spriteBatch.Draw(texture, rectangle, new Color(175, 20, 0)); + } + DrawText(_spriteBatch); + } + + } +} diff --git a/DangerousD/GameCore/UI/Elements/Label.cs b/DangerousD/GameCore/UI/Elements/Label.cs new file mode 100644 index 0000000..4657bbc --- /dev/null +++ b/DangerousD/GameCore/UI/Elements/Label.cs @@ -0,0 +1,51 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using MonogameLibrary.UI.Base; +using MonogameLibrary.UI.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MonogameLibrary.UI.Elements +{ + public class Label : MonoDrawableTextedUI + { + + protected HoverState hoverState = HoverState.None; + + public virtual bool InteractUpdate(MouseState mouseState, MouseState prevmouseState) + { + if (rectangle.Intersects(new Rectangle(mouseState.Position, Point.Zero))) + { + if (mouseState.LeftButton == ButtonState.Pressed) + { + hoverState = HoverState.Pressing; + } + else + { + hoverState = HoverState.Hovering; + } + } + else + { + hoverState = HoverState.None; + } + return false; + } + public override void Draw(SpriteBatch _spriteBatch) + { + if (hoverState == HoverState.None) + { + _spriteBatch.Draw(texture, rectangle, new Color(235, 235, 235)); + } + else if (hoverState == HoverState.Hovering) + _spriteBatch.Draw(texture, rectangle, new Color(211, 211, 211)); + else + _spriteBatch.Draw(texture, rectangle, new Color(112, 128, 144)); + DrawText(_spriteBatch); + } + } +} diff --git a/DangerousD/GameCore/UI/Elements/Slider.cs b/DangerousD/GameCore/UI/Elements/Slider.cs new file mode 100644 index 0000000..7656f64 --- /dev/null +++ b/DangerousD/GameCore/UI/Elements/Slider.cs @@ -0,0 +1,71 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using MonogameLibrary.UI.Base; +using MonogameLibrary.UI.Enums; +using MonogameLibrary.UI.Interfaces; +using System; +using System.Collections.Generic; +using System.Text; + +namespace MonogameLibrary.UI.Elements +{ + public class Slider : MonoDrawableTextedUI, IInteractable + { + public delegate void OnSliderChanges(float value); + public event OnSliderChanges? SliderChanged; + + public Rectangle sliderRect = new Rectangle(0, 0, 30, 30); + private float sliderValue = 0; + private float minValue = 0, maxValue = 1; + SliderState sliderState = SliderState.None; + + public float GetValue { get { return minValue + sliderValue * (maxValue - minValue); } } + public float GetSliderValue { get { return sliderValue; } } + public float MinValue { get { return minValue; } set { minValue = value; } } + public float MaxValue { get { return maxValue; } set { maxValue = value; } } + + public bool InteractUpdate(MouseState mouseState, MouseState prevmouseState) + { + if (mouseState.LeftButton == ButtonState.Pressed) + { + if (sliderRect.Intersects(new Rectangle(mouseState.Position, Point.Zero)) || + rectangle.Intersects(new Rectangle(mouseState.Position, Point.Zero)) || + sliderState == SliderState.Moving) + { + sliderValue = Math.Clamp((mouseState.Position.X - rectangle.X - sliderRect.Width / 2f) / (rectangle.Width - sliderRect.Width), 0, 1); + sliderState = SliderState.Moving; + SliderChanged?.Invoke(GetValue); + return true; + } + } + else if (sliderRect.Intersects(new Rectangle(mouseState.Position, Point.Zero))) + { + sliderState = SliderState.HoveringOverSliderButton; + } + else + sliderState = SliderState.None; + return false; + } + public void SetValue(float setvalue) + { + sliderValue = setvalue; + SliderChanged?.Invoke(GetValue); + } + + public override void Draw(SpriteBatch _spriteBatch) + { + base.Draw(_spriteBatch); + sliderRect.Location = rectangle.Location; + sliderRect.X += (int)(sliderValue * (rectangle.Width - sliderRect.Width)); + sliderRect.Y -= sliderRect.Height / 2 - rectangle.Height / 2; + if (sliderState == SliderState.Moving) + _spriteBatch.Draw(texture, sliderRect, Color.DarkRed); + else if(sliderState == SliderState.HoveringOverSliderButton) + _spriteBatch.Draw(texture, sliderRect, new Color(200,0,0)); + else + _spriteBatch.Draw(texture, sliderRect, Color.Red); + DrawText(_spriteBatch); + } + } +} diff --git a/DangerousD/GameCore/UI/Elements/TextBox.cs b/DangerousD/GameCore/UI/Elements/TextBox.cs new file mode 100644 index 0000000..1661942 --- /dev/null +++ b/DangerousD/GameCore/UI/Elements/TextBox.cs @@ -0,0 +1,306 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using MonogameLibrary.UI.Base; +using MonogameLibrary.UI.Enums; +using MonogameLibrary.UI.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using static System.Net.Mime.MediaTypeNames; + +namespace MonogameLibrary.UI.Elements +{ + public class TextBox : MonoDrawableTextedUI, IInteractable + { + public delegate void OnTextChange(string text); + public event OnTextChange? TextChanged; + public event OnTextChange? StopChanging; + public event OnTextChange? OnEnter; + + protected HoverState hoverState = HoverState.None; + protected IsSelected isSelected = IsSelected.NotSelected; + public bool shouldEndOnEnter; + + public TextBox() : base() + { + OnEnter += (txt) => { + isSelected = IsSelected.NotSelected; + StopChanging?.Invoke(text); + }; + } + public virtual bool InteractUpdate(MouseState mouseState, MouseState prevmouseState) + { + if (isSelected == IsSelected.Selected) + { + if (MonoClassManagerUI.GetKeyboardState.IsKeyDown(Keys.Enter)) + { + OnEnter?.Invoke(text); + if (shouldEndOnEnter) + { + return false; + } + } + + InputManager.GetInput(ref text); + } + if (rectangle.Intersects(new Rectangle(mouseState.Position, Point.Zero))) + { + if (mouseState.LeftButton == ButtonState.Pressed) + { + hoverState = HoverState.Pressing; + } + else + { + hoverState = HoverState.Hovering; + } + if (prevmouseState.LeftButton == ButtonState.Pressed) + { + if (mouseState.LeftButton != prevmouseState.LeftButton) + { + hoverState = HoverState.Pressing; + isSelected = IsSelected.Selected; + TextChanged?.Invoke(text); + return true; + } + } + } + else + { + + + if (mouseState.LeftButton == ButtonState.Pressed) + { + isSelected = IsSelected.NotSelected; + StopChanging?.Invoke(text); + } + + hoverState = HoverState.None; + } + return false; + } + public override void Draw(SpriteBatch _spriteBatch) + { + if (hoverState == HoverState.None) + { + if (isSelected == IsSelected.Selected) + _spriteBatch.Draw(texture, rectangle, new Color(220, 220, 220)); + else + _spriteBatch.Draw(texture, rectangle, new Color(245, 245, 245)); + } + else if (hoverState == HoverState.Hovering) + _spriteBatch.Draw(texture, rectangle, new Color(211, 211, 211)); + else + _spriteBatch.Draw(texture, rectangle, new Color(112, 128, 144)); + DrawText(_spriteBatch); + } + } + + + //TODO: add translation + public static class InputManager + { + static List pressed = new List(); + static float del = 0; + static bool isShiftPressed = false; + static bool isCTRLPressed = false; + static bool isALTPressed = false; + static bool isCAPSLOCKOn = false; + + public static void GetInput(ref string text) + { + var state = MonoClassManagerUI.GetKeyboardState; + var keys = state.GetPressedKeys(); + isShiftPressed = state.IsKeyDown(Keys.LeftShift) || state.IsKeyDown(Keys.RightShift); + isCTRLPressed = state.IsKeyDown(Keys.LeftControl) || state.IsKeyDown(Keys.RightControl); + isALTPressed = state.IsKeyDown(Keys.LeftAlt) || state.IsKeyDown(Keys.RightAlt); + for (int i = 0; i < pressed.Count; i++) + { + if (!keys.Contains(pressed[i])) + { + pressed.RemoveAt(i); + i--; + } + } + foreach (var key in keys) + { + //System.Diagnostics.Debug.WriteLine(key.ToString()); + if (!pressed.Contains(key)) + { + pressed.Add(key); + + + + string getPressed = KeyDecode(key); + if (getPressed != null) + { + text += getPressed; + } + else + { + if (key == Keys.Back) + { + if (text.Length > 0) + { + text = text.Remove(text.Length - 1); + del = 0; + } + } + if (key == Keys.CapsLock) + { + isCAPSLOCKOn = !isCAPSLOCKOn; + } + } + + + } + if (IsKeySpecial(key)) + { + del++; + if (key == Keys.Back) + { + if (del>15) + { + if (text.Length > 0) + text = text.Remove(text.Length - 1); + del = 13; + } + } + } + } + } + public static string KeyDecode(Keys key) + { + string str = null; + if ((int)key >= 65 && (int)key <= 90) + { + str = key.ToString(); + } + else if ((int)key >= 48 && (int)key <= 57) + { + if (!isShiftPressed) + { + str = key.ToString().Trim('D'); + } + else + { + switch (key) + { + case Keys.D1: + return str = "!"; + case Keys.D2: + return str = "@"; + case Keys.D3: + return str = "#"; + case Keys.D4: + return str = "$"; + case Keys.D5: + return str = "%"; + case Keys.D6: + return str = "^"; + case Keys.D7: + return str = "&"; + case Keys.D8: + return str = "*"; + case Keys.D9: + return str = "("; + case Keys.D0: + return str = ")"; + } + } + } + else if ((int)key >= 96 && (int)key <= 105) + { + str = key.ToString().Remove(0, 6); + } + if (str != null) + { + if ((!isShiftPressed && !isCAPSLOCKOn) || (isShiftPressed && isCAPSLOCKOn)) + return str.ToLower(); + else + return str.ToUpper(); + } + + + if (!isShiftPressed) + { + switch (key) + { + case Keys.Space: + return " "; + case Keys.OemTilde: + return "`"; + case Keys.Enter: + return "\n"; + case Keys.OemPipe: + return "\\"; + case Keys.OemPlus: + return "="; + case Keys.OemMinus: + return "-"; + + + case Keys.OemComma: + return ","; + case Keys.OemQuestion: + return "."; + case Keys.OemPeriod: + return "/"; + case Keys.OemSemicolon: + return ";"; + case Keys.OemQuotes: + return "'"; + case Keys.OemOpenBrackets: + return "["; + case Keys.OemCloseBrackets: + return "]"; + } + } + else + { + switch (key) + { + case Keys.Space: + return " "; + case Keys.OemTilde: + return "~"; + case Keys.Enter: + return "\n"; + case Keys.OemPipe: + return "|"; + case Keys.OemPlus: + return "+"; + case Keys.OemMinus: + return "_"; + + + case Keys.OemComma: + return "<"; + case Keys.OemQuestion: + return ">"; + case Keys.OemPeriod: + return "?"; + case Keys.OemSemicolon: + return ":"; + case Keys.OemQuotes: + return "\""; + case Keys.OemOpenBrackets: + return "{"; + case Keys.OemCloseBrackets: + return "}"; + } + } + + //else if ((int)key >= 112 && (int)key <= 125) + //{ + // return key.ToString().Trim('F'); + //} + return null; + } + public static bool IsKeySpecial(Keys key) + { + return (key == Keys.Back) || (key == Keys.Space); + } + } +} diff --git a/DangerousD/GameCore/UI/Enums/Enums.cs b/DangerousD/GameCore/UI/Enums/Enums.cs new file mode 100644 index 0000000..3c7838a --- /dev/null +++ b/DangerousD/GameCore/UI/Enums/Enums.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MonogameLibrary.UI.Enums +{ + public enum HoverState { None, Hovering, Pressing } + public enum SliderState { None, Moving, HoveringOverSliderButton } + public enum IsSelected { NotSelected, Selected } + public enum TextAligment { Center, Left, Right } +} diff --git a/DangerousD/GameCore/UI/Interfaces/IInteractable.cs b/DangerousD/GameCore/UI/Interfaces/IInteractable.cs new file mode 100644 index 0000000..6f48b9f --- /dev/null +++ b/DangerousD/GameCore/UI/Interfaces/IInteractable.cs @@ -0,0 +1,12 @@ +using Microsoft.Xna.Framework.Input; +using System; +using System.Collections.Generic; +using System.Text; + +namespace MonogameLibrary.UI.Interfaces +{ + interface IInteractable + { + bool InteractUpdate(MouseState mouseState, MouseState prevmouseState); + } +} diff --git a/DangerousD/Icon.ico b/DangerousD/Icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..7d9dec18704053ee43cd7c956022ddbdb34d8de1 GIT binary patch literal 147541 zcmeGl2|QHY_o31*DkNL0ilkjLBkemP*sNDHl0|CFz!@@Z9>Xho|^ zX)(&oghZPy%>SM@9z%l}GjCAu{C;oVGIu%KJ@?!l!{o4r7=Rq6i}`C}*jDuH?#_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9777T@eF642Fkv(M9-SgX*CdVSwu@@JEC_O8H@2N^}^H%ef}L zoKYMiUqN}(xM=M%>iZCO!GD5bahVF>4Exx@{u~tn{3p2AoglrCc4cviG$G9Ic%b=@ z<@#$xY1<0YBK`QQh4QdGUkMz_=TFdE)xDzlu-{TiUg%j67~JHN|0<5}ULtGYr654M zL_FeNUVdfgyLpvFFE2kq9U$}v_bb?+O7nnc5Xl^+`W2eMf| zO7SSM@5pu*mmeUEC`SY>d|P%J8_4O3UoaPvu#x4;ue)4llmP!yWOYWP&7Cn#^iEtl RJoIeLznU7AhJ`o~_y6Yy51#-4 literal 0 HcmV?d00001 diff --git a/DangerousD/Program.cs b/DangerousD/Program.cs new file mode 100644 index 0000000..a36e5d1 --- /dev/null +++ b/DangerousD/Program.cs @@ -0,0 +1,14 @@ +using System; + +namespace DangerousD +{ + public static class Program + { + [STAThread] + static void Main() + { + using (var game = new AppManager()) + game.Run(); + } + } +} diff --git a/DangerousD/app.manifest b/DangerousD/app.manifest new file mode 100644 index 0000000..676d5d7 --- /dev/null +++ b/DangerousD/app.manifest @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true/pm + permonitorv2,permonitor + + + +