This commit is contained in:
TheRealNull
2021-01-03 17:54:32 -05:00
parent de95668590
commit 1d461f38ff
35 changed files with 485 additions and 310 deletions

View File

@@ -246,6 +246,9 @@ public abstract class RSClientMixin implements RSClient
@Inject
private static ArrayList<WidgetItem> widgetItems = new ArrayList<>();
@Inject
private static ArrayList<Widget> hiddenWidgets = new ArrayList<>();
@Inject
@Override
public void setPrintMenuActions(boolean yes)
@@ -1549,6 +1552,30 @@ public abstract class RSClientMixin implements RSClient
widget.setRenderX(renderX);
widget.setRenderY(renderY);
if (widget.getContentType() == WidgetType.VIEWPORT)
{
client.setViewportColor(0);
}
else if (widget.getContentType() == WidgetType.RECTANGLE)
{
if (renderX == client.getViewportXOffset() && renderY == client.getViewportYOffset()
&& widget.getWidth() == client.getViewportWidth() && widget.getHeight() == client.getViewportHeight()
&& widget.getOpacity() > 0 && widget.isFilled() && client.isGpu())
{
int textColor = widget.getTextColor();
int alpha = widget.getOpacity() & 0xFF;
int inverseAlpha = 256 - alpha;
int viewportColor = client.getViewportColor();
int c1 = (alpha * (textColor & 0xff00ff) >> 8 & 0xFF00FF) + (alpha * (textColor & 0x00FF00) >> 8 & 0x00FF00);
int c2 = (inverseAlpha * (viewportColor & 0xff00ff) >> 8 & 0xFF00FF) + (inverseAlpha * (viewportColor & 0x00FF00) >> 8 & 0x00FF00);
int outAlpha = alpha + ((viewportColor >>> 24) * (255 - alpha) * 0x8081 >>> 23);
client.setViewportColor(outAlpha << 24 | c1 + c2);
widget.setHidden(true);
hiddenWidgets.add(widget);
continue;
}
}
WidgetNode childNode = componentTable.get(widget.getId());
if (childNode != null)
@@ -1565,10 +1592,6 @@ public abstract class RSClientMixin implements RSClient
}
}
}
else
{
}
}
}
@@ -1649,6 +1672,15 @@ public abstract class RSClientMixin implements RSClient
callbacks.drawInterface(group, widgetItems);
widgetItems.clear();
for (int i = hiddenWidgets.size() - 1; i >= 0; i--)
{
Widget widget = hiddenWidgets.get(i);
if (WidgetInfo.TO_GROUP(widget.getId()) == group)
{
widget.setHidden(false);
hiddenWidgets.remove(i);
}
}
}
}

View File

@@ -83,7 +83,7 @@ public abstract class RSGameShellMixin implements RSGameShell
DrawCallbacks drawCallbacks = client.getDrawCallbacks();
if (drawCallbacks != null)
{
drawCallbacks.draw();
drawCallbacks.draw(client.getViewportColor());
}
}

View File

@@ -244,7 +244,7 @@ public abstract class RSSceneMixin implements RSScene
}
}
}
outer:
for (int z = minLevel; z < maxY; ++z)
{
RSTile[][] planeTiles = tiles[z];
@@ -303,17 +303,8 @@ public abstract class RSSceneMixin implements RSScene
if (client.getTileUpdateCount() == 0)
{
if (!isGpu && (client.getOculusOrbState() != 0 && !client.getComplianceValue("orbInteraction")))
{
client.setEntitiesAtMouseCount(0);
}
client.setCheckClick(false);
if (!checkClick)
{
client.setViewportWalking(false);
}
client.getCallbacks().drawScene();
return;
// exit the loop early and go straight to "if (!isGpu && (client..."
break outer;
}
}
}