2323namespace PlayEveryWare . EpicOnlineServices . Editor . Utility
2424{
2525 using Common ;
26+
27+ #if ! EOS_DISABLE
2628 using Epic . OnlineServices . Platform ;
29+ #endif
30+
2731 using EpicOnlineServices . Utility ;
2832 using System ;
2933 using System . Collections . Generic ;
@@ -263,22 +267,30 @@ public static void AssigningEnumField<T>(string label, ref T value, float labelW
263267
264268 static readonly Dictionary < Type , RenderInputDelegate > RenderInputMethods = new ( )
265269 {
266- { typeof ( Deployment ) , ( attr , val , width ) => RenderInput ( attr , ( Deployment ) val , width ) } ,
270+ #if ! EOS_DISABLE
267271 { typeof ( EOSClientCredentials ) , ( attr , val , width ) => RenderInput ( attr , ( EOSClientCredentials ) val , width ) } ,
268272 { typeof ( SetOfNamed < EOSClientCredentials > ) , ( attr , val , width ) => RenderInput ( attr , ( SetOfNamed < EOSClientCredentials > ) val , width ) } ,
273+ { typeof ( WrappedInitializeThreadAffinity ) , ( attr , val , width ) => RenderInput ( attr , ( WrappedInitializeThreadAffinity ) val , width ) } ,
274+ #endif
275+ { typeof ( Deployment ) , ( attr , val , width ) => RenderInput ( attr , ( Deployment ) val , width ) } ,
269276 { typeof ( string ) , ( attr , val , width ) => RenderInput ( attr , ( string ) val , width ) } ,
270277 { typeof ( ulong ) , ( attr , val , width ) => RenderInput ( attr , ( ulong ) val , width ) } ,
271278 { typeof ( uint ) , ( attr , val , width ) => RenderInput ( attr , ( uint ) val , width ) } ,
272279 { typeof ( ProductionEnvironments ) , ( attr , val , width ) => RenderInput ( attr , ( ProductionEnvironments ) val , width ) } ,
273280 { typeof ( float ) , ( attr , val , width ) => RenderInput ( attr , ( float ) val , width ) } ,
274281 { typeof ( double ) , ( attr , val , width ) => RenderInput ( attr , ( double ) val , width ) } ,
275- { typeof ( WrappedInitializeThreadAffinity ) , ( attr , val , width ) => RenderInput ( attr , ( WrappedInitializeThreadAffinity ) val , width ) } ,
282+
276283 { typeof ( bool ) , ( attr , val , width ) => RenderInput ( attr , ( bool ) val , width ) } ,
277284 // Add other specific types as needed
278285 } ;
279286
280287 static readonly Dictionary < ConfigFieldType , FieldHandler > FieldHandlers = new ( )
281288 {
289+ #if ! EOS_DISABLE
290+ { ConfigFieldType . SetOfClientCredentials , HandleField < SetOfNamed < EOSClientCredentials > > } ,
291+ { ConfigFieldType . ClientCredentials , HandleField < EOSClientCredentials > } ,
292+ { ConfigFieldType . WrappedInitializeThreadAffinity , HandleField < WrappedInitializeThreadAffinity > } ,
293+ #endif
282294 { ConfigFieldType . Text , HandleField < string > } ,
283295 { ConfigFieldType . FilePath , ( target , fieldDetails , getValue , setValue , labelWidth ) =>
284296 HandleField < string > ( target , ( FilePathFieldAttribute ) fieldDetails , getValue , setValue , labelWidth ) } ,
@@ -291,12 +303,9 @@ public static void AssigningEnumField<T>(string label, ref T value, float labelW
291303 { ConfigFieldType . Uint , HandleField < uint > } ,
292304 { ConfigFieldType . Float , HandleField < float > } ,
293305 { ConfigFieldType . ProductionEnvironments , HandleField < ProductionEnvironments > } ,
294- { ConfigFieldType . SetOfClientCredentials , HandleField < SetOfNamed < EOSClientCredentials > > } ,
295- { ConfigFieldType . NamedGuid , HandleField < Named < Guid > > } ,
306+ { ConfigFieldType . Guid , HandleField < Named < Guid > > } ,
296307 { ConfigFieldType . Version , HandleField < Version > } ,
297308 { ConfigFieldType . Deployment , HandleField < Deployment > } ,
298- { ConfigFieldType . ClientCredentials , HandleField < EOSClientCredentials > } ,
299- { ConfigFieldType . WrappedInitializeThreadAffinity , HandleField < WrappedInitializeThreadAffinity > } ,
300309 { ConfigFieldType . Button , HandleButtonField } ,
301310 { ConfigFieldType . Enum , HandleEnumField } ,
302311 // Add other field types as needed
@@ -306,6 +315,7 @@ public static void AssigningEnumField<T>(string label, ref T value, float labelW
306315
307316 private static T RenderInput < T > ( ConfigFieldAttribute attribute , T value , float labelWidth )
308317 {
318+ #if ! EOS_DISABLE
309319 if ( typeof ( T ) == typeof ( WrappedInitializeThreadAffinity ) )
310320 {
311321 // Create a foldout label with a tooltip
@@ -340,6 +350,7 @@ private static T RenderInput<T>(ConfigFieldAttribute attribute, T value, float l
340350 RenderInputs ( ref value ) ;
341351 }
342352 }
353+ #endif
343354 return value ;
344355 }
345356
@@ -395,15 +406,20 @@ static void HandleEnumField(
395406 setValue ( target , newValue ) ;
396407 }
397408
398-
399-
400409 delegate void FieldHandler (
401410 object target ,
402411 ConfigFieldAttribute fieldDetails ,
403412 Func < object , object > getValue ,
404413 Action < object , object > setValue ,
405414 float labelWidth ) ;
406415
416+ public static void RenderSectionHeader ( string label )
417+ {
418+ GUILayout . Label ( label . ToUpper ( ) , EditorStyles . boldLabel ) ;
419+ Rect rect = EditorGUILayout . GetControlRect ( false , 1 ) ; // Set the height to 1 pixel
420+ EditorGUI . DrawRect ( rect , Color . gray ) ;
421+ }
422+
407423 /// <summary>
408424 /// Render the config fields for the config that has been set to edit.
409425 /// </summary>
@@ -696,7 +712,7 @@ private static void RenderSetOfNamed<T>(
696712 Action < Rect , Named < T > > renderItemFn ,
697713 Action addNewItemFn ,
698714 Action < Named < T > > removeItemFn
699- ) where T : IEquatable < T >
715+ ) where T : IEquatable < T > , new ( )
700716 {
701717 List < Named < T > > items = value . ToList ( ) ;
702718
@@ -867,6 +883,7 @@ private static Version VersionField(Version value, params GUILayoutOption[] opti
867883 return Version . TryParse ( tempStringVersion , out Version newValue ) ? newValue : value ;
868884 }
869885
886+ #if ! EOS_DISABLE
870887 public static EOSClientCredentials RenderInput ( ConfigFieldAttribute configFieldAttribute ,
871888 EOSClientCredentials value ,
872889 float labelWidth )
@@ -897,6 +914,7 @@ public static EOSClientCredentials RenderInput(ConfigFieldAttribute configFieldA
897914 return ( newIndex >= 0 && newIndex < credentials . Count ) ? credentials [ newIndex ] . Value : value ;
898915 } ) ;
899916 }
917+ #endif
900918
901919 public static Deployment RenderInput ( ConfigFieldAttribute configFieldAttribute , Deployment value , float labelWidth )
902920 {
@@ -942,6 +960,7 @@ public static Version RenderInput(ConfigFieldAttribute configFieldAttribute, Ver
942960 VersionField ) ;
943961 }
944962
963+ #if ! EOS_DISABLE
945964 public static SetOfNamed < EOSClientCredentials > RenderInput ( ConfigFieldAttribute configFieldAttribute ,
946965 SetOfNamed < EOSClientCredentials > value , float labelWidth )
947966 {
@@ -1001,6 +1020,7 @@ public static WrappedInitializeThreadAffinity RenderInput(ConfigFieldAttribute a
10011020 RenderInputs ( ref value ) ;
10021021 return value ;
10031022 }
1023+ #endif
10041024
10051025 public static ProductionEnvironments RenderInput ( ConfigFieldAttribute configFieldAttribute ,
10061026 ProductionEnvironments value , float labelWidth )
@@ -1030,25 +1050,6 @@ public static ProductionEnvironments RenderInput(ConfigFieldAttribute configFiel
10301050 return value ;
10311051 }
10321052
1033- public static Named < Guid > RenderInput ( ConfigFieldAttribute configFieldDetails , Named < Guid > value ,
1034- float labelWidth )
1035- {
1036- EditorGUILayout . LabelField ( CreateGUIContent ( configFieldDetails . Label , configFieldDetails . ToolTip ) ) ;
1037-
1038- GUILayout . BeginHorizontal ( ) ;
1039-
1040- value ??= new Named < Guid > ( ) ;
1041-
1042- value . Name = RenderFieldWithHint ( EditorGUILayout . TextField , string . IsNullOrEmpty , value . Name ,
1043- "Product Name" ) ;
1044-
1045- value . Value = RenderFieldWithHint ( GuidField , guid => guid . Equals ( Guid . Empty ) , value . Value , "Product Id" ) ;
1046-
1047- GUILayout . EndHorizontal ( ) ;
1048-
1049- return value ;
1050- }
1051-
10521053 public static List < string > RenderInput ( ConfigFieldAttribute configFieldDetails , List < string > value ,
10531054 float labelWidth )
10541055 {
@@ -1229,6 +1230,6 @@ private static T InputRendererWrapper<T>(string label, string toolTip, float lab
12291230 } ) ;
12301231 }
12311232
1232- #endregion
1233+ #endregion
12331234 }
12341235}
0 commit comments