1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

Merge pull request #2831 from neikeq/select_menu_patch

Show select menu on button pressed (instead of released)
This commit is contained in:
Juan Linietsky
2015-11-19 19:34:50 -03:00
2 changed files with 52 additions and 52 deletions

View File

@@ -999,7 +999,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
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);

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));
}
}
}
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);
}
if (!b.pressed && (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT && b.mod.alt)) {
if (b.mod.alt) {
if (nav_scheme == NAVIGATION_MAYA)
break;
@@ -939,6 +913,32 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
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;
case BUTTON_MIDDLE: {