-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: master
Are you sure you want to change the base?
Conversation
whiitehead
commented
Oct 16, 2024
- Options to change inventory tag type
- Colored inventory tags
- Applies tags to modified potions now
|
||
public class InventoryPotionOverlay extends WidgetItemOverlay { | ||
private static final int MODIFIED_POTION_ID_DIFF = ItemID.MIXALOT_30030 - ItemID.MIXALOT; |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
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.