-
Notifications
You must be signed in to change notification settings - Fork 314
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
Numeric widget and localized number formatting. #2532
Conversation
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.
How about adding defaultFormat
or smth to NumberFormatMUI
, so that we don't need to write protected static final NumberFormatMUI numberFormat = new NumberFormatMUI();
everywhere?
src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
Outdated
Show resolved
Hide resolved
src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
Outdated
Show resolved
Hide resolved
I thought about doing something like this, but the issue is somehow guaranteeing that the singleton format will never be modified. If someone decides to screw with, say, minimum number of decimal places of the global format, it will mess up every other UI opened after that one. I thought about some solutions (strongly worded javadoc comment vs. an immutable subclass with a singleton), this is something that we can certainly return to either with MUI2 or after the stable release. I already have a couple other ideas to simplify this too. |
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 see, anyways great work!
This is the penultimate (still need to do GT++, coming later today) and by far the largest set of changes to support localized number formatting in ModularUI.
Notes:
50%
or100% - 1000
will correctly evaluate to the desired value.en-US
).Some examples (click to expand):
Energy detector cover using the percent function of
NumericWidget
:Some other functions in action:
Machine process (
fr-FR
locale):New volumetric flask UI: