You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Other Updates: - The WidgetReflector is now in its own module as well. It will be converted to a plug-in later. - The Public API of both Slate and SlateCore has largely been reorganized for better discoverabilty. More cleanup work is needed. - Added a lot of missing API documentation and fixed existing ones. More and better documentation is needed. - Removed dead code, fixed a couple things I stubled upon, and conformed to coding guidelines (NULL vs nullptr, line breaks, etc.) Upgrade Notes: - The Slate Remote Server is currently disabled - will be re-enabled shortly! - If your module previously had a module dependency to 'Slate', it now also needs a PrivateModuleDependency to 'SlateCore' in its Build.cs file. - If your module exposes in any of its Public header files types that are now declared in SlateCore, it needs a PublicModuleDependency to 'SlateCore' - The ToolTip property type on SWidget has changed from SToolTip to IToolTip; change local variables to TSharedPtr<IToolTip> instead of TSharedPtr<SToolTip> where needed - IToolTip is not a widget. If you need access to the actual widget that represents the tool tip, use IToolTip::AsWidget(); If you need access to the tool tip's content, use IToolTip::GetContentWidget() Troubleshooting: - After syncing to this changelist you may have to clean your /Engine/Intermediate/Build/ directory and rebuild your entire project - If in your project you are getting linker errors for unresolved types that are now declared in SlateCore, you may be missing a dependency to 'SlateCore' - If in the Engine code you are getting linker errors for unresolved types that are now declared in SlateCore, you may need to rebuild the entire Engine [CL 2057118 by Max Preussner in Main branch]
88 lines
2.1 KiB
C++
88 lines
2.1 KiB
C++
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
SlateReflectorModule.cpp: Implements the FSlateReflectorModule class.
|
|
=============================================================================*/
|
|
|
|
#include "SlateReflectorPrivatePCH.h"
|
|
#include "ModuleManager.h"
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "FSlateReflectorModule"
|
|
|
|
|
|
/**
|
|
* Implements the SlateReflector module.
|
|
*/
|
|
class FSlateReflectorModule
|
|
: public ISlateReflectorModule
|
|
{
|
|
public:
|
|
|
|
// Begin ISlateReflectorModule interface
|
|
|
|
virtual TSharedRef<SWidget> GetWidgetReflector( ) OVERRIDE
|
|
{
|
|
TSharedPtr<SWidgetReflector> WidgetReflector = WidgetReflectorPtr.Pin();
|
|
|
|
if (!WidgetReflector.IsValid())
|
|
{
|
|
WidgetReflector = SNew(SWidgetReflector);
|
|
FSlateApplication::Get().SetWidgetReflector(WidgetReflector.ToSharedRef());
|
|
}
|
|
|
|
return WidgetReflector.ToSharedRef();
|
|
}
|
|
|
|
virtual void RegisterTabSpawner( const TSharedRef<FWorkspaceItem>& WorkspaceGroup ) OVERRIDE
|
|
{
|
|
FGlobalTabmanager::Get()->RegisterNomadTabSpawner("WidgetReflector", FOnSpawnTab::CreateRaw(this, &FSlateReflectorModule::MakeWidgetReflectorTab) )
|
|
.SetDisplayName(LOCTEXT("WidgetReflectorTitle", "Widget Reflector"))
|
|
.SetTooltipText(LOCTEXT("WidgetReflectorTooltipText", "Open the Widget Reflector tab."))
|
|
.SetGroup(WorkspaceGroup)
|
|
.SetIcon(FSlateIcon(FCoreStyle::Get().GetStyleSetName(), "WidgetReflector.TabIcon"));
|
|
}
|
|
|
|
virtual void UnregisterTabSpawner( )
|
|
{
|
|
FGlobalTabmanager::Get()->UnregisterNomadTabSpawner("WidgetReflector");
|
|
}
|
|
|
|
// End ISlateReflectorModule interface
|
|
|
|
public:
|
|
|
|
// Begin IModuleInterface interface
|
|
|
|
virtual void StartupModule( ) OVERRIDE { }
|
|
|
|
virtual void ShutdownModule( ) OVERRIDE
|
|
{
|
|
UnregisterTabSpawner();
|
|
}
|
|
|
|
// End IModuleInterface interface
|
|
|
|
private:
|
|
|
|
TSharedRef<SDockTab> MakeWidgetReflectorTab( const FSpawnTabArgs& )
|
|
{
|
|
return SNew(SDockTab)
|
|
.TabRole(ETabRole::NomadTab)
|
|
[
|
|
GetWidgetReflector()
|
|
];
|
|
}
|
|
|
|
private:
|
|
|
|
// Holds the widget reflector singleton.
|
|
TWeakPtr<SWidgetReflector> WidgetReflectorPtr;
|
|
};
|
|
|
|
|
|
IMPLEMENT_MODULE(FSlateReflectorModule, SlateReflector);
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|