mixins: Don't clobber left click forced menuops

This commit is contained in:
Max Weber
2019-01-26 07:55:27 -07:00
parent 5b9c3cf511
commit 001ac540e7
3 changed files with 14 additions and 1 deletions

View File

@@ -59,5 +59,11 @@ public class MenuEntry
* A second additional parameter for the action. * A second additional parameter for the action.
*/ */
private int param1; private int param1;
/**
* If this field is true and you have single mouse button on and this entry is
* the top entry the right click menu will not be opened when you left click
*
* This is used for shift click
*/
private boolean forceLeftClick;
} }

View File

@@ -546,6 +546,7 @@ public abstract class RSClientMixin implements RSClient
int[] menuTypes = getMenuTypes(); int[] menuTypes = getMenuTypes();
int[] params0 = getMenuActionParams0(); int[] params0 = getMenuActionParams0();
int[] params1 = getMenuActionParams1(); int[] params1 = getMenuActionParams1();
boolean[] leftClick = getMenuForceLeftClick();
MenuEntry[] entries = new MenuEntry[count]; MenuEntry[] entries = new MenuEntry[count];
for (int i = 0; i < count; ++i) for (int i = 0; i < count; ++i)
@@ -557,6 +558,7 @@ public abstract class RSClientMixin implements RSClient
entry.setType(menuTypes[i]); entry.setType(menuTypes[i]);
entry.setParam0(params0[i]); entry.setParam0(params0[i]);
entry.setParam1(params1[i]); entry.setParam1(params1[i]);
entry.setForceLeftClick(leftClick[i]);
} }
return entries; return entries;
} }
@@ -572,6 +574,7 @@ public abstract class RSClientMixin implements RSClient
int[] menuTypes = getMenuTypes(); int[] menuTypes = getMenuTypes();
int[] params0 = getMenuActionParams0(); int[] params0 = getMenuActionParams0();
int[] params1 = getMenuActionParams1(); int[] params1 = getMenuActionParams1();
boolean[] leftClick = getMenuForceLeftClick();
for (MenuEntry entry : entries) for (MenuEntry entry : entries)
{ {
@@ -581,6 +584,7 @@ public abstract class RSClientMixin implements RSClient
menuTypes[count] = entry.getType(); menuTypes[count] = entry.getType();
params0[count] = entry.getParam0(); params0[count] = entry.getParam0();
params1[count] = entry.getParam1(); params1[count] = entry.getParam1();
leftClick[count] = entry.isForceLeftClick();
++count; ++count;
} }

View File

@@ -307,6 +307,9 @@ public interface RSClient extends RSGameEngine, Client
@Import("menuActionParams1") @Import("menuActionParams1")
int[] getMenuActionParams1(); int[] getMenuActionParams1();
@Import("menuForceLeftClick")
boolean[] getMenuForceLeftClick();
@Import("worldList") @Import("worldList")
@Override @Override
RSWorld[] getWorldList(); RSWorld[] getWorldList();