-
Notifications
You must be signed in to change notification settings - Fork 310
Refactor Amount Set Widget on ME Parts #3485
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
base: 1.20.1
Are you sure you want to change the base?
Conversation
jurrejelle
left a comment
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.
I have never done UI bs so ideally someone else reviews it too, but apart from the tiny code cleanness nitpick, LGTM
| if (this.index < 0) { | ||
| return "0"; | ||
| public long getAmount() { | ||
| if (index < 0) { |
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.
very tiny nitpick, either use this.index both here and in setAmount, or just index in both <3
screret
left a comment
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.
jurre's review too
| this.amountSetWidget.setVisible(false); | ||
| this.amountSetWidget.getAmountText().setVisible(false); | ||
| init(); | ||
| var asw = new AmountSetWidget(15, -53, this); |
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.
why not just do this.amountSetWidget = ... here?
| amountSetWidget.setSlotIndexClient(slotIndex); | ||
| amountSetWidget.setVisible(true); | ||
| amountSetWidget.getAmountText().setVisible(true); |
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.
why remove the this. from all of these?
| import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; | ||
| import lombok.Getter; | ||
|
|
||
| import java.awt.*; |
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.
hold up, what AWT class did you import? we can't use those because JREs don't have AWT by default
What
cleans up the amount set widget for ae parts
Implementation Details
use a LongInputWidget instead of string and sanitization, use an actual background and label widgets instead of hard coding the amount text, shift around the widget grouping so its accessable
Outcome
easier to set the amount on all ae parts