Skip to content

Commit e59182f

Browse files
author
Roberto De Ioris
committed
added script generator for sublime text autocomplete
1 parent 6b378a6 commit e59182f

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import unreal_engine as ue
2+
import json
3+
import os
4+
5+
data = {
6+
'scope': 'source.python',
7+
'completions': []
8+
}
9+
10+
for item in ('unreal_engine', 'unreal_engine.classes', 'unreal_engine.structs', 'unreal_engine.enums'):
11+
data['completions'].append({'trigger': item, 'contents': item})
12+
13+
for item in dir(ue):
14+
value = 'unreal_engine.{0}'.format(item)
15+
data['completions'].append({'trigger': value, 'contents': value})
16+
17+
for item in dir(ue.UObject):
18+
value = 'unreal_engine.UObject.{0}'.format(item)
19+
data['completions'].append({'trigger': value, 'contents': value})
20+
21+
for _class in ue.all_classes():
22+
data['completions'].append({'trigger': _class.get_name(), 'contents': _class.get_name()})
23+
for function in _class.functions():
24+
value = '{0}.{1}()'.format(_class.get_name(), function)
25+
data['completions'].append({'trigger': value, 'contents': value})
26+
for _property in _class.properties():
27+
value = '{0}.{1}'.format(_class.get_name(), _property)
28+
data['completions'].append({'trigger': value, 'contents': value})
29+
30+
j = json.dumps(data, indent=4)
31+
32+
with open(os.path.join(ue.get_content_dir(), 'UnrealEnginePython..sublime-completions'), 'w') as f:
33+
f.write(j)

0 commit comments

Comments
 (0)