Announcement

Collapse
No announcement yet.

Modular Menu System Support Thread

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    I have a few stupid questions if you don't mind. First do the menus work example start will actually start the game, load will load the games, graphics settings will change the graphics or is it a shell only and you need your own BP's to start, save, load etc?
    Second is this VR ready or can a quick fix be used for VR so it can be projected as a 3d widget and you can change menu options with a game pad.

    Comment


      #32
      Originally posted by tcla75 View Post
      First do the menus work example start will actually start the game, load will load the games, graphics settings will change the graphics or is it a shell only and you need your own BP's to start, save, load etc?
      It's more or less a shell, as you call it. So you need to write the logic behind the menus compatible with your game. Every game needs different things to load/save, so I cannot provide a generic solution to this unfortunately. Graphics settings should be easy to implement though, as described in the handbook. Also with UE4.11 there are more graphics settings available as BP nodes.

      Originally posted by tcla75 View Post
      Second is this VR ready or can a quick fix be used for VR so it can be projected as a 3d widget and you can change menu options with a game pad.
      Lacking VR hardware we have not been able to test MMS in VR mode yet. It is solely based on vanilla UMG though, so in theory if it works with UMG directly, than it's very likely that it would work with the MMS too

      Hope that helps!
      Modular Menu System @ UE4 Marketplace: "Build your UMG Menus in Minutes!"
      Marketplace Page | General Discussion | Support Thread | Preview Video

      Comment


        #33
        Hello haimat,

        Thanks for the update. I will definitely be looking at some of those changes when I get the chance. I'm out of town atm. As for my window resize issue, I think you can replicate it as follows. Create a 3 column menu and add buttons to the left and right columns only. Then at runtime just resize the window smaller. You should see it clip the buttons on left and right. Then if you hide the menu and redraw it, they draw correctly.

        Thanks
        Jake

        Comment


          #34
          I love this system but I'm really new to both Blueprint and C++ so I'm struggling to integrate this with the C++ Persistent Graphics settings from your site. I've managed to setup the blueprint functions library and can call them from within a blueprint (although I cant call the get or set video quality settings function for some reason).

          Do you have any plans to create a guide or tutorial on how to use both system together? Even just seeing how to setup the fullscreen checkbox with the C++ bp function library would probably help me workout the rest.

          Thanks.

          Comment


            #35
            Okay, I am not the sharpest crayon in the box but I still can't figure this who button calling function. All I need's to know how to implement setting a resolution such as 1920x1200 with the command of r.setRes 1920x1200. I can't figure out how to get it to connect to the array in the MyEventHandler for the menu. I have tried a bunch of things and nothing seems to work. Please help!

            Comment


              #36
              Originally posted by Jazz View Post
              I love this system but I'm really new to both Blueprint and C++ so I'm struggling to integrate this with the C++ Persistent Graphics settings from your site. I've managed to setup the blueprint functions library and can call them from within a blueprint (although I cant call the get or set video quality settings function for some reason).

              Do you have any plans to create a guide or tutorial on how to use both system together? Even just seeing how to setup the fullscreen checkbox with the C++ bp function library would probably help me workout the rest.
              Hi Jazz, sorry for my late reply, seems I have missed your post somehow.

              Anyways, as for your question: Usually it should be quite straight forward to implement the persistent graphics settings, also in combination with the MMS. First I would make sure that the BP library for the graphics settings work, without intetgration into MMS. What is your issue exactly with the video quality settings? When that works, you can simply call those BP library functions from your event handler in MMS. Do you understand how that event handling in MMS works?
              Modular Menu System @ UE4 Marketplace: "Build your UMG Menus in Minutes!"
              Marketplace Page | General Discussion | Support Thread | Preview Video

              Comment


                #37
                Originally posted by ClassyGentleman View Post
                Okay, I am not the sharpest crayon in the box but I still can't figure this who button calling function. All I need's to know how to implement setting a resolution such as 1920x1200 with the command of r.setRes 1920x1200. I can't figure out how to get it to connect to the array in the MyEventHandler for the menu. I have tried a bunch of things and nothing seems to work. Please help!
                Hi ClassyGentleman, thanks for your feedback to the Modular Menu System. So in order to handle user selection of screen resolution, as you describe above, you can do the following: First, populate the combo box with all resolutions you want to support in your game. You just need to provide a String array when creating the combo box or screen settings menu via MMS.

                Then you have two choices: Either you read what the user has selected in the combo box when she clicks on some kind of "OK" or "Save" button. In your event handling code you can simply get the option selected in the combo box by calling the "Get Combobox Selection" BP node, as described in section 2.5.1.2 of the MMS manual.

                Your second option is to implement the "ComboSelectionChanged" function in your custom event handler class. That way you can react to the user when she selects a screen resolution the combo box, without the need to confirm that with an extra button.

                I hope that answers your questioin.
                Please get back here if you need any further assistance.
                Modular Menu System @ UE4 Marketplace: "Build your UMG Menus in Minutes!"
                Marketplace Page | General Discussion | Support Thread | Preview Video

                Comment


                  #38
                  Originally posted by haimat View Post
                  Hi Jazz, sorry for my late reply, seems I have missed your post somehow.

                  Anyways, as for your question: Usually it should be quite straight forward to implement the persistent graphics settings, also in combination with the MMS. First I would make sure that the BP library for the graphics settings work, without intetgration into MMS. What is your issue exactly with the video quality settings? When that works, you can simply call those BP library functions from your event handler in MMS. Do you understand how that event handling in MMS works?
                  No problem, the issue I'm currently having is that the function called "Get Video Quality Settings" and "Set Video Quality Settings" doesn't appear in the right click list within a blueprint. I am able to call other functions created by the new bp function library but not those specific ones.

                  Could it be some sort of incompatibility with 4.11.2, as the tutorial was made using 4.8? Unless its something simple that I'm overlooking.

                  Click image for larger version

