Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Model Change icon inside tooltip

Newbie Spellweaver
Joined
Oct 4, 2022
Messages
38
Reaction score
54
Just a little snipped so that the icon from the transmuted item displays inside the tooltip
Keep in mind that this is a addition to the __LOOKCHANGE system (Using ketchup v18)



[tooltip.cpp]
Add :
Code:
CToolTip::CToolTip()
#endif // __IMPROVE_SYSTEM_VER15
{
    m_bReadyToopTip = FALSE;
    m_dwToolTipId   = 0;
    m_ptToolTip     = 0;
    m_ptOldToolTip  = 0;
    m_bPutToolTip = FALSE;
    m_bEnable = TRUE;
    m_nPosition = 0;
    m_bToolTip = FALSE;
    m_nAlpha = 255;

#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
    m_pSkinIcon = NULL;
#endif //__LOOKCHANGE_TOOLTIP

Add :
Code:
void CToolTip::CancelToolTip()
{
    if(m_bEnable == FALSE)
        return;
    m_bReadyToopTip = FALSE;
    //m_dwToolTipId = 0;
    m_bToolTip = FALSE;
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
    m_pSkinIcon = NULL;
#endif //__LOOKCHANGE_TOOLTIP
}

Add at the end of both appearances "void CToolTip::putToolTip"
Code:
#ifdef __IMPROVE_MAP_SYSTEM
    m_vecMapMonsterID.clear();
#endif // __IMPROVE_MAP_SYSTEM  
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
    m_pSkinIcon = NULL;
#endif //__LOOKCHANGE_TOOLTIP

Add at the end of "void CToolTip::putToolTipEx"
Code:
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
    m_pSkinIcon = NULL;
#endif //__LOOKCHANGE_TOOLTIP

Add inside "void CToolTip::paint(C2DRender* p2DRender)"

above :
Code:
#if __VER >= 9 // __CSC_VER9_1
        if(m_nAdded == 1)

add:
Code:
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
        if(m_pSkinIcon != NULL)
        {
            CString strTemp;
            int topAdjustment = 26;

            if( m_nSubToolTipFlag != CWndMgr::TOOL_TIP_SWITCH_MAIN )
            {
                topAdjustment += 17;
                strTemp = m_strToolTip.GetLine(1);
            }
            else
                strTemp = m_strToolTip.GetLine(0);

            CString strEnd = strTemp.GetAt( strTemp.GetLength() - 1 );

            if(strEnd != "\n")
                topAdjustment+= 18;

            m_pJewelBgTexture->Render2( p2DRender, CPoint( PlusRect.left + 52, PlusRect.top + topAdjustment), D3DCOLOR_ARGB(255, 255, 255, 255) , 0.71f, 0.71f);
            m_pSkinIcon->Render2( p2DRender, CPoint( PlusRect.left + 53, PlusRect.top + topAdjustment + 1), D3DCOLOR_ARGB(255, 255, 255, 255) , 0.65f, 0.65f);
        }
#endif //__LOOKCHANGE_TOOLTIP

Add above "void CToolTip::SetUltimateToolTip(CItemBase* pItemBase)"
Code:
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
void CToolTip::SetSkinTexture(CItemBase* pItemBase)
{
    CItemElem* pItemElem = (CItemElem*)pItemBase;
    m_pSkinIcon = CWndBase::m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_ITEM, prj.GetItemProp(pItemElem->GetLook())->szIcon), 0xffff00ff);
}
#endif //__LOOKCHANGE_TOOLTIP


[tooltip.h]
add :
Code:
    int            m_nAdded;
    int            m_nAddedJewel[5];
    int            m_nSlot;
    CItemBase*    m_pUltimateItemBase;
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
    CTexture*    m_pSkinIcon;
#endif //__LOOKCHANGE_TOOLTIP

add :
Code:
    void Delete();
    void InitTexture();
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
    void SetSkinTexture(CItemBase* pItemBase);
#endif //__LOOKCHANGE_TOOLTIP


[WndManger.cpp]
Add inside "void CWndMgr::putToolTip_Item"

search :
Code:
    g_toolTip.PutToolTip( pItemBase->m_dwItemId, strItem, *pRect, point, 0 );

add below :
Code:
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
        CItemElem* itemElement = (CItemElem*)pItemBase;

        if(itemElement->IsChangedLook() && pItemBase->GetProp()->bCanLooksChange && itemElement->GetLook() != NULL_ID )
            g_toolTip.SetSkinTexture(pItemBase);
#endif //__LOOKCHANGE_TOOLTIP

Add inside void CWndMgr::putToolTipParts

