[Request] Treasure Box Source / Resource Code

12/19/2014 16:13 jeromerz#1
FIXED Thanks to Pixelfehler :)
12/19/2014 17:04 Pixelfehler#2
Quote:
Originally Posted by jeromerz View Post
Hello everybody,

i tried to add the system using this code but when i double click the treasurebox and tried to use the appropriate key the key is not placed on the second slot and i cannot open the treasurebox.


i used this code of treasurebox
thanks in advance :3
Code:
CWndTreasureBox::OnDropIcon
Check this

Quote:
Originally Posted by jeromerz View Post
in WndField.cpp

what should i do with this? :)

BOOL CWndTreasureBox::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
{
CRect rect;
CItemElem* pItemElem;
pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );

if(g_pPlayer->IsUsing(pItemElem))
{
g_WndMng.PutString( "Item wird bereits verwendet" );
}
else
{
if( pItemElem->GetProp()->dwItemKind3 == IK3_BOXOPEN && IsOpenKey( pItemElem ) )
{
if( /*m_nCtrlId[0].PtInRect( point ) &&*/ m_pItemElem == NULL )
{
m_pItemElem = pItemElem;
m_pItemElem->SetExtra( 1 );
}
}
}
if( m_pItemElem != NULL )
{
CWndButton* pButton = (CWndButton*)GetDlgItem(WIDC_BT_OK);
pButton->EnableWindow(TRUE);
}
return TRUE;
}
Code:
IK3_BOXOPEN && IsOpenKey