@@ -1870,7 +1870,19 @@ public interface Client extends GameShell
|
|||||||
|
|
||||||
EnumDefinition getEnum(int id);
|
EnumDefinition getEnum(int id);
|
||||||
|
|
||||||
void draw2010Menu();
|
/**
|
||||||
|
* Draws a menu in the 2010 interface style.
|
||||||
|
*
|
||||||
|
* @param alpha background transparency of the menu
|
||||||
|
*/
|
||||||
|
void draw2010Menu(int alpha);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draws a menu in the OSRS interface style.
|
||||||
|
*
|
||||||
|
* @param alpha background transparency of the menu
|
||||||
|
*/
|
||||||
|
void drawOriginalMenu(int alpha);
|
||||||
|
|
||||||
void resetHealthBarCaches();
|
void resetHealthBarCaches();
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public abstract class MenuMixin implements RSClient
|
|||||||
private static final int MENU_TEXT_2010 = 0xC6B895;
|
private static final int MENU_TEXT_2010 = 0xC6B895;
|
||||||
private static final int MENU_HEADER_GRADIENT_TOP_2010 = 0x322E22;
|
private static final int MENU_HEADER_GRADIENT_TOP_2010 = 0x322E22;
|
||||||
private static final int MENU_HEADER_GRADIENT_BOTTOM_2010 = 0x090A04;
|
private static final int MENU_HEADER_GRADIENT_BOTTOM_2010 = 0x090A04;
|
||||||
|
private static final int ORIGINAL_BG = 0x5D5447;
|
||||||
|
|
||||||
@Shadow("client")
|
@Shadow("client")
|
||||||
private static RSClient client;
|
private static RSClient client;
|
||||||
@@ -53,7 +54,7 @@ public abstract class MenuMixin implements RSClient
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public void draw2010Menu()
|
public void draw2010Menu(int alpha)
|
||||||
{
|
{
|
||||||
int x = getMenuX();
|
int x = getMenuX();
|
||||||
int y = getMenuY();
|
int y = getMenuY();
|
||||||
@@ -61,36 +62,36 @@ public abstract class MenuMixin implements RSClient
|
|||||||
int h = getMenuHeight();
|
int h = getMenuHeight();
|
||||||
|
|
||||||
// Outside border
|
// Outside border
|
||||||
rasterizerDrawHorizontalLine(x + 2, y, w - 4, MENU_BORDER_OUTER_2010);
|
rasterizerDrawHorizontalLineAlpha(x + 2, y, w - 4, MENU_BORDER_OUTER_2010, alpha);
|
||||||
rasterizerDrawHorizontalLine(x + 2, y + h - 1, w - 4, MENU_BORDER_OUTER_2010);
|
rasterizerDrawHorizontalLineAlpha(x + 2, y + h - 1, w - 4, MENU_BORDER_OUTER_2010, alpha);
|
||||||
rasterizerDrawVerticalLine(x, y + 2, h - 4, MENU_BORDER_OUTER_2010);
|
rasterizerDrawVerticalLineAlpha(x, y + 2, h - 4, MENU_BORDER_OUTER_2010, alpha);
|
||||||
rasterizerDrawVerticalLine(x + w - 1, y + 2, h - 4, MENU_BORDER_OUTER_2010);
|
rasterizerDrawVerticalLineAlpha(x + w - 1, y + 2, h - 4, MENU_BORDER_OUTER_2010, alpha);
|
||||||
|
|
||||||
// Padding
|
// Padding
|
||||||
rasterizerDrawRectangle(x + 1, y + 5, w - 2, h - 6, MENU_PADDING_2010);
|
rasterizerDrawRectangleAlpha(x + 1, y + 5, w - 2, h - 6, MENU_PADDING_2010, alpha);
|
||||||
rasterizerDrawHorizontalLine(x + 1, y + 17, w - 2, MENU_PADDING_2010);
|
rasterizerDrawHorizontalLineAlpha(x + 1, y + 17, w - 2, MENU_PADDING_2010, alpha);
|
||||||
rasterizerDrawCircle(x + 2, y + h - 3, 0, MENU_PADDING_2010);
|
rasterizerDrawCircleAlpha(x + 2, y + h - 3, 0, MENU_PADDING_2010, alpha);
|
||||||
rasterizerDrawCircle(x + w - 3, y + h - 3, 0, MENU_PADDING_2010);
|
rasterizerDrawCircleAlpha(x + w - 3, y + h - 3, 0, MENU_PADDING_2010, alpha);
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
rasterizerDrawGradient(x + 2, y + 1, w - 4, 16, MENU_HEADER_GRADIENT_TOP_2010, MENU_HEADER_GRADIENT_BOTTOM_2010);
|
rasterizerDrawGradientAlpha(x + 2, y + 1, w - 4, 16, MENU_HEADER_GRADIENT_TOP_2010, MENU_HEADER_GRADIENT_BOTTOM_2010, alpha, alpha);
|
||||||
rasterizerFillRectangle(x + 1, y + 1, 2, 4, MENU_PADDING_2010);
|
rasterizerFillRectangleAlpha(x + 1, y + 1, 2, 4, MENU_PADDING_2010, alpha);
|
||||||
rasterizerFillRectangle(x + w - 3, y + 1, 2, 4, MENU_PADDING_2010);
|
rasterizerFillRectangleAlpha(x + w - 3, y + 1, 2, 4, MENU_PADDING_2010, alpha);
|
||||||
|
|
||||||
// Inside border
|
// Inside border
|
||||||
rasterizerDrawHorizontalLine(x + 2, y + 18, w - 4, MENU_BORDER_INNER_2010);
|
rasterizerDrawHorizontalLineAlpha(x + 2, y + 18, w - 4, MENU_BORDER_INNER_2010, alpha);
|
||||||
rasterizerDrawHorizontalLine(x + 3, y + h - 3, w - 6, MENU_BORDER_INNER_2010);
|
rasterizerDrawHorizontalLineAlpha(x + 3, y + h - 3, w - 6, MENU_BORDER_INNER_2010, alpha);
|
||||||
rasterizerDrawVerticalLine(x + 2, y + 18, h - 21, MENU_BORDER_INNER_2010);
|
rasterizerDrawVerticalLineAlpha(x + 2, y + 18, h - 21, MENU_BORDER_INNER_2010, alpha);
|
||||||
rasterizerDrawVerticalLine(x + w - 3, y + 18, h - 21, MENU_BORDER_INNER_2010);
|
rasterizerDrawVerticalLineAlpha(x + w - 3, y + 18, h - 21, MENU_BORDER_INNER_2010, alpha);
|
||||||
|
|
||||||
// Options background
|
// Options background
|
||||||
rasterizerFillRectangle(x + 3, y + 19, w - 6, h - 22, MENU_BACKGROUND_2010);
|
rasterizerFillRectangleAlpha(x + 3, y + 19, w - 6, h - 22, MENU_BACKGROUND_2010, alpha);
|
||||||
|
|
||||||
// Corner insets
|
// Corner insets
|
||||||
rasterizerDrawCircle(x + 1, y + 1, 0, MENU_BORDER_OUTER_2010);
|
rasterizerDrawCircleAlpha(x + 1, y + 1, 0, MENU_BORDER_OUTER_2010, alpha);
|
||||||
rasterizerDrawCircle(x + w - 2, y + 1, 0, MENU_BORDER_OUTER_2010);
|
rasterizerDrawCircleAlpha(x + w - 2, y + 1, 0, MENU_BORDER_OUTER_2010, alpha);
|
||||||
rasterizerDrawCircle(x + 1, y + h - 2, 0, MENU_BORDER_OUTER_2010);
|
rasterizerDrawCircleAlpha(x + 1, y + h - 2, 0, MENU_BORDER_OUTER_2010, alpha);
|
||||||
rasterizerDrawCircle(x + w - 2, y + h - 2, 0, MENU_BORDER_OUTER_2010);
|
rasterizerDrawCircleAlpha(x + w - 2, y + h - 2, 0, MENU_BORDER_OUTER_2010, alpha);
|
||||||
|
|
||||||
RSFont font = getFontBold12();
|
RSFont font = getFontBold12();
|
||||||
font.drawTextLeftAligned("Choose Option", x + 3, y + 14, MENU_TEXT_2010, -1);
|
font.drawTextLeftAligned("Choose Option", x + 3, y + 14, MENU_TEXT_2010, -1);
|
||||||
@@ -121,6 +122,47 @@ public abstract class MenuMixin implements RSClient
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Override
|
||||||
|
public void drawOriginalMenu(int alpha)
|
||||||
|
{
|
||||||
|
int x = getMenuX();
|
||||||
|
int y = getMenuY();
|
||||||
|
int w = getMenuWidth();
|
||||||
|
int h = getMenuHeight();
|
||||||
|
rasterizerFillRectangleAlpha(x, y, w, h, ORIGINAL_BG, alpha);
|
||||||
|
rasterizerDrawRectangleAlpha(x, y, w, h, ORIGINAL_BG, alpha);
|
||||||
|
rasterizerFillRectangleAlpha(x + 1, y + 1, w - 2, 16, 0, alpha);
|
||||||
|
rasterizerDrawRectangleAlpha(x + 1, y + 18, w - 2, h - 19, 0, alpha);
|
||||||
|
RSFont font = getFontBold12();
|
||||||
|
font.drawTextLeftAligned("Choose Option", x + 3, y + 14, ORIGINAL_BG, -1);
|
||||||
|
|
||||||
|
int mouseX = getMouseX();
|
||||||
|
int mouseY = getMouseY();
|
||||||
|
|
||||||
|
int count = getMenuOptionCount();
|
||||||
|
String[] targets = getMenuTargets();
|
||||||
|
String[] options = getMenuOptions();
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
int rowY = y + (count - 1 - i) * 15 + 31;
|
||||||
|
|
||||||
|
String s = options[i];
|
||||||
|
if (!targets[i].isEmpty())
|
||||||
|
{
|
||||||
|
s += " " + targets[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
int highlight = 0xFFFFFF;
|
||||||
|
if (mouseX > x && mouseX < w + x && mouseY > rowY - 13 && mouseY < rowY + 3)
|
||||||
|
{
|
||||||
|
highlight = 0xFFFF00;
|
||||||
|
}
|
||||||
|
|
||||||
|
font.drawTextLeftAligned(s, x + 3, rowY, highlight, -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public MenuEntry getLeftClickMenuEntry()
|
public MenuEntry getLeftClickMenuEntry()
|
||||||
@@ -166,7 +208,9 @@ public abstract class MenuMixin implements RSClient
|
|||||||
public void setTempMenuEntry(MenuEntry entry)
|
public void setTempMenuEntry(MenuEntry entry)
|
||||||
{
|
{
|
||||||
if (entry == null || tempMenuAction == null)
|
if (entry == null || tempMenuAction == null)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
tempMenuAction.setOption(entry.getOption());
|
tempMenuAction.setOption(entry.getOption());
|
||||||
tempMenuAction.setOpcode(entry.getOpcode());
|
tempMenuAction.setOpcode(entry.getOpcode());
|
||||||
|
|||||||
@@ -1009,21 +1009,36 @@ public interface RSClient extends RSGameShell, Client
|
|||||||
@Import("Rasterizer2D_drawHorizontalLine")
|
@Import("Rasterizer2D_drawHorizontalLine")
|
||||||
void rasterizerDrawHorizontalLine(int x, int y, int w, int rgb);
|
void rasterizerDrawHorizontalLine(int x, int y, int w, int rgb);
|
||||||
|
|
||||||
|
@Import("Rasterizer2D_drawHorizontalLineAlpha")
|
||||||
|
void rasterizerDrawHorizontalLineAlpha(int x, int y, int w, int rgb, int a);
|
||||||
|
|
||||||
@Import("Rasterizer2D_drawVerticalLine")
|
@Import("Rasterizer2D_drawVerticalLine")
|
||||||
void rasterizerDrawVerticalLine(int x, int y, int h, int rgb);
|
void rasterizerDrawVerticalLine(int x, int y, int h, int rgb);
|
||||||
|
|
||||||
|
@Import("Rasterizer2D_drawVerticalLineAlpha")
|
||||||
|
void rasterizerDrawVerticalLineAlpha(int x, int y, int h, int rgb, int a);
|
||||||
|
|
||||||
@Import("Rasterizer2D_fillRectangleGradient")
|
@Import("Rasterizer2D_fillRectangleGradient")
|
||||||
void rasterizerDrawGradient(int x, int y, int w, int h, int rgbTop, int rgbBottom);
|
void rasterizerDrawGradient(int x, int y, int w, int h, int rgbTop, int rgbBottom);
|
||||||
|
|
||||||
|
@Import("Rasterizer2D_fillRectangleGradientAlpha")
|
||||||
|
void rasterizerDrawGradientAlpha(int x, int y, int w, int h, int rgbTop, int rgbBottom, int alphaTop, int alphaBottom);
|
||||||
|
|
||||||
@Import("Rasterizer2D_fillRectangleAlpha")
|
@Import("Rasterizer2D_fillRectangleAlpha")
|
||||||
void rasterizerFillRectangleAlpha(int x, int y, int w, int h, int rgb, int a);
|
void rasterizerFillRectangleAlpha(int x, int y, int w, int h, int rgb, int a);
|
||||||
|
|
||||||
@Import("Rasterizer2D_drawRectangle")
|
@Import("Rasterizer2D_drawRectangle")
|
||||||
void rasterizerDrawRectangle(int x, int y, int w, int h, int rgb);
|
void rasterizerDrawRectangle(int x, int y, int w, int h, int rgb);
|
||||||
|
|
||||||
|
@Import("Rasterizer2D_drawRectangleAlpha")
|
||||||
|
void rasterizerDrawRectangleAlpha(int x, int y, int w, int h, int rgb, int a);
|
||||||
|
|
||||||
@Import("drawCircle")
|
@Import("drawCircle")
|
||||||
void rasterizerDrawCircle(int x, int y, int r, int rgb);
|
void rasterizerDrawCircle(int x, int y, int r, int rgb);
|
||||||
|
|
||||||
|
@Import("Rasterizer2D_drawCircleAlpha")
|
||||||
|
void rasterizerDrawCircleAlpha(int x, int y, int r, int rgb, int a);
|
||||||
|
|
||||||
@Import("HealthBarDefinition_cached")
|
@Import("HealthBarDefinition_cached")
|
||||||
RSEvictingDualNodeHashTable getHealthBarCache();
|
RSEvictingDualNodeHashTable getHealthBarCache();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user