Steve Streeting 510423abfe Improve the checking for game in foreground
Instead of checking every imput event, check every 0.5s. Also expose the foregrounded boolean, and raise an event so other code can use this.
2021-04-29 12:28:27 +01:00
2021-03-03 11:37:38 +00:00
2020-09-14 17:00:52 +01:00
2020-09-14 17:00:52 +01:00
2020-10-05 17:08:41 +01:00

Steve's UE Helper Plugin Library

Introduction

This is a helper plugin library for Unreal Engine 4 which makes a bunch of things better:

  • New Widgets
    • Focusable buttons, menu stacks, control prompts and more
  • Input events
    • Reliable notification when the player changes input method

Examples

This project contains the master documentation for this library, but if you want to see examples of its use, see the Steve's UE Examples project.

Support This Work!!

It's not a trivial amount of work to separate things I make for my own UE projects and document them so other people can use them! 😀

If you appreciate these efforts, why not ❤️❤️ Support my work on Patreon! ❤️❤️

Installing this plugin

Cloning

The best way is to clone this repository as a submodule; that way you can contribute pull requests if you want. The project should be placed in your project's Plugins folder.

> cd YourProject
> git submodule add https://github.com/sinbad/StevesUEHelpers Plugins/StevesUEHelpers
> git add ../.gitmodules
> git commit

Alternatively you can download the ZIP of this repo and place it in YourProject/Plugins/StevesUEHelpers.

Referencing in C++

Edit YourProject.Build.cs and do something similar to this:

public class YourProject : ModuleRules
{
	private string PluginsPath
	{
		get { return Path.GetFullPath( Path.Combine( ModuleDirectory, "../../Plugins/" ) ); }
	}

	public YourProject(ReadOnlyTargetRules Target) : base(Target)
	{
        // Your existing rules
        // ...


		AddStevesUEHelpers();
	}

	protected void AddStevesUEHelpers() {
		// Linker
		PrivateDependencyModuleNames.AddRange(new string[] { "StevesUEHelpers" });
		// Headers
		PublicIncludePaths.Add(Path.Combine( PluginsPath, "StevesUEHelpers", "Source", "StevesUEHelpers", "Public"));
	}

After adding this you should right-click your .uproject file and "Generate Visual Studio Project Files".

You can use most of the features without doing anything else, but certain features require some additional setup, see below.

Configure Custom GameViewportClient

This library contains a new UGameViewportClient subclass called UStevesGameViewportClientBase, which is used to suppress the mouse cursor in menus then using a gamepad.

Unfortunately UE4's Slate overrides the mouse pointer visibility sometimes, so this fixes that.

To use it, simply:

  1. Open Project Settings
  2. Go to Engine > General Settings
  3. Change Game Viewport Client Class to StevesGameViewportClientBase

Configure UiTheme

Some features require you to configure some theme information for the UI, which is discussed in more detail in the UiTheme section.

Game instance subsystem

In order to track stateful things like the current input mode for each player, there is a custom GameInstanceSubsystem called StevesGameSubsystem, which you can tap into anywhere in Blueprints by searching for it:

Game Instance Subsystem

Once you have access to this you can do things like get the latest input device used:

Game Instance Subsystem

For more details, see the Input section.

License

The MIT License (MIT) Copyright © 2020 Steve Streeting

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Description
A plugin adding a bunch of common helper functionality that I use in my UE projects
Readme 8.2 MiB
Languages
C++ 98.6%
C 0.9%
C# 0.5%