Name:	1.jpg
Views:	1
Size:	345.6 KB
ID:	1107442

                  Click image for larger version

Name:	2.jpg
Views:	1
Size:	347.1 KB
ID:	1107443

                  Comment


                    #39
                    Very interesting.
                    I will have a look at that and get back to you soon!
                    Modular Menu System @ UE4 Marketplace: "Build your UMG Menus in Minutes!"
                    Marketplace Page | General Discussion | Support Thread | Preview Video

                    Comment


                      #40
                      Originally posted by haimat View Post
                      Very interesting.
                      I will have a look at that and get back to you soon!
                      Thank you for looking into it!

                      Comment


                        #41
                        Originally posted by Jazz View Post
                        No problem, the issue I'm currently having is that the function called "Get Video Quality Settings" and "Set Video Quality Settings" doesn't appear in the right click list within a blueprint. I am able to call other functions created by the new bp function library but not those specific ones.

                        Could it be some sort of incompatibility with 4.11.2, as the tutorial was made using 4.8? Unless its something simple that I'm overlooking.
                        Hmm, I just double-checked it here with two different projects, it works fine in both cases.

                        Two questions come to mind:
                        *) Have you tried it with the new UE4.12?
                        *) Have you tried it with a completly fresh project?

                        Click image for larger version

