it basically shows the transmuted item inside the tooltip
I know this isn't something big but i do those little snippets to expand my understanding for the flyff source and the coding language in general.
since im not a professional when it comes to coding i would be happy about some criticism or if someone points out some bad practices!
[tooltip.cpp]
Add :
Add :
Add at the end of both appearances "void CToolTip::PutToolTip"
Add at the end of "void CToolTip::PutToolTipEx"
Add inside "void CToolTip::Paint(C2DRender* p2DRender)"
above :
add:
Add above "void CToolTip::SetUltimateToolTip(CItemBase* pItemBase)"
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
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 }
Code:
#ifdef __IMPROVE_MAP_SYSTEM m_vecMapMonsterID.clear(); #endif // __IMPROVE_MAP_SYSTEM #if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE) m_pSkinIcon = NULL; #endif //__LOOKCHANGE_TOOLTIP
Code:
#if defined(__LOOKCHANGE_TOOLTIP) && defined(__LOOKCHANGE) m_pSkinIcon = NULL; #endif //__LOOKCHANGE_TOOLTIP
above :
Code:
#if __VER >= 9 // __CSC_VER9_1 if(m_nAdded == 1)
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
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 :
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
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 :
add below :
Add inside void CWndMgr::PutToolTipParts
!!!!!!!!!!!!! in each switch case add the following !!!!!!!!!!!!!!!!!!!!!!!!
add inside void CWndMgr::MakeToolTipText
right under :
add :
!!!!!!!!!!!!!!!!!!!! replace both appearances of :
to :
search :
Code:
g_toolTip.PutToolTip( pItemBase->m_dwItemId, strItem, *pRect, point, 0 );
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
!!!!!!!!!!!!! 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; }
right under :
Code:
PutItemAbilityPiercing( pItemElem, &strEdit, dwColorBuf );
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
Code:
#ifdef __LOOKCHANGE PutLookText(pItemElem, &strEdit); #endif //__LOOKCHANGE
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); }