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!

[Releases] Search Inventory

Initiate Mage
Joined
Feb 3, 2019
Messages
1
Reaction score
3
Search Inventory
ระบบค้นหาไอเทมในช่องเก็บของ Series01


WndItemCtrl.cpp
Search
Code:
void CWndItemCtrl::RanderIcon( C2DRender* p2DRender, CItemElem* pItemElem, int x, int y, int nParent, int nalpha )

On
Code:
if( !g_eLocal.GetState(EVE_SCHOOL) )

Add

Code:
#ifdef    __SEARCH_INVENTORY
    CWndBase* pWndBase = this->GetParentWnd();    if (pWndBase)
    {
        CWndBase* pWndBaseTemp = pWndBase->GetParentWnd();
        if (pWndBaseTemp)
            nParent = pWndBaseTemp->GetWndId();
        if (nParent == APP_INVENTORY)
        {
            CWndEdit* pSearchBox = (CWndEdit*)pWndBaseTemp->GetDlgItem(WIDC_EDIT1);
            if (pSearchBox)
            {
                CString strFilter = pSearchBox->GetString();
                if (strFilter.GetLength())
                {
                    CString strName = pItemElem->GetName();
                    if (!strstr(strName.MakeLower(), strFilter.MakeLower()))
                        nalpha = 50;                }
            }
        }#endif    //__SEARCH_INVENTORY

Under

Code:
#ifdef    __SEARCH_INVENTORY    

}

#endif

My Code

Code