Name:	video-settings.png
Views:	1
Size:	124.4 KB
ID:	1107534
                        Modular Menu System @ UE4 Marketplace: "Build your UMG Menus in Minutes!"
                        Marketplace Page | General Discussion | Support Thread | Preview Video

                        Comment


                          #42
                          Originally posted by haimat View Post
                          Hmm, I just double-checked it here with two different projects, it works fine in both cases.

                          Two questions come to mind:
                          *) Have you tried it with the new UE4.12?
                          *) Have you tried it with a completly fresh project?

                          [ATTACH=CONFIG]95773[/ATTACH]
                          Sorry for all the large images, it seems the forum doesn't support resizing or spoiler button tags.

                          I'm still having no luck with UE4.12 or a fresh project. This is what I'm doing, perhaps I'm doing something wrong.

                          1. New project - C++ - Third Person
                          2. Open "ProjectName.Build.cs - add "RHI" to dependencies.
                          Code:
                          // Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
                          
                          using UnrealBuildTool;
                          
                          public class MyProject2 : ModuleRules
                          {
                          	public MyProject2(TargetInfo Target)
                          	{
                          		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "RHI" });
                          	}
                          }
                          3. Build Project

                          Now these are the 2 different routes I have tried for the BP Function library, both in fresh new projects.
                          1. Right click PROJECTNAME folder in Visual Studio - Add - Class - C++ Class.

                          2. Add code to Header.
                          Code:
                          #pragma once
                          
                          #include "Kismet/BlueprintFunctionLibrary.h"
                          #include "UBpVideoSettingsLib.generated.h"
                          
                          #define MIN_SCREEN_WIDTH 1024
                          #define MIN_SCREEN_HEIGHT 768
                          
                          
                          /**
                          * Custom Blueprint Function Library.
                          */
                          UCLASS()
                          class MYPROJECT_API UBpVideoSettingsLib : public UBlueprintFunctionLibrary
                          {
                          	GENERATED_BODY()
                          
                          public:
                          	// Get a list of screen resolutions supported on this machine
                          	UFUNCTION(BlueprintPure, Category = "Video Settings")
                          		static bool GetSupportedScreenResolutions(TArray<FString>& Resolutions);
                          
                          	// Get currently set screen resolution
                          	UFUNCTION(BlueprintPure, Category = "Video Settings")
                          		static FString GetScreenResolution();
                          
                          	// Check whether or not we are currently running in fullscreen mode
                          	UFUNCTION(BlueprintPure, Category = "Video Settings")
                          		static bool IsInFullscreen();
                          
                          	// Set the desired screen resolution (does not change it yet)
                          	UFUNCTION(BlueprintCallable, Category = "Video Settings")
                          		static bool SetScreenResolution(const int32 Width, const int32 Height, const bool Fullscreen);
                          
                          	// Change the current screen resolution
                          	UFUNCTION(BlueprintCallable, Category = "Video Settings")
                          		static bool ChangeScreenResolution(const int32 Width, const int32 Height, const bool Fullscreen);
                          
                          	// Get the current video quality settings
                          	UFUNCTION(BlueprintCallable, Category = "Video Settings")
                          		static bool GetVideoQualitySettings(int32& AntiAliasing, int32& Effects, int32& PostProcess, int32& Resolution, int32& Shadow, int32& Texture, int32& ViewDistance);
                          
                          	// Set the quality settings (not applied nor saved yet)
                          	UFUNCTION(BlueprintCallable, Category = "Video Settings")
                          		static bool SetVideoQualitySettings(const int32 AntiAliasing = 3, const int32 Effects = 3, const int32 PostProcess = 3,
                          			const int32 Resolution = 100, const int32 Shadow = 3, const int32 Texture = 3, const int32 ViewDistance = 3);
                          
                          	// Check whether or not we have vertical sync enabled
                          	UFUNCTION(BlueprintPure, Category = "Video Settings")
                          		static bool IsVSyncEnabled();
                          
                          	// Set the vertical sync flag
                          	UFUNCTION(BlueprintCallable, Category = "Video Settings")
                          		static bool SetVSyncEnabled(const bool VSync);
                          
                          	// Confirm and save current video mode (resolution and fullscreen/windowed) as well as quality settings
                          	UFUNCTION(BlueprintCallable, Category = "Video Settings")
                          		static bool SaveVideoModeAndQuality();
                          
                          	// Revert to original video settings
                          	UFUNCTION(BlueprintCallable, Category = "Video Settings")
                          		static bool RevertVideoMode();
                          
                          private:
                          	// Try to get the GameUserSettings object from the engine
                          	static UGameUserSettings* GetGameUserSettings();
                          };
                          3. Add code to CPP
                          Code:
                          #include"MyProject2.h"
                          #include "UBpVideoSettingsLib.h"
                          
                          
                          // Get a list of screen resolutions supported by video adapter
                          // NOTE: This function needs "RHI" to be added to <Project>.Build.cs file!
                          bool UBpVideoSettingsLib::GetSupportedScreenResolutions(TArray<FString>& Resolutions)
                          {
                          	FScreenResolutionArray ResolutionsArray;
                          
                          	if (RHIGetAvailableResolutions(ResolutionsArray, true))  // needs the "RHI" dependency
                          	{
                          		for (const FScreenResolutionRHI& Resolution : ResolutionsArray)
                          		{
                          			if (Resolution.Width < MIN_SCREEN_WIDTH || Resolution.Height < MIN_SCREEN_HEIGHT)
                          			{
                          				continue;
                          			}
                          
                          			FString Str = FString::FromInt(Resolution.Width) + "x" + FString::FromInt(Resolution.Height);
                          			Resolutions.AddUnique(Str);
                          		}
                          
                          		return true;
                          	}
                          
                          	return false;  // failed to obtain screen resolutions
                          }
                          
                          
                          // Get currently set screen resolution
                          FString UBpVideoSettingsLib::GetScreenResolution()
                          {
                          	UGameUserSettings* Settings = GetGameUserSettings();
                          	if (!Settings)
                          	{
                          		return FString("");
                          	}
                          
                          	FIntPoint Resolution = Settings->GetScreenResolution();
                          	return FString::FromInt(Resolution.X) + "x" + FString::FromInt(Resolution.Y);
                          }
                          
                          
                          // Check whether or not we are currently running in fullscreen mode
                          bool UBpVideoSettingsLib::IsInFullscreen()
                          {
                          	UGameUserSettings* Settings = GetGameUserSettings();
                          	if (!Settings)
                          	{
                          		return false;
                          	}
                          
                          	return Settings->GetFullscreenMode() == EWindowMode::Fullscreen;
                          }
                          
                          
                          // Set the desired screen resolution (does not change it yet)
                          bool UBpVideoSettingsLib::SetScreenResolution(const int32 Width, const int32 Height, const bool Fullscreen)
                          {
                          	UGameUserSettings* Settings = GetGameUserSettings();
                          	if (!Settings)
                          	{
                          		return false;
                          	}
                          
                          	Settings->SetScreenResolution(FIntPoint(Width, Height));
                          	Settings->SetFullscreenMode(Fullscreen ? EWindowMode::Fullscreen : EWindowMode::Windowed);
                          	return true;
                          }
                          
                          
                          // Change the current screen resolution
                          bool UBpVideoSettingsLib::ChangeScreenResolution(const int32 Width, const int32 Height, const bool Fullscreen)
                          {
                          	UGameUserSettings* Settings = GetGameUserSettings();
                          	if (!Settings)
                          	{
                          		return false;
                          	}
                          
                          	EWindowMode::Type WindowMode = Fullscreen ? EWindowMode::Fullscreen : EWindowMode::Windowed;
                          	Settings->RequestResolutionChange(Width, Height, WindowMode, false);
                          	return true;
                          }
                          
                          
                          // Get the current video quality settings
                          bool UBpVideoSettingsLib::GetVideoQualitySettings(int32& AntiAliasing, int32& Effects, int32& PostProcess,
                          	int32& Resolution, int32& Shadow, int32& Texture, int32& ViewDistance)
                          {
                          	UGameUserSettings* Settings = GetGameUserSettings();
                          	if (!Settings)
                          	{
                          		return false;
                          	}
                          
                          	AntiAliasing = Settings->ScalabilityQuality.AntiAliasingQuality;
                          	Effects = Settings->ScalabilityQuality.EffectsQuality;
                          	PostProcess = Settings->ScalabilityQuality.PostProcessQuality;
                          	Resolution = Settings->ScalabilityQuality.ResolutionQuality;
                          	Shadow = Settings->ScalabilityQuality.ShadowQuality;
                          	Texture = Settings->ScalabilityQuality.TextureQuality;
                          	ViewDistance = Settings->ScalabilityQuality.ViewDistanceQuality;
                          	return true;
                          }
                          
                          
                          // Set the quality settings (not applied nor saved yet)
                          bool UBpVideoSettingsLib::SetVideoQualitySettings(const int32 AntiAliasing, const int32 Effects, const int32 PostProcess,
                          	const int32 Resolution, const int32 Shadow, const int32 Texture, const int32 ViewDistance)
                          {
                          	UGameUserSettings* Settings = GetGameUserSettings();
                          	if (!Settings)
                          	{
                          		return false;
                          	}
                          
                          	Settings->ScalabilityQuality.AntiAliasingQuality = AntiAliasing;
                          	Settings->ScalabilityQuality.EffectsQuality = Effects;
                          	Settings->ScalabilityQuality.PostProcessQuality = PostProcess;
                          	Settings->ScalabilityQuality.ResolutionQuality = Resolution;
                          	Settings->ScalabilityQuality.ShadowQuality = Shadow;
                          	Settings->ScalabilityQuality.TextureQuality = Texture;
                          	Settings->ScalabilityQuality.ViewDistanceQuality = ViewDistance;
                          	return true;
                          }
                          
                          
                          // Check whether or not we have vertical sync enabled
                          bool UBpVideoSettingsLib::IsVSyncEnabled()
                          {
                          	UGameUserSettings* Settings = GetGameUserSettings();
                          	if (!Settings)
                          	{
                          		return false;
                          	}
                          
                          	return Settings->IsVSyncEnabled();
                          }
                          
                          
                          // Set the vertical sync flag
                          bool UBpVideoSettingsLib::SetVSyncEnabled(const bool VSync)
                          {
                          	UGameUserSettings* Settings = GetGameUserSettings();
                          	if (!Settings)
                          	{
                          		return false;
                          	}
                          
                          	Settings->SetVSyncEnabled(VSync);
                          	return true;
                          }
                          
                          
                          // Confirm and save current video mode (resolution and fullscreen/windowed)
                          bool UBpVideoSettingsLib::SaveVideoModeAndQuality()
                          {
                          	UGameUserSettings* Settings = GetGameUserSettings();
                          	if (!Settings)
                          	{
                          		return false;
                          	}
                          
                          	Settings->ConfirmVideoMode();
                          	Settings->ApplyNonResolutionSettings();
                          	Settings->SaveSettings();
                          	return true;
                          }
                          
                          
                          // Revert to original video settings
                          bool UBpVideoSettingsLib::RevertVideoMode()
                          {
                          	UGameUserSettings* Settings = GetGameUserSettings();
                          	if (!Settings)
                          	{
                          		return false;
                          	}
                          
                          	Settings->RevertVideoMode();
                          	return true;
                          }
                          
                          
                          //---- PRIVATE METHODS -------------------------------------------------------------------------------
                          
                          // Try to get the GameUserSettings object from the engine
                          UGameUserSettings* UBpVideoSettingsLib::GetGameUserSettings()
                          {
                          	if (GEngine != nullptr)
                          	{
                          		return GEngine->GameUserSettings;
                          	}
                          
                          	return nullptr;
                          }
                          4. Build Solution. No errors.
                          5. Compile in editor. Compile Complete with no errors.
                          6. Can't call new functions in a blueprint within the editor.
                          7. Relaunch editor - Still not able to call functions.

                          Second way of creating the BP function library.
                          1. In the editor - File - Add C++ Class - BluePrintFunctionLibrary


                          2. Add code to Header.
                          3. Add code to CPP.
                          4 Build solution. - Compile errors.


                          That's as far as I've got, I must be doing something wrong but I've no idea what it is. Hopefully this long list will help identify exactly what it is.

                          Comment


                            #43
                            Hmm, that is weird. So far I was not able to reproduce your problem, even with a fresh project.
                            I will give it a bit more time this weekend and get back to you then!
                            Modular Menu System @ UE4 Marketplace: "Build your UMG Menus in Minutes!"
                            Marketplace Page | General Discussion | Support Thread | Preview Video

                            Comment


                              #44
                              Originally posted by haimat View Post
                              Hmm, that is weird. So far I was not able to reproduce your problem, even with a fresh project.
                              I will give it a bit more time this weekend and get back to you then!
                              Thank you for taking the time! I wonder if my install of Visual Studio is missing something? I have the C++ language and common tools installed but I might try a fresh install of it and see how that goes.

                              Comment


                                #45
                                Originally posted by haimat View Post
                                Hmm, that is weird. So far I was not able to reproduce your problem, even with a fresh project.
                                I will give it a bit more time this weekend and get back to you then!
                                Now this is odd, I've managed to get it working. Here's what I did.

                                1. Started a new Blue Print Only project rather than a C++ one.
                                2. File - New C++ Class.
                                3. Add "RHI" to build.cs.
                                4. Add code to to Header.
                                5. Add code to CPP.
                                6. Build project.

                                Now all of the new blueprint library functions show up in blueprint. Very odd that it doesn't work for me in a fresh C++ project but does work in a blueprint project with C++ added to it.

                                Comment

                                Working...
                                X