Merge pull request #2630 from open-osrs/upstream
client: merge upstream
This commit is contained in:
@@ -49,10 +49,14 @@ import org.slf4j.Logger;
|
||||
public interface Client extends GameShell
|
||||
{
|
||||
/**
|
||||
* The client invokes these callbacks to communicate to
|
||||
* The injected client invokes these callbacks to send events to us
|
||||
*/
|
||||
Callbacks getCallbacks();
|
||||
|
||||
/**
|
||||
* The injected client invokes these callbacks for scene drawing, which is
|
||||
* used by the gpu plugin to override the client's normal scene drawing code
|
||||
*/
|
||||
DrawCallbacks getDrawCallbacks();
|
||||
|
||||
void setDrawCallbacks(DrawCallbacks drawCallbacks);
|
||||
@@ -2019,4 +2023,16 @@ public interface Client extends GameShell
|
||||
* Sets the status of client mirror
|
||||
*/
|
||||
void setMirrored(boolean isMirrored);
|
||||
|
||||
/**
|
||||
* Sets the image to be used for the login screen, provided as SpritePixels
|
||||
* If the image is larger than half the width of fixed mode,
|
||||
* it won't get mirrored to the other side of the screen
|
||||
*/
|
||||
void setLoginScreen(Sprite pixels);
|
||||
|
||||
/**
|
||||
* Sets whether the flames on the login screen should be rendered
|
||||
*/
|
||||
void setShouldRenderLoginScreenFire(boolean val);
|
||||
}
|
||||
|
||||
@@ -279,6 +279,11 @@ public enum MenuOpcode
|
||||
* Menu action for configuring runelite overlays.
|
||||
*/
|
||||
RUNELITE_OVERLAY_CONFIG(1502),
|
||||
/**
|
||||
* Menu action injected by runelite for menu items which target
|
||||
* a player and have its identifier set to a player index.
|
||||
*/
|
||||
RUNELITE_PLAYER(1503),
|
||||
|
||||
FOLLOW(2046),
|
||||
TRADE(2047),
|
||||
|
||||
@@ -61,6 +61,15 @@ public enum VarPlayer
|
||||
*/
|
||||
AUTO_RETALIATE(172),
|
||||
|
||||
/**
|
||||
* The ID of the party. This Var is only set in the raid bank area and the raid lobby
|
||||
*
|
||||
* This gets set to -1 when the raid starts. This is first set when the first player of the clan forms a party
|
||||
* on the recruiting board and it changes again when the first person actually enters the raid.
|
||||
*
|
||||
* -1 : Not in a party or in the middle of an ongoing raid
|
||||
* Anything else : This means that your clan has a raid party being formed and has not started yet
|
||||
*/
|
||||
IN_RAID_PARTY(1427),
|
||||
|
||||
NMZ_REWARD_POINTS(1060),
|
||||
|
||||
@@ -448,9 +448,10 @@ public class MenuManager
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getMenuOpcode() != MenuOpcode.RUNELITE)
|
||||
if (event.getMenuOpcode() != MenuOpcode.RUNELITE
|
||||
&& event.getMenuOpcode() != MenuOpcode.RUNELITE_PLAYER)
|
||||
{
|
||||
return; // not a player menu
|
||||
return; // not a managed widget option or custom player option
|
||||
}
|
||||
|
||||
int widgetId = event.getParam1();
|
||||
@@ -459,7 +460,7 @@ public class MenuManager
|
||||
for (WidgetMenuOption curMenuOption : options)
|
||||
{
|
||||
if (curMenuOption.getMenuTarget().equals(event.getTarget())
|
||||
&& curMenuOption.getMenuOption().equals(event.getOption()))
|
||||
&& curMenuOption.getMenuOption().equals(event.getMenuOpcode()))
|
||||
{
|
||||
WidgetMenuOptionClicked customMenu = new WidgetMenuOptionClicked();
|
||||
customMenu.setMenuOption(event.getOption());
|
||||
@@ -483,7 +484,7 @@ public class MenuManager
|
||||
{
|
||||
client.getPlayerOptions()[playerOptionIndex] = menuText;
|
||||
client.getPlayerOptionsPriorities()[playerOptionIndex] = true;
|
||||
client.getPlayerMenuTypes()[playerOptionIndex] = MenuOpcode.RUNELITE.getId();
|
||||
client.getPlayerMenuTypes()[playerOptionIndex] = MenuOpcode.RUNELITE_PLAYER.getId();
|
||||
|
||||
playerMenuIndexMap.put(playerOptionIndex, menuText);
|
||||
}
|
||||
|
||||
@@ -70,8 +70,16 @@ public class InfoBoxManager
|
||||
log.debug("Adding InfoBox {}", infoBox);
|
||||
|
||||
updateInfoBoxImage(infoBox);
|
||||
infoBoxes.add(infoBox);
|
||||
refreshInfoBoxes();
|
||||
|
||||
synchronized (this)
|
||||
{
|
||||
int idx = Collections.binarySearch(infoBoxes, infoBox, (b1, b2) -> ComparisonChain
|
||||
.start()
|
||||
.compare(b1.getPriority(), b2.getPriority())
|
||||
.compare(b1.getPlugin().getName(), b2.getPlugin().getName())
|
||||
.result());
|
||||
infoBoxes.add(idx < 0 ? -idx - 1 : idx, infoBox);
|
||||
}
|
||||
|
||||
BufferedImage image = infoBox.getImage();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user