Code:
void CWndItemCtrl::RanderIcon( C2DRender* p2DRender, CItemElem* pItemElem, int x, int y, int nParent, int nalpha ) 
{
    int bRander = 0;

    if( nParent == APP_SHOP_ )
    {
        ItemProp* pItemProp        = pItemElem->GetProp();
        if( pItemProp == NULL ) return;
        switch( pItemProp->dwItemKind2 )
        {
            case IK2_WEAPON_DIRECT:
//            case IK2_WEAPON_RANGE:
            case IK2_WEAPON_MAGIC:
//            case IK2_WEAPON_DOLL:
//            case IK2_WEAPON_GUN:
            case IK2_ARMOR:
            case IK2_ARMORETC:
            case IK2_CLOTH:
            case IK2_CLOTHETC:
            {
                                    // นซฑโ : ม๗พ๗, ดษทยฤก ฝบล, ฐกฐ
                if( pItemProp->dwItemSex != 0xffffffff && pItemProp->dwItemSex != g_pPlayer->GetSex() )
                {
                    bRander = 1;
                    break;
                }
                if( JOB_VAGRANT != pItemProp->dwItemJob )
                {
                    if( pItemProp->dwItemJob != 0xffffffff && JOB_VAGRANT < pItemProp->dwItemJob && !(g_pPlayer->IsInteriorityJob( pItemProp->dwItemJob ) ) )
                    {
                        bRander = 1;
                        break;
                    }
                }
#if __VER >= 14 // __NEW_ITEM_LIMIT_LEVEL
                if( pItemProp->dwLimitLevel1 != 0xffffffff && pItemElem->IsLimitLevel( g_pPlayer ) )
#else // __NEW_ITEM_LIMIT_LEVEL
#if __VER >= 11 // __SYS_IDENTIFY
                if( pItemProp->dwLimitLevel1 != 0xffffffff && g_pPlayer->GetLevel() < pItemElem->GetLimitLevel() )
#else    // __SYS_IDENTIFY
                if( pItemProp->dwLimitLevel1 != 0xffffffff && g_pPlayer->GetLevel() < pItemProp->dwLimitLevel1 )
#endif    // __SYS_IDENTIFY
#endif // __NEW_ITEM_LIMIT_LEVEL
                {
                    bRander = 1;
                    break;
                }
                break;
            }
            case IK2_RIDING:
//            case IK2_BOARDING:
//            case IK2_HATCH:
            {
                // บ๑วเ : บ๑วเทนบง
                if( g_pPlayer->GetFlightLv() < (int)( pItemProp->dwFlightLimit ) )
                {
                    bRander = 1;
                    break;
                }
                break;
            }
        }
         // ธ๐ต็พฦภฬล ฐกฐ บ๑ฑณ
#if __VER >= 11 // __CSC_VER11_3
        if (nParent == APP_SHOP_)
        {
            CWndShop* pWndBase = (CWndShop*)g_WndMng.GetWndBase(APP_SHOP_);
            LPCHARACTER lpCharacter = pWndBase->m_pMover->GetCharacter();
#ifdef __VENDOR_UPDATE
            if (lpCharacter && lpCharacter->m_nVenderType != 0)
            {
#ifdef __WBQT_EXT_CURRENCY
                if (bRander == 0 && ((lpCharacter->m_nVenderType == II_CHP_RED && g_pPlayer->GetChips() < pItemElem->GetChipCost()) || (lpCharacter->m_nVenderType != II_CHP_RED && g_pPlayer->m_Inventory.GetAtItemNum(lpCharacter->m_nVenderType) < (int)pItemElem->GetChipCost())))
#else
                if (bRander == 0 && g_pPlayer->m_Inventory.GetAtItemNum(II_CHP_RED) < (int)pItemElem->GetChipCost())
#endif
                    bRander = 1;
            }
#else
            if (lpCharacter && lpCharacter->m_nVenderType == 1)
            {
#ifdef __WBQT_EXT_CURRENCY
                if (bRander == 0 && g_pPlayer->GetChips() < pItemElem->GetChipCost())#else
                if (bRander == 0 && g_pPlayer->m_Inventory.GetAtItemNum(II_CHP_RED) < (int)pItemElem->GetChipCost())
#endif
                    bRander = 1;
            }
#endif
        }
        else
        {
            if (bRander == 0 && g_pPlayer->GetGold() < (int)pItemProp->dwCost)
                bRander = 1;
        }
#else //__CSC_VER11_3
        if (bRander == 0 && g_pPlayer->GetGold() < (int)pItemProp->dwCost)
            bRander = 1;
#endif //__CSC_VER11_3
            }
#ifdef __AFK_VENDOR
    if (pItemElem->IsFlag(CItemElem::expired) && pItemElem->GetPropA() && pItemElem->GetPropA()->dwItemKind3 != IK3_VENDING)
#else
    if (pItemElem->IsFlag(CItemElem::expired))
#endif
    {
        bRander = 1;
    }
#ifdef    __SEARCH_INV
    CWndBase* pWndBase = this->GetParentWnd();
    if (pWndBase)
    {
        CWndBase* pWndBaseTemp = pWndBase->GetParentWnd();
        if (pWndBaseTemp)
            nParent = pWndBaseTemp->GetWndId();
        if (nParent == APP_INVENTORY)
        {
            CWndEdit* pSearchBox = (CWndEdit*)pWndBaseTemp->GetDlgItem(WIDC_EDIT1);
            if (pSearchBox)
            {
                CString strFilter = pSearchBox->GetString();
                if (strFilter.GetLength())
                {
                    CString strName = pItemElem->GetName();
                    if (!strstr(strName.MakeLower(), strFilter.MakeLower()))
                        nalpha = 50;
                }
            }
        }
#endif    //__SEARCH_INV
    if( !g_eLocal.GetState(EVE_SCHOOL) )
    {
        if( bRander == 0 )
        {
            pItemElem->GetTexture()->Render( p2DRender, CPoint( x, y ), nalpha );
        }
        else
        if( bRander == 1 )    // ป็ฟ๋วาผ๖ พ๘ดยฐอ
        {
            pItemElem->GetTexture()->Render2( p2DRender, CPoint( x, y ), D3DCOLOR_ARGB( nalpha, 255, 100, 100 ) );
        }
    }
    else
        pItemElem->GetTexture()->Render( p2DRender, CPoint( x, y ), nalpha );
#ifdef    __SEARCH_INVENTORY
    }
#endif
}
VersionCommon.h
Code:
#define __SEARCH_INVENTORY

