today i'm releasing what i've worked on for the last few days -> an resizeable inventory for Flyff!
So far i've seen this system on only one server, which is also the reason why i've decided to recode this because it's such a huge improvement for Flyff's interface which actually every server should provide.
Although this requires a bunch of modifications through various files (including resources). Therefore you may be faster by diffing the files to your own source rather than inserting the snippets below manually.
If you prefer merging the snippets into your source / resource, and i really recommend you to do so, you can grab the snippets (including the base source for diff) from here (password = "mcoocr"):

Also note i've coded this on a clean V15 base, you may need to add your custom or additional inventory controls (like perin counter, etc.)... to make this more comprehensible i've added the checkbox controls from __SYS_280514 (hide / show CS items) as an example to show how this could be done.
In case you modified the original inventory size (for example if you use perin counters, etc.) make sure you adjust the size at AdjustMinRect() call to the new one.
Monstrous spoiler warning!
+ add in VersionCommon.h
+ add in WndItemCtrl.cpp
= below
+ add in WndItemCtrl.h
= below
+ add in WndField.h
= below
~ modify in WndField.h
= replacing
+ add in WndField.cpp
= below
+ add in WndField.cpp
= below
+ add in WndField.cpp
= below
+ add in WndField.cpp
= below
+ add in WndField.cpp
= before
~ modify in WndField.cpp
= replacing
+ add in WndField.cpp
= before
~ modify in WndField.cpp
= replacing
+ add in WndField.cpp
= below
+ add in WndField.cpp
= before
+ add in WndField.cpp
= at bottom of CWndInventory::OnSize, before
+ modify in WndField.cpp
= replacing
+ add in WndField.cpp
= below
Code:
#define _INVENTORY_RESIZEABLE
Code:
#ifdef _INVENTORY_RESIZEABLE
int CWndItemCtrl::getScrollbarPos()
{
return (m_wndScrollBar.GetScrollPage() + m_wndScrollBar.GetScrollPos());
}
int CWndItemCtrl::getScrollbarMax()
{
return m_wndScrollBar.GetMaxScrollPos();
}
#endif // _INVENTORY_RESIZEABLE
Code:
#if __VER >= 8 //__CSC_VER8_5
void CWndItemCtrl::SetDieFlag(BOOL flag)
{
this->m_useDieFlag = flag;
}
#endif //__CSC_VER8_5
Code:
#ifdef _INVENTORY_RESIZEABLE
public:
int getScrollbarPos();
int getScrollbarMax();
#endif // _INVENTORY_RESIZEABLE
Code:
#if __VER >= 8 //__CSC_VER8_5 public: BOOL m_useDieFlag; #endif //__CSC_VER8_5
Code:
#ifdef _INVENTORY_RESIZEABLE
enum ctrltype
{
PARENT, STATIC, CUSTOM, CHECKBOX
};
class ctrlhelp
{
public:
int id;
ctrltype type;
CRect rect;
ctrlhelp(int id, ctrltype type, CRect rect)
{
this->id = id;
this->type = type;
this->rect = rect;
}
};
vector<ctrlhelp> arOriginalSizes;
const int nGridTexSize = 32; // texturesize grid
std::vector<CTexture*> m_arTexInvGrid;
virtual void SetWndRect(CRect rectWnd, BOOL bOnSize);
CRect getItemRect(int id, CPoint sizediff = CPoint(0, 0), ctrltype type = PARENT);
void saveOriginRects();
void resetItemRects();
#endif // _INVENTORY_RESIZEABLE
Code:
CTexture* m_TexRemoveItem;
Code:
bool SetEnchantCursor();
void refreshItemRects();
Code:
void SetEnchantCursor();
Code:
#ifdef _INVENTORY_RESIZEABLE
m_arTexInvGrid.clear();
arOriginalSizes.clear();
#endif // _INVENTORY_RESIZEABLE
Code:
#if __VER >= 9 // __CSC_VER9_1 m_pWndRemoveJewelConfirm = NULL; m_bRemoveJewel = FALSE; #endif //__CSC_VER9_1
Code:
#ifdef _INVENTORY_RESIZEABLE
resetItemRects();
arOriginalSizes.clear();
#endif // _INVENTORY_RESIZEABLE
Code:
#if __VER >= 9 // __CSC_VER9_1 SAFE_DELETE(m_pWndRemoveJewelConfirm); #endif //__CSC_VER9_1
Code:
#ifdef _INVENTORY_RESIZEABLE
resetItemRects();
#endif // _INVENTORY_RESIZEABLE
Code:
CWndBank* pWndBank = ( CWndBank* )GetWndBase( APP_COMMON_BANK ); if( pWndBank != NULL ) pWndBank->Destroy();
Code:
#ifdef _INVENTORY_RESIZEABLE
if(m_nResizeDir)
{
return;
}
#endif // _INVENTORY_RESIZEABLE
Code:
void CWndInventory::OnMouseWndSurface( CPoint point )
{
Code:
#ifdef _INVENTORY_RESIZEABLE
if(m_arTexInvGrid.size() > 0)
{
CWndTabCtrl *pwnd = (CWndTabCtrl*)GetDlgItem(WIDC_INVENTORY);
int left = (pwnd->GetWndRect().left + 5) - 1; // +5 border left
int top = (pwnd->GetWndRect().top + 1) - 1; // +1 offset top
int width = (pwnd->GetWndRect().Width() - 23); // -18 scrollbar right (-5 border left)
int height = (pwnd->GetWndRect().Height() - 22); // -21 label bottom (-1 offset top)
//int right = (left + width), bottom = (top + height);
int rows = (height / nGridTexSize), cols = (width / nGridTexSize);
bool bScrolledToBottom = ((m_wndItemCtrl.getScrollbarPos() >= m_wndItemCtrl.getScrollbarMax()) && ((MAX_INVENTORY / cols) >= rows) && ((MAX_INVENTORY % cols) > 0));
for(int y = 0, z = 0; y < rows; y++)
{
for(int x = 0; x < cols; x++)
{
CTexture *ptex = NULL;
CPoint cp;
cp.x = (left + (nGridTexSize * x));
cp.y = (top + (nGridTexSize * y));
if(m_arTexInvGrid.size() >= 12)
{
bool bIsEmptySpaceScroll = (bScrolledToBottom && /*((MAX_INVENTORY / cols) > rows) && ((MAX_INVENTORY % cols) > 0) &&*/ ((y + 1) >= rows));
if((y >= (MAX_INVENTORY / cols)) || // if there are more rows than required last will get bottom grid
bIsEmptySpaceScroll) // scrolled to the last row
{
if((((y * cols) + (x + 1)) > MAX_INVENTORY) || // max inventory size (empty space)
(bIsEmptySpaceScroll && (((MAX_INVENTORY / cols) * cols) + (x + 1)) > MAX_INVENTORY)) // last scrolled line (empty space)
{
if(z < cols)
{
ptex = m_arTexInvGrid[x == 0 ? 9 : (((x + 1) == cols ? 11 : 10))];
z = (x + 1);
} else
{
ptex = NULL;
}
} else // last row
{
if(x == 0)
{
ptex = m_arTexInvGrid[6];
} else if(x == (cols - 1))
{
ptex = m_arTexInvGrid[8];
} else
{
ptex = m_arTexInvGrid[7];
}
}
} else // fill grid
{
if(y == 0) // first row
{
if(x == 0)
{
ptex = m_arTexInvGrid[0];
} else if(x == (cols - 1))
{
ptex = m_arTexInvGrid[2];
} else
{
ptex = m_arTexInvGrid[1];
}
} else if(y == (rows - 1)) // last row
{
if(x == 0)
{
ptex = m_arTexInvGrid[6];
} else if(x == (cols - 1))
{
ptex = m_arTexInvGrid[8];
} else
{
ptex = m_arTexInvGrid[7];
}
} else // rows in between
{
if(x == 0)
{
ptex = m_arTexInvGrid[3];
} else if(x == (cols - 1))
{
ptex = m_arTexInvGrid[5];
} else
{
ptex = m_arTexInvGrid[4];
}
}
}
}
if(ptex != NULL)
{
ptex->Render(p2DRender, cp, CPoint(nGridTexSize, nGridTexSize), 255, 1.0f, 1.0f);
}
}
}
}
#endif // _INVENTORY_RESIZEABLE
Code:
pGoldNum->SetTitle( strGoldNum );
Code:
refreshItemRects();
Code:
LPWNDCTRL lpWndCtrl1 = GetWndCtrl( WIDC_CUSTOM1 ); LPWNDCTRL lpWndCtrl2 = GetWndCtrl( WIDC_CUSTOM2 ); LPWNDCTRL lpWndCtrl3 = GetWndCtrl(WIDC_CUSTOM3); LPWNDCTRL lpWndCtrl4 = GetWndCtrl(WIDC_CUSTOM4); LPWNDCTRL lpWndCtrl5 = GetWndCtrl(WIDC_CUSTOM5); LPWNDCTRL lpWndCtrl6 = GetWndCtrl(WIDC_CUSTOM6); LPWNDCTRL lpWndCtrl7 = GetWndCtrl(WIDC_CUSTOM7); LPWNDCTRL lpWndCtrl8 = GetWndCtrl(WIDC_CUSTOM8); LPWNDCTRL lpWndCtrl9 = GetWndCtrl(WIDC_CUSTOM9); LPWNDCTRL lpWndCtrl10 = GetWndCtrl(WIDC_CUSTOM10); m_InvenRect[6] = m_InvenRect[14] = lpWndCtrl1->rect; m_InvenRect[2] = m_InvenRect[15] = lpWndCtrl2->rect; m_InvenRect[4] = m_InvenRect[17] = lpWndCtrl3->rect; m_InvenRect[5] = m_InvenRect[18] = lpWndCtrl4->rect; m_InvenRect[10] = lpWndCtrl5->rect; m_InvenRect[9] = m_InvenRect[11] = lpWndCtrl6->rect; m_InvenRect[25] = lpWndCtrl7->rect; m_InvenRect[8] = lpWndCtrl8->rect; m_InvenRect[12] = lpWndCtrl9->rect; m_InvenRect[13] = lpWndCtrl10->rect; lpWndCtrl1 = GetWndCtrl(WIDC_CUSTOM11); lpWndCtrl2 = GetWndCtrl(WIDC_CUSTOM12); lpWndCtrl3 = GetWndCtrl(WIDC_CUSTOM13); lpWndCtrl4 = GetWndCtrl(WIDC_CUSTOM14); lpWndCtrl5 = GetWndCtrl(WIDC_CUSTOM15); lpWndCtrl6 = GetWndCtrl(WIDC_CUSTOM16); lpWndCtrl7 = GetWndCtrl(WIDC_CUSTOM17); lpWndCtrl8 = GetWndCtrl(WIDC_CUSTOM18); lpWndCtrl9 = GetWndCtrl(WIDC_CUSTOM19); m_InvenRect[20] = lpWndCtrl1->rect; m_InvenRect[22] = lpWndCtrl2->rect; m_InvenRect[19] = lpWndCtrl3->rect; m_InvenRect[23] = lpWndCtrl4->rect; m_InvenRect[21] = lpWndCtrl5->rect; m_InvenRect[26] = lpWndCtrl6->rect; m_InvenRect[27] = lpWndCtrl7->rect; m_InvenRect[28] = lpWndCtrl8->rect; m_InvenRect[29] = lpWndCtrl9->rect;
Code:
#ifdef _INVENTORY_RESIZEABLE
void CWndInventory::saveOriginRects()
{
if(arOriginalSizes.size() > 0)
{
return;
}
arOriginalSizes.push_back(ctrlhelp(0, PARENT, GetClientRect()));
arOriginalSizes.push_back(ctrlhelp(WIDC_INVENTORY, STATIC, GetDlgItem(WIDC_INVENTORY)->GetWndRect()));
arOriginalSizes.push_back(ctrlhelp(WIDC_GOLD, STATIC, GetDlgItem(WIDC_GOLD)->GetWndRect()));
arOriginalSizes.push_back(ctrlhelp(WIDC_GOLD_NUM, STATIC, GetDlgItem(WIDC_GOLD_NUM)->GetWndRect()));
arOriginalSizes.push_back(ctrlhelp(WIDC_STATIC1, STATIC, GetDlgItem(WIDC_STATIC1)->GetWndRect()));
#ifdef __SYS_280514
for(size_t i = 0; i < (sizeof(m_awndCheckHide) / sizeof(CWndButton)); i++)
{
arOriginalSizes.push_back(ctrlhelp(i, CHECKBOX, m_awndCheckHide[i].GetWndRect()));
}
#endif // __SYS_280514
arOriginalSizes.push_back(ctrlhelp(WIDC_STATIC11, STATIC, GetDlgItem(WIDC_STATIC11)->GetWndRect()));
arOriginalSizes.push_back(ctrlhelp(WIDC_STATIC12, STATIC, GetDlgItem(WIDC_STATIC12)->GetWndRect()));
arOriginalSizes.push_back(ctrlhelp(WIDC_STATIC13, STATIC, GetDlgItem(WIDC_STATIC13)->GetWndRect()));
arOriginalSizes.push_back(ctrlhelp(WIDC_STATIC14, STATIC, GetDlgItem(WIDC_STATIC14)->GetWndRect()));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM1, CUSTOM, GetWndCtrl(WIDC_CUSTOM1)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM2, CUSTOM, GetWndCtrl(WIDC_CUSTOM2)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM3, CUSTOM, GetWndCtrl(WIDC_CUSTOM3)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM4, CUSTOM, GetWndCtrl(WIDC_CUSTOM4)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM5, CUSTOM, GetWndCtrl(WIDC_CUSTOM5)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM6, CUSTOM, GetWndCtrl(WIDC_CUSTOM6)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM7, CUSTOM, GetWndCtrl(WIDC_CUSTOM7)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM8, CUSTOM, GetWndCtrl(WIDC_CUSTOM8)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM9, CUSTOM, GetWndCtrl(WIDC_CUSTOM9)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM10, CUSTOM, GetWndCtrl(WIDC_CUSTOM10)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM11, CUSTOM, GetWndCtrl(WIDC_CUSTOM11)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM12, CUSTOM, GetWndCtrl(WIDC_CUSTOM12)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM13, CUSTOM, GetWndCtrl(WIDC_CUSTOM13)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM14, CUSTOM, GetWndCtrl(WIDC_CUSTOM14)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM15, CUSTOM, GetWndCtrl(WIDC_CUSTOM15)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM16, CUSTOM, GetWndCtrl(WIDC_CUSTOM16)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM17, CUSTOM, GetWndCtrl(WIDC_CUSTOM17)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM18, CUSTOM, GetWndCtrl(WIDC_CUSTOM18)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM19, CUSTOM, GetWndCtrl(WIDC_CUSTOM19)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM20, CUSTOM, GetWndCtrl(WIDC_CUSTOM20)->rect));
arOriginalSizes.push_back(ctrlhelp(WIDC_CUSTOM21, CUSTOM, GetWndCtrl(WIDC_CUSTOM21)->rect));
}
void CWndInventory::resetItemRects()
{
for(size_t i = 1; i < arOriginalSizes.size(); i++)
{
switch(arOriginalSizes[i].type)
{
case STATIC:
GetDlgItem(arOriginalSizes[i].id)->SetWndRect(arOriginalSizes[i].rect);
break;
case CUSTOM:
GetWndCtrl(arOriginalSizes[i].id)->rect = arOriginalSizes[i].rect;
break;
case CHECKBOX:
#ifdef __SYS_280514
m_awndCheckHide[arOriginalSizes[i].id].SetWndRect(arOriginalSizes[i].rect);
#endif // __SYS_280514
break;
}
}
}
CRect CWndInventory::getItemRect(int id, CPoint sizediff, ctrltype type)
{
for(size_t i = 0; i < arOriginalSizes.size(); i++)
{
if((type == PARENT || arOriginalSizes[i].type == type) && arOriginalSizes[i].id == id)
{
if(type == CHECKBOX)
{
switch(id)
{
case 4: // cloak
return arOriginalSizes[i].rect;
default:
return CRect(arOriginalSizes[i].rect.left + (sizediff.x / 2), arOriginalSizes[i].rect.top, arOriginalSizes[i].rect.right + (sizediff.x / 2), arOriginalSizes[i].rect.bottom);
}
}
switch(id)
{
case WIDC_STATIC11: // left
{
CRect t1 = getItemRect(WIDC_CUSTOM5, sizediff);
CRect t2 = getItemRect(WIDC_CUSTOM9, sizediff);
return CRect(t1.left, t1.top, t2.right, t2.bottom);
}
case WIDC_STATIC12: // top
{
CRect t1 = getItemRect(WIDC_CUSTOM11, sizediff);
CRect t2 = getItemRect(WIDC_CUSTOM15, sizediff);
return CRect(t1.left, t1.top, t2.right, t2.bottom);
}
case WIDC_STATIC13: // right
{
CRect t1 = getItemRect(WIDC_CUSTOM1, sizediff);
CRect t2 = getItemRect(WIDC_CUSTOM10, sizediff);
return CRect(t1.left, t1.top, t2.right, t2.bottom);
}
case WIDC_STATIC14: // bottom
{
CRect t1 = getItemRect(WIDC_CUSTOM16, sizediff);
CRect t2 = getItemRect(WIDC_CUSTOM19, sizediff);
return CRect(t1.left, t1.top, t2.right, t2.bottom);
}
case WIDC_CUSTOM5:
case WIDC_CUSTOM6:
case WIDC_CUSTOM7:
case WIDC_CUSTOM8:
case WIDC_CUSTOM9:
return arOriginalSizes[i].rect;
case WIDC_CUSTOM1:
case WIDC_CUSTOM2:
case WIDC_CUSTOM3:
case WIDC_CUSTOM4:
case WIDC_CUSTOM10:
return CRect(arOriginalSizes[i].rect.left + sizediff.x, arOriginalSizes[i].rect.top, arOriginalSizes[i].rect.right + sizediff.x, arOriginalSizes[i].rect.bottom);
case WIDC_CUSTOM11:
case WIDC_CUSTOM12:
case WIDC_CUSTOM13:
case WIDC_CUSTOM14:
case WIDC_CUSTOM15:
case WIDC_CUSTOM16:
case WIDC_CUSTOM17:
case WIDC_CUSTOM18:
case WIDC_CUSTOM19:
case WIDC_CUSTOM20:
return CRect(arOriginalSizes[i].rect.left + (sizediff.x / 2), arOriginalSizes[i].rect.top, arOriginalSizes[i].rect.right + (sizediff.x / 2), arOriginalSizes[i].rect.bottom);
case WIDC_GOLD:
case WIDC_GOLD_NUM:
case WIDC_STATIC1:
return CRect(arOriginalSizes[i].rect.left + sizediff.x, arOriginalSizes[i].rect.top + sizediff.y, arOriginalSizes[i].rect.right + sizediff.x, arOriginalSizes[i].rect.bottom + sizediff.y);
case WIDC_CUSTOM21:
return CRect(arOriginalSizes[i].rect.left, arOriginalSizes[i].rect.top + sizediff.y, arOriginalSizes[i].rect.right, arOriginalSizes[i].rect.bottom + sizediff.y);
case WIDC_INVENTORY:
return CRect(arOriginalSizes[i].rect.left, arOriginalSizes[i].rect.top, arOriginalSizes[i].rect.right + sizediff.x, arOriginalSizes[i].rect.bottom + sizediff.y);
}
}
}
return CRect(0, 0, 0, 0);
}
void CWndInventory::SetWndRect(CRect rectWnd, BOOL bOnSize)
{
if(m_nResizeDir)
{
int width = abs(m_rectWindow.Width() - rectWnd.Width()), height = abs(m_rectWindow.Height() - rectWnd.Height());
if((width < nGridTexSize || (width % nGridTexSize) > 0) && (height < nGridTexSize || (height % nGridTexSize) > 0)) // no half resizes (only full item size)
{
return;
}
if(width < nGridTexSize || (width % nGridTexSize) > 0)
{
rectWnd.left = m_rectWindow.left;
rectWnd.right = m_rectWindow.right;
}
if(height < nGridTexSize || (height % nGridTexSize) > 0)
{
rectWnd.top = m_rectWindow.top;
rectWnd.bottom = m_rectWindow.bottom;
}
}
AdjustMinRect(&rectWnd, 240, 464); // should match APP_INVENTORY initial size
AdjustMaxRect(&rectWnd, 600, 700); // note that the grid would not display correctly if there is only a single row of items
CWndNeuz::SetWndRect(rectWnd, bOnSize);
}
#endif // _INVENTORY_RESIZEABLE
void CWndInventory::refreshItemRects()
{
LPWNDCTRL lpWndCtrl1 = GetWndCtrl(WIDC_CUSTOM1);
LPWNDCTRL lpWndCtrl2 = GetWndCtrl(WIDC_CUSTOM2);
LPWNDCTRL lpWndCtrl3 = GetWndCtrl(WIDC_CUSTOM3);
LPWNDCTRL lpWndCtrl4 = GetWndCtrl(WIDC_CUSTOM4);
LPWNDCTRL lpWndCtrl5 = GetWndCtrl(WIDC_CUSTOM5);
LPWNDCTRL lpWndCtrl6 = GetWndCtrl(WIDC_CUSTOM6);
LPWNDCTRL lpWndCtrl7 = GetWndCtrl(WIDC_CUSTOM7);
LPWNDCTRL lpWndCtrl8 = GetWndCtrl(WIDC_CUSTOM8);
LPWNDCTRL lpWndCtrl9 = GetWndCtrl(WIDC_CUSTOM9);
LPWNDCTRL lpWndCtrl10 = GetWndCtrl(WIDC_CUSTOM10);
m_InvenRect[6] = m_InvenRect[14] = lpWndCtrl1->rect;
m_InvenRect[2] = m_InvenRect[15] = lpWndCtrl2->rect;
m_InvenRect[4] = m_InvenRect[17] = lpWndCtrl3->rect;
m_InvenRect[5] = m_InvenRect[18] = lpWndCtrl4->rect;
m_InvenRect[10] = lpWndCtrl5->rect;
m_InvenRect[9] = m_InvenRect[11] = lpWndCtrl6->rect;
m_InvenRect[25] = lpWndCtrl7->rect;
m_InvenRect[8] = lpWndCtrl8->rect;
m_InvenRect[12] = lpWndCtrl9->rect;
m_InvenRect[13] = lpWndCtrl10->rect;
lpWndCtrl1 = GetWndCtrl(WIDC_CUSTOM11);
lpWndCtrl2 = GetWndCtrl(WIDC_CUSTOM12);
lpWndCtrl3 = GetWndCtrl(WIDC_CUSTOM13);
lpWndCtrl4 = GetWndCtrl(WIDC_CUSTOM14);
lpWndCtrl5 = GetWndCtrl(WIDC_CUSTOM15);
lpWndCtrl6 = GetWndCtrl(WIDC_CUSTOM16);
lpWndCtrl7 = GetWndCtrl(WIDC_CUSTOM17);
lpWndCtrl8 = GetWndCtrl(WIDC_CUSTOM18);
lpWndCtrl9 = GetWndCtrl(WIDC_CUSTOM19);
m_InvenRect[20] = lpWndCtrl1->rect;
m_InvenRect[22] = lpWndCtrl2->rect;
m_InvenRect[19] = lpWndCtrl3->rect;
m_InvenRect[23] = lpWndCtrl4->rect;
m_InvenRect[21] = lpWndCtrl5->rect;
m_InvenRect[26] = lpWndCtrl6->rect;
m_InvenRect[27] = lpWndCtrl7->rect;
m_InvenRect[28] = lpWndCtrl8->rect;
m_InvenRect[29] = lpWndCtrl9->rect;
}
Code:
void CWndInventory::OnInitialUpdate()
{
Code:
#ifdef _INVENTORY_RESIZEABLE
CRect rectGold = GetWndCtrl(WIDC_STATIC1)->rect;
m_wndGold.Create("g", WBS_NODRAWFRAME, rectGold, this, WIDC_GOLD);
m_wndGold.AddWndStyle(WBS_NODRAWFRAME);
#else
// undefining this with the modified APP_INVENTORY resdata will cause crashes (use the old one in such cases)
LPWNDCTRL lpWndCtrl = GetWndCtrl( WIDC_GOLD );
m_wndGold.Create( "g", WBS_NODRAWFRAME, lpWndCtrl->rect, this, WIDC_GOLD );
m_wndGold.AddWndStyle( WBS_NODRAWFRAME );
#endif // _INVENTORY_RESIZEABLE
Code:
LPWNDCTRL lpWndCtrl = GetWndCtrl( WIDC_GOLD ); m_wndGold.Create( "g", WBS_NODRAWFRAME, lpWndCtrl->rect, this, WIDC_GOLD ); m_wndGold.AddWndStyle( WBS_NODRAWFRAME );
Code:
#ifdef _INVENTORY_RESIZEABLE
for(int i = 1; i <= 12; i++)
{
CTexture *ptex = NULL;
char tmp[32] = { 0 };
sprintf(tmp, "InvGrid%d.bmp", i);
ptex = m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_THEME, tmp), 0xffff00ff);
if(ptex != NULL)
{
m_arTexInvGrid.push_back(ptex);
} else
{
break;
}
}
#endif // _INVENTORY_RESIZEABLE
Code:
m_TexRemoveItem = m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_THEME, "WndInventoryGarbage.dds" ), 0xffff00ff );
Code:
#ifdef _INVENTORY_RESIZEABLE
saveOriginRects();
#endif // _INVENTORY_RESIZEABLE
Code:
CRect rectRoot = m_pWndRoot->GetLayoutRect(); CRect rectWindow = GetWindowRect(); CPoint point( rectRoot.right - rectWindow.Width(), 112 + 48 ); Move( point );
Code:
#ifdef _INVENTORY_RESIZEABLE
CPoint cpSizeDiff;
cpSizeDiff.x = (cx - arOriginalSizes[0].rect.Width());
cpSizeDiff.y = (cy - arOriginalSizes[0].rect.Height());
m_wndItemCtrl.OnMouseWheel(0, 0, CPoint(0, 0)); // reset scrollbar
for(size_t i = 1; i < arOriginalSizes.size(); i++)
{
switch(arOriginalSizes[i].type)
{
case STATIC:
GetDlgItem(arOriginalSizes[i].id)->SetWndRect(getItemRect(arOriginalSizes[i].id, cpSizeDiff));
break;
case CUSTOM:
GetWndCtrl(arOriginalSizes[i].id)->rect = getItemRect(arOriginalSizes[i].id, cpSizeDiff);
break;
case CHECKBOX:
#ifdef __SYS_280514
m_awndCheckHide[arOriginalSizes[i].id].SetWndRect(getItemRect(arOriginalSizes[i].id, cpSizeDiff, CHECKBOX));
#endif // __SYS_280514
break;
}
}
refreshItemRects();
#endif // _INVENTORY_RESIZEABLE
Code:
CWndNeuz::OnSize(nType, cx, cy); }
Code:
BOOL CWndInventory::OnSetCursor ( CWndBase* pWndBase, UINT nHitTest, UINT message )
{
if(!SetEnchantCursor())
{
#ifdef _INVENTORY_RESIZEABLE
CWndNeuz::OnSetCursor(pWndBase, nHitTest, message);
#endif // _INVENTORY_RESIZEABLE
}
return TRUE;
}
bool CWndInventory::SetEnchantCursor()
{
bool bRet = false;
// ĀΚĨÃĒĀĖ ŋ*·ÁĀÖ°í ĀÎÃūÆŪ ļðĩåĀĖļé Äŋž*ļðūį šŊ°æ
if( m_bIsUpgradeMode )
{
SetMouseCursor( CUR_HAMMER );
bRet = true;
}
else
{
SetMouseCursor( CUR_BASE );
}
return bRet;
}
Code:
BOOL CWndInventory::OnSetCursor ( CWndBase* pWndBase, UINT nHitTest, UINT message )
{
SetEnchantCursor();
return TRUE;
}
void CWndInventory::SetEnchantCursor()
{
// ĀΚĨÃĒĀĖ ŋ*·ÁĀÖ°í ĀÎÃūÆŪ ļðĩåĀĖļé Äŋž*ļðūį šŊ°æ
if( m_bIsUpgradeMode )
{
SetMouseCursor( CUR_HAMMER );
}
else
{
SetMouseCursor( CUR_BASE );
}
}
Code:
#ifdef _INVENTORY_RESIZEABLE
if(m_nResizeDir)
{
return;
}
#endif // _INVENTORY_RESIZEABLE
Code:
void CWndInventory::OnMouseMove(UINT nFlags, CPoint point)
{
+ replace the "APP_INVENTORY" block in resdata.inc with this (or diff with your own and add / remove the actual items):
+ add in resData.txt.txt (note: you may customize the numbering of those items to match your resData, in this case you also have to customize these entries in the resdata.inc addition above):
+ place the *.bmp Files from the theme.zip in Theme/Default or whichever you're using
- ignore the description.txt file, this only includes notes for everyone who is interested on modding the appearance of the inventory grid
Code:
APP_INVENTORY "WndTile00.tga" 1 240 464 0x2410040 26
{
// Title String
IDS_RESDATA_INC_002130
}
{
// ToolTip
IDS_RESDATA_INC_002131
}
{
WTYPE_CUSTOM WIDC_CUSTOM1 "" 0 178 4 222 48 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002132
}
{
// ToolTip
IDS_RESDATA_INC_002133
}
WTYPE_TABCTRL WIDC_INVENTORY "" 1 8 250 223 400 0x220000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002134
}
{
// ToolTip
IDS_RESDATA_INC_002135
}
WTYPE_STATIC WIDC_GOLD_NUM "WndEditTile00.tga" 1 116 404 220 424 0x2220000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002138
}
{
// ToolTip
IDS_RESDATA_INC_002139
}
WTYPE_CUSTOM WIDC_CUSTOM2 "" 0 178 52 222 96 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002140
}
{
// ToolTip
IDS_RESDATA_INC_002141
}
WTYPE_CUSTOM WIDC_CUSTOM3 "" 0 178 100 222 144 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002142
}
{
// ToolTip
IDS_RESDATA_INC_002143
}
WTYPE_CUSTOM WIDC_CUSTOM4 "" 0 178 148 222 192 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002144
}
{
// ToolTip
IDS_RESDATA_INC_002145
}
WTYPE_CUSTOM WIDC_CUSTOM5 "" 0 6 4 50 48 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002146
}
{
// ToolTip
IDS_RESDATA_INC_002147
}
WTYPE_CUSTOM WIDC_CUSTOM6 "" 0 6 52 50 96 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002148
}
{
// ToolTip
IDS_RESDATA_INC_002149
}
WTYPE_CUSTOM WIDC_CUSTOM7 "" 0 6 100 50 144 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002150
}
{
// ToolTip
IDS_RESDATA_INC_002151
}
WTYPE_CUSTOM WIDC_CUSTOM8 "" 0 6 148 50 192 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002152
}
{
// ToolTip
IDS_RESDATA_INC_002153
}
WTYPE_CUSTOM WIDC_CUSTOM9 "" 0 6 196 50 240 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002154
}
{
// ToolTip
IDS_RESDATA_INC_002155
}
WTYPE_CUSTOM WIDC_CUSTOM10 "" 0 176 196 220 240 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002156
}
{
// ToolTip
IDS_RESDATA_INC_002157
}
WTYPE_CUSTOM WIDC_CUSTOM11 "" 0 52 4 76 28 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002158
}
{
// ToolTip
IDS_RESDATA_INC_002159
}
WTYPE_CUSTOM WIDC_CUSTOM12 "" 0 76 4 100 28 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002160
}
{
// ToolTip
IDS_RESDATA_INC_002161
}
WTYPE_CUSTOM WIDC_CUSTOM13 "" 0 102 4 126 28 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002162
}
{
// ToolTip
IDS_RESDATA_INC_002163
}
WTYPE_CUSTOM WIDC_CUSTOM14 "" 0 128 4 152 28 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002164
}
{
// ToolTip
IDS_RESDATA_INC_002165
}
WTYPE_CUSTOM WIDC_CUSTOM15 "" 0 152 4 176 28 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002166
}
{
// ToolTip
IDS_RESDATA_INC_002167
}
WTYPE_CUSTOM WIDC_CUSTOM16 "" 0 52 210 83 241 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002168
}
{
// ToolTip
IDS_RESDATA_INC_002169
}
WTYPE_CUSTOM WIDC_CUSTOM17 "" 0 82 210 113 241 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002170
}
{
// ToolTip
IDS_RESDATA_INC_002171
}
WTYPE_CUSTOM WIDC_CUSTOM18 "" 0 114 210 145 241 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002172
}
{
// ToolTip
IDS_RESDATA_INC_002173
}
WTYPE_CUSTOM WIDC_CUSTOM19 "" 0 144 210 175 241 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002174
}
{
// ToolTip
IDS_RESDATA_INC_002175
}
WTYPE_CUSTOM WIDC_CUSTOM20 "" 0 54 32 174 206 0x260000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_002176
}
{
// ToolTip
IDS_RESDATA_INC_002177
}
WTYPE_CUSTOM WIDC_CUSTOM21 "" 0 8 400 33 425 0x220000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_003778
}
{
// ToolTip
IDS_RESDATA_INC_003779
}
WTYPE_STATIC WIDC_STATIC1 "ButtMoney.tga" 0 90 402 109 421 0x220002 0 0 0 0
{
// Title String
IDS_RESDATA_INC_007032
}
{
// ToolTip
IDS_RESDATA_INC_007033
}
WTYPE_STATIC WIDC_STATIC11 "InvLeft.bmp" 0 6 5 48 237 0x220002 0 0 0 0
{
// Title String
IDS_RESDATA_INC_007034
}
{
// ToolTip
IDS_RESDATA_INC_007035
}
WTYPE_STATIC WIDC_STATIC12 "InvTop.bmp" 0 54 6 175 27 0x220002 0 0 0 0
{
// Title String
IDS_RESDATA_INC_007036
}
{
// ToolTip
IDS_RESDATA_INC_007037
}
WTYPE_STATIC WIDC_STATIC13 "InvRight.bmp" 0 177 6 220 238 0x220002 0 0 0 0
{
// Title String
IDS_RESDATA_INC_007038
}
{
// ToolTip
IDS_RESDATA_INC_007039
}
WTYPE_STATIC WIDC_STATIC14 "InvBottom.bmp" 0 52 210 174 239 0x220002 0 0 0 0
{
// Title String
IDS_RESDATA_INC_007040
}
{
// ToolTip
IDS_RESDATA_INC_007041
}
}
Code:
IDS_RESDATA_INC_007032 IDS_RESDATA_INC_007033 IDS_RESDATA_INC_007034 IDS_RESDATA_INC_007035 IDS_RESDATA_INC_007036 IDS_RESDATA_INC_007037 IDS_RESDATA_INC_007038 IDS_RESDATA_INC_007039 IDS_RESDATA_INC_007040 IDS_RESDATA_INC_007041
- ignore the description.txt file, this only includes notes for everyone who is interested on modding the appearance of the inventory grid
Done!
PS: i'm entirely sure there are better or smarter ways to handle the custom textures for the grid / weapon / armor background rendering rather than the way i actually implemented it (didn't wasted much time on this), feel free to leave comments or improve this on your own.
Greetings ~mcoocr







