Hi all. A short guide here on adding the shift-click focusing
to your 317refactor-based client.
Head over to the RSApplet
class. You want to declare a new boolean called shiftClick
with the other global variables.
You now want to head to the mousePressed
method and add the following code above the isMetaDown()
This uses the isShiftDown()
method from the MouseEvent
class to check whether the user is holding shift whilst clicking the mouse and, if so, stores that in the boolean.
We're done in the RSApplet
class, head over to the Client
class. At the top of the class, declare a boolean called shiftClickWarning
with a default value of false.
boolean shiftClickWarning =false;
Search for the following line of code, there is only one occurrence in the class.
Now, replace everything inside that if-statement with the following code:
pushMessage("Walking disabled due to shift-click.", 0, "");
int x = WorldController.clickedTileX;
int y = WorldController.clickedTileY;
boolean walkable = doWalkTo(0, 0, 0, 0, localPlayer.waypointY,
0, 0, y, localPlayer.waypointX, true, x);
As you can see, the code checks whether the player is holding shift. If they're not, click on the tile as usual. If they are, the code then checks whether they've already received the warning message. If they haven't, the code sends the message and records the fact that they've received the message.