Merge pull request #2486 from open-osrs/param
client: make actions follow menu entry params.
This commit is contained in:
@@ -1871,17 +1871,7 @@ public interface Client extends GameShell
|
|||||||
|
|
||||||
void setRenderSelf(boolean enabled);
|
void setRenderSelf(boolean enabled);
|
||||||
|
|
||||||
/**
|
void invokeMenuAction(String option, String target, int identifier, int opcode, int param0, int param1);
|
||||||
* @param param0 This is SceneX for gameObject, index for items, and 0 for npc.
|
|
||||||
* @param param1 This is SceneY for gameObject, static for items, and 0 for npc.
|
|
||||||
* @param opcode Menu entry Action opcode.
|
|
||||||
* @param id Targets ID
|
|
||||||
* @param menuEntry Do these actually matter?
|
|
||||||
* @param targetString Do these actually matter?
|
|
||||||
* @param canvasX Canvas X Point
|
|
||||||
* @param canvasY Canvas Y Point
|
|
||||||
*/
|
|
||||||
void invokeMenuAction(int param0, int param1, int opcode, int id, String menuEntry, String targetString, int canvasX, int canvasY);
|
|
||||||
|
|
||||||
MouseRecorder getMouseRecorder();
|
MouseRecorder getMouseRecorder();
|
||||||
|
|
||||||
|
|||||||
@@ -1396,20 +1396,20 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Replace("menuAction")
|
@Replace("menuAction")
|
||||||
static void rl$menuAction(int param0, int param1, int opcode, int id, String menuOption, String menuTarget, int canvasX, int canvasY)
|
static void rl$menuAction(int param0, int param1, int opcode, int id, String option, String target, int canvasX, int canvasY)
|
||||||
{
|
{
|
||||||
boolean authentic = true;
|
boolean authentic = true;
|
||||||
if (menuTarget != null && menuTarget.startsWith("!AUTHENTIC"))
|
if (target != null && target.startsWith("!AUTHENTIC"))
|
||||||
{
|
{
|
||||||
authentic = false;
|
authentic = false;
|
||||||
menuTarget = menuTarget.substring(10);
|
target = target.substring(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (printMenuActions && client.getLogger().isDebugEnabled())
|
if (printMenuActions && client.getLogger().isDebugEnabled())
|
||||||
{
|
{
|
||||||
client.getLogger().debug(
|
client.getLogger().debug(
|
||||||
"|MenuAction|: Param0={} Param1={} Opcode={} Id={} MenuOption={} MenuTarget={} CanvasX={} CanvasY={} Authentic={}",
|
"|MenuAction|: MenuOption={} MenuTarget={} Id={} Opcode={} Param0={} Param1={} CanvasX={} CanvasY={} Authentic={}",
|
||||||
param0, param1, opcode, id, menuOption, menuTarget, canvasX, canvasY, authentic
|
option, target, id, opcode, param0, param1, canvasX, canvasY, authentic
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1422,8 +1422,8 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
final MenuOptionClicked menuOptionClicked = new MenuOptionClicked(
|
final MenuOptionClicked menuOptionClicked = new MenuOptionClicked(
|
||||||
menuOption,
|
option,
|
||||||
menuTarget,
|
target,
|
||||||
id,
|
id,
|
||||||
opcode,
|
opcode,
|
||||||
param0,
|
param0,
|
||||||
@@ -1446,9 +1446,11 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Inject
|
@Inject
|
||||||
public void invokeMenuAction(int param0, int param1, int opcode, int id, String menuOption, String menuTarget, int canvasX, int canvasY)
|
public void invokeMenuAction(String option, String target, int identifier, int opcode, int param0, int param1)
|
||||||
{
|
{
|
||||||
client.sendMenuAction(param0, param1, opcode, id, menuOption, "!AUTHENTIC" + menuTarget, canvasX, canvasY);
|
assert isClientThread();
|
||||||
|
|
||||||
|
client.sendMenuAction(param0, param1, opcode, identifier, option, "!AUTHENTIC" + target, 658, 384);
|
||||||
}
|
}
|
||||||
|
|
||||||
@FieldHook("Login_username")
|
@FieldHook("Login_username")
|
||||||
@@ -1928,4 +1930,5 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
{
|
{
|
||||||
invertYaw = state;
|
invertYaw = state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public abstract class WorldHoppingMixin implements RSClient
|
|||||||
public void openWorldHopper()
|
public void openWorldHopper()
|
||||||
{
|
{
|
||||||
// The clicked x & y coordinates (the last arguments) are not processed in the game or sent to Jagex, so they don't have to be real.
|
// The clicked x & y coordinates (the last arguments) are not processed in the game or sent to Jagex, so they don't have to be real.
|
||||||
invokeMenuAction(-1, WidgetInfo.WORLD_SWITCHER_BUTTON.getId(), MenuOpcode.CC_OP.getId(), 1, "World Switcher", "", 658, 384);
|
invokeMenuAction("World Switcher", "", 1, MenuOpcode.CC_OP.getId(), -1, WidgetInfo.WORLD_SWITCHER_BUTTON.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -23,6 +23,6 @@ public abstract class WorldHoppingMixin implements RSClient
|
|||||||
public void hopToWorld(World world)
|
public void hopToWorld(World world)
|
||||||
{
|
{
|
||||||
final int worldId = world.getId();
|
final int worldId = world.getId();
|
||||||
invokeMenuAction(worldId, WidgetInfo.WORLD_SWITCHER_LIST.getId(), MenuOpcode.CC_OP.getId(), 1, "Switch", "<col=ff9040>" + (worldId - 300) + "</col>", 683, 244);
|
invokeMenuAction("Switch", "<col=ff9040>" + (worldId - 300) + "</col>", 1, MenuOpcode.CC_OP.getId(), worldId, WidgetInfo.WORLD_SWITCHER_LIST.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user