project: Merge upstream

This commit is contained in:
Owain van Brakel
2021-09-09 22:26:51 +02:00
14 changed files with 583 additions and 76 deletions

View File

@@ -424,6 +424,13 @@ public class ExternalPluginManager
public static void loadBuiltin(Class<? extends Plugin>... plugins)
{
boolean assertsEnabled = false;
assert (assertsEnabled = true);
if (!assertsEnabled)
{
throw new RuntimeException("Assertions are not enabled, add '-ea' to your VM options. Enabling assertions during development catches undefined behavior and incorrect API usage.");
}
builtinExternals = plugins;
}
}

View File

@@ -80,7 +80,7 @@ class NpcMinimapOverlay extends Overlay
if (minimapLocation != null)
{
Color color = highlightedNpc.getHighlightColor();
OverlayUtil.renderMinimapLocation(graphics, minimapLocation, color.darker());
OverlayUtil.renderMinimapLocation(graphics, minimapLocation, color);
if (highlightedNpc.isNameOnMinimap() && actor.getName() != null)
{

View File

@@ -495,12 +495,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
return;
}
if (event.getScriptId() != ScriptID.BANKMAIN_BUILD || !config.removeSeparators())
{
return;
}
if (!tabInterface.isActive())
if (event.getScriptId() != ScriptID.BANKMAIN_BUILD)
{
return;
}
@@ -511,6 +506,20 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
return;
}
if (tabInterface.isTagTabActive())
{
int numTabs = (int) Arrays.stream(itemContainer.getDynamicChildren())
.filter(child -> child.getItemId() != -1 && !child.isHidden())
.count();
updateBankContainerScrollHeight(numTabs);
return;
}
if (!tabInterface.isActive() || !config.removeSeparators())
{
return;
}
int items = 0;
Widget[] containerChildren = itemContainer.getDynamicChildren();
@@ -550,10 +559,15 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
}
}
final Widget bankItemContainer = client.getWidget(WidgetInfo.BANK_ITEM_CONTAINER);
updateBankContainerScrollHeight(items);
}
private void updateBankContainerScrollHeight(int items)
{
Widget bankItemContainer = client.getWidget(WidgetInfo.BANK_ITEM_CONTAINER);
int itemContainerHeight = bankItemContainer.getHeight();
final int adjustedScrollHeight = (Math.max(0, items - 1) / ITEMS_PER_ROW) * ITEM_VERTICAL_SPACING + ITEM_VERTICAL_SPACING + ITEM_CONTAINER_BOTTOM_PADDING;
itemContainer.setScrollHeight(Math.max(adjustedScrollHeight, itemContainerHeight));
bankItemContainer.setScrollHeight(Math.max(adjustedScrollHeight, itemContainerHeight));
final int itemContainerScroll = bankItemContainer.getScrollY();
clientThread.invokeLater(() ->
@@ -561,7 +575,6 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener
WidgetInfo.BANK_SCROLLBAR.getId(),
WidgetInfo.BANK_ITEM_CONTAINER.getId(),
itemContainerScroll));
}
@Subscribe

View File

@@ -209,7 +209,7 @@ public class ItemStatChanges
add(combo(range(food(1), food(3)), heal(RUN_ENERGY, 10)), PURPLE_SWEETS_10476);
add(new SpicyStew(), SPICY_STEW);
add(boost(MAGIC, perc(.10, 1)), IMBUED_HEART);
add(combo(boost(ATTACK, 2), boost(STRENGTH, 1), heal(DEFENCE, -1)), JANGERBERRIES);
add(combo(boost(ATTACK, 2), boost(STRENGTH, 1), heal(PRAYER, 1), heal(DEFENCE, -1)), JANGERBERRIES);
// Gauntlet items
add(heal(HITPOINTS, 16), CRYSTAL_PADDLEFISH, CORRUPTED_PADDLEFISH);