MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / CmEditDelete

Method CmEditDelete

roomedit/source/editcli.cpp:3945–3984  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////// TEditorClient -------------

Source from the content-addressed store, hash-verified

3943//
3944//
3945void TEditorClient::CmEditDelete ()
3946{
3947 // Ignore if "insert object" mode
3948 if ( InsertingObject )
3949 return;
3950
3951 // Do nothing if nothing selected!
3952 if ( Selected == NULL && CurObject == -1 )
3953 return;
3954
3955 SET_HELP_CONTEXT(Delete_objects);
3956
3957 if ( EditMode == OBJ_THINGS ||
3958 Expert ||
3959 Confirm ("Do you really want to delete %s ?\nThis will also delete "
3960 "the eventual objects bound to %s.",
3961 Selected ? "these objects" : "this object",
3962 Selected ? "them" : "it") )
3963 {
3964 // UNDO
3965 StartUndoRecording(AddObjectType ("Delete"));
3966
3967 if (Selected)
3968 DeleteObjects (EditMode, &Selected);
3969 else
3970 DeleteObject (EditMode, CurObject);
3971
3972 // UNDO
3973 StopUndoRecording();
3974
3975 // No selection to prevent invalid object numbers
3976 assert (Selected == NULL);
3977 CurObject = -1;
3978
3979 // Redraw map, info windows and status bar
3980 RefreshWindows();
3981 }
3982
3983 RESTORE_HELP_CONTEXT();
3984}
3985
3986
3987/////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 5

ConfirmFunction · 0.85
StartUndoRecordingFunction · 0.85
DeleteObjectsFunction · 0.85
DeleteObjectFunction · 0.85
StopUndoRecordingFunction · 0.85

Tested by

no test coverage detected