blob: 8c25ec4057174daf3627fe6d13f3d99326c9e38e (
plain)
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
65
66
67
|
#include "addon_editor_plugin.h"
#include "editor_node.h"
EditorAddonLibrary::EditorAddonLibrary() {
tabs = memnew( TabContainer );
tabs->set_v_size_flags(SIZE_EXPAND_FILL);
add_child(tabs);
installed = memnew( EditorPluginSettings );
installed->set_name("Installed");
tabs->add_child(installed);
library = memnew( VBoxContainer );
library->set_name("Online");
tabs->add_child(library);
HBoxContainer *search_hb = memnew( HBoxContainer );
library->add_child(search_hb);
search_hb->add_child( memnew( Label("Search: ")));
filter =memnew( LineEdit );
search_hb->add_child(filter);
filter->set_h_size_flags(SIZE_EXPAND_FILL);
categories = memnew( OptionButton );
categories->add_item("All Categories");
search_hb->add_child(categories);
search = memnew( Button("Search"));
search_hb->add_child(search);
}
///////
void AddonEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
addon_library->show();
} else {
addon_library->hide();
}
}
AddonEditorPlugin::AddonEditorPlugin(EditorNode *p_node) {
editor=p_node;
addon_library = memnew( EditorAddonLibrary );
addon_library->set_v_size_flags(Control::SIZE_EXPAND_FILL);
editor->get_viewport()->add_child(addon_library);
addon_library->set_area_as_parent_rect();
addon_library->hide();
}
AddonEditorPlugin::~AddonEditorPlugin() {
}
|