Repository navigation
Lay out dialogs the way Factorio's own are - #1669
Merged
Merged
Conversation
Gui.add_dialog puts a window's content in a padded inner frame, and Gui.add_dialog_buttons adds the row of buttons below it: the likes of Clear on the left, the confirming button on the right, space to drag the window by between them, and all of them the same height. A dialog has no Close or Cancel button: its X closes it. The poll, task, announcement and tag editors, the report form, the jail confirmation and popups use them. A window whose only button was Close now closes with its X alone. Docked panels keep their size when they don't all fit, and the announcements in Tasks read as text rather than an input field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lex
marked this pull request as ready for review
October 30, 2026 10:35
Contributor
|
This probably doesn't matter since it's never used, but for Rich Text I'd put the 11 fields into a 3x4 | 4x3 | 6x2 table with sprite button in the 12th spot so it's more appealing. For the button style, I'd use the lot button in shallow frame one Other than that, everything looks clean |
…t slot Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Thanks! Done in 1193f4b: the eleven image types are a 4 by 3 grid with the picker in the twelfth place, as a And from your review of #1670, ea2d63c takes the announcements back to their own text box, so they stand out; that change was in this PR, not #1670. |
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.
Every dialog gets the same layout, like Factorio's own: its content in an inner frame, and one row of buttons along the bottom, all the same height, with space between them to drag the window by. Following the rule from #1668's review, no dialog has a Close or Cancel button: its X closes it.
Change
utils/gui.lua:Gui.add_dialog(player, spec): a window (Gui.add_window) with its content in a padded inner frame (inside_shallow_frame_with_padding). Returns the window, the content and the X.Gui.add_dialog_buttons(frame, left, right): the row of buttons under it.leftholds the likes of Clear and Reset,rightthe likes of Delete and then the confirming button. Without a style of their own, the last one on the right is aconfirm_buttonand the restdialog_buttons, so they all line up. A drag space between the two sides is never narrower than 24, so every dialog has somewhere to drag it by.slot_button_in_shallow_frame, in the twelfth place, and the text box below as wide as the grid (screenshot 10).Gui.set_stylein the code this touches.Tests
utils/Guitests with a player, in a 2.1.24 client: 28 passed, 0 failed.pwsh .github/scripts/run-all.ps1 <factorio> crashsite danger-ore diggy frontier: all pass.luacheck .: 0 warnings / 0 errors.Screenshots
🤖 Generated with Claude Code