Skip to content

Textfield number input fixes.#131

Merged
Dream-Master merged 4 commits into
masterfrom
textfield-fixes
May 31, 2026
Merged

Textfield number input fixes.#131
Dream-Master merged 4 commits into
masterfrom
textfield-fixes

Conversation

@brachy84

@brachy84 brachy84 commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Made expression behaviour more similar to GTNHLib's parser for whole numbers, that is:

  • SI prefixes for, kilo, mega, giga and terra
  • b/B works for giga
  • case insensitive prefixes
  • % operator works.

Unfortunatly the way parsing works, we can't detect if % was actually used. Instead the maximum value is multiplied if the parsed number is a noninteger (Math.abs(value - rounded) < 0.0000001).

Additionally, I adjusted the scrolling logic to allow multiple modifiers to be active at the same time and added scroll step for ALT.

I also added a text field test to TestGuis (open with diamond).

@Miklebe Miklebe left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looked through the code, seems good. I am not the most knowledgeable guy, but so far seems like working fix and a few extra changes to add a bit more keybinds for text fields. Tested in GT5 dev env, saw no problems after changing to the new methods. :shipit:

@Dream-Master Dream-Master merged commit dfeb103 into master May 31, 2026
1 check passed
@Dream-Master Dream-Master deleted the textfield-fixes branch May 31, 2026 12:44
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.

3 participants