@@ -26,7 +26,13 @@ public class UIControllerEditor : SubjectNerd.Utilities.ReorderableArrayInspecto
26
26
{
27
27
{ SessionSettingsMode . SelectWithUI , "TODO" } ,
28
28
{ SessionSettingsMode . DownloadFromURL , "TODO" } ,
29
- { SessionSettingsMode . None , "TODO" }
29
+ { SessionSettingsMode . Empty , "TODO" }
30
+ } ;
31
+
32
+ static Dictionary < PPIDMode , string > ppidModeDescriptionMapping = new Dictionary < PPIDMode , string > ( )
33
+ {
34
+ { PPIDMode . EnterWithUI , "TODO" } ,
35
+ { PPIDMode . GenerateUnique , "TODO" }
30
36
} ;
31
37
32
38
protected override void InitInspector ( )
@@ -73,20 +79,40 @@ protected override void DrawInspector()
73
79
switch ( tabSelection )
74
80
{
75
81
case 0 :
76
- string reasonText ;
77
- if ( ! uiController . SettingsAreCompatible ( out reasonText ) )
82
+
83
+ string ppidReasonText ;
84
+ if ( ! uiController . PPIDModeIsInvalid ( out ppidReasonText ) )
85
+ {
86
+ string errorText = "Incompatibility Error: " + ppidReasonText ;
87
+ EditorGUILayout . HelpBox ( errorText , UnityEditor . MessageType . Error ) ;
88
+ EditorGUILayout . Separator ( ) ;
89
+ }
90
+
91
+ string settingsReasonText ;
92
+ if ( ! uiController . SettingsModeIsCompatible ( out settingsReasonText ) )
78
93
{
79
- string errorText = "Incompatibility Error: " + reasonText ;
94
+ string errorText = "Incompatibility Error: " + settingsReasonText ;
80
95
EditorGUILayout . HelpBox ( errorText , UnityEditor . MessageType . Error ) ;
81
96
EditorGUILayout . Separator ( ) ;
82
97
}
83
98
84
99
this . DrawProperty ( "startupMode" ) ;
85
- EditorGUILayout . HelpBox ( uiController . startupMode . ToString ( ) + ": " + startupModeDescriptionMapping [ uiController . startupMode ] , UnityEditor . MessageType . Info ) ;
100
+ EditorGUILayout . HelpBox ( "Startup Mode " + uiController . startupMode . ToString ( ) + ": " + startupModeDescriptionMapping [ uiController . startupMode ] , UnityEditor . MessageType . Info ) ;
101
+ EditorGUILayout . Separator ( ) ;
102
+
103
+ EditorGUI . BeginDisabledGroup ( uiController . startupMode == StartupMode . Manual ) ;
104
+ if ( uiController . startupMode == StartupMode . Manual )
105
+ {
106
+ EditorGUILayout . HelpBox ( "Manual is selected as the Startup Setting - the options below have no effect." , UnityEditor . MessageType . Info ) ;
107
+ EditorGUILayout . Separator ( ) ;
108
+ }
109
+
110
+ this . DrawProperty ( "ppidMode" ) ;
111
+ EditorGUILayout . HelpBox ( "PPID Mode " + uiController . ppidMode . ToString ( ) + ": " + ppidModeDescriptionMapping [ uiController . ppidMode ] , UnityEditor . MessageType . Info ) ;
86
112
EditorGUILayout . Separator ( ) ;
87
113
88
114
this . DrawProperty ( "settingsMode" ) ;
89
- EditorGUILayout . HelpBox ( uiController . settingsMode . ToString ( ) + ": " + settingsModeDescriptionMapping [ uiController . settingsMode ] , UnityEditor . MessageType . Info ) ;
115
+ EditorGUILayout . HelpBox ( "Settings Mode " + uiController . settingsMode . ToString ( ) + ": " + settingsModeDescriptionMapping [ uiController . settingsMode ] , UnityEditor . MessageType . Info ) ;
90
116
switch ( uiController . settingsMode )
91
117
{
92
118
case SessionSettingsMode . SelectWithUI :
@@ -96,36 +122,40 @@ protected override void DrawInspector()
96
122
if ( MiddleButton ( "Test URL" ) ) throw new NotImplementedException ( "TODO" ) ;
97
123
this . DrawProperty ( "jsonURL" ) ;
98
124
break ;
99
- case SessionSettingsMode . None :
125
+ case SessionSettingsMode . Empty :
100
126
break ;
101
127
}
128
+
129
+ EditorGUI . EndDisabledGroup ( ) ;
130
+
102
131
EditorGUILayout . Separator ( ) ;
103
132
break ;
104
133
case 1 :
134
+ string datapointsReasonText ;
105
135
EditorGUILayout . HelpBox (
106
136
"Below you can enter a series of datapoints to be collected about a participant" +
107
137
"- such as their age, gender, or even things that could affect the task such as " +
108
138
"the preferred hand of the participant. Press the Generate button to update the UI " +
109
139
"to reflect your items." , UnityEditor . MessageType . Info ) ;
110
- bool valid = uiController . DatapointsAreValid ( out reasonText ) ;
140
+ bool valid = uiController . DatapointsAreValid ( out datapointsReasonText ) ;
111
141
if ( ! valid )
112
142
{
113
- string errorText = "Participant Datapoints Error: " + reasonText ;
143
+ string errorText = "Participant Datapoints Error: " + datapointsReasonText ;
114
144
EditorGUILayout . HelpBox ( errorText , UnityEditor . MessageType . Error ) ;
115
145
EditorGUILayout . Separator ( ) ;
116
146
}
117
147
if ( MiddleButton ( "Generate" , enabled : valid ) ) throw new NotImplementedException ( "TODO" ) ;
118
148
EditorGUILayout . Separator ( ) ;
119
149
EditorGUI . indentLevel ++ ;
120
- this . DrawProperty ( "showPPIDElement" ) ;
121
150
DrawPropertiesFromUpTo ( "participantDataPoints" , "termsAndConditions" ) ;
122
151
EditorGUI . indentLevel -- ;
123
152
break ;
124
153
case 2 :
125
154
EditorGUILayout . HelpBox (
126
155
"You can edit the content that displays in the right side of the UI. This can " +
127
156
"be used for instructions to the participant or researcher on how the study should " +
128
- "be performed. You can add any UI elements such as text, images, or even buttons to " +
157
+ "be performed, and what types of data will be collected. " +
158
+ "You can add any UI elements such as text, images, or even buttons to " +
129
159
"the Instructions Panel Content GameObject. You can select it with the button below." , UnityEditor . MessageType . Info ) ;
130
160
if ( MiddleButton ( "Select Content GameObject" ) )
131
161
{
@@ -151,7 +181,7 @@ protected override void DrawInspector()
151
181
152
182
public void DrawUIDisabledMessage ( )
153
183
{
154
- EditorGUILayout . HelpBox ( "The Built-in UI is not selected as the Startup Setting - these options have no effect." , UnityEditor . MessageType . Warning ) ;
184
+ EditorGUILayout . HelpBox ( "The Built-in UI is not selected as the Startup Setting - the options below have no effect." , UnityEditor . MessageType . Warning ) ;
155
185
EditorGUILayout . Separator ( ) ;
156
186
}
157
187
0 commit comments