!!!!!!!!!!!!! in each switch case add the following !!!!!!!!!!!!!!!!!!!!!!!!
Code:
   case 0:
        {
            g_toolTip.PutToolTipEx( pPartsItemBase->m_dwItemId, strEquipItem, *pRect, point, 0, nSubToolTipFlag );
            if( pPartsItemProp->IsUltimate() )
                g_toolTip.SetUltimateToolTip( pPartsItemBase );
#ifdef __NEW_ITEM_VARUNA
            if( pPartsItemProp->IsBaruna() )
                g_toolTip.SetBarunaToolTip( pPartsItemBase );
#endif // __NEW_ITEM_VARUNA
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
        CItemElem* itemElement = (CItemElem*)pPartsItemBase;

        if(itemElement->IsChangedLook() && pPartsItemBase->GetProp()->bCanLooksChange && itemElement->GetLook() != NULL_ID )
            g_toolTip.SetSkinTexture(pPartsItemBase);
#endif //__LOOKCHANGE_TOOLTIP
            break;
        }
    case 1:
        {
            g_toolTipSub1.PutToolTipEx( pPartsItemBase->m_dwItemId, strEquipItem, *pRect, point, 0, nSubToolTipFlag );

            if( pPartsItemProp->IsUltimate() )
                g_toolTipSub1.SetUltimateToolTip( pPartsItemBase );
#ifdef __NEW_ITEM_VARUNA
            if( pPartsItemProp->IsBaruna() )
                g_toolTipSub1.SetBarunaToolTip( pPartsItemBase );
#endif // __NEW_ITEM_VARUNA
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
        CItemElem* itemElement = (CItemElem*)pPartsItemBase;

        if(itemElement->IsChangedLook() && pPartsItemBase->GetProp()->bCanLooksChange && itemElement->GetLook() != NULL_ID )
            g_toolTipSub1.SetSkinTexture(pPartsItemBase);
#endif //__LOOKCHANGE_TOOLTIP
            break;
        }
    case 2:
        {
            g_toolTipSub2.PutToolTipEx( pPartsItemBase->m_dwItemId, strEquipItem, *pRect, point, 0, nSubToolTipFlag );


            if( pPartsItemProp->IsUltimate() )
                g_toolTipSub2.SetUltimateToolTip( pPartsItemBase );
#ifdef __NEW_ITEM_VARUNA
            if( pPartsItemProp->IsBaruna() )
                g_toolTipSub2.SetBarunaToolTip( pPartsItemBase );
#endif // __NEW_ITEM_VARUNA

#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
        CItemElem* itemElement = (CItemElem*)pPartsItemBase;

        if(itemElement->IsChangedLook() && pPartsItemBase->GetProp()->bCanLooksChange && itemElement->GetLook() != NULL_ID )
            g_toolTipSub2.SetSkinTexture(pPartsItemBase);
#endif //__LOOKCHANGE_TOOLTIP
            break;
        }

add inside void CWndMgr::MakeToolTipText

right under :
Code:
    PutItemAbilityPiercing( pItemElem, &strEdit, dwColorBuf );

add :
Code:
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
    if( pItemElem->IsChangedLook() && pItemElem->GetProp()->bCanLooksChange && pItemElem->GetLook() != NULL_ID )
    {
        strEdit.AddString('\n');
        strEdit.AddString("Skin : ", 0xff000000);
    }
#endif //__LOOKCHANGE_TOOLTIP

!!!!!!!!!!!!!!!!!!!! replace both appearances of :
Code:
#ifdef __LOOKCHANGE
    PutLookText(pItemElem, &strEdit);
#endif //__LOOKCHANGE

to :
Code:
#if !defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
    PutLookText(pItemElem, &strEdit);
#endif //__LOOKCHANGE_TOOLTIP

[WndField.cpp] ( __ITEMLINK tooltip )
add :
Code:
void CWndLinkedItem::OnDraw(C2DRender* p2DRender)
{
    if (m_pItemElem == NULL)
        return;

    CRect rect = GetClientRect();

    CTexture* pTexture = m_pItemElem->GetTexture();
    if (pTexture != NULL)
        pTexture->Render(p2DRender, CPoint(rect.right / 2 - (32 / 2), rect.top + 10), 255);

    if (m_pTex != NULL)
        m_pTex->Render(p2DRender, CPoint(rect.TopLeft().x + 1, rect.TopLeft().y + 32 + 10 + 10 + 1), 255);

#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
    if(m_pItemElem->IsChangedLook() && m_pItemElem->GetProp()->bCanLooksChange && m_pItemElem->GetLook() != NULL_ID )
    {
        CTexture* pSkinTexture =  CWndBase::m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_ITEM, prj.GetItemProp(m_pItemElem->GetLook())->szIcon), 0xffff00ff);

        if (pSkinTexture != NULL)
        {
            CTexture* pSlotTexture = CWndBase::m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_THEME, "WndChgElemItem.bmp"), 0xffff00ff);

            int topAdjustment = 67;
            CString strTemp = m_strItem.GetLine(0);
            CString strEnd = strTemp.GetAt(strTemp.GetLength() - 1);

            if (strEnd != "\n")
                topAdjustment += 18;
                    

            pSlotTexture->Render2( p2DRender, CPoint( rect.left + 42, rect.top + topAdjustment), D3DCOLOR_ARGB(255, 255, 255, 255) , 0.71f, 0.71f);
            pSkinTexture->Render2( p2DRender, CPoint( rect.left + 43, rect.top + topAdjustment + 1), D3DCOLOR_ARGB(255, 255, 255, 255) , 0.65f, 0.65f);
        }
    }
