Repository navigation
Upmerge master-1.21-lts into master-26-lts - #100
Open
rubensworks wants to merge 79 commits into
Open
rubensworks wants to merge 79 commits into
rubensworks wants to merge 79 commits into
Conversation
Editing reset the first visible row to the top, while the scrollbar stayed in place. Only reset it when a new script is loaded, and clamp the scroll position when the text shrinks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Only up and down arrow keys scrolled the editor, so typing, pressing enter, home/end and pasting could move the cursor out of view. Scroll to the cursor after every handled key or typed character, and allow the cursor to be placed on the empty line after a trailing newline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Pressing a key the editor doesn't handle, such as tab or a function key, unfocused it, so a following 'e' closed the terminal. Consume all keys except escape while focused. Typing only worked before because of this unfocusing: once the widget stays focused, EditBox.charTyped consumes every character into its own unused value. Handle characters without delegating to EditBox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
String.split dropped trailing empty strings, so blank lines at the end of a script were lost when sending it between client and server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Script error messages count lines from 1, so a 0-based gutter made them off by one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The wrap width didn't account for the scrollbar, so long lines were drawn underneath it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Both keys were consumed without doing anything. Move the cursor and the viewport by one page instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Resizing the window, or changing the GUI scale, recreated the editor without the open script. The next key press then replaced the whole script with what was typed into the empty editor. Restore the open script and cursor position when the screen is initialized again, and close the removal dialog if it was open, as its widgets are removed as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
This also avoids binding variable cards to keywords.
This could happen in non-English languages.
On macOS, Cmd+Left/Right jumped by word, while native text fields use Option+Left/Right for that, and Cmd+Left/Right to go to the start or end of the line. The editor now follows these conventions on macOS, including Option+Backspace to delete a word and Cmd+Up/Down to go to the start or end of the script. Other platforms keep using Ctrl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
When a selection continued below the last visible line, the highlight of the hidden next line was drawn over the editor's bottom border. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The script editor claimed every mouse drag, even outside of it, so spreading a held stack over inventory slots by dragging put the whole stack in one slot. The editor now only claims drags it handles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
… line The editor has room for part of a row below its last visible line. Clicking or dragging there put the cursor on that hidden line, and the cursor was drawn over the editor's bottom border. Such positions now go to the last visible line instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Fix scripting terminal editor bugs (scroll, cursor, focus, sync)
Scripts are saved on every edit and right-click selected the whole script, so a right-click followed by a single key press replaced and saved the entire script, without any way to get it back. Add a per-file undo history (ctrl+z, and ctrl+y or ctrl+shift+z to redo) that groups consecutive typing, and stop selecting everything on right-click. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
When the client synced a script, the server sent the same version back. If the player typed in the meantime, this echo overwrote the newer client version, which was then synced instead, losing the last keystrokes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Scripts were flushed by truncating and rewriting the file, so the file watcher could reload a partially written or empty script into memory and send it to clients. Write to a temporary file outside the watched directories and move it into place instead, keeping the permissions of existing files and the default permissions for new ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
When a script changed outside the editor, for example by editing the file on disk, the open editor kept showing the old text, and the next key press synced that old text back, discarding the external change. Reload the active script when the server sends a newer version, as an undoable edit that keeps the cursor position. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
When the file watcher reloaded a disk directory, it replaced the scripts in memory with whatever was on disk at that moment. As it also triggers on the server's own writes, it could run while a script was not written yet, for example right after creating the directory of a new disk, which made that script disappear. Concurrent reloads could also overwrite each other. Remember the contents last written or read for each file, only apply files that changed outside of the mod, and don't let reloads, flushes and script changes run at the same time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Files created outside of the game did not always show up until another file changed. Every reload cancelled and re-registered the directory watchers, losing events that happened in between, and only directories that already contained scripts were watched, so files in new, empty or intermediate directories were missed. Watch all directories of a disk before reading its files, keep existing watchers registered, and clean up watchers of deleted directories. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Tab did nothing in the editor, so indenting code meant typing spaces one by one. Make tab insert an indent, or indent all selected lines, and shift+tab remove one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
A new line always started at the first column, so the indentation had to be retyped on every line. Keep the indentation of the current line, and indent one more level after an opening bracket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
In the small editor it was hard to see which bracket closes which block. Highlight the bracket next to the cursor and its matching bracket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Finding something in a script meant scrolling through it in the small editor. Ctrl+F opens a search bar below the editor to find text, and Ctrl+G opens it to go to a line number, for example one from an error message. The bar shows the current match and the number of matches, has previous and next buttons (also Shift+Enter and Enter), highlights all matches, and turns red when nothing matches. Escape closes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Commenting out or reordering multiple lines meant editing every line by hand. Add ctrl+/ to toggle line comments and alt+up/down to move the current or selected lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Dragging a selection beyond the top or bottom of the editor stopped at the visible lines, so a selection could not be larger than the viewport. The editor now keeps scrolling while a selection is held above or below it, faster the further away the mouse is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Tab inserted a fixed 4 spaces, which is wide in the small editor, and doesn't match every code style. Add a client option for the number of spaces, defaulting to 2, which is common for JavaScript. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The editor actions were only available through keyboard shortcuts, which players can't discover in-game. Add small buttons for undo, redo, find, go to line and toggle comment next to the terminal title, whose tooltips also show their shortcut. Long translations of the title are shortened so they don't run under the buttons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The shortcuts for undo, redo, find, go to line, toggle comment and moving lines were hardcoded. They are now key mappings that can be changed in the Controls settings, and the toolbar tooltips show the current key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The tooltip of a syntax error was placed at the mouse, often covering the line it describes. Like in other editors, it is now placed below all rows of the line, or above them if there is no room, with an arrow pointing at the column of the error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The scrollbar took as much width as an inventory scrollbar, leaving less room for text in the small editor. It is now about half as wide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The red mark of a syntax error on the scrollbar was drawn over the scrollbar handle, and gave no information when hovered. It is now drawn below the handle, and hovering it shows the error message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
JEI drew its item list over the enlarged script editor. When JEI is installed, the focus mode now claims the whole screen, so JEI hides it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
JEI keeps its bookmark and config buttons in the bottom corners of the screen, which overlapped the enlarged script editor. The focus mode now leaves a larger margin when JEI is installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Creating a script with the + button left the previous script open, so the new one had to be selected manually. It is now opened and focused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Show syntax errors in the scripting terminal editor
…g-performance Fix syntax highlighting and editor performance in the scripting terminal
…ew-script # Conflicts: # src/main/java/org/cyclops/integratedscripting/inventory/container/ContainerTerminalScripting.java
Variable cards refer to scripts by path, so they stop working when their script is renamed. The rename dialog now says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The enlarged editor could only be toggled with its button. F12 now toggles it too, as F11 is used by Minecraft for fullscreen, and keeps the editor focused so typing can continue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
…files Add focus mode and script renaming to the scripting terminal
Add a button to open the scripts folder in the scripting terminal
…eate Scripting terminal: code-aware line wrapping
…nding Scripting terminal: only bind cards to top-level declarations
…ew-script # Conflicts: # src/main/java/org/cyclops/integratedscripting/client/gui/container/ContainerScreenTerminalScripting.java
…x-clean/10-last-value # Conflicts: # src/main/java/org/cyclops/integratedscripting/gametest/GameTestsScripts.java
Open new scripts after creating them in the terminal
Scripting terminal: show the last evaluation of the bound card
Completions could only be chosen with the keyboard. Clicking one now inserts it, and scrolling on the list moves through it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Types in the completion list and signature hint were plain text. They are now shown in the colors of their value types, as in tooltips, on a dark background those colors are made for, with a neutral selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
…/12-editor-polish # Conflicts: # src/main/java/org/cyclops/integratedscripting/client/gui/component/input/WidgetTextArea.java
Scripting terminal: idContext.ops completion and signature hints
Scripting terminal: error tooltip, scrollbar and JEI polish
An empty drive added disk -1 to the network, which the scripting terminal then showed as an available disk. Replacing a disk in a drive by another one also kept the old disk in the network. Drives now only expose the disk they contain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The empty editor now tells the player what to do next: insert a Scripting Disk into a connected drive when there are no disks, click + to create a script when the disk is empty, or select a script from the list otherwise. The unusable editor and script list are also grayed out more clearly. The create and open-folder buttons are hidden while there are no disks, and the disk field no longer shows -1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
This includes the fix for incorrect key binding labels in info book appendices, such as the ones in the editor shortcuts section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Fix the scripting terminal showing disk -1, and update CyclopsCore
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges
master-1.21-lts(up to #99) intomaster-26-lts, as one merge commit like the earlier upmerges. It carries all the scripting terminal work from #87 to #99.Porting to 26.1.2
GuiGraphicsbecameGuiGraphicsExtractor, andrender*becameextract*, including the screen's background, labels and tooltip hooks.RenderSystemshader color calls and the Tesselator selection highlight are replaced by plain fills and theGUI_TEXT_HIGHLIGHTpipeline.setTooltipForNextFrame; the error tooltip keeps its custom positioner.ARGB.opaque/RGBAToInt(..., 255)). Otherwise they would be invisible on 26.MouseButtonEvent,KeyEventandCharacterEventreplace the raw ints.Minecraft.hasControlDown()no longer means Cmd on macOS, so Ctrl+Home/End now useshasControlDownWithQuirk(), which keeps the 1.21 behavior.KeyModifier.CONTROL_OR_COMMANDand the mod's mainKeyMapping.Category. The lang key is nowkey.category.integratedscripting.main.IModHelpers,IdentifierandConfigurablePropertyCommonreplace the old helpers,ResourceLocationandConfigurableProperty. Card evaluation lines are synced asList<Component>.@GameTestand are registered ingetGameTestClasses.@OnlyInis removed from the two new packets; NeoForge 26 logs an error for it.jei_version=29.5.0.28is the newest JEI that runs on this branch's NeoForge (26.1.2.22-beta); later builds need 26.1.2.53 or newer.Validation
buildpasses (161 unit tests) andrunGameTestServerpasses 28/28.Not changed
Escape while the delete dialog is open closes the whole screen, the same as on 1.21.
🤖 Generated with Claude Code
https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9