From: Stas'M Date: Tue, 22 May 2018 11:05:20 +0000 (+0300) Subject: Main: Add Ctrl+Alt switch for object range selection X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=323503bc772cd18a15d9e350cc4077675a82cf81;p=d2df-editor.git Main: Add Ctrl+Alt switch for object range selection http://doom2d.org/forum/viewtopic.php?f=12&t=1927 --- diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index 5c1e8bd..d217b30 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -3611,12 +3611,24 @@ procedure TMainForm.RenderPanelMouseUp(Sender: TObject; var panel: TPanel; trigger: TTrigger; - i: Integer; - IDArray: DWArray; rRect: TRectWH; rSelectRect: Boolean; wWidth, wHeight: Word; TextureID: DWORD; + + procedure SelectObjects(ObjectType: Byte); + var + i: Integer; + IDArray: DWArray; + begin + IDArray := ObjectInRect(rRect.X, rRect.Y, + rRect.Width, rRect.Height, + ObjectType, rSelectRect); + + if IDArray <> nil then + for i := 0 to High(IDArray) do + SelectObject(ObjectType, IDArray[i], (ssCtrl in Shift) or rSelectRect); + end; begin if Button = mbLeft then MouseLDown := False; @@ -3982,14 +3994,16 @@ begin RemoveSelectFromObjects(); // Выделяем всё в выбранном прямоугольнике: - IDArray := ObjectInRect(rRect.X, rRect.Y, - rRect.Width, rRect.Height, - pcObjects.ActivePageIndex+1, rSelectRect); - - if IDArray <> nil then - for i := 0 to High(IDArray) do - SelectObject(pcObjects.ActivePageIndex+1, IDArray[i], - (ssCtrl in Shift) or rSelectRect); + if (ssCtrl in Shift) and (ssAlt in Shift) then + begin + SelectObjects(OBJECT_PANEL); + SelectObjects(OBJECT_ITEM); + SelectObjects(OBJECT_MONSTER); + SelectObjects(OBJECT_AREA); + SelectObjects(OBJECT_TRIGGER); + end + else + SelectObjects(pcObjects.ActivePageIndex+1); FillProperty(); end;