private void DoClosePanel(PanelWidget widget) { var closeCommand = new EditorPanelCommand("ClosePanel", OpenedPanel, false) { Owner = CurrentOpenedPanelPlayer }; OpenedPanel = EditorPanel.None; NotifyEditorCommandExecuted(closeCommand); }
private void DoExecuteEditorPanelCommand(EditorPanelCommand command) { if (OpenedPanel == EditorPanel.None) // open a panel { OpenedPanel = command.Panel; NotifyEditorCommandExecuted(command); } else if (OpenedPanel == command.Panel) // open a panel that is already opened => close it { var closeCommand = new EditorPanelCommand("ClosePanel", OpenedPanel, false); OpenedPanel = EditorPanel.None; NotifyEditorCommandExecuted(closeCommand); } else if (OpenedPanel != command.Panel && command.Show) // open a panel while another is opened { var closeCommand = new EditorPanelCommand("ClosePanel", OpenedPanel, false); NotifyEditorCommandExecuted(closeCommand); OpenedPanel = command.Panel; NotifyEditorCommandExecuted(command); } }