Added an Energy Textbox Widget #364
Labels
No labels
Area-Assets
Area-Backend
Area-Conduits
Area-Datapacks
Area-Lang
Area-Mod Compat
Area-Parity
Area-Rendering
Good first issue
MC-1.19.2
MC-1.20.1
MC-1.20.4
MC-1.20.6
MC-1.21
MC-1.21.1
Modtoberfest
P-0-High
P-1-Medium
P-2-Low
Status-Awaiting Response
Status-Behind-Flag
Status-Blocked
Status-Cannot Reproduce
Status-Duplicate
Status-Help Wanted
Status-Incomplete Report
Status-Invalid
Status-Needs LTS Backport
Status-Needs Updating
Status-Stale
Status-To Implement
Status-Triage
Status-Wontfix
Status-Wontmerge
Type-Backport
Type-Bug
Type-Documentation
Type-Enhancement
Type-Question
Type-RFC
Type-Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Team-EnderIO/EnderIO#364
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "my1.20-6.0.7"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
A Textbox that only accepts numbers and format with comma separator in real time.
It can be used in buffers to set energy i/o and was also used in capacitor banks in 1.12
The way I imagine it is that the menu in which it is used control whatever value is stored on it. When ticking, then menu gets the integer and do whatever we want with it (communicate it with the block entity etc...)
I am sure that this can be improved, I take suggestions from the main team (you guys are very skilled :D )
Checklist:
Haven't tested in-game. just initial code review :)
@ -0,0 +1,108 @@package com.enderio.machines.client.gui.widget;redundant override ?
I don't think you are supposed to return
falseunless you don't consume the input@ -0,0 +31,4 @@return res;}return false;always return
false?@ -0,0 +31,4 @@return res;}return false;yes.
Because I want only digits to be entered (0,1, ..., 9)
Any other character cannot be entered.
It could be improved if we think we need to do so by allowing prefixes like k = 1000 etc...
@ -0,0 +88,4 @@}try {DecimalFormat decimalFormat = (DecimalFormat) NumberFormat.getInstance(Locale.US);Should be swapped to Locale.ROOT imo :)
Looks good from what I can see, its difficult to tell how this will work in game without an explainer, but I trust that it should behave as expected :)
Well, this one wasn't merged before I finished the buffers.
Full implementation done in #455 so I'm going to close this .
Pull request closed