Draw the edit link line when picking from the modify tab

This commit is contained in:
parax0 2016-03-07 21:13:44 -07:00
parent 95d4deeab6
commit 4b8a42f341
4 changed files with 14 additions and 1 deletions

View File

@ -511,6 +511,8 @@ void CWorldEditor::UpdateNewLinkLine()
} }
else if (mIsMakingLink && mpNewLinkSender) else if (mIsMakingLink && mpNewLinkSender)
pSender = mpNewLinkSender; pSender = mpNewLinkSender;
else if (ui->ModifyTabContents->IsPicking() && ui->ModifyTabContents->EditNode()->NodeType() == eScriptNode)
pSender = static_cast<CScriptNode*>(ui->ModifyTabContents->EditNode())->Object();
// No sender and no receiver = no line // No sender and no receiver = no line
if (!pSender && !pReceiver) if (!pSender && !pReceiver)
@ -526,7 +528,7 @@ void CWorldEditor::UpdateNewLinkLine()
// Compensate for missing sender or missing receiver // Compensate for missing sender or missing receiver
else else
{ {
if (ui->MainViewport->underMouse() && !ui->MainViewport->IsMouseInputActive() && (mIsMakingLink || mpLinkDialog->IsPicking())) if (ui->MainViewport->underMouse() && !ui->MainViewport->IsMouseInputActive() && (mIsMakingLink || mpLinkDialog->IsPicking() || ui->ModifyTabContents->IsPicking()))
{ {
CSceneNode *pHoverNode = ui->MainViewport->HoverNode(); CSceneNode *pHoverNode = ui->MainViewport->HoverNode();
CScriptObject *pInst = (pSender ? pSender : pReceiver); CScriptObject *pInst = (pSender ? pSender : pReceiver);

View File

@ -136,11 +136,13 @@ void WModifyTab::OnLinksSelectionModified()
{ {
u32 NumSelectedRows = ui->InLinksTableView->selectionModel()->selectedRows().size(); u32 NumSelectedRows = ui->InLinksTableView->selectionModel()->selectedRows().size();
ui->EditIncomingConnectionButton->setEnabled(NumSelectedRows == 1); ui->EditIncomingConnectionButton->setEnabled(NumSelectedRows == 1);
ui->DeleteIncomingConnectionButton->setEnabled(NumSelectedRows > 0);
} }
else else
{ {
u32 NumSelectedRows = ui->OutLinksTableView->selectionModel()->selectedRows().size(); u32 NumSelectedRows = ui->OutLinksTableView->selectionModel()->selectedRows().size();
ui->EditOutgoingConnectionButton->setEnabled(NumSelectedRows == 1); ui->EditOutgoingConnectionButton->setEnabled(NumSelectedRows == 1);
ui->DeleteOutgoingConnectionButton->setEnabled(NumSelectedRows > 0);
} }
} }

View File

@ -50,6 +50,9 @@ public slots:
void OnDeleteLinksClicked(); void OnDeleteLinksClicked();
void OnEditLinkClicked(); void OnEditLinkClicked();
inline bool IsPicking() const { return mIsPicking; }
inline CSceneNode* EditNode() const { return mpSelectedNode; }
private: private:
Ui::WModifyTab *ui; Ui::WModifyTab *ui;

View File

@ -218,6 +218,9 @@
</item> </item>
<item> <item>
<widget class="QToolButton" name="DeleteOutgoingConnectionButton"> <widget class="QToolButton" name="DeleteOutgoingConnectionButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::StrongFocus</enum> <enum>Qt::StrongFocus</enum>
</property> </property>
@ -335,6 +338,9 @@
</item> </item>
<item> <item>
<widget class="QToolButton" name="DeleteIncomingConnectionButton"> <widget class="QToolButton" name="DeleteIncomingConnectionButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::StrongFocus</enum> <enum>Qt::StrongFocus</enum>
</property> </property>