|
You last visited: Today at 14:38
Advertisement
[Release] Single-Right Click to use Items
Discussion on [Release] Single-Right Click to use Items within the Flyff PServer Guides & Releases forum part of the Flyff Private Server category.
04/04/2018, 23:28
|
#1
|
elite*gold: 2
Join Date: Jan 2008
Posts: 778
Received Thanks: 983
|
[Release] Single-Right Click to use Items
As seen on some Servers, you can use a Right-Click on Items in your Inventory to use/activate them, instead of the painful double-left-clicking. (Specially annoying on awakes/Upgrade processes)
Here I'm releasing a basic code making your Inventory be able to use a single-right-click instead.
So here's what we're about to edit:
Neuz project:
In the Function:
Code:
void CWndItemCtrl::OnRButtonDown( UINT nFlags, CPoint point )
Find:
Code:
CPoint pt;
pt.y = 0;
pt.y += m_wndScrollBar.GetScrollPos() * nWidth;
Below add the following:
Code:
#ifdef __DOUBLECLICK_ITEMUSE
if (!g_pPlayer)
return;
if (!m_pItemContainer)
return;
if (GetAsyncKeyState(VK_LCONTROL) & 0x8000)
return;
if (CWndBase::m_GlobalShortcut.IsEmpty() == FALSE)
return;
int nItem = HitTest(point);
if (nItem == -1) return;
CItemElem* pItemElem = NULL;
pItemElem = GetItem(nItem);
#ifdef __DELETEITEM_INSTANT
if (pItemElem == NULL)
return;
if (GetAsyncKeyState(VK_MENU) && GetAsyncKeyState(VK_SHIFT))
g_DPlay.SendRemoveItem(pItemElem, pItemElem->m_nItemNum);
else
{
#else
#endif
if (IsUsableItem(pItemElem) || (m_useDieFlag && pItemElem != NULL))
{
if (IsSelectedItem(nItem) == FALSE)
{
m_dwSelectAry.RemoveAll();
m_dwSelectAry.Add(nItem);
m_nCurSelect = nItem;
m_pFocusItem = pItemElem;
}
CWndBase* pParent = (CWndBase*)GetParentWnd();
pParent->OnChildNotify(WIN_DBLCLK, m_nIdWnd, (LRESULT*)m_pFocusItem);
}
#ifdef __DELETEITEM_INSTANT
}
#endif //__DELETEITEM_INSTANT
#endif //__DOUBLECLICK_ITEMUSE
Inside the Function-begin:
Code:
void CWndInventory::OnRButtonDown(UINT nFlags, CPoint point)
Add the following code:
Code:
#ifdef __DOUBLECLICK_ITEMUSE
// Equipped Items~
for (int i = 2; i<MAX_HUMAN_PARTS; i++)
{
CRect DrawRect = m_InvenRect[i];
if (DrawRect.PtInRect(point))
{
CItemElem* pItemElem = NULL;
pItemElem = (CItemElem*)g_pPlayer->GetEquipItem(i);
if (pItemElem)
{
g_DPlay.SendDoEquip(pItemElem, i);
}
}
}
#endif //__DOUBLECLICK_ITEMUSE
Define the following:
Code:
#define __DOUBLECLICK_ITEMUSE
#define __DELETEITEM_INSTANT
Small Note:
I'm not leading a server or something, I'm just wanting to improve the general Flyff scene with useful functions and, as we all know, this source is a mess so, anything useful for the leechers out there is fine i guess/hope.
Also I rely on bug reports, so if you encounter anything wrong, let me know, I'm usually just quick-testing but who knows what happens you know. xD
Tested Scenarios:
- (De-)Equip Gear
- Use Consumables like perins, use Eggs/Pets, Using Safe Upgrade Interface
(Everything worked perfectly, if you find a scenario in which it doesnt, let me know, I'm to lazy to go trough all possibilities, but am willing to provide a working code if you find something missing )
Credits: 100% me, netHox
Inspiration: various P-servers
Update: Delete Items directly without Yes/No prompt from Inventory by holding alt+shift+rightclicking the Item
Preview:
Source-Code Snippet's above have this included now, if you dont wish to use it, just dont define:
Code:
__DELETEITEM_INSTANT
|
|
|
04/05/2018, 08:24
|
#2
|
elite*gold: 0
Join Date: Mar 2018
Posts: 71
Received Thanks: 5
|
very nice. but the question is for the player wrong right click to the item will dmd.
|
|
|
04/05/2018, 10:35
|
#3
|
elite*gold: 0
Join Date: Mar 2017
Posts: 342
Received Thanks: 18
|
im don't have intelligent on c++ codes. but i think this feature may can help in game thank for this sir
Edit: Sir i got this? can you help me please?
|
|
|
04/05/2018, 11:14
|
#4
|
elite*gold: 0
Join Date: Feb 2017
Posts: 49
Received Thanks: 33
|
Quote:
Originally Posted by babyminion
im don't have intelligent on c++ codes. but i think this feature may can help in game thank for this sir
Edit: Sir i got this? can you help me please?
|
Your for loop have an incorrect syntaxe and you forgot a }
|
|
|
04/05/2018, 11:17
|
#5
|
elite*gold: 2
Join Date: Jan 2008
Posts: 778
Received Thanks: 983
|
Quote:
Originally Posted by babyminion
im don't have intelligent on c++ codes. but i think this feature may can help in game thank for this sir
Edit: Sir i got this? can you help me please?
|
The errors dont tell any much detailed stuff, you should check the code arround the error locations, you maybe copied something to a wrong location, or are using an older sourcecode maybe? (this uses Visual Studio 2017)
Better re-check twice for miss-copying ^^
|
|
|
04/05/2018, 11:18
|
#6
|
elite*gold: 0
Join Date: Mar 2017
Posts: 342
Received Thanks: 18
|
Quote:
Originally Posted by FlyServices
Your for loop have an incorrect syntaxe and you forgot a }
|
i just copied from what the thread say's and im just a leecher idk how it works well *****
Quote:
Originally Posted by netHoxInc
The errors dont tell any much detailed stuff, you should check the code arround the error locations, you maybe copied something to a wrong location, or are using an older sourcecode maybe? (this uses Visual Studio 2017)
Better re-check twice for miss-copying ^^
|
yes sir im using old source i think im using erendora files and thats what i got. and im using vs2003 only ***** pizup!
|
|
|
04/05/2018, 11:43
|
#7
|
elite*gold: 2
Join Date: Jan 2008
Posts: 778
Received Thanks: 983
|
Im not 100% sure if all functions included will work in VS2003, but usual c++ knownledge should be enough to fix it. Im not a c++ pro myself so, I dont know the differenced of version in exact.
But as long as you put it into the right location, the code should only spit our reference or syntax errors, which shouldnt be hard to fix by googling them.
Cheers
|
|
|
04/05/2018, 12:56
|
#8
|
elite*gold: 0
Join Date: Feb 2017
Posts: 49
Received Thanks: 33
|
Code:
void CWndItemCtrl::OnLButtonDblClk( UINT nFlags, CPoint point )
{
if( !g_pPlayer )
return;
if( !m_pItemContainer )
return;
if( GetAsyncKeyState( VK_LCONTROL ) & 0x8000 )
return;
if( CWndBase::m_GlobalShortcut.IsEmpty() == FALSE )
return;
int nItem = HitTest( point );
if( nItem == -1 ) return;
CItemElem* pItemElem = NULL;
pItemElem = GetItem( nItem );
#ifdef __DELETEITEM_INSTANT
if (/*pItemElem && GetAsyncKeyState(VK_MENU)&& */GetAsyncKeyState(VK_SHIFT))
g_DPlay.SendRemoveItem( pItemElem, pItemElem->m_nItemNum );
else
#endif // __DELETEITEM_INSTANT
{
#if __VER >= 8 // __CSC_VER8_5
if( IsUsableItem( pItemElem ) || (m_useDieFlag && pItemElem != NULL))
#else // __CSC_VER8_5
if( IsUsableItem( pItemElem ) )
#endif // __CSC_VER8_5
{
if( IsSelectedItem( nItem ) == FALSE )
{
m_dwSelectAry.RemoveAll();
m_dwSelectAry.Add( nItem );
m_nCurSelect = nItem;
m_pFocusItem = pItemElem;
}
CWndBase* pParent = (CWndBase*)GetParentWnd();
pParent->OnChildNotify( WIN_DBLCLK,m_nIdWnd,(LRESULT*)m_pFocusItem);
}
}
}
Code:
void CWndInventory::OnRButtonDown(UINT nFlags, CPoint point)
{
#ifdef __DOUBLECLICK_ITEMUSE
for( int i = PARTS_UPPER_BODY; i < MAX_HUMAN_PARTS; i++ )
{
if( m_InvenRect[i].PtInRect( point ))
{
CItemElem* pItemElem = NULL;
pItemElem = (CItemElem*)g_pPlayer->GetEquipItem(i);
if( pItemElem )
g_DPlay.SendDoEquip(pItemElem, i);
}
}
#endif //__DOUBLECLICK_ITEMUSE
BaseMouseCursor();
}
|
|
|
04/05/2018, 14:02
|
#9
|
elite*gold: 0
Join Date: Mar 2017
Posts: 342
Received Thanks: 18
|
Quote:
Originally Posted by FlyServices
Code:
void CWndItemCtrl::OnLButtonDblClk( UINT nFlags, CPoint point )
{
if( !g_pPlayer )
return;
if( !m_pItemContainer )
return;
if( GetAsyncKeyState( VK_LCONTROL ) & 0x8000 )
return;
if( CWndBase::m_GlobalShortcut.IsEmpty() == FALSE )
return;
int nItem = HitTest( point );
if( nItem == -1 ) return;
CItemElem* pItemElem = NULL;
pItemElem = GetItem( nItem );
#ifdef __DELETEITEM_INSTANT
if (/*pItemElem && GetAsyncKeyState(VK_MENU)&& */GetAsyncKeyState(VK_SHIFT))
g_DPlay.SendRemoveItem( pItemElem, pItemElem->m_nItemNum );
else
#endif // __DELETEITEM_INSTANT
{
#if __VER >= 8 // __CSC_VER8_5
if( IsUsableItem( pItemElem ) || (m_useDieFlag && pItemElem != NULL))
#else // __CSC_VER8_5
if( IsUsableItem( pItemElem ) )
#endif // __CSC_VER8_5
{
if( IsSelectedItem( nItem ) == FALSE )
{
m_dwSelectAry.RemoveAll();
m_dwSelectAry.Add( nItem );
m_nCurSelect = nItem;
m_pFocusItem = pItemElem;
}
CWndBase* pParent = (CWndBase*)GetParentWnd();
pParent->OnChildNotify( WIN_DBLCLK,m_nIdWnd,(LRESULT*)m_pFocusItem);
}
}
}
Code:
void CWndInventory::OnRButtonDown(UINT nFlags, CPoint point)
{
#ifdef __DOUBLECLICK_ITEMUSE
for( int i = PARTS_UPPER_BODY; i < MAX_HUMAN_PARTS; i++ )
{
if( m_InvenRect[i].PtInRect( point ))
{
CItemElem* pItemElem = NULL;
pItemElem = (CItemElem*)g_pPlayer->GetEquipItem(i);
if( pItemElem )
g_DPlay.SendDoEquip(pItemElem, i);
}
}
#endif //__DOUBLECLICK_ITEMUSE
BaseMouseCursor();
}
|
compile has success! sir thanks for recoding it <3. but feature is not functioning. the only effect of the feature is ( when i right click a item its automatically equip. but when i wear a item and try to try to right click to remove its not working ) and about the SHIFT+ALT+RIGHT THE ITEM its not also working with the code that you give
|
|
|
04/05/2018, 15:01
|
#10
|
elite*gold: 2
Join Date: Jan 2008
Posts: 778
Received Thanks: 983
|
Quote:
Originally Posted by babyminion
compile has success! sir thanks for recoding it <3. but feature is not functioning. the only effect of the feature is ( when i right click a item its automatically equip. but when i wear a item and try to try to right click to remove its not working ) and about the SHIFT+ALT+RIGHT THE ITEM its not also working sad
|
Maybe you're using a different Inventory/Equipment window code? Im not sure why it wouldnt do it else.
You could send me the files which you implemented it on on PM, and I'll check if there's something misscopied, but else i got no clue.
For me It works perfectly and i explicitly only did the changes I mentioned above, and the code is original code for these actions, just copied onto these Key functions.
|
|
|
04/05/2018, 16:20
|
#11
|
elite*gold: 0
Join Date: Mar 2017
Posts: 342
Received Thanks: 18
|
Quote:
Originally Posted by netHoxInc
Maybe you're using a different Inventory/Equipment window code? Im not sure why it wouldnt do it else.
You could send me the files which you implemented it on on PM, and I'll check if there's something misscopied, but else i got no clue.
For me It works perfectly and i explicitly only did the changes I mentioned above, and the code is original code for these actions, just copied onto these Key functions.
|
ok sir. i already pm you now
|
|
|
04/05/2018, 16:34
|
#12
|
elite*gold: 0
Join Date: Mar 2018
Posts: 77
Received Thanks: 57
|
Quote:
Originally Posted by netHoxInc
Maybe you're using a different Inventory/Equipment window code? Im not sure why it wouldnt do it else.
You could send me the files which you implemented it on on PM, and I'll check if there's something misscopied, but else i got no clue.
For me It works perfectly and i explicitly only did the changes I mentioned above, and the code is original code for these actions, just copied onto these Key functions.
|
Your code works fine, he just expects you to do it for him. This is how he always rolls with his 13+ help threads a day. No effort, complains it doesn't work till someone directly implements it for him.
Nice release nonetheless.
|
|
|
04/05/2018, 18:31
|
#13
|
elite*gold: 0
Join Date: Mar 2017
Posts: 342
Received Thanks: 18
|
Quote:
Originally Posted by Mushpoie
Your code works fine, he just expects you to do it for him. This is how he always rolls with his 13+ help threads a day. No effort, complains it doesn't work till someone directly implements it for him.
Nice release nonetheless.
|
im just a leecher what are you expecting for? like i said on my previous replies i dont have enough intelligent on c++. btw i dont have server and i dont want to make im just exploring things regarding flyff/developing and how gm's/admins doing. and coz i love playing flyff since 2004. and i didnt expect that he do it for me sir. and i think theres no problem to post error problems on help desk *****
|
|
|
04/05/2018, 21:00
|
#14
|
elite*gold: 2
Join Date: Jan 2008
Posts: 778
Received Thanks: 983
|
PM answered, you included code into wrong functions, I've fixed it up just insert the whole code back.
#Leechnote: I dont mind about that, as long as it doesnt end in requesting any other thing. I'm supporting what I've released, as best I can, even to people who aren't cappable of copying things into the correct sections.
But I also have to say, this is an very easy Task, and if @ would've followed the instructions 'correctly', it'd be working fine.
As in this example, he did the WndCtrlItem.cpp in wrong way, he did not seek the function and then
Code:
CPoint pt;
pt.y = 0;
pt.y += m_wndScrollBar.GetScrollPos() * nWidth;
Instead he searched this code piece at first, resulting in being copied into the wrong function, as earlier functions uses this code snippet aswell.
So please @ echers, Read the Instructions closely.
|
|
|
04/05/2018, 22:14
|
#15
|
elite*gold: 0
Join Date: Mar 2017
Posts: 342
Received Thanks: 18
|
Quote:
Originally Posted by netHoxInc
PM answered, you included code into wrong functions, I've fixed it up just insert the whole code back.
#Leechnote: I dont mind about that, as long as it doesnt end in requesting any other thing. I'm supporting what I've released, as best I can, even to people who aren't cappable of copying things into the correct sections.
But I also have to say, this is an very easy Task, and if @ would've followed the instructions 'correctly', it'd be working fine.
As in this example, he did the WndCtrlItem.cpp in wrong way, he did not seek the function and then
Code:
CPoint pt;
pt.y = 0;
pt.y += m_wndScrollBar.GetScrollPos() * nWidth;
Instead he searched this code piece at first, resulting in being copied into the wrong function, as earlier functions uses this code snippet aswell.
So please @ echers, Read the Instructions closely.
|
sorry i didn't check it first before i put the codes my bad btw. the codes are now functionable but i saw a little bug thing.
Scenario:
- i try to unequip 4 of my equipments in inventory and i try to reput it again. backwards EX: i unequip item1 then item2 and item3 item4 now i try to wear items backwards first i equip item4 using right click feature. then i was shock! i dont know if its a coincidence or what but i try to rightclick item4 but it's not just that instead it wear's item1 idk how did happen maybe its a bug but its not a big deal i think. btw i just want to report it to you to help sir btw thanks for being kind people godbless
Edit: regarding shift + alt + rightclick = delete
I think the shift + alt + rightclick is not good sometimes because I tried pressing once the shift and i try to walk and do something else and i accidentally press alt and try to unequip one of my things and re-equip again and its gone. im just wondering if someone has official server and player accidentally happened especially if he got very rare item maybe that player will be quit automatically lmfao! That's just my opinion
|
|
|
Similar Threads
|
Spam right clicks when right click held
06/18/2014 - CO2 Programming - 0 Replies
Can any one guide me into making this thing?
I made 2 scripts, one it autoit and one in autohotkey and they both work but only out of the game.
The game seems to be blocking them with some sort of "cheat" guard.
I really need this to spamm scatters without developing a carpal-tunner syndrom so i can level up faster and get to double reborn before june 28th (new server)
Please help!
|
[Help]cannot use or right click at my equipment
11/27/2009 - EO PServer Hosting - 1 Replies
i need some help to find this erro...who can find it??
|
click click click!!!!!!!!!!!
09/07/2007 - Off Topic - 14 Replies
if you reeeeaaaallyyy >are< bored (or if you are annoyed that you have to work on a saturday or smthing :D)
Click for Germany - Click Click Click - ClickClickClick.com - Click game
here you go ^^
nebenbei, japan hat ca. 500 mill klicks mehr als deutschland!!!!!
|
All times are GMT +2. The time now is 14:38.
|
|