Ejemplo n.º 1
0
	virtual void StartupModule( ) override
	{
		if (!SupportsSlateRemote())
		{
			return;
		}

		// register settings
		ISettingsModule* SettingsModule = ISettingsModule::Get();

		if (SettingsModule != nullptr)
		{
			FSettingsSectionDelegates SettingsDelegates;
			SettingsDelegates.ModifiedDelegate = FOnSettingsSectionModified::CreateRaw(this, &FSlateRemoteModule::HandleSettingsSaved);

			SettingsModule->RegisterSettings("Project", "Plugins", "SlateRemote",
				LOCTEXT("SlateRemoteSettingsName", "Slate Remote"),
				LOCTEXT("SlateRemoteSettingsDescription", "Configure the Slate Remote plug-in."),
				GetMutableDefault<USlateRemoteSettings>(),
				SettingsDelegates
			);
		}

		// register application events
		FCoreDelegates::ApplicationHasReactivatedDelegate.AddRaw(this, &FSlateRemoteModule::HandleApplicationHasReactivated);
		FCoreDelegates::ApplicationWillDeactivateDelegate.AddRaw(this, &FSlateRemoteModule::HandleApplicationWillDeactivate);

		RestartServices();
	}
Ejemplo n.º 2
0
	virtual void StartupModule() override
	{
		if (!SupportsNetworkedTransport())
		{
			return;
		}

		// load dependencies
		if (!FModuleManager::Get().LoadModule(TEXT("Networking")).IsValid())
		{
			GLog->Log(TEXT("Error: The required module 'Networking' failed to load. Plug-in 'UDP Messaging' cannot be used."));

			return;
		}

		// register settings
		ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");

		if (SettingsModule != nullptr)
		{
			ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings("Project", "Plugins", "UdpMessaging",
				LOCTEXT("UdpMessagingSettingsName", "UDP Messaging"),
				LOCTEXT("UdpMessagingSettingsDescription", "Configure the UDP Messaging plug-in."),
				GetMutableDefault<UUdpMessagingSettings>()
			);

			if (SettingsSection.IsValid())
			{
				SettingsSection->OnModified().BindRaw(this, &FUdpMessagingModule::HandleSettingsSaved);
			}
		}

		// register application events
		FCoreDelegates::ApplicationHasReactivatedDelegate.AddRaw(this, &FUdpMessagingModule::HandleApplicationHasReactivated);
		FCoreDelegates::ApplicationWillDeactivateDelegate.AddRaw(this, &FUdpMessagingModule::HandleApplicationWillDeactivate);

		RestartServices();
	}
Ejemplo n.º 3
0
	// Callback for when the settings were saved.
	bool HandleSettingsSaved( )
	{
		RestartServices();

		return true;
	}
Ejemplo n.º 4
0
	// Callback for when an has been reactivated (i.e. return from sleep on iOS).
	void HandleApplicationHasReactivated( )
	{
		RestartServices();
	}