This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 34
Added configuration foldout to all service configuration profiles #529
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ public class MixedRealityServiceProfileInspector : BaseMixedRealityProfileInspec | |
|
||
private SerializedProperty configurations; | ||
|
||
private bool showConfigurationFoldout = true; | ||
|
||
/// <summary> | ||
/// Gets the service constraint used to filter options listed in the | ||
/// <see cref="configurations"/> instance type dropdown. Set after | ||
|
@@ -56,18 +58,21 @@ protected override void OnEnable() | |
public override void OnInspectorGUI() | ||
{ | ||
EditorGUILayout.Space(); | ||
EditorGUILayout.LabelField("Configuration Options", EditorStyles.boldLabel); | ||
EditorGUILayout.Space(); | ||
serializedObject.Update(); | ||
EditorGUILayout.Space(); | ||
configurationList.DoLayoutList(); | ||
showConfigurationFoldout = EditorGUILayout.Foldout(showConfigurationFoldout, new GUIContent($"{ServiceConstraint.Name} Configuration Options"), true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use the "EditorGUILayoutExtensions.FoldoutWithBoldLabel" here? To gradually update all the inspectors to use it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do use it in the rolled up branches. It's just that you didn't commit just that change to the development branch. (We could have you pull it out but that's up to you) |
||
|
||
if (configurations == null || configurations.arraySize == 0) | ||
if (showConfigurationFoldout) | ||
{ | ||
EditorGUILayout.HelpBox("Register a new Service Configuration", MessageType.Warning); | ||
} | ||
serializedObject.Update(); | ||
EditorGUILayout.Space(); | ||
configurationList.DoLayoutList(); | ||
|
||
serializedObject.ApplyModifiedProperties(); | ||
if (configurations == null || configurations.arraySize == 0) | ||
{ | ||
EditorGUILayout.HelpBox($"Register a new {ServiceConstraint.Name} Configuration", MessageType.Warning); | ||
} | ||
|
||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
|
||
private void DrawConfigurationOptionElement(Rect rect, int index, bool isActive, bool isFocused) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be cached as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it? I'm not confident the service constraint is populated in the constructor