Skip to content

[DO NOT MERGE] Text Block UI Rework & Abstracting - Multiline Editing, Tab Ribbon UI, & Other Goodies - #150

Draft
Superkat32 wants to merge 44 commits into
ModFest:26.1from
Superkat32:text-ui-rework
Draft

[DO NOT MERGE] Text Block UI Rework & Abstracting - Multiline Editing, Tab Ribbon UI, & Other Goodies#150
Superkat32 wants to merge 44 commits into
ModFest:26.1from
Superkat32:text-ui-rework

Conversation

@Superkat32

Copy link
Copy Markdown

DO NOT MERGE YET
Things to be done before merging is ready:

  • Handle new Anchor options - Some of the new options (anchor position) still need to be added to the Text Block entity & rendering. Ampflower should be handling this for me :)
  • I think my Color Picker PR (Color Picker Rewrite - Alpha Slider & Presets, Color Pickers Everywhere! #148) needs to be merged first, or closed after this is merged - This PR is based off of that color picker rewrite branch. (I don't actually know how the git stuff needs to be done here)

PR TLDR
Text Block Edit screen has options via tabs now, line editing logic for screens has been abstracted into a single widget and now allows for multiline selection & vertical scrolling, various other abstractions and small improvements have been made.

User Facing Changes
List of changes the user will see, including screenshots of the new result.

Text Block 2026-08-16_21 50 11 2026-08-16_21 50 13 Main:
  • A ribbon tab UI has been added for the options, with the initial options on an "Edit" tab and remaining options on a "View" tab (fully replacing the previous Extra Properties screen).
  • Multiline selection has been added.
  • Vertical scrolling has been added if there's too many lines, and horizontal scrolling is now possible on the current line if it overflows the width of the editor.
  • XYZ number offsets, yaw/pitch/roll rotations, and new anchor options have been added. For the offsets and rotation edit boxes, you can scroll or use the arrow keys to increase/decrease their numbers for quicker editing.
  • A new "Insert Font Tag" button has been added, which inserts a selected QuickText font tag.
  • Added Creature of Whimsy.
Other:
  • You can now right-click the text scale slider to edit it as if it were an edit box.
  • Added tooltips for multiple options, notably the formatting icon buttons to include their hotkeys in their tooltips and the text scale slider to let the user know they can right click it.
  • Tags now act as their own words, allowing you to easily jump to (Ctrl + Left/Right) or select them (double click).
  • Added a new icon for the "Color Text" formatting icon button.
  • The Text Alignment (left/center/right) option has been replaced with an icon triumvirate (there's three of them, they are powerful too now I guess?).
  • Triple clicking a line now selects all of it.
  • Clicking a formatting icon button now follows-up with focusing the edit box (I can't remember if this was already the case or not).
  • Changed the "Color" tooltip to "Text Color" to be easier to tell the difference between it and Background Color.
  • Fixed a bug where changing the Text Shadow option wouldn't be reflected in the text editor until it was opened again (or it wasn't reflected at all, I can't remember).
Popup Block 2026-08-16_21 50 56 2026-08-16_21 50 59 Edit Screen:
  • Uses the new text editor (multiline selection, formatting hotkeys, vertical & horizontal overflow scrolling).
  • Added the formatting icon buttons to the edit screen.
  • Added a couple pixels of vertical padding to the top of the screen to ensure it isn't touching the top of the screen.
  • Fixed x positioning of buttons on smaller GUI scales (they are now always centered despite GUI scale).
View Screen:
  • The Popup Block's title is now shown at the top of the view screen. It is controlled by a block nbt entry (boolean), `view_screen_title` (true by default), but I don't recommend disabling it.
  • The view screen can now vertically scroll if there are too many lines (I don't recommend having that many lines though).
Other:
  • Fixed a bug where the Popup Block would say "No Content!" when there was a single formatted line as its only line.
Note Item 2026-08-16_21 51 18 2026-08-16_21 51 39
  • Uses the new text editor (multiline selection, formatting hotkeys, improved horizontal overflow scrolling).
  • The formatting icon buttons now disappear when signing, instead of only becoming disabled (a majority of the screen for handling these two states was rewritten, explained later).
Particle Block 2026-08-16_21 51 54
  • The Mean Position/Velocity and Position/Velocity Deviation options can now be scrolled to be increased/decreased, and have been colored red/green/blue too (for x/y/z).
Sound Block 2026-08-16_21 51 52
  • The offset x/y/z options can now be scrolled to be increased/decreased, and have been colored red/green/blue too.

Internal Changes
Main:

  • A new widget, GlowcaseMultilineEditBox, has been created which contains text editing functionality. It uses the FormattableMultilineTextField class to handle text logic (e.g. selection, holding the text), while the edit box handles the widget side of things (e.g. rendering, clicking). The TextEditorScreen has switched its main logic from the TextFieldHelper stuff to this new widget. All previous text editing screens (text/popup blocks, note item) now use this widget too.
  • Format tag related items from the ColorPickerIncludedScreen have been moved into a new interface, TagFormatIncludedScreen.
  • The note item edit screen has been refactored, now using borderless edit boxes for the signing inputs and manually rendering the signing text info. This was done because the foundation these things relied on were replaced by the new multiline edit box. Besides the formatting icon buttons disappearing when signing (instead of deactivating), it should all be visually the same.
  • The popup block view screen now uses the new MultilineTextViewArea widget to render its text, allowing vertical scrolling if there's too many lines (I don't recommend that many lines though).

Other:

  • The highlight cursor position is now included in the Filter#apply() check, to allow for entering prefix characters when all of the text is selected.
  • The Vec3FieldsWidget was refactored some to allow for use of the new DegreeRotationEditBox, and repositioning & hovering of its children widgets.
  • Moved Vec3FieldsWidget into .../widget/ingame/number/ (from .../widget/ingame/).
  • The text block edit screen now uses Vanilla's LinearLayout class to position its option widgets (makes it easier to add new widgets).
  • The SuggestionListWidget's textFieldWidget was renamed to focusedWidget, and now allows any AbstractWidget instead of specifically an EditBox (builder methods still require an EditBox though).
  • The SuggestionListWidget now has a height check on its mouseClicked() method.

Any changes can be made as needed. Thanks!

I would have waited longer to commit this, but there is a Windows update and I'm afraid of it destroying my progress
…is point, now. It was a bit complex but it is indeed nice

Refactor: Abstractify tag formatting stuff from ColorPickerIncludedScreen into its own interface, TagFormatIncludedScreen
Fix: Add formatting hotkeys to GlowcaseMultilineEditBox, and improve its cursor placement after tag insertions
Refactor: Split logic form GlowcaseMultilineEditBox into new FormattableMultilineTextField class
Fix: Fixed a bug where Popup Blocks would say "No Content!" if there was only one line and it was formatted
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.

1 participant