FrogJumpUI is an Unreal Engine plugin for structured UI management. Utilizing the Model-View-Controller (MVC) pattern, it ensures a clear separation of concerns. Its key feature is a stack-based navigation flow, enabling users to traverse UI screens like web pages, easily pushing new views and popping back to the previous one for predictable state management.
- Manage UI screens in a stack, similar to browser back/forward navigation
- Use
PushWidget()to add new UIs andPopWidget()to return to previous ones - Predictable state management and intuitive UI flow control
- Each UI is identified by a unique Key, and UIs with the same Key reuse their instances
- UI instances remain in memory once created, enabling fast transitions
- Minimizes unnecessary creation/deletion overhead
- Provides 4 UI layers:
- Gameplay: HUD elements always visible during gameplay (health bar, minimap, etc.)
- Popup: General additional UIs like equipment windows, settings, etc.
- Modal: Information display modals like notifications, warnings, tutorials
- Loading: Loading screens, the topmost layer
- Automatic layer classification based on Key name prefixes (
Gameplay_,Popup_,Modal_,Loading_)
- Independent Enhanced Input Mapping Context support for each UI
- Input Context automatically added when UI is activated
- Input Context automatically removed when UI is deactivated
- Automatic mouse cursor and Input Mode management
- Model: UI data and business logic
- View: UI widget (inherits from UUserWidget)
- Controller: Input handling and state management for UI
Ensure the FrogJumpUI plugin is enabled in your project's .uproject file.
- Go to Edit > Project Settings
- Find Game > UI Settings section
- Register UI Keys and their corresponding
BaseUIViewsubclasses in the UI Classes map
Example:
Key: "Gameplay_MainHUD"
Value: BP_MainHUD (Blueprint inheriting from BaseUIView)
Key: "Popup_Inventory"
Value: BP_Inventory (Blueprint inheriting from BaseUIView)
Layers are automatically determined by Key name prefixes:
Gameplay_*: Gameplay layerPopup_*: Popup layerModal_*: Modal layerLoading_*: Loading layer
ULocalPlayerUIManageSubSystem* UISubsystem = GetLocalPlayer()->GetSubsystem<ULocalPlayerUIManageSubSystem>();
if (UISubsystem)
{
UISubsystem->InitializeUI();
}UISubsystem->PushWidget(TEXT("Popup_Inventory"));UISubsystem->PopWidget();FString TopUI = UISubsystem->GetTopStackUI();bool bHasInventory = UISubsystem->HasViewUI(TEXT("Popup_Inventory"));UISubsystem->ResetWidget();Create a Blueprint or C++ class that inherits from BaseUIView.
UCLASS(Blueprintable)
class YOURGAME_API UYourUIView : public UBaseUIView
{
GENERATED_BODY()
// UI widget composition
};Inherit from BaseUIController to add custom logic.
UCLASS(Blueprintable)
class YOURGAME_API UYourUIController : public UBaseUIController
{
GENERATED_BODY()
public:
virtual void OnPushUI() override
{
// Called when UI is pushed
}
protected:
virtual void BindInputAction(UEnhancedInputComponent* InputComponent) override
{
// Bind Enhanced Input actions
}
};Inherit from BaseUIModel to define data models.
UCLASS(Blueprintable)
class YOURGAME_API UYourUIModel : public UBaseUIModel
{
GENERATED_BODY()
public:
virtual void InitializeModel() override
{
// Initialize model
}
};In Blueprint Editor or C++:
ModelClass: Specify the Model class to useControllerClass: Specify the Controller class to use
BaseUIView supports three default animations:
- DefaultTickAnimation: Animation that loops while the UI is displayed
- DefaultStartAnimation: Animation played when UI appears
- DefaultEndAnimation: Animation played when UI disappears
Bind these animations in your widget blueprint and they will play automatically.
-
In
BaseUIControllersubclass:- Set
IsInputAccesstotrue - Assign Enhanced Input Mapping Context to
UIMappingContext
- Set
-
Override
BindInputAction()function to bind Input actions:
virtual void BindInputAction(UEnhancedInputComponent* InputComponent) override
{
Super::BindInputAction(InputComponent);
// Bind Input actions
InputComponent->BindAction(YourInputAction, ETriggerEvent::Triggered, this, &UYourUIController::OnInputAction);
}ULocalPlayerUIManageSubSystem
├── UI Stack Management (WidgetStack)
├── Layer Management (WidgetLayers)
└── Controller Instance Management (ControllerInstances)
UBaseUIView
├── UBaseUIModel (Data)
└── UBaseUIController (Logic)
UBaseUIController
├── Input Management
├── Animation Control
└── Input Mode Management
PushWidget(Key)is called- Layer is determined by Key and added to stack
- If Controller instance doesn't exist, View is created and Controller is initialized
- Controller's
StartShowUI()is called OnPushUI()is called (can be overridden)- Input Context is added and animations play
- Keys must be unique: Each UI is bound to only one Key.
- Layers are determined by prefixes: Use Key name prefixes correctly.
- Call InitializeUI(): Always call
InitializeUI()before using the UI subsystem. - Enhanced Input Plugin: Enhanced Input plugin must be enabled to use Input features.
// Open inventory
UISubsystem->PushWidget(TEXT("Popup_Inventory"));
// Close inventory (go back)
UISubsystem->PopWidget();// Show modal (displayed above existing UI)
UISubsystem->PushWidget(TEXT("Modal_ConfirmDialog"));
// Close modal
UISubsystem->PopWidget();// Main menu
UISubsystem->PushWidget(TEXT("Popup_MainMenu"));
// Settings menu (displayed above main menu)
UISubsystem->PushWidget(TEXT("Popup_Settings"));
// Confirm dialog (displayed above settings menu)
UISubsystem->PushWidget(TEXT("Modal_Confirm"));
// Close confirm dialog -> return to settings menu
UISubsystem->PopWidget();
// Close settings menu -> return to main menu
UISubsystem->PopWidget();This plugin is created by GoldFrosch.
Bug reports and feature suggestions are welcome on GitHub.