resdata.inc
Go APP_INVENTORY

add
Code:
WTYPE_EDITCTRL WIDC_EDIT1 "WndEditTile00.tga" 1 8 244 273 266 0x20000 1 0 0 0 255 255 255
    {
    // Title String
    IDS_RESDATA_INC_011160
    }
    {
    // ToolTip
    IDS_RESDATA_INC_011161
    }

Enjoy.. Sorry My Bad Eng.
 
Skilled Illusionist
Joined
May 11, 2011
Messages
316
Reaction score
28
tested ?
you forgot something to add in your guide...

UNDER WHAT add this:
Code:
#ifdef    __SEARCH_INVENTORY    

}

#endif
 
Inactive
Joined
Jan 20, 2009
Messages
1,014
Reaction score
1,830
@Ratpack

Code:
	if (pItemElem->IsFlag(CItemElem::expired))
	{
		bRander = 1;
	}

#ifdef	__SEARCH_INVENTORY
	CWndBase* pWndBase = this->GetParentWnd();

	if (pWndBase)
	{
		CWndBase* pWndBaseTemp = pWndBase->GetParentWnd();
		if (pWndBaseTemp)
			nParent = pWndBaseTemp->GetWndId();

		if (nParent == APP_INVENTORY)
		{
			CWndEdit* pSearchBox = (CWndEdit*)pWndBaseTemp->GetDlgItem(WIDC_EDIT1);
			if (pSearchBox)
			{
				CString strFilter = pSearchBox->GetString();
				if (strFilter.GetLength())
				{
					CString strName = pItemElem->GetName();
					if (!strstr(strName.MakeLower(), strFilter.MakeLower()))
						nalpha = 50;
				}
			}
		}

#endif	//__SEARCH_INVENTORY

		if (!g_eLocal.GetState(EVE_SCHOOL))
		{
			if (bRander == 0)
			{
				pItemElem->GetTexture()->Render(p2DRender, CPoint(x, y), nalpha);
			}
			else
				if (bRander == 1)	// 사용할수 없는것
				{
					pItemElem->GetTexture()->Render2(p2DRender, CPoint(x, y), D3DCOLOR_ARGB(nalpha, 255, 100, 100));
				}
		}
		else
			pItemElem->GetTexture()->Render(p2DRender, CPoint(x, y), nalpha);
#ifdef	__SEARCH_INVENTORY
	}
#endif	//__SEARCH_INVENTORY
}
 
Experienced Elementalist
Joined
Sep 13, 2014
Messages
232
Reaction score
86
someone need to learn how to put credit.
 
Initiate Mage
Joined
Feb 17, 2019
Messages
3
Reaction score
3
Is the search bar meant to be invisible? It functions correctly, but you wouldn't know it's there unless you edit your theme.

If it is meant to be invisible, I would recommend using this snippet in your resdata.inc. The search bar has been moved from the top of your inventory (where it's blocking half of the top row) to the bottom, and has been shifted slightly to the right, next to where it says "Item"

Changed Resdata.inc
Code:
WTYPE_EDITCTRL WIDC_EDIT1 "WndEditTile00.tga" 1 55 380 520 400 0x20000 1 0 0 0 255 255 255
    {
    // Title String
    IDS_RESDATA_INC_011160
    }
    {
    // ToolTip
    IDS_RESDATA_INC_011161
    }
Image of Search Bar with new resdata.inc
warayut5030 - [Releases] Search Inventory - RaGEZONE Forums

Lastly, for anyone running a V15 server, remove the 255 255 255 from the end of that first line, and it will work properly. If you don't, Neuz will throw you errors as soon as you open it, and you'll be unable to reach the login screen.
 
Skilled Illusionist
Joined
Nov 29, 2009
Messages
368
Reaction score
15
Is it yours?If not, you should quiet your mouth.Keep eating cold hands better

But i'm also sure you're not the first person to use it.

If i remember correctly Vendetta Flyff was the first server to use inventory search in the fashion you've implemented!
 
Back
Top