@@ -33,9 +33,10 @@ function createCurrentBrowser ()
3333 currentBrowserGUI .search = guiCreateEdit ( 12 , 50 , windowWidth , 30 , " Search..." , false , currentBrowserGUI .browser )
3434 currentBrowserGUI .dropdown = editingControl .dropdown :create {[" x" ]= 12 ,[" y" ]= 25 ,[" width" ]= windowWidth ,[" height" ]= 20 ,[" dropWidth" ]= windowWidth ,[" dropHeight" ]= 200 ,[" relative" ]= false ,[" parent" ]= currentBrowserGUI .browser ,[" rows" ]= {" " }}
3535 -- linked to options
36- dialog .autosnap = editingControl .boolean :create {[" x" ]= 12 ,[" y" ]= windowHeight - 48 ,[" width" ]= 115 ,[" height" ]= 30 ,[" relative" ]= false ,[" parent" ]= currentBrowserGUI .browser ,[" label" ]= " Autosnap camera" }
37- currentBrowserGUI .isolate = guiCreateCheckBox ( 12 , windowHeight - 24 , 115 , 30 , " Isolate element" , false , false , currentBrowserGUI .browser )
38- currentBrowserGUI .close = guiCreateButton ( 132 , windowHeight - 40 , windowWidth , 40 , " Close" , false , currentBrowserGUI .browser )
36+ dialog .autosnap = editingControl .boolean :create {[" x" ]= 12 ,[" y" ]= windowHeight - 48 ,[" width" ]= windowWidth / 2 ,[" height" ]= 30 ,[" relative" ]= false ,[" parent" ]= currentBrowserGUI .browser ,[" label" ]= " Autosnap camera" }
37+ currentBrowserGUI .isolate = guiCreateCheckBox ( 12 , windowHeight - 24 , windowWidth / 2 , 30 , " Isolate element" , false , false , currentBrowserGUI .browser )
38+ currentBrowserGUI .restore = guiCreateButton ( windowWidth / 4 * 2 - 10 , windowHeight - 40 , windowWidth / 4 , 40 , " Restore" , false , currentBrowserGUI .browser )
39+ currentBrowserGUI .close = guiCreateButton ( windowWidth / 4 * 3 , windowHeight - 40 , windowWidth / 4 , 40 , " Close" , false , currentBrowserGUI .browser )
3940 guiSetProperty (currentBrowserGUI .browser ," RelativeMinSize" ," w:0.250000 h:0.400000" )
4041 --
4142 guiSetAlpha ( currentBrowserGUI .browser , 50 )
@@ -51,6 +52,7 @@ function createCurrentBrowser ()
5152 currentBrowser .update ()
5253 addEventHandler ( " onClientGUIClick" , currentBrowserGUI .close , closeCurrentBrowser , false )
5354 addEventHandler ( " onClientGUIClick" , currentBrowserGUI .isolate , currentBrowser .isolateClick , false )
55+ addEventHandler ( " onClientGUIClick" , currentBrowserGUI .restore , restoreSelectedElement , false )
5456 addEventHandler ( " onClientGUISize" , currentBrowserGUI .browser , currentBrowser .resized , false )
5557 currentBrowserGUI .gridlist :addCallback (currentBrowser .gridlistClick )
5658 currentBrowserGUI .gridlist :addDoubleClickCallback (currentBrowser .doubleClick )
@@ -64,8 +66,10 @@ function currentBrowser.resized()
6466 currentBrowserGUI .dropdown :setSize (windowWidth ,20 ,windowWidth ,200 ,false )
6567 dialog .autosnap :setPosition ( 12 , windowHeight - 48 ,false )
6668 guiSetPosition ( currentBrowserGUI .isolate , 12 , windowHeight - 24 ,false )
67- guiSetPosition ( currentBrowserGUI .close , 132 , windowHeight - 40 , false )
68- guiSetSize ( currentBrowserGUI .close , windowWidth , 40 , false )
69+ guiSetPosition ( currentBrowserGUI .close , windowWidth / 4 * 3 , windowHeight - 40 , false )
70+ guiSetSize ( currentBrowserGUI .close , windowWidth / 4 , 40 , false )
71+ guiSetPosition ( currentBrowserGUI .restore , windowWidth / 4 * 2 - 10 , windowHeight - 40 , false )
72+ guiSetSize ( currentBrowserGUI .restore , windowWidth / 4 , 40 , false )
6973 --
7074 if not isResizing then
7175 addEventHandler ( " onClientClick" ,root ,resizeStop )
@@ -178,6 +182,7 @@ function currentBrowser.gridlistClick (cellrow)
178182 if cellrow ~= 0 then
179183 local id = currentBrowserGUI .gridlist :getSelectedText ()
180184 cSelectedElement = getElementByID ( id )
185+ editor_main .selectElement ( cSelectedElement , 2 , false , cSelectedElement , cSelectedElement , true )
181186 if ( dialog .autosnap :getValue () ) then
182187 autoSnap ( cSelectedElement )
183188 end
@@ -450,6 +455,17 @@ function closeCurrentBrowser()
450455 removeEventHandler ( " onClientElementDestroyed" ,root ,currentBrowser .prepareSearch )
451456end
452457
458+ function restoreSelectedElement ()
459+ if cSelectedElement then
460+ editor_main .destroySelectedElement ()
461+ closeCurrentBrowser ()
462+
463+ setTimer (function ()
464+ showCurrentBrowser ()
465+ end , 100 , 1 )
466+ end
467+ end
468+
453469function isCurrentBrowserShowing ()
454470 return guiGetVisible (currentBrowserGUI .browser )
455471end
0 commit comments