|
You last visited: Today at 00:26
Advertisement
[Release] Resizeable Inventory
Discussion on [Release] Resizeable Inventory within the Flyff PServer Guides & Releases forum part of the Flyff Private Server category.
04/02/2019, 21:41
|
#46
|
elite*gold: 0
Join Date: Sep 2010
Posts: 229
Received Thanks: 13
|
Is was an ODBC issue, nothing was wrong with the source.
|
|
|
06/21/2019, 05:43
|
#47
|
elite*gold: 0
Join Date: Jun 2019
Posts: 7
Received Thanks: 0
|
Hi! I was wondering, can anyone hook me up with your v17 or higher resdata? I have an error of this..
Code:
2019/ 6/20 20:36:04 GetDlgItem : nID=143 not Found.
I think this is in resdata?
|
|
|
04/14/2020, 17:57
|
#48
|
elite*gold: 0
Join Date: Feb 2014
Posts: 248
Received Thanks: 28
|
sad!
i change
#ifdef _INVENTORY_RESIZEABLE
for(int i = 1; ; i++)
{
CTexture *ptex = NULL;
char tmp[32] = { 0 };
TO
#ifdef _INVENTORY_RESIZEABLE
for(int i = 1; i <= 12; i++)
{
CTexture *ptex = NULL;
char tmp[32] = { 0 };
And still
error Theme\Default\InvGrid13.bmp not found
|
|
|
04/14/2020, 19:58
|
#49
|
elite*gold: 0
Join Date: Feb 2020
Posts: 64
Received Thanks: 23
|
Quote:
Originally Posted by Wezzy_Dev
sad!
i change
#ifdef _INVENTORY_RESIZEABLE
for(int i = 1; ; i++)
{
CTexture *ptex = NULL;
char tmp[32] = { 0 };
TO
#ifdef _INVENTORY_RESIZEABLE
for(int i = 1; i <= 12; i++)
{
CTexture *ptex = NULL;
char tmp[32] = { 0 };
And still
error Theme\Default\InvGrid13.bmp not found
|
Why would you change the source's code if the error itself telling you what you should do to fix your problem.
It seems you changed something inside its loop.
|
|
|
09/01/2020, 11:20
|
#50
|
elite*gold: 0
Join Date: Aug 2020
Posts: 1
Received Thanks: 0
|
Error 1 error C2864: "CWndInventory::nGridTexSize": Only static constant integer data members can be initialized in the class H:\game\make\new80ff (SRC)-2\Src\_Interface\WndField.h 245
|
|
|
03/16/2022, 19:49
|
#51
|
elite*gold: 0
Join Date: Aug 2017
Posts: 11
Received Thanks: 1
|
no errors on compiling but when i start neuz i got this problem.
|
|
|
09/17/2022, 08:48
|
#52
|
elite*gold: 115
Join Date: Jun 2022
Posts: 13
Received Thanks: 14
|
Thanks for the release i tweaked the design a little bit so the inventory equipment window stays centered
and i would use this method to set the new resizing sizes to avoid the bug where the inventory border cuts out
Code:
/*maximum slots you can expand by resizing*/
int maxWidthResize = 17;
int maxHeightResize = 10;
//your inventorys originals height/widht from the resdata
int inventoryHeight = 464;
int inventoryWidth = 240;
/*change nGridTexSize in the header file if you want play around with the v19 inventory alignment*/
AdjustMinRect(&rectWnd, inventoryWidth, inventoryHeight);
AdjustMaxRect(&rectWnd, inventoryWidth + ( nGridTexSize * maxWidthResize), inventoryHeight + ( nGridTexSize * maxHeightResize));
keep in mind that this download is not the full code only the changes i made after using the released code
|
|
|
09/19/2022, 06:38
|
#53
|
elite*gold: 0
Join Date: Apr 2019
Posts: 81
Received Thanks: 7
|
Anyone knows how to fit this feature in v19 files?
|
|
|
09/19/2022, 07:59
|
#54
|
elite*gold: 115
Join Date: Jun 2022
Posts: 13
Received Thanks: 14
|
Quote:
Originally Posted by IFlyffMc
Anyone knows how to fit this feature in v19 files?
|
first you need to change the nGridTexSize to 35 in the wndField.h (could also be 38 because on the v19 inventory it has 3 pixel spaces between each inventory slot)
then insert the default v19 inventory width/height in the AdjustMinRect part :
Code:
void CWndInventory::SetWndRect(CRect rectWnd, BOOL bOnSize)
.....
AdjustMinRect(&rectWnd, /*width here */, /*height here */);
and if its still not properly aligned you have to play around with those vars :
Code:
void CWndInventory::OnDraw(C2DRender* p2DRender)
........
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 rows = (height / nGridTexSize), cols = (width / nGridTexSize);
someone on here was playing around with it too if you go a couple pages back you can find some more information about it
|
|
|
09/19/2022, 10:17
|
#55
|
elite*gold: 0
Join Date: Apr 2019
Posts: 81
Received Thanks: 7
|
Quote:
Originally Posted by Int16
first you need to change the nGridTexSize to 35 in the wndField.h (could also be 38 because on the v19 inventory it has 3 pixel spaces between each inventory slot)
then insert the default v19 inventory width/height in the AdjustMinRect part :
Code:
void CWndInventory::SetWndRect(CRect rectWnd, BOOL bOnSize)
.....
AdjustMinRect(&rectWnd, /*width here */, /*height here */);
and if its still not properly aligned you have to play around with those vars :
Code:
void CWndInventory::OnDraw(C2DRender* p2DRender)
........
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 rows = (height / nGridTexSize), cols = (width / nGridTexSize);
someone on here was playing around with it too if you go a couple pages back you can find some more information about it
|
35 is fine but after i changed it the inventory resizing is not functioning. I mean the resize arrow is showing up but the inventory which is WndTile00 is not resizing can you help me please?
|
|
|
09/28/2022, 05:20
|
#56
|
elite*gold: 0
Join Date: Jan 2016
Posts: 15
Received Thanks: 0
|
Quote:
Originally Posted by mcoocr
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
|
is possible that re-upload the link?thanks
|
|
|
09/28/2022, 07:56
|
#57
|
elite*gold: 115
Join Date: Jun 2022
Posts: 13
Received Thanks: 14
|
Quote:
Originally Posted by yjbytyx
is possible that re-upload the link?thanks
|
let me know if i missed something
|
|
|
09/29/2022, 10:05
|
#58
|
elite*gold: 0
Join Date: Jan 2016
Posts: 15
Received Thanks: 0
|
Quote:
Originally Posted by Int16
let me know if i missed something
|
thank you ~
|
|
|
10/06/2022, 05:26
|
#59
|
elite*gold: 0
Join Date: Jul 2008
Posts: 680
Received Thanks: 106
|
Quote:
Originally Posted by Int16
Thanks for the release i tweaked the design a little bit so the inventory equipment window stays centered
and i would use this method to set the new resizing sizes to avoid the bug where the inventory border cuts out
Code:
/*maximum slots you can expand by resizing*/
int maxWidthResize = 17;
int maxHeightResize = 10;
//your inventorys originals height/widht from the resdata
int inventoryHeight = 464;
int inventoryWidth = 240;
/*change nGridTexSize in the header file if you want play around with the v19 inventory alignment*/
AdjustMinRect(&rectWnd, inventoryWidth, inventoryHeight);
AdjustMaxRect(&rectWnd, inventoryWidth + ( nGridTexSize * maxWidthResize), inventoryHeight + ( nGridTexSize * maxHeightResize));
keep in mind that this download is not the full code only the changes i made after using the released code

|
thats a huge inventory  . would be useful for servers which are high rate / farm server.
|
|
|
10/06/2022, 05:57
|
#60
|
elite*gold: 115
Join Date: Jun 2022
Posts: 13
Received Thanks: 14
|
Quote:
Originally Posted by okatokat²
thats a huge inventory  . would be useful for servers which are high rate / farm server.
|
You just never know what inventory sizes people prefer lol
Just give them some options
|
|
|
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 +1. The time now is 00:26.
|
|