Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add colored inventory tags #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

whiitehead
Copy link

  • Options to change inventory tag type
  • Colored inventory tags
  • Applies tags to modified potions now
Screenshot 2024-10-16 at 7 42 19 AM


public class InventoryPotionOverlay extends WidgetItemOverlay {
private static final int MODIFIED_POTION_ID_DIFF = ItemID.MIXALOT_30030 - ItemID.MIXALOT;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do this as it's generally not kosher to rely on the order of itemid. Probably should add a ctor parameter to potion type and they can be added to the same item map.

description = "How potions should be tagged in the inventory",
position = 1
)
default InventoryPotionTagType inventoryPotionTagType() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reuse the current config defaulted to white

// Font measurements come from: graphics2D.getFontMetrics(FontManager.getRunescapeSmallFont())
var image = new BufferedImage(25, 13, BufferedImage.TYPE_INT_ARGB);
var graphics2D = image.createGraphics();
drawRecipe(graphics2D, potion, 1, 13, Color.BLACK); // Drop shadow
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally don't like the shadow, it should at least be configurable

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then should I make the shadow on resin configurable. What about the shadow on the overlay. Everything has shadow. I'm not making it configurable.

Copy link
Collaborator

@raiyni raiyni Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are making a false equivalence about how things are rendered. The rendering engine for widgets isn't the same as the rendering engine for Runelite overlays.

If you really wanted to be in the spirit of runelite, you could do rendering like the Item Identification plugin. I believe that might have a shadow in TextComponent it handles and even parses colors.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally don't like the shadow

It's not a false equivalent. You are commenting on what the user sees. The user doesn't see implementation details. The spirit of RuneLite is to add a drop shadow. If you know of a better way of doing it I'm happy to change it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

for (var component : potion.components()) {
if (component == MOX) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to do all of this casing if you just use the measurement and use the component.character() and component.color()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to comment the same recommendation 5 times. This is a good idea and I will have a revision coming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants