Color properties now update in realtime while the user is choosing a color from the color dialog; also some misc bugfixes

This commit is contained in:
parax0
2016-03-28 03:28:33 -06:00
parent e461039882
commit f9a2d019e1
9 changed files with 70 additions and 33 deletions

View File

@@ -75,10 +75,13 @@ public:
{
CScriptObject *pSender = mpArea->InstanceByID(mSenderID);
for (u32 iLink = 0; iLink < pSender->NumLinks(eOutgoing); iLink++)
if (pSender)
{
if (pSender->Link(eOutgoing, iLink) == this)
return iLink;
for (u32 iLink = 0; iLink < pSender->NumLinks(eOutgoing); iLink++)
{
if (pSender->Link(eOutgoing, iLink) == this)
return iLink;
}
}
return -1;
@@ -88,10 +91,13 @@ public:
{
CScriptObject *pReceiver = mpArea->InstanceByID(mReceiverID);
for (u32 iLink = 0; iLink < pReceiver->NumLinks(eIncoming); iLink++)
if (pReceiver)
{
if (pReceiver->Link(eIncoming, iLink) == this)
return iLink;
for (u32 iLink = 0; iLink < pReceiver->NumLinks(eIncoming); iLink++)
{
if (pReceiver->Link(eIncoming, iLink) == this)
return iLink;
}
}
return -1;

View File

@@ -193,14 +193,16 @@ void CScriptObject::BreakAllLinks()
for (auto it = mInLinks.begin(); it != mInLinks.end(); it++)
{
CLink *pLink = *it;
pLink->Sender()->RemoveLink(eOutgoing, pLink);
CScriptObject *pSender = pLink->Sender();
if (pSender) pSender->RemoveLink(eOutgoing, pLink);
delete pLink;
}
for (auto it = mOutLinks.begin(); it != mOutLinks.end(); it++)
{
CLink *pLink = *it;
pLink->Receiver()->RemoveLink(eIncoming, pLink);
CScriptObject *pReceiver = pLink->Receiver();
if (pReceiver) pReceiver->RemoveLink(eIncoming, pLink);
delete pLink;
}