You've already forked godot
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:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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: {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user