Skip to content

Commit d3b96b9

Browse files
committed
GuiEditCtrl Clean Up
Fixed a few things with the way the Gui Editor selects controls with the goal of not clearing the selection unless absolutely necessary. This prevents the inspector from destroying all it's contents repeatedly every time any action is taken.
1 parent de0219d commit d3b96b9

File tree

5 files changed

+1293
-1315
lines changed

5 files changed

+1293
-1315
lines changed

editor/GuiEditor/scripts/GuiEditorBrain.cs

+2-5
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,9 @@
5353
}
5454

5555
//Source callbacks - Events that happened with this control and need to be relayed to other controls.
56-
function GuiEditorBrain::onSelect(%this, %ctrl)
56+
function GuiEditorBrain::onEdit(%this, %ctrl)
5757
{
58-
%this.clearSelection();
59-
%this.select(%ctrl);
60-
%this.postEvent("Inspect", %ctrl);
61-
%this.toggleMenuItems();
58+
%this.postEvent("Edit", %ctrl);
6259
}
6360

6461
function GuiEditorBrain::onRemoveSelected(%this,%ctrl)

editor/GuiEditor/scripts/GuiEditorExplorerWindow.cs

-12
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,6 @@
3838
%this.tree.inspect(%object);
3939
}
4040

41-
function GuiEditorExplorerWindow::onInspect(%this, %ctrl)
42-
{
43-
%this.tree.startRadioSilence();
44-
%index = %this.tree.findItemID(%ctrl.getID());
45-
if(%index != -1)
46-
{
47-
%this.tree.clearSelection();
48-
%this.tree.setSelected(%index, true);
49-
}
50-
%this.tree.endRadioSilence();
51-
}
52-
5341
function GuiEditorExplorerWindow::onAlsoInspect(%this, %ctrl)
5442
{
5543
%this.tree.startRadioSilence();

editor/GuiEditor/scripts/GuiEditorInspectorWindow.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@
6969
}
7070
}
7171

72-
function GuiEditorInspectorWindow::onInspect(%this, %object)
72+
function GuiEditorInspectorWindow::onEdit(%this, %object)
7373
{
74-
%this.inspectList.clear();
75-
%this.inspectList.add(%object);
7674
%this.inspector.inspect(%object);
7775
}
7876

0 commit comments

Comments
 (0)