1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Enhance undoredo action name, TTR, cleanup

This commit is contained in:
Poommetee Ketson
2017-12-12 22:57:17 +07:00
parent 55962ce28f
commit 24df9f3707
12 changed files with 18 additions and 163 deletions

View File

@@ -88,12 +88,6 @@ public:
void ConnectDialog::_notification(int p_what) {
if (p_what == NOTIFICATION_DRAW) {
//RID ci = get_canvas_item();
//get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
}
if (p_what == NOTIFICATION_ENTER_TREE) {
bind_editor->edit(cdbinds);
}
@@ -117,11 +111,6 @@ void ConnectDialog::_tree_node_selected() {
dst_path->set_text(node->get_path_to(current));
}
void ConnectDialog::_dst_method_list_selected(int p_idx) {
//dst_method->set_text( dst_method_list->get_popup()->get_item_text(p_idx));
}
void ConnectDialog::edit(Node *p_node) {
node = p_node;
@@ -247,9 +236,7 @@ void ConnectDialog::set_dst_method(const StringName &p_method) {
void ConnectDialog::_bind_methods() {
//ClassDB::bind_method("_ok",&ConnectDialog::_ok_pressed);
ClassDB::bind_method("_cancel", &ConnectDialog::_cancel_pressed);
//ClassDB::bind_method("_dst_method_list_selected",&ConnectDialog::_dst_method_list_selected);
ClassDB::bind_method("_tree_node_selected", &ConnectDialog::_tree_node_selected);
ClassDB::bind_method("_add_bind", &ConnectDialog::_add_bind);
@@ -355,18 +342,6 @@ ConnectDialog::ConnectDialog() {
oneshot->set_text(TTR("Oneshot"));
dstm_hb->add_child(oneshot);
/*
realtime = memnew( CheckButton );
realtime->set_anchor( MARGIN_TOP, ANCHOR_END );
realtime->set_anchor( MARGIN_BOTTOM, ANCHOR_END );
realtime->set_anchor( MARGIN_RIGHT, ANCHOR_END );
realtime->set_begin( Point2( 120, button_margin-10 ) );
realtime->set_end( Point2( 80, margin ) );
realtime->set_text("Realtime");
add_child(realtime);
*/
//dst_method_list->get_popup()->connect("id_pressed", this,"_dst_method_list_selected");
tree->connect("node_selected", this, "_tree_node_selected");
set_as_toplevel(true);
@@ -377,7 +352,6 @@ ConnectDialog::ConnectDialog() {
add_child(error);
error->get_ok()->set_text(TTR("Close"));
get_ok()->set_text(TTR("Connect"));
//error->get_cancel()->set_text("Close");
}
ConnectDialog::~ConnectDialog() {
@@ -386,12 +360,6 @@ ConnectDialog::~ConnectDialog() {
void ConnectionsDock::_notification(int p_what) {
if (p_what == NOTIFICATION_DRAW) {
//RID ci = get_canvas_item();
//get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
}
if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
update_tree();
}
@@ -478,7 +446,7 @@ void ConnectionsDock::_connect_pressed() {
Connection c = item->get_metadata(0);
ERR_FAIL_COND(c.source != node); //shouldn't happen but...bugcheck
undo_redo->create_action(TTR("Create Subscription"));
undo_redo->create_action(vformat(TTR("Disconnect '%s' from '%s'"), c.signal, c.method));
undo_redo->add_do_method(node, "disconnect", c.signal, c.target, c.method);
undo_redo->add_undo_method(node, "connect", c.signal, c.target, c.method, Vector<Variant>(), c.flags);
undo_redo->add_do_method(this, "update_tree");
@@ -491,42 +459,6 @@ void ConnectionsDock::_connect_pressed() {
update_tree();
}
}
/*
void ConnectionsDock::_remove() {
if (!tree->get_selected())
return;
TreeItem *selected=tree->get_selected();
if (!selected)
return;
Dictionary meta=selected->get_metadata(0);
remove_confirm->set_text(String()+"Remove Connection \""+meta["from_event"].operator String()+"\" ?");
remove_confirm->popup_centered(Size2(340,80));
}
*/
/*
void ConnectionsDock::_remove_confirm() {
if (!tree->get_selected())
return;
TreeItem *selected=tree->get_selected();
if (!selected)
return;
Dictionary meta=selected->get_metadata(0);
undo_redo->create_action("Remove Subscription");
undo_redo->add_do_method(node,"unsubscribe_path_event",meta["from_event"].operator String(),meta["from_path"].operator NodePath(),meta["to_method"].operator String());
undo_redo->add_undo_method(node,"subscribe_path_event_persist",meta["from_event"].operator String(),meta["from_path"].operator NodePath(),meta["to_method"].operator String(),Array(),false);
undo_redo->add_do_method(this,"update_tree");
undo_redo->add_undo_method(this,"update_tree");
undo_redo->commit_action();
}
*/
struct _ConnectionsDockMethodInfoSort {