1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-20 14:45:44 +00:00

Add read-only mode to AnimationTreeEditor plugins

This commit is contained in:
SaracenOne
2022-05-04 06:31:53 +01:00
parent d0a2a4c981
commit 75f1357ced
15 changed files with 421 additions and 197 deletions

View File

@@ -1005,6 +1005,22 @@ bool GraphNode::is_resizable() const {
return resizable;
}
void GraphNode::set_draggable(bool p_draggable) {
draggable = p_draggable;
}
bool GraphNode::is_draggable() {
return draggable;
}
void GraphNode::set_selectable(bool p_selectable) {
selectable = p_selectable;
}
bool GraphNode::is_selectable() {
return selectable;
}
Vector<int> GraphNode::get_allowed_size_flags_horizontal() const {
Vector<int> flags;
flags.append(SIZE_FILL);
@@ -1066,6 +1082,12 @@ void GraphNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_resizable", "resizable"), &GraphNode::set_resizable);
ClassDB::bind_method(D_METHOD("is_resizable"), &GraphNode::is_resizable);
ClassDB::bind_method(D_METHOD("set_draggable", "draggable"), &GraphNode::set_draggable);
ClassDB::bind_method(D_METHOD("is_draggable"), &GraphNode::is_draggable);
ClassDB::bind_method(D_METHOD("set_selectable", "selectable"), &GraphNode::set_selectable);
ClassDB::bind_method(D_METHOD("is_selectable"), &GraphNode::is_selectable);
ClassDB::bind_method(D_METHOD("set_selected", "selected"), &GraphNode::set_selected);
ClassDB::bind_method(D_METHOD("is_selected"), &GraphNode::is_selected);
@@ -1091,6 +1113,8 @@ void GraphNode::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "position_offset", PROPERTY_HINT_NONE, "suffix:px"), "set_position_offset", "get_position_offset");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_close"), "set_show_close_button", "is_close_button_visible");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "resizable"), "set_resizable", "is_resizable");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draggable"), "set_draggable", "is_draggable");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selectable"), "set_selectable", "is_selectable");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "selected"), "set_selected", "is_selected");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "comment"), "set_comment", "is_comment");
ADD_PROPERTY(PropertyInfo(Variant::INT, "overlay", PROPERTY_HINT_ENUM, "Disabled,Breakpoint,Position"), "set_overlay", "get_overlay");