1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Show select menu on button pressed (instead of released)

This commit is contained in:
neikeq
2015-11-19 15:47:04 +01:00
parent f84dc8e59d
commit 6b0423b191
2 changed files with 52 additions and 52 deletions

View File

@@ -987,7 +987,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
if (b.button_index==BUTTON_RIGHT) { if (b.button_index==BUTTON_RIGHT) {
if (!b.pressed && tool==TOOL_SELECT && b.mod.alt) { if (b.pressed && tool==TOOL_SELECT && b.mod.alt) {
Point2 click=Point2(b.x,b.y); Point2 click=Point2(b.x,b.y);

View File

@@ -862,34 +862,8 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
//VisualServer::get_singleton()->instance_set_transform(cursor_instance,Transform(Matrix3(),cursor.cursor_pos)); //VisualServer::get_singleton()->instance_set_transform(cursor_instance,Transform(Matrix3(),cursor.cursor_pos));
} }
} }
}
if (_edit.mode!=TRANSFORM_NONE && b.pressed) { if (b.mod.alt) {
//cancel motion
_edit.mode=TRANSFORM_NONE;
//_validate_selection();
List<Node*> &selection = editor_selection->get_selected_node_list();
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
Spatial *sp = E->get()->cast_to<Spatial>();
if (!sp)
continue;
SpatialEditorSelectedItem *se=editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
if (!se)
continue;
sp->set_global_transform( se->original );
}
surface->update();
//VisualServer::get_singleton()->poly_clear(indicators);
set_message("Transform Aborted.",3);
}
if (!b.pressed && (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT && b.mod.alt)) {
if (nav_scheme == NAVIGATION_MAYA) if (nav_scheme == NAVIGATION_MAYA)
break; break;
@@ -939,6 +913,32 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
break; break;
} }
} }
}
if (_edit.mode!=TRANSFORM_NONE && b.pressed) {
//cancel motion
_edit.mode=TRANSFORM_NONE;
//_validate_selection();
List<Node*> &selection = editor_selection->get_selected_node_list();
for(List<Node*>::Element *E=selection.front();E;E=E->next()) {
Spatial *sp = E->get()->cast_to<Spatial>();
if (!sp)
continue;
SpatialEditorSelectedItem *se=editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
if (!se)
continue;
sp->set_global_transform( se->original );
}
surface->update();
//VisualServer::get_singleton()->poly_clear(indicators);
set_message("Transform Aborted.",3);
}
} break; } break;
case BUTTON_MIDDLE: { case BUTTON_MIDDLE: {