Sfoglia il codice sorgente

added #Class support to access statics in scripts

Nicolas Cannasse 2 mesi fa
parent
commit
2199720f8a
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      hide/comp/ScriptEditor.hx

+ 2 - 0
hide/comp/ScriptEditor.hx

@@ -327,6 +327,8 @@ class ScriptChecker {
 					switch( t ) {
 					switch( t ) {
 					case TEnum(e,_):
 					case TEnum(e,_):
 						t = TAnon([for( c in e.constructors ) { name : c.name, opt : false, t : c.args == null ? t : TFun(c.args,t) }]);
 						t = TAnon([for( c in e.constructors ) { name : c.name, opt : false, t : c.args == null ? t : TFun(c.args,t) }]);
+					case TInst(c,[]):
+						t = TAnon([for( f in c.statics ) if( f.isPublic || (api.publicFields != true && f.t.match(TFun(_))) ) { name : f.name, opt : false, t : f.t }]);
 					default:
 					default:
 						error('Cannot process class type $tname');
 						error('Cannot process class type $tname');
 					}
 					}