You last visited: Today at 17:03
Advertisement
[Release] Resizeable Inventory
Discussion on [Release] Resizeable Inventory within the Flyff PServer Guides & Releases forum part of the Flyff Private Server category.
05/01/2018, 20:13
#1
elite*gold: 0
Join Date: Sep 2007
Posts: 92
Received Thanks: 101
[Release] Resizeable Inventory
Hi folks,
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
Code:
#define _INVENTORY_RESIZEABLE
+ add in
WndItemCtrl.cpp
Code:
#ifdef _INVENTORY_RESIZEABLE
int CWndItemCtrl::getScrollbarPos()
{
return (m_wndScrollBar.GetScrollPage() + m_wndScrollBar.GetScrollPos());
}
int CWndItemCtrl::getScrollbarMax()
{
return m_wndScrollBar.GetMaxScrollPos();
}
#endif // _INVENTORY_RESIZEABLE
= below
Code:
#if __VER >= 8 //__CSC_VER8_5
void CWndItemCtrl::SetDieFlag(BOOL flag)
{
this->m_useDieFlag = flag;
}
#endif //__CSC_VER8_5
+ add in
WndItemCtrl.h
Code:
#ifdef _INVENTORY_RESIZEABLE
public:
int getScrollbarPos();
int getScrollbarMax();
#endif // _INVENTORY_RESIZEABLE
= below
Code:
#if __VER >= 8 //__CSC_VER8_5
public:
BOOL m_useDieFlag;
#endif //__CSC_VER8_5
+ add in
WndField.h
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
= below
Code:
CTexture* m_TexRemoveItem;
~ modify in
WndField.h
Code:
bool SetEnchantCursor();
void refreshItemRects();
= replacing
Code:
void SetEnchantCursor();
+ add in
WndField.cpp
Code:
#ifdef _INVENTORY_RESIZEABLE
m_arTexInvGrid.clear();
arOriginalSizes.clear();
#endif // _INVENTORY_RESIZEABLE
= below
Code:
#if __VER >= 9 // __CSC_VER9_1
m_pWndRemoveJewelConfirm = NULL;
m_bRemoveJewel = FALSE;
#endif //__CSC_VER9_1
+ add in
WndField.cpp
Code:
#ifdef _INVENTORY_RESIZEABLE
resetItemRects();
arOriginalSizes.clear();
#endif // _INVENTORY_RESIZEABLE
= below
Code:
#if __VER >= 9 // __CSC_VER9_1
SAFE_DELETE(m_pWndRemoveJewelConfirm);
#endif //__CSC_VER9_1
+ add in
WndField.cpp
Code:
#ifdef _INVENTORY_RESIZEABLE
resetItemRects();
#endif // _INVENTORY_RESIZEABLE
= below
Code:
CWndBank* pWndBank = ( CWndBank* )GetWndBase( APP_COMMON_BANK );
if( pWndBank != NULL )
pWndBank->Destroy();
+ add in
WndField.cpp
Code:
#ifdef _INVENTORY_RESIZEABLE
if(m_nResizeDir)
{
return;
}
#endif // _INVENTORY_RESIZEABLE
= below
Code:
void CWndInventory::OnMouseWndSurface( CPoint point )
{
+ add in
WndField.cpp
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
= before
Code:
pGoldNum->SetTitle( strGoldNum );
~ modify in
WndField.cpp
Code:
refreshItemRects();
= replacing
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;
+ add in
WndField.cpp
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;
}
= before
Code:
void CWndInventory::OnInitialUpdate()
{
~ modify in
WndField.cpp
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
= replacing
Code:
LPWNDCTRL lpWndCtrl = GetWndCtrl( WIDC_GOLD );
m_wndGold.Create( "g", WBS_NODRAWFRAME, lpWndCtrl->rect, this, WIDC_GOLD );
m_wndGold.AddWndStyle( WBS_NODRAWFRAME );
+ add in
WndField.cpp
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
= below
Code:
m_TexRemoveItem = m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_THEME, "WndInventoryGarbage.dds" ), 0xffff00ff );
+ add in
WndField.cpp
Code:
#ifdef _INVENTORY_RESIZEABLE
saveOriginRects();
#endif // _INVENTORY_RESIZEABLE
= before
Code:
CRect rectRoot = m_pWndRoot->GetLayoutRect();
CRect rectWindow = GetWindowRect();
CPoint point( rectRoot.right - rectWindow.Width(), 112 + 48 );
Move( point );
+ add in
WndField.cpp
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
= at bottom of
CWndInventory::OnSize , before
Code:
CWndNeuz::OnSize(nType, cx, cy);
}
+ modify in
WndField.cpp
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;
}
= replacing
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 );
}
}
+ add in
WndField.cpp
Code:
#ifdef _INVENTORY_RESIZEABLE
if(m_nResizeDir)
{
return;
}
#endif // _INVENTORY_RESIZEABLE
= below
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):
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
}
}
+ 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):
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
+ 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
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
Attached Files
theme.zip
(26.1 KB, 525 views)
05/01/2018, 20:30
#2
elite*gold: 0
Join Date: Nov 2016
Posts: 20
Received Thanks: 0
Can you help theme upload it to mega?
05/01/2018, 21:01
#3
elite*gold: 0
Join Date: Sep 2007
Posts: 92
Received Thanks: 101
Quote:
Originally Posted by
xuejizhixiaozhi
Can you help theme upload it to mega?
The theme folder is also included in the source.zip from Mega.
05/01/2018, 21:24
#4
elite*gold: 10
Join Date: Mar 2010
Posts: 558
Received Thanks: 340
An actual, good quality, useful release?
What year is it?
Good Job
05/02/2018, 01:28
#5
elite*gold: 0
Join Date: Aug 2009
Posts: 36
Received Thanks: 3
wow... thanks for the release
05/03/2018, 04:05
#6
elite*gold: 0
Join Date: Nov 2016
Posts: 20
Received Thanks: 0
Can you share your resources? The cherry trees in your game are very nice! Can I share it?
05/03/2018, 11:01
#7
elite*gold: 0
Join Date: Sep 2011
Posts: 677
Received Thanks: 390
Quote:
Originally Posted by
xuejizhixiaozhi
Can you share your resources? The cherry trees in your game are very nice! Can I share it?
He's just missing the textures for the trees lol.
Good job looks really usable. :^)
05/03/2018, 18:49
#8
elite*gold: 0
Join Date: Jan 2017
Posts: 301
Received Thanks: 28
Im getting compile error
Quote:
d:\Own V15\New\Resource\Source\Source\_Interface\WndField .h(220): error C2864: 'nGridTexSize' : only const static integral data members can be initialized inside a class or struct
Error on const int nGridTexSize = 32; // texturesize grid anyone can help me out? thx
05/04/2018, 02:47
#9
elite*gold: 0
Join Date: Mar 2014
Posts: 305
Received Thanks: 19
Wow ! You really did a great release this Year ! This is very useful for every 168 Slot users. Thanks thanks.
05/04/2018, 03:05
#10
elite*gold: 74
Join Date: Dec 2017
Posts: 1,300
Received Thanks: 222
more slots nice !
05/04/2018, 07:32
#11
elite*gold: 0
Join Date: Mar 2018
Posts: 71
Received Thanks: 5
how about the extended slot if you want to expand the inventory?
05/04/2018, 11:49
#12
elite*gold: 0
Join Date: Mar 2012
Posts: 26
Received Thanks: 3
Quote:
Originally Posted by
KingKeesie
Im getting compile error
Error on const int nGridTexSize = 32; // texturesize grid anyone can help me out? thx
static const int nGridTexSize = 32; // texturesize grid <-----try that one.
05/04/2018, 12:57
#13
elite*gold: 0
Join Date: Jan 2017
Posts: 301
Received Thanks: 28
Quote:
Originally Posted by
accelerated
static const int nGridTexSize = 32; // texturesize grid <-----try that one.
after i tried this i get error
Code:
D:\Own V15\New\Resource\Source\Source\_Interface\WndField.cpp(873): error C3861: 'refreshItemRects': identifier not found, even with argument-dependent lookup
inside this void
Code:
void CWndQueryEquip::OnInitialUpdate()
{
CWndNeuz::OnInitialUpdate();
m_bLButtonDownRot = FALSE;
m_fRot = 0.0f;
refreshItemRects();
MoveParentCenter();
}
It's working now but i get this error Theme\Default\InvGrid13.bmp not found the InvGrid13.bmp wasnt at theme.zip ?
05/04/2018, 14:40
#14
elite*gold: 0
Join Date: Sep 2007
Posts: 92
Received Thanks: 101
Quote:
Originally Posted by
KingKeesie
after i tried this i get error
Code:
D:\Own V15\New\Resource\Source\Source\_Interface\WndField.cpp(873): error C3861: 'refreshItemRects': identifier not found, even with argument-dependent lookup
inside this void
Code:
void CWndQueryEquip::OnInitialUpdate()
{
CWndNeuz::OnInitialUpdate();
m_bLButtonDownRot = FALSE;
m_fRot = 0.0f;
refreshItemRects();
MoveParentCenter();
}
It's working now but i get this error Theme\Default\InvGrid13.bmp not found the InvGrid13.bmp wasnt at theme.zip ?
Replace this:
Code:
#ifdef _INVENTORY_RESIZEABLE
for(int i = 1; ; i++)
{
CTexture *ptex = NULL;
char tmp[32] = { 0 };
with this:
Code:
#ifdef _INVENTORY_RESIZEABLE
for(int i = 1; i <= 12; i++)
{
CTexture *ptex = NULL;
char tmp[32] = { 0 };
Initially i've implemented a second way to render the grid (with 3 bitmaps), which is the reason why i didn't limited the loop right there.
Another option is to check if the file exists before calling AddTexture, but the way iv'e mentioned above is easier.
05/04/2018, 14:47
#15
elite*gold: 0
Join Date: Jan 2017
Posts: 301
Received Thanks: 28
Quote:
Originally Posted by
mcoocr
Replace this:
Code:
#ifdef _INVENTORY_RESIZEABLE
for(int i = 1; ; i++)
{
CTexture *ptex = NULL;
char tmp[32] = { 0 };
with this:
Code:
#ifdef _INVENTORY_RESIZEABLE
for(int i = 1; i <= 12; i++)
{
CTexture *ptex = NULL;
char tmp[32] = { 0 };
Initially i've implemented a second way to render the grid (with 3 bitmaps), which is the reason why i didn't limited the loop right there.
Another option is to check if the file exists before calling AddTexture, but the way iv'e mentioned above is easier.
Thanks
Similar Threads
[Selling] Sell CS.GO Inventory | Verkaufe mein CS.GO Inventory "CHEAP"
10/10/2015 - Counter-Strike Trading - 3 Replies
Sold
Verkauft
Best regards
Souza
Verkaufe Inventory/Sell Inventory
09/16/2015 - Counter-Strike Trading - 3 Replies
Verkaufen mein Inventar, wenn ihr Interesse an was habt pnīt mich.
Steam Community :: Mr.NoAIm :: Item Inventory
Akzeptiere Paypal und PSC.
ihr gebt First oder MM den wir zusammen aussuchen.
LG Erek :)
[Release]Automatic Cps in Inventory
08/29/2012 - CO2 PServer Guides & Releases - 95 Replies
This is for 5165!
Go to Mob.cs and search for this.
else if (MyMath.ChanceSuccess(DropRates.CPBag))
Under that void put this.
if (MyMath.ChanceSuccess(DropRates.CPs))
{
if (Char != null)
{
Char.CPs += CPS AMOUNT YOU WANT;
resizeable 9dragons window
10/01/2008 - 9Dragons - 4 Replies
hi all
how do i make resizeable 9dragons window that i can use not on a full screen? like this on picture:
http://i34.tinypic.com/ibxa20.jpg
thanks
All times are GMT +2. The time now is 17:03 .