Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nDisplay Launch Button Plugin
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Unreal-Development
Tools
nDisplay Launch Button Plugin
Commits
cf4ed7c8
Commit
cf4ed7c8
authored
4 years ago
by
Sebastian Pape
Browse files
Options
Downloads
Patches
Plain Diff
Adding fix to enable nDisplay on launch and setting config stuff
parent
33a66ab9
No related branches found
No related tags found
2 merge requests
!9
Update current master to develop
,
!6
Adding fix to enable nDisplay on launch and setting config stuff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/NDisplayLaunchButton/Private/NDisplayLaunchButton.cpp
+43
-1
43 additions, 1 deletion
Source/NDisplayLaunchButton/Private/NDisplayLaunchButton.cpp
Source/NDisplayLaunchButton/Public/NDisplayLaunchButton.h
+2
-0
2 additions, 0 deletions
Source/NDisplayLaunchButton/Public/NDisplayLaunchButton.h
with
45 additions
and
1 deletion
Source/NDisplayLaunchButton/Private/NDisplayLaunchButton.cpp
+
43
−
1
View file @
cf4ed7c8
...
...
@@ -45,6 +45,46 @@ void FNDisplayLaunchButtonModule::ShutdownModule()
FNDisplayLaunchButtonCommands
::
Unregister
();
}
/*
* Copied from DisplayClusterEditorSettings.cpp:
* Switches on the nDisplay Plugin and changes the Editor Runtime
*/
void
FNDisplayLaunchButtonModule
::
ChangeNDisplayStateAndStoreConfig
(
bool
NewState
,
bool
&
OldState
)
{
static
const
FString
PlatformName
=
FPlatformProperties
::
PlatformName
();
static
const
FString
DefaultEnginePath
=
FString
::
Printf
(
TEXT
(
"%s/DefaultEngine.ini"
),
*
FPaths
::
SourceConfigDir
());
static
const
FString
DefaultPlatformEnginePath
=
FString
::
Printf
(
TEXT
(
"%s%s/%sEngine.ini"
),
*
FPaths
::
SourceConfigDir
(),
*
PlatformName
,
*
PlatformName
);
static
const
FString
DefaultGamePath
=
FString
::
Printf
(
TEXT
(
"%sDefaultGame.ini"
),
*
FPaths
::
SourceConfigDir
());
FString
OldValue
;
GConfig
->
GetString
(
TEXT
(
"/Script/DisplayClusterEditor.DisplayClusterEditorSettings"
),
TEXT
(
"bEnabled"
),
OldValue
,
DefaultEnginePath
);
OldState
=
OldValue
.
ToBool
();
if
(
NewState
)
{
// DefaultEngine.ini
GConfig
->
SetString
(
TEXT
(
"/Script/Engine.Engine"
),
TEXT
(
"GameEngine"
),
TEXT
(
"/Script/DisplayCluster.DisplayClusterGameEngine"
),
DefaultPlatformEnginePath
);
GConfig
->
SetString
(
TEXT
(
"/Script/Engine.Engine"
),
TEXT
(
"UnrealEdEngine"
),
TEXT
(
"/Script/DisplayClusterEditor.DisplayClusterEditorEngine"
),
DefaultPlatformEnginePath
);
GConfig
->
SetString
(
TEXT
(
"/Script/Engine.Engine"
),
TEXT
(
"GameViewportClientClassName"
),
TEXT
(
"/Script/DisplayCluster.DisplayClusterViewportClient"
),
DefaultPlatformEnginePath
);
// DefaultGame.ini
GConfig
->
SetString
(
TEXT
(
"/Script/EngineSettings.GeneralProjectSettings"
),
TEXT
(
"bUseBorderlessWindow"
),
TEXT
(
"True"
),
DefaultGamePath
);
}
else
{
GConfig
->
SetString
(
TEXT
(
"/Script/Engine.Engine"
),
TEXT
(
"GameEngine"
),
TEXT
(
"/Script/Engine.GameEngine"
),
DefaultPlatformEnginePath
);
GConfig
->
SetString
(
TEXT
(
"/Script/Engine.Engine"
),
TEXT
(
"UnrealEdEngine"
),
TEXT
(
"/Script/UnrealEd.UnrealEdEngine"
),
DefaultPlatformEnginePath
);
GConfig
->
SetString
(
TEXT
(
"/Script/Engine.Engine"
),
TEXT
(
"GameViewportClientClassName"
),
TEXT
(
"/Script/Engine.GameViewportClient"
),
DefaultPlatformEnginePath
);
// DefaultGame.ini
GConfig
->
SetString
(
TEXT
(
"/Script/EngineSettings.GeneralProjectSettings"
),
TEXT
(
"bUseBorderlessWindow"
),
TEXT
(
"False"
),
DefaultGamePath
);
}
GConfig
->
Flush
(
false
,
DefaultPlatformEnginePath
);
GConfig
->
Flush
(
false
,
DefaultGamePath
);
}
/**
* Since some plugins interfere with nDisplay execution, this function can disable them
* @param PluginName - Name of the plugin to enable/disable
...
...
@@ -158,9 +198,10 @@ void FNDisplayLaunchButtonModule::PluginButtonClicked()
if
(
Settings
->
TracehostIP
.
Len
()
>
0
)
InsightParameters
.
Append
(
FString
::
Printf
(
TEXT
(
" -tracehost=%s"
),
*
Settings
->
TracehostIP
));
}
/* Disable Plugins temporarily */
/*
Enable/
Disable Plugins temporarily */
if
(
!
ChangePluginStateAndStoreConfig
(
"SteamVR"
,
false
,
SteamVRState
))
return
;
if
(
!
ChangePluginStateAndStoreConfig
(
"OculusVR"
,
false
,
OculusVRState
))
return
;
ChangeNDisplayStateAndStoreConfig
(
true
,
nDisplayState
);
/* Trigger Editor save. Needed, else old version will be launched every time */
if
(
!
UEditorLoadingAndSavingUtils
::
SaveDirtyPackagesWithDialog
(
true
,
true
))
return
;
...
...
@@ -271,6 +312,7 @@ void FNDisplayLaunchButtonModule::PluginButtonClicked()
/* Restore Plugin States */
ChangePluginStateAndStoreConfig
(
"SteamVR"
,
SteamVRState
,
SteamVRState
);
ChangePluginStateAndStoreConfig
(
"OculusVR"
,
OculusVRState
,
OculusVRState
);
ChangeNDisplayStateAndStoreConfig
(
nDisplayState
,
nDisplayState
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Source/NDisplayLaunchButton/Public/NDisplayLaunchButton.h
+
2
−
0
View file @
cf4ed7c8
...
...
@@ -20,6 +20,7 @@ public:
/** IModuleInterface implementation */
virtual
void
StartupModule
()
override
;
virtual
void
ShutdownModule
()
override
;
static
void
ChangeNDisplayStateAndStoreConfig
(
bool
NewState
,
bool
&
OldState
);
bool
ChangePluginStateAndStoreConfig
(
FString
PluginName
,
bool
NewState
,
bool
&
OldState
)
const
;
static
FString
GetEditorExecutableName
();
static
FString
GetFilePathInProject
(
FString
FileName
);
...
...
@@ -34,4 +35,5 @@ public:
private:
bool
SteamVRState
=
false
;
bool
OculusVRState
=
false
;
bool
nDisplayState
=
false
;
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment