mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-19 00:40:32 +00:00
09572a8ef9
- Divided ImGui settings into UImGuiSettings persistent object and FImGuiModuleSettings proxy that provides interface for other classes and handles delayed loading of UImGuiSettings. - Removed from FImGuiModuleProperties and FImGuiModuleCommands direct dependencies on UImGuiSettings. - Simplified FImGuiModuleProperties making it more robust when moving data after hot-reloading. - Inverted binding logic by injecting FImGuiModuleProperties and FImGuiModuleCommands into FImGuiModuleSettings and letting it take care of synchronization. Dependencies are setup by module manager. - Added to module manager FImGuiModuleSettings and interface to access it. - Cleaned interface of FImGuiInputHandlerFactory and removed direct dependency on settings.
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
// Distributed under the MIT License (MIT) (see accompanying LICENSE file)
|
|
|
|
#pragma once
|
|
|
|
#include <IConsoleManager.h>
|
|
|
|
|
|
struct FImGuiKeyInfo;
|
|
class FImGuiModuleProperties;
|
|
|
|
// Manges ImGui module console commands.
|
|
class FImGuiModuleCommands
|
|
{
|
|
public:
|
|
|
|
static const TCHAR* const ToggleInput;
|
|
static const TCHAR* const ToggleKeyboardNavigation;
|
|
static const TCHAR* const ToggleGamepadNavigation;
|
|
static const TCHAR* const ToggleKeyboardInputSharing;
|
|
static const TCHAR* const ToggleGamepadInputSharing;
|
|
static const TCHAR* const ToggleDemo;
|
|
|
|
FImGuiModuleCommands(FImGuiModuleProperties& InProperties);
|
|
|
|
void SetKeyBinding(const TCHAR* CommandName, const FImGuiKeyInfo& KeyInfo);
|
|
|
|
private:
|
|
|
|
void ToggleInputImpl();
|
|
void ToggleKeyboardNavigationImpl();
|
|
void ToggleGamepadNavigationImpl();
|
|
void ToggleKeyboardInputSharingImpl();
|
|
void ToggleGamepadInputSharingImpl();
|
|
void ToggleDemoImpl();
|
|
|
|
FImGuiModuleProperties& Properties;
|
|
|
|
FAutoConsoleCommand ToggleInputCommand;
|
|
FAutoConsoleCommand ToggleKeyboardNavigationCommand;
|
|
FAutoConsoleCommand ToggleGamepadNavigationCommand;
|
|
FAutoConsoleCommand ToggleKeyboardInputSharingCommand;
|
|
FAutoConsoleCommand ToggleGamepadInputSharingCommand;
|
|
FAutoConsoleCommand ToggleDemoCommand;
|
|
};
|