forked from UPBGE/UPBGE-logicnodes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreferences.py
64 lines (57 loc) · 2.19 KB
/
preferences.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import bpy
import sys
from .props.propertyfilter import LogicNodesPropertyFilter
from .props.customnode import CustomNodeReference
_uplogic_versions = [
('1.9.5', '1.9.5', 'Suitable for Logic Nodes 2.4'),
('2.0.1', '2.0.1', 'Suitable for Logic Nodes 3.0'),
('latest', 'Latest', 'Download the latest version')
]
class LogicNodesAddonPreferences(bpy.types.AddonPreferences):
bl_idname = 'bge_netlogic'
use_reload_text: bpy.props.BoolProperty(default=True)
uplogic_version: bpy.props.EnumProperty(items=_uplogic_versions, default='latest', name='Uplogic Version')
use_node_debug: bpy.props.BoolProperty(default=True)
use_node_notify: bpy.props.BoolProperty(default=True)
prop_filter: bpy.props.PointerProperty(type=LogicNodesPropertyFilter)
use_fmod_nodes: bpy.props.BoolProperty(name='FMOD Support', description='')
custom_logic_nodes: bpy.props.CollectionProperty(
type=CustomNodeReference
)
def draw(self, context):
layout = self.layout
box = layout.box()
col = box.column()
col.label(
text='Logic Nodes require the uplogic module, please install if missing.',
icon='CHECKMARK' if 'uplogic' in sys.modules else 'ERROR'
)
row = col.row(align=True)
row.operator('logic_nodes.install_uplogic', icon='IMPORT')
row.prop(self, 'uplogic_version', text='')
main_row = layout.row()
col = main_row.column()
col.prop(
self,
'use_reload_text',
text="Reload Scripts on Game Start"
)
col.prop(
self,
'use_node_notify',
text="Notifications"
)
col.prop(
self,
'use_node_debug',
text="Debug Mode (Print Errors to Console)"
)
col.separator()
col.label(text='Additional Nodes')
col.prop(self, 'use_fmod_nodes')
col.separator()
link_row = col.row(align=True)
link_row.operator("logic_nodes.open_github", icon="URL")
link_row.operator("logic_nodes.open_donate", icon="FUND")
contrib_row = col.row()
contrib_row.label(text='Contributors: VUAIEO, Simon, L_P, p45510n')