diff --git a/MonogameLibrary/UI/Elements/ItemDisplayButton.cs b/MonogameLibrary/UI/Elements/ItemDisplayButton.cs index 5024c1f..c8b0ed8 100644 --- a/MonogameLibrary/UI/Elements/ItemDisplayButton.cs +++ b/MonogameLibrary/UI/Elements/ItemDisplayButton.cs @@ -102,7 +102,8 @@ public class ItemDisplayButton : Button fontColor2 = fontColor1, fontName2 = fontName1, scale2 = scale1, - itemTextureName1 = itemTextureName + itemTextureName1 = itemTextureName, + textureName = "Textures/GUI/Back" }; hoverWindow.Initialize(content); hoverWindow.LoadTexture(content); diff --git a/MonogameLibrary/UI/Elements/ItemDisplayLabel.cs b/MonogameLibrary/UI/Elements/ItemDisplayLabel.cs index 9a8cdde..f3e9aca 100644 --- a/MonogameLibrary/UI/Elements/ItemDisplayLabel.cs +++ b/MonogameLibrary/UI/Elements/ItemDisplayLabel.cs @@ -111,7 +111,8 @@ public class ItemDisplayLabel : DrawableUIElement fontColor2 = fontColor1, fontName2 = fontName1, scale2 = scale1, - itemTextureName1 = itemTextureName + itemTextureName1 = itemTextureName, + textureName = "Textures/GUI/Back" }; hoverWindow.Initialize(content); hoverWindow.LoadTexture(content); diff --git a/ZoFo/Content/Content.mgcb b/ZoFo/Content/Content.mgcb index 99f738d..a42d9d4 100644 --- a/ZoFo/Content/Content.mgcb +++ b/ZoFo/Content/Content.mgcb @@ -329,6 +329,18 @@ /processorParam:TextureFormat=Color /build:Textures/AnimationTextures/Zombie/zombie_spritesheet_v2.png +#begin Textures/GUI/back.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/back.png + #begin Textures/GUI/background/base.png /importer:TextureImporter /processor:TextureProcessor @@ -413,6 +425,30 @@ /processorParam:TextureFormat=Color /build:Textures/GUI/background/waiting.png +#begin Textures/GUI/Button.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/Button.png + +#begin Textures/GUI/Button2.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/Button2.png + #begin Textures/GUI/checkboxs_off-on.png /importer:TextureImporter /processor:TextureProcessor diff --git a/ZoFo/Content/Textures/GUI/Button.png b/ZoFo/Content/Textures/GUI/Button.png new file mode 100644 index 0000000..d1d11e9 Binary files /dev/null and b/ZoFo/Content/Textures/GUI/Button.png differ diff --git a/ZoFo/Content/Textures/GUI/Button2.png b/ZoFo/Content/Textures/GUI/Button2.png new file mode 100644 index 0000000..c8ccc30 Binary files /dev/null and b/ZoFo/Content/Textures/GUI/Button2.png differ diff --git a/ZoFo/Content/Textures/GUI/back.png b/ZoFo/Content/Textures/GUI/back.png new file mode 100644 index 0000000..951ca6c Binary files /dev/null and b/ZoFo/Content/Textures/GUI/back.png differ diff --git a/ZoFo/GameCore/GUI/BaseGUI.cs b/ZoFo/GameCore/GUI/BaseGUI.cs index d46ac63..fb2dbd5 100644 --- a/ZoFo/GameCore/GUI/BaseGUI.cs +++ b/ZoFo/GameCore/GUI/BaseGUI.cs @@ -54,14 +54,16 @@ public class BaseGUI : AbstractGUI rectangle = new Rectangle(width / 2 - (height / 16 + (int)(width / 2.5)) / 2, height / 2 - (int)(height / 1.5) / 2, height / 40 + width / 5, (int)(height / 1.5)), - mainColor = Color.LightGray + mainColor = Color.LightGray, + textureName = "Textures/GUI/Back" }; Elements.Add(baseItemBack); DrawableUIElement baseCraftBack = new DrawableUIElement(Manager) { rectangle = new Rectangle(width / 2 + height / 160, height / 2 - (int)(height / 1.5) / 2, height / 40 + width / 5, (int)(height / 1.5)), - mainColor = Color.LightGray + mainColor = Color.LightGray, + textureName = "Textures/GUI/Back" }; Elements.Add(baseCraftBack); @@ -85,7 +87,8 @@ public class BaseGUI : AbstractGUI mainColor = Color.Gray, fontName1 = "Fonts\\Font4", discriptions1 = itemInfo.description, - resourcesNeededToCraft1 = itemInfo.resourcesNeededToCraft + resourcesNeededToCraft1 = itemInfo.resourcesNeededToCraft, + textureName = "Textures/GUI/Button" }; Elements.Add(temp); temp.Initialize(); @@ -134,7 +137,8 @@ public class BaseGUI : AbstractGUI mainColor = Color.Gray, fontName1 = "Fonts\\Font4", discriptions1 = itemInfo.description, - resourcesNeededToCraft1 = itemInfo.resourcesNeededToCraft + resourcesNeededToCraft1 = itemInfo.resourcesNeededToCraft, + textureName = "Textures/GUI/Button" }; Elements.Add(temp); temp.Initialize(); @@ -160,7 +164,7 @@ public class BaseGUI : AbstractGUI { fontName = "Fonts\\Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), - textureName = "Textures\\GUI\\checkboxs_off" + textureName = "Textures/GUI/Button2" }; Elements.Add(bTExit); bTExit.LeftButtonPressed += () => { AppManager.Instance.SetGUI(new MainMenuGUI()); }; diff --git a/ZoFo/GameCore/GUI/ExitGameGUI.cs b/ZoFo/GameCore/GUI/ExitGameGUI.cs index aca7173..1f14fea 100644 --- a/ZoFo/GameCore/GUI/ExitGameGUI.cs +++ b/ZoFo/GameCore/GUI/ExitGameGUI.cs @@ -36,7 +36,8 @@ public class ExitGameGUI : AbstractGUI scale = 0.3f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts/Font" + fontName = "Fonts/Font", + textureName = "Textures/GUI/Button" }; endButton.LeftButtonPressed += () => { diff --git a/ZoFo/GameCore/GUI/FinishingGUI.cs b/ZoFo/GameCore/GUI/FinishingGUI.cs index e437e3d..cef6a5c 100644 --- a/ZoFo/GameCore/GUI/FinishingGUI.cs +++ b/ZoFo/GameCore/GUI/FinishingGUI.cs @@ -38,7 +38,8 @@ public class FinishingGUI : AbstractGUI rectangle = new Rectangle(width / 2 - height / 80 - width / 5 / 2, height / 2 - (int)(height / 1.5) / 2, height / 40 + width / 5, (int)(height / 1.5)), - mainColor = Color.LightGray + mainColor = Color.LightGray, + textureName = "Textures/GUI/Back" }; Elements.Add(inventoryBack); @@ -50,7 +51,8 @@ public class FinishingGUI : AbstractGUI scale = 0.2f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts\\Font" + fontName = "Fonts\\Font", + textureName = "Textures/GUI/Button" }; ExitButton.LeftButtonPressed += () => { AppManager.Instance.SetGUI(new MainMenuGUI()); }; Elements.Add(ExitButton); diff --git a/ZoFo/GameCore/GUI/GameEndedGUI.cs b/ZoFo/GameCore/GUI/GameEndedGUI.cs index abd5835..14bcd68 100644 --- a/ZoFo/GameCore/GUI/GameEndedGUI.cs +++ b/ZoFo/GameCore/GUI/GameEndedGUI.cs @@ -36,7 +36,8 @@ public class GameEndedGUI : AbstractGUI scale = 0.3f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts/Font" + fontName = "Fonts/Font", + textureName = "Textures/GUI/Button" }; endButton.LeftButtonPressed += () => { diff --git a/ZoFo/GameCore/GUI/HUD.cs b/ZoFo/GameCore/GUI/HUD.cs index 6ffb83f..d75502a 100644 --- a/ZoFo/GameCore/GUI/HUD.cs +++ b/ZoFo/GameCore/GUI/HUD.cs @@ -24,7 +24,11 @@ public class HUD : AbstractGUI int height = AppManager.Instance.CurentScreenResolution.Y; Button pauseButton = new Button(Manager) - { fontName = "Fonts\\Font3", scale = 0.4f, text = "| |", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width - width / 30 - width / 40, height / 30, width / 40, width / 40), textureName = "Textures\\GUI\\checkboxs_off"}; + { + fontName = "Fonts\\Font3", scale = 0.4f, text = "| |", fontColor = Color.Black, + mainColor = Color.Transparent, rectangle = new Rectangle(width - width / 30 - width / 40, height / 30, width / 40, width / 40), + textureName = "Textures/GUI/Button2" + }; Elements.Add(pauseButton); pauseButton.LeftButtonPressed += () => { @@ -34,7 +38,11 @@ public class HUD : AbstractGUI overlayGUI.LoadContent(); }; Button invButton = new Button(Manager) - { fontName = "Fonts\\Font3", scale = 0.4f, text = "inv", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width - width / 30 - width / 40, height / 15 + width / 40, width / 40, width / 40), textureName = "Textures\\GUI\\checkboxs_off"}; + { + fontName = "Fonts\\Font3", scale = 0.4f, text = "inv", fontColor = Color.Black, + mainColor = Color.Transparent, rectangle = new Rectangle(width - width / 30 - width / 40, height / 15 + width / 40, width / 40, width / 40), + textureName = "Textures/GUI/Button2" + }; Elements.Add(invButton); invButton.LeftButtonPressed += () => { diff --git a/ZoFo/GameCore/GUI/InventoryGUI.cs b/ZoFo/GameCore/GUI/InventoryGUI.cs index 1f8fb86..feeb0af 100644 --- a/ZoFo/GameCore/GUI/InventoryGUI.cs +++ b/ZoFo/GameCore/GUI/InventoryGUI.cs @@ -31,7 +31,8 @@ public class InventoryGUI : AbstractGUI rectangle = new Rectangle(width / 2 - height / 80 - width / 5 / 2, height / 2 - (int)(height / 1.5) / 2 - height / 10, height / 40 + width / 5, (int)(height / 1.5)), - mainColor = Color.LightGray + mainColor = Color.LightGray, + textureName = "Textures/GUI/Back" }; Elements.Add(inventoryBack); @@ -43,7 +44,8 @@ public class InventoryGUI : AbstractGUI scale = 0.2f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts\\Font" + fontName = "Fonts\\Font", + textureName = "Textures/GUI/Button" }; continueButton.LeftButtonPressed += () => { AppManager.Instance.SetGUI(new HUD()); }; Elements.Add(continueButton); @@ -69,7 +71,8 @@ public class InventoryGUI : AbstractGUI mainColor = Color.Gray, fontName1 = "Fonts\\Font4", discriptions1 = itemInfo.description, - resourcesNeededToCraft1 = itemInfo.resourcesNeededToCraft + resourcesNeededToCraft1 = itemInfo.resourcesNeededToCraft, + textureName = "Texturs/GUI/Button" }; Elements.Add(temp); temp.Initialize(); diff --git a/ZoFo/GameCore/GUI/MainMenuGUI.cs b/ZoFo/GameCore/GUI/MainMenuGUI.cs index 645faf8..fd28022 100644 --- a/ZoFo/GameCore/GUI/MainMenuGUI.cs +++ b/ZoFo/GameCore/GUI/MainMenuGUI.cs @@ -36,7 +36,8 @@ public class MainMenuGUI : AbstractGUI scale = 0.2f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts/Font" + fontName = "Fonts/Font", + textureName = "Textures/GUI/Button" }; playButton.LeftButtonPressed += () => { @@ -51,7 +52,8 @@ public class MainMenuGUI : AbstractGUI scale = 0.2f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts\\Font" + fontName = "Fonts\\Font", + textureName = "Textures/GUI/Button" }; baseButton.LeftButtonPressed += () => { @@ -65,7 +67,8 @@ public class MainMenuGUI : AbstractGUI scale = 0.2f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts/Font" + fontName = "Fonts/Font", + textureName = "Textures/GUI/Button" }; optionButton.LeftButtonPressed += () => { @@ -80,7 +83,8 @@ public class MainMenuGUI : AbstractGUI scale = 0.2f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts/Font" + fontName = "Fonts/Font", + textureName = "Textures/GUI/Button" }; exitButton.LeftButtonPressed += () => { diff --git a/ZoFo/GameCore/GUI/OptionsGUI.cs b/ZoFo/GameCore/GUI/OptionsGUI.cs index 39db371..2fc8f4c 100644 --- a/ZoFo/GameCore/GUI/OptionsGUI.cs +++ b/ZoFo/GameCore/GUI/OptionsGUI.cs @@ -116,7 +116,11 @@ public class OptionsGUI : AbstractGUI //-------------------------------------- Button bTExit = new Button(Manager) - { fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures/GUI/checkboxs_off"}; + { + fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, + rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), + textureName = "Textures/GUI/Button2" + }; Elements.Add(bTExit); bTExit.LeftButtonPressed += () => { diff --git a/ZoFo/GameCore/GUI/PauseGUI.cs b/ZoFo/GameCore/GUI/PauseGUI.cs index d316fb7..d030c6d 100644 --- a/ZoFo/GameCore/GUI/PauseGUI.cs +++ b/ZoFo/GameCore/GUI/PauseGUI.cs @@ -27,7 +27,8 @@ public class PauseGUI : AbstractGUI scale = 0.2f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts\\Font" + fontName = "Fonts\\Font", + textureName = "Textures/GUI/Button" }; continueButton.LeftButtonPressed += () => { @@ -41,7 +42,8 @@ public class PauseGUI : AbstractGUI scale = 0.2f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts\\Font" + fontName = "Fonts\\Font", + textureName = "Textures/GUI/Button" }; exitButton.LeftButtonPressed += () => { diff --git a/ZoFo/GameCore/GUI/SelectModeMenu.cs b/ZoFo/GameCore/GUI/SelectModeMenu.cs index 5b1320b..605f2d8 100644 --- a/ZoFo/GameCore/GUI/SelectModeMenu.cs +++ b/ZoFo/GameCore/GUI/SelectModeMenu.cs @@ -34,7 +34,8 @@ public class SelectModeMenu : AbstractGUI scale = 0.3f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts/Font" + fontName = "Fonts/Font", + textureName = "Textures/GUI/Button" }; singleButton.LeftButtonPressed += () => { @@ -64,7 +65,8 @@ public class SelectModeMenu : AbstractGUI scale = 0.3f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts/Font" + fontName = "Fonts/Font", + textureName = "Textures/GUI/Button" }; optionButton.LeftButtonPressed += () => { @@ -76,7 +78,11 @@ public class SelectModeMenu : AbstractGUI Elements.Add(optionButton); Button bTExit = new Button(Manager) - { fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures/GUI/checkboxs_off"}; + { + fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, + rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), + textureName = "Textures/GUI/Button2" + }; Elements.Add(bTExit); bTExit.LeftButtonPressed += () => { diff --git a/ZoFo/GameCore/GUI/SelectingServerGUI.cs b/ZoFo/GameCore/GUI/SelectingServerGUI.cs index 9460341..cc454e8 100644 --- a/ZoFo/GameCore/GUI/SelectingServerGUI.cs +++ b/ZoFo/GameCore/GUI/SelectingServerGUI.cs @@ -36,7 +36,8 @@ public class SelectingServerGUI : AbstractGUI fontColor = Color.White, mainColor = Color.Gray, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left, - fontName = "Fonts/Font3" + fontName = "Fonts/Font3", + textureName = "Textures/GUI/Button" }; ipBox.TextChanged += input => { @@ -61,7 +62,8 @@ public class SelectingServerGUI : AbstractGUI scale = 0.3f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts/Font" + fontName = "Fonts/Font", + textureName = "Textures/GUI/Button" }; joinButton.LeftButtonPressed += () => { @@ -95,7 +97,8 @@ public class SelectingServerGUI : AbstractGUI scale = 0.3f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts/Font" + fontName = "Fonts/Font", + textureName = "Textures/GUI/Button" }; hostButton.LeftButtonPressed += () => { @@ -115,7 +118,11 @@ public class SelectingServerGUI : AbstractGUI Elements.Add(hostButton); Button bTExit = new Button(Manager) - { fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures/GUI/checkboxs_off" }; + { + fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, + rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), + textureName = "Textures/GUI/Button2" + }; Elements.Add(bTExit); bTExit.LeftButtonPressed += () => { diff --git a/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs b/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs index 2764fb1..2e28fad 100644 --- a/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs +++ b/ZoFo/GameCore/GUI/WaitingForPlayersGUI.cs @@ -47,7 +47,8 @@ public class WaitingForPlayersGUI : AbstractGUI scale = 0.3f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts/Font" + fontName = "Fonts/Font", + textureName = "Textures/GUI/Button" }; startButton.LeftButtonPressed += () => { @@ -67,7 +68,8 @@ public class WaitingForPlayersGUI : AbstractGUI scale = 0.3f, fontColor = Color.White, mainColor = Color.Gray, - fontName = "Fonts/Font" + fontName = "Fonts/Font", + textureName = "Textures/GUI/Button" }; waitButton.LeftButtonPressed += () => { @@ -79,7 +81,11 @@ public class WaitingForPlayersGUI : AbstractGUI } Button bTExit = new Button(Manager) - { fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures/GUI/checkboxs_off"}; + { + fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, + rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), + textureName = "Textures/GUI/Button2" + }; Elements.Add(bTExit); bTExit.LeftButtonPressed += () => {