#endif //__LOOKCHANGE_TOOLTIP
    p2DRender->TextOut_EditString(rect.TopLeft().x + 3, rect.TopLeft().y + 32 + 10 + 10, m_strItem, 0, 0, 2);

}




 
Last edited:
Experienced Elementalist
Joined
Jan 7, 2020
Messages
257
Reaction score
97
Very nice release, I like it.
thanks for the contribution :thumbup1:
 
Newbie Spellweaver
Joined
Oct 4, 2022
Messages
38
Reaction score
54
I just realized the itemlink tooltip also needs some code
Im going to update this later today
 
Junior Spellweaver
Joined
Mar 24, 2021
Messages
149
Reaction score
25
Great release! 10 out of 10 rate i like it!
 
Junior Spellweaver
Joined
Sep 29, 2021
Messages
133
Reaction score
26
Thankyou for the released, this is really cool
 
Newbie Spellweaver
Joined
Oct 4, 2022
Messages
38
Reaction score
54
Updated the thread for the __ITEMLINK tooltip (WndField.cpp)

came across a problem where long item names would create extra rows in the tooltip = icon not aligned anymore

working on a fix
 
Junior Spellweaver
Joined
Mar 24, 2021
Messages
149
Reaction score
25
Updated the thread for the __ITEMLINK tooltip (WndField.cpp)

came across a problem where long item names would create extra rows in the tooltip = icon not aligned anymore

working on a fix

Just want to report this on k19 if you got long item name it happens

 
Newbie Spellweaver
Joined
Oct 4, 2022
Messages
38
Reaction score
54
Just want to report this on k19 if you got long item name it happens


I did manage to fix the issue also updated the thread

tooltip.cpp
replace the already existing code from my snippet inside "void CToolTip::paint(C2DRender* p2DRender)"

with this

Code:
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
		if(m_pSkinIcon != NULL)
		{
			CString strTemp;
			int topAdjustment = 26;

			if( m_nSubToolTipFlag != CWndMgr::TOOL_TIP_SWITCH_MAIN )
			{
				topAdjustment += 17;
				strTemp = m_strToolTip.GetLine(1);
			}
			else
				strTemp = m_strToolTip.GetLine(0);

			CString strEnd = strTemp.GetAt( strTemp.GetLength() - 1 );

			if(strEnd != "\n")
				topAdjustment+= 18;

			m_pJewelBgTexture->Render2( p2DRender, CPoint( PlusRect.left + 52, PlusRect.top + topAdjustment), D3DCOLOR_ARGB(255, 255, 255, 255) , 0.71f, 0.71f);
			m_pSkinIcon->Render2( p2DRender, CPoint( PlusRect.left + 53, PlusRect.top + topAdjustment + 1), D3DCOLOR_ARGB(255, 255, 255, 255) , 0.65f, 0.65f);
		}
#endif //__LOOKCHANGE_TOOLTIP

WndField.cpp ( if you use the __ITEMLINK part )

Code:
void CWndLinkedItem::OnDraw(C2DRender* p2DRender)
{
	if (m_pItemElem == NULL)
		return;

	CRect rect = GetClientRect();

	CTexture* pTexture = m_pItemElem->GetTexture();
	if (pTexture != NULL)
		pTexture->Render(p2DRender, CPoint(rect.right / 2 - (32 / 2), rect.top + 10), 255);

	if (m_pTex != NULL)
		m_pTex->Render(p2DRender, CPoint(rect.TopLeft().x + 1, rect.TopLeft().y + 32 + 10 + 10 + 1), 255);

#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE)
	if(m_pItemElem->IsChangedLook() && m_pItemElem->GetProp()->bCanLooksChange && m_pItemElem->GetLook() != NULL_ID )
	{
		CTexture* pSkinTexture =  CWndBase::m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_ITEM, prj.GetItemProp(m_pItemElem->GetLook())->szIcon), 0xffff00ff);

		if (pSkinTexture != NULL)
		{
			CTexture* pSlotTexture = CWndBase::m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_THEME, "WndChgElemItem.bmp"), 0xffff00ff);

			int topAdjustment = 67;
			CString strTemp = m_strItem.GetLine(0);
			CString strEnd = strTemp.GetAt(strTemp.GetLength() - 1);

			if (strEnd != "\n")
				topAdjustment += 18;
					

			pSlotTexture->Render2( p2DRender, CPoint( rect.left + 42, rect.top + topAdjustment), D3DCOLOR_ARGB(255, 255, 255, 255) , 0.71f, 0.71f);
			pSkinTexture->Render2( p2DRender, CPoint( rect.left + 43, rect.top + topAdjustment + 1), D3DCOLOR_ARGB(255, 255, 255, 255) , 0.65f, 0.65f);
		}
	}
#endif //__LOOKCHANGE_TOOLTIP
	p2DRender->TextOut_EditString(rect.TopLeft().x + 3, rect.TopLeft().y + 32 + 10 + 10, m_strItem, 0, 0, 2);

}
 
Newbie Spellweaver
Joined
Oct 4, 2022
Messages
38
Reaction score
54
other people use this without any problems so the problem is on your end

be sure to read every note above the code blocks i posted
 
Back
Top