diff --git a/MonogameLibrary/UI/Elements/CheckBox.cs b/MonogameLibrary/UI/Elements/CheckBox.cs index 5dc400f..5d927ca 100644 --- a/MonogameLibrary/UI/Elements/CheckBox.cs +++ b/MonogameLibrary/UI/Elements/CheckBox.cs @@ -49,9 +49,9 @@ namespace MonogameLibrary.UI.Elements public override void LoadTexture(ContentManager content) { - texture1 = content.Load("textures\\ui\\checkboxs_off"); - texture2 = content.Load("textures\\ui\\checkboxs_off-on"); - texture3 = content.Load("textures\\ui\\checkboxs_on"); + texture1 = content.Load("Textures\\GUI\\checkboxs_off"); + texture2 = content.Load("Textures\\GUI\\checkboxs_off-on"); + texture3 = content.Load("Textures\\GUI\\checkboxs_on"); base.LoadTexture(content); } public override void Draw(SpriteBatch _spriteBatch) diff --git a/MonogameLibrary/UI/Elements/Slider.cs b/MonogameLibrary/UI/Elements/Slider.cs index b496cdf..f614f53 100644 --- a/MonogameLibrary/UI/Elements/Slider.cs +++ b/MonogameLibrary/UI/Elements/Slider.cs @@ -56,7 +56,7 @@ namespace MonogameLibrary.UI.Elements public override void LoadTexture(ContentManager content) { - texture2 = content.Load("textures\\ui\\slider"); + texture2 = content.Load("Textures\\GUI\\checkboxs_off"); base.LoadTexture(content); } diff --git a/ZoFo/Content/Content.mgcb b/ZoFo/Content/Content.mgcb index 4390819..e1730da 100644 --- a/ZoFo/Content/Content.mgcb +++ b/ZoFo/Content/Content.mgcb @@ -27,6 +27,42 @@ /processorParam:TextureFormat=Compressed /build:Fonts/Font2.spritefont +#begin Textures/GUI/checkboxs_off-on.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/GUI/checkboxs_off-on.png + +#begin Textures/GUI/checkboxs_off.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/GUI/checkboxs_off.png + +#begin Textures/GUI/checkboxs_on.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Textures/GUI/checkboxs_on.png + #begin Textures/GUI/MenuBackground.jpg /importer:TextureImporter /processor:TextureProcessor diff --git a/ZoFo/Content/Textures/GUI/checkboxs_off-on.png b/ZoFo/Content/Textures/GUI/checkboxs_off-on.png new file mode 100644 index 0000000..0537fc1 Binary files /dev/null and b/ZoFo/Content/Textures/GUI/checkboxs_off-on.png differ diff --git a/ZoFo/Content/Textures/GUI/checkboxs_off.png b/ZoFo/Content/Textures/GUI/checkboxs_off.png new file mode 100644 index 0000000..f258fcb Binary files /dev/null and b/ZoFo/Content/Textures/GUI/checkboxs_off.png differ diff --git a/ZoFo/Content/Textures/GUI/checkboxs_on.png b/ZoFo/Content/Textures/GUI/checkboxs_on.png new file mode 100644 index 0000000..9f7a350 Binary files /dev/null and b/ZoFo/Content/Textures/GUI/checkboxs_on.png differ diff --git a/ZoFo/GameCore/GUI/MainMenuGUI.cs b/ZoFo/GameCore/GUI/MainMenuGUI.cs index cb259c7..45c3e65 100644 --- a/ZoFo/GameCore/GUI/MainMenuGUI.cs +++ b/ZoFo/GameCore/GUI/MainMenuGUI.cs @@ -16,13 +16,12 @@ namespace ZoFo.GameCore.GUI; public class MainMenuGUI : AbstractGUI { private DrawableUIElement menuBackground; - Color mainBackgroundColor = Color.White; protected override void CreateUI() { int width = AppManager.Instance.CurentScreenResolution.X; int height = AppManager.Instance.CurentScreenResolution.Y; - menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = mainBackgroundColor, textureName = "Textures\\GUI\\MenuBackground" }; + menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures\\GUI\\MenuBackground" }; Elements.Add(menuBackground); menuBackground.LoadTexture(AppManager.Instance.Content); @@ -54,7 +53,7 @@ public class MainMenuGUI : AbstractGUI }; optionButton.LeftButtonPressed += () => { - + AppManager.Instance.SetGUI(new OptionsGUI()); }; Elements.Add(optionButton); Button exitButton = new Button(Manager) diff --git a/ZoFo/GameCore/GUI/OptionsGUI.cs b/ZoFo/GameCore/GUI/OptionsGUI.cs index 7282f70..11f8c5e 100644 --- a/ZoFo/GameCore/GUI/OptionsGUI.cs +++ b/ZoFo/GameCore/GUI/OptionsGUI.cs @@ -9,19 +9,96 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using MonogameLibrary.UI.Base; using MonogameLibrary.UI.Elements; +using ZoFo.GameCore.GameManagers; namespace ZoFo.GameCore.GUI; public class OptionsGUI : AbstractGUI { + private DrawableUIElement menuBackground; protected override void CreateUI() { - // int width = AppManager.Instance.inGameHUDHelperResolution.X; - // int height = AppManager.Instance.inGameHUDHelperResolution.Y; + int width = AppManager.Instance.CurentScreenResolution.X; + int height = AppManager.Instance.CurentScreenResolution.Y; + + menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures\\GUI\\MenuBackground" }; + Elements.Add(menuBackground); + menuBackground.LoadTexture(AppManager.Instance.Content); + + Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 5, (int)(width / 4), (int)(height / 20)), text = "Options", fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts\\Font"}); + + + + Label label_OverallVolume = new Label(Manager) + { fontName = "Fonts\\Font", scale = 0.2f, text = "All Volume", fontColor = Color.White, rectangle = new Rectangle(width / 3, height / 3, 50, 50), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left }; + Elements.Add(label_OverallVolume); + + var slider_OverallVolume = new Slider(Manager) + { rectangle = new Rectangle(width / 2, height / 3, width / 10, height / 20), indentation = 4, textureName = "Textures\\GUI\\checkbox_on", MinValue = 0, MaxValue = 1 }; + slider_OverallVolume.SliderChanged += (newVal) => + { + + }; + Elements.Add(slider_OverallVolume); + + Label label_MusicVolume = new Label(Manager) + { fontName = "Fonts\\Font", scale = 0.2f, text = "Music Volume", fontColor = Color.White, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 1, 50, 50), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left }; + Elements.Add(label_MusicVolume); + + var slider_MusicVolume = new Slider(Manager) + { rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 1, width / 10, height / 20), indentation = 4, textureName = "Textures\\GUI\\checkboxs_on", MinValue = 0, MaxValue = 1 }; + slider_MusicVolume.SliderChanged += (newVal) => + { + + }; + Elements.Add(slider_MusicVolume); + + + Label label_EffectsVolume = new Label(Manager) + { fontName = "Fonts\\Font", scale = 0.2f, text = "Effects Volume", fontColor = Color.White, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 2, 50, 50), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left }; + Elements.Add(label_EffectsVolume); + + var slider_EffectsVolume = new Slider(Manager) + { rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 2, width / 10, height / 20), indentation = 4, textureName = "Textures\\GUI\\checkboxs_on", MinValue = 0, MaxValue = 1 }; + slider_EffectsVolume.SliderChanged += (newVal) => + { + + }; + Elements.Add(slider_EffectsVolume); + + Label lblSwitchMode = new Label(Manager) + { fontName = "Fonts\\Font", scale = 0.2f, text = "Left/Right Mode", fontColor = Color.White, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 3, 50, 50), mainColor = Color.Transparent}; + Elements.Add(lblSwitchMode); + + //var button_left_right_mode = new CheckBox(Manager) { rectangle = new Rectangle(rightBorder - checkboxlength, lblSwitchMode.rectangle.Y - 12, checkboxlength, checkboxlength) }; + //button_left_right_mode.Checked += (newCheckState) => { }; + //Elements.Add(button_left_right_mode); + + + Label label_IsFullScreen = new Label(Manager) + { fontName = "Fonts\\Font", scale = 0.2f, text = "Full Screen", fontColor = Color.White, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 4, 50, 50), mainColor = Color.Transparent}; + Elements.Add(label_IsFullScreen); + + var button_FullScreen = new CheckBox(Manager) { rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 4, width / 30, width / 30) }; + button_FullScreen.Checked += (newCheckState) => + { + + }; + Elements.Add(button_FullScreen); + + + Button bTExit = new Button(Manager) + { fontName = "Fonts\\Font", scale = 0.2f, text = "<-", rectangle = new Rectangle(width / 30, height / 30, 40, 40), textureName = "Textures\\GUI\\checkboxs_off" }; + Elements.Add(bTExit); + bTExit.LeftButtonPressed += () => + { + + }; + } public override void Update(GameTime gameTime) { - + base.Update(gameTime); } } \ No newline at end of file diff --git a/ZoFo/GameCore/GameManagers/AppManager.cs b/ZoFo/GameCore/GameManagers/AppManager.cs index 2cb6d1d..3be4402 100644 --- a/ZoFo/GameCore/GameManagers/AppManager.cs +++ b/ZoFo/GameCore/GameManagers/AppManager.cs @@ -136,7 +136,11 @@ namespace ZoFo.GameCore.GameManagers } public void SetGUI(AbstractGUI gui) { - currentGUI = gui; + currentGUI = gui; + currentGUI.Initialize(); + currentGUI.LoadContent(); + + //TODO } public void GameEnded(Dictionary lootIGot)