Skip to content

Commit 1be080c

Browse files
committed
Plugin: Move disabled classes to a constant
1 parent c8b37f5 commit 1be080c

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

addons/block_code/block_code_plugin.gd

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,42 @@ static var main_panel
77

88
var old_feature_profile: String = ""
99

10+
const DISABLED_CLASSES := [
11+
"BlockScriptData",
12+
"DragManager",
13+
"InstructionTree",
14+
"EditorInterfaceAccess",
15+
"SimpleCharacter",
16+
"Types",
17+
"BasicBlock",
18+
"Block",
19+
"ControlBlock",
20+
"ParameterBlock",
21+
"StatementBlock",
22+
"DragDropArea",
23+
"SnapPoint",
24+
"NodeBlockCanvas",
25+
"SerializedBlockTreeNodeArray",
26+
"SerializedBlockTreeNode",
27+
"SerializedBlock",
28+
"PackedSceneTreeNodeArray",
29+
"PackedSceneTreeNode",
30+
"BlockCanvas",
31+
"NodeCanvas",
32+
"NodeClass",
33+
"NodeClassList",
34+
"NodeData",
35+
"NodePreview",
36+
"NodeList",
37+
"CategoryFactory",
38+
"BlockCategoryDisplay",
39+
"BlockCategory",
40+
"Picker",
41+
"TitleBar",
42+
"MainPanel",
43+
"BlockCodePlugin"
44+
]
45+
1046

1147
func _enter_tree():
1248
main_panel = MainPanel.instantiate()
@@ -21,50 +57,14 @@ func _enter_tree():
2157
add_autoload_singleton("SignalManager", "res://addons/block_code/block_code_node/utilities/signal_manager.gd")
2258

2359
# Remove unwanted class nodes from create node
24-
var remove_list := [
25-
"BlockScriptData",
26-
"DragManager",
27-
"InstructionTree",
28-
"EditorInterfaceAccess",
29-
"SimpleCharacter",
30-
"Types",
31-
"BasicBlock",
32-
"Block",
33-
"ControlBlock",
34-
"ParameterBlock",
35-
"StatementBlock",
36-
"DragDropArea",
37-
"SnapPoint",
38-
"NodeBlockCanvas",
39-
"SerializedBlockTreeNodeArray",
40-
"SerializedBlockTreeNode",
41-
"SerializedBlock",
42-
"PackedSceneTreeNodeArray",
43-
"PackedSceneTreeNode",
44-
"BlockCanvas",
45-
"NodeCanvas",
46-
"NodeClass",
47-
"NodeClassList",
48-
"NodeData",
49-
"NodePreview",
50-
"NodeList",
51-
"CategoryFactory",
52-
"BlockCategoryDisplay",
53-
"BlockCategory",
54-
"Picker",
55-
"TitleBar",
56-
"MainPanel",
57-
"BlockCodePlugin"
58-
]
59-
6060
old_feature_profile = EditorInterface.get_current_feature_profile()
6161

6262
var editor_paths: EditorPaths = EditorInterface.get_editor_paths()
6363
if editor_paths:
6464
var config_dir := editor_paths.get_config_dir()
6565
var new_profile := EditorFeatureProfile.new()
6666
new_profile.load_from_file(config_dir + "/feature_profiles/" + old_feature_profile + ".profile")
67-
for _class_name in remove_list:
67+
for _class_name in DISABLED_CLASSES:
6868
new_profile.set_disable_class(_class_name, true)
6969

7070
var dir = config_dir + "/feature_profiles/block_code.profile"

0 commit comments

Comments
 (0)