Skip to content

Use Factorio's own elements in the side panels, and write the GUI guide - #1670

Merged
RedRafe merged 14 commits into
Refactorio:developfrom
lex:gui-elements
Nov 2, 2026
Merged

RedRafe merged 14 commits into
Refactorio:developfrom
lex:gui-elements

Conversation

@lex

@lex lex commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

The side panels and the Settings window use Factorio's own elements for each job instead of custom styles and font colours, and docs/GUI.md writes down how RedMew builds its GUIs, so the next one fits in: where a GUI goes, how it closes, which element does which job, and what's easy to get wrong.

Change

  • docs/GUI.md, a new guide, and AGENTS.md points to it. It includes the rules from Move Polls and Tasks to side panels, and their editors to windows #1668's review: every panel and window has its own X and no Close or Cancel button (the info window, the first one new players see, keeps its Close as the one exception), and styles are set with Gui.set_style.
  • Polls (screenshot 1): the page arrows are tool_buttons with arrow icons, and the player's own vote shows as a lit button rather than an orange number. The green edit button, the question's colour and the vote buttons' style stay, so the question stands out. The panel takes the wide width, like Tasks, and its question and answers wrap at that width, so most of a map poll's names fit on one line; the width stays the same whichever poll is shown, and the list shows 400 pixels before it scrolls, rather than 250.
  • Tasks (screenshot 2): the volunteer count is a tool_button, lit when the player has volunteered; the green edit button stays.
  • Production HUD (screenshot 3): the + shows an item picker and a fluid picker, filtered to what the HUD can track, instead of a signal picker, and its numbers have the game's own tooltips. The time span button and the green and red numbers stay.
  • Paint (screenshot 4): the brush is a sunken slot like the game's own, with its tile's name beside it ("Select brush tile" while it's empty) and the instructions under it, reworded in every language. A right click clears it, as its tooltip says, so the trash button and its locale key go.
  • Shortcuts (screenshot 5): the buttons sit on the game's shortcut bar slots, through a new frameless option for Gui.add_panel, without font colours.
  • Autofill (screenshot 6): its rows go in a spaced table, so the ammo slots' border no longer covers the ammo count field.
  • Players (screenshot 7): headings are caption_labels, and the names line up with the buttons.
  • Tag group: the names line up with the buttons.
  • Settings (screenshot 8): it opens through Gui.add_window, so it has an X and remembers where it was left; Save changes goes in Gui.add_dialog_buttons' row and Cancel goes (its locale key too). Fraction settings such as the toast volume show their percentage next to the slider.
  • Experience: the rewards list's levels are bold_labels rather than fake slot buttons.
  • Top buttons (screenshot 9): full-color icons like the other top buttons, here and in the info window: Paint shows refined hazard concrete, Shortcuts the game's hand in color, and Tag group the map's tag marker instead of a dark bookmark (while the player has no tag of their own, which the button shows).
  • Gui.make_close_button is a plain back_button, and resources/styles.lua loses the styles nothing uses any more.

Tests

  • The utils/Gui tests with a player, in a 2.1.24 client: 30 passed, 0 failed.
  • Every panel above and the Settings window, on develop and on this branch, in a 2.1.24 client; Polls with two polls, a vote cast and the map poll's real names, plus an answer longer than the panel, which wraps at its width; switching between polls of 14 answers, the map names and Yes / No keeps the panel's width, with no gap under the answers.
  • pwsh .github/scripts/run-all.ps1 <factorio> crashsite danger-ore diggy frontier: all pass. luacheck .: 0 warnings / 0 errors.

Screenshots

1_polls 2_task_editor 3_announcements_editor 4_paint 5_shortcuts 6_autofill 7_reports_list 8_settings 9_top_buttons

🤖 Generated with Claude Code

@RedRafe

RedRafe commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

A few feedbacks:

Polls

  1. Arrow changes: OK
  2. Arrow button size change: OK
  3. Edit button & poll caption style change: rejected. Reason: title doesn't stand out in the poll anymore at first glance (exception case)
  4. Options button style change: rejected. Reason: tool button is not used in raw shallow inside frame
  5. Options button voted option(s) is highlighted instead of colored: OK

Tip: should show in screenshot the version where player has voted at least an option, and multiple options and show arrow buttons both enabled and disabled

Announcements\Tasks

  1. Ann: changed style of body frame & font colour: rejected. Reason: the announcements should stand out
  2. Tasks: changed style of edit button: rejected. Reason: doesn't stand out (exception case of Polls)
  3. Tasks: changed style of assignee count: OK

Stats

  1. Change of style\type of time span: rejected. Reason: right UIs use only darker shades, doesn't blend with style group, drop-down occupies more space than a simple button ).
  2. Change of colour of displayed data: rejected. Reason: +- rates should be color coded based on the sign to improve data readability. See "Rate Calculator" mod for further references.

Paint brush

  1. Rearrange of layout: OK
  2. Removed bin button for right_click action: OK

Additionally, show in the button tooltip how to clear it

Shortcuts

  1. Frameless frame: OK

Autofill

  1. Table alignment: OK

Player list

  1. Change of style for column headers: pending. Reason: title headers now blend with window title (exception case)
  2. Style change for poke button: rejected. Reason: tool button is not used in raw shallow inside frame
  3. Alignments: OK

Choose your tag

  1. Style change for edit button: rejected. Reason: tool button is not used in raw shallow inside frame.
  2. Style change in tag button: rejected. Reason: tool button is not used in raw shallow inside frame.

Additionally, edit button is not visible to non-admin, so different styles for the 2 buttons is not an issue for players.

Settings

  1. Open in window screen: OK
  2. Slider percentage OK
  3. X button to close: OK

Additionally, this part could be standardized as any other Gui.panel (both docked & free able) now.

Tool bar

  1. Change of sprites for unified look: OK

@lex

lex commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for going through all of it! Done in 2715880:

  • Polls: the green edit button, the question's style and the vote buttons' frame_button are back; the arrows and the lit vote stay. Screenshot 1 now has two polls, so the back arrow is enabled and the next one disabled, with a vote cast on a four-answer poll.
  • Tasks: the green edit button is back. The announcements' own text box is back too, in Lay out dialogs the way Factorio's own are #1669 (ea2d63c), where that change was.
  • Stats: the time span button and the green and red numbers are back. The + still opens an item picker and a fluid picker instead of the signal picker, now as dark slot_buttons on the dark frame (screenshot 3).
  • Players: Poke and Report are back to their slot styles. The headings are still caption_labels until you decide.
  • Choose your tag: both buttons are back to their slot styles, and so is the tag editor's icon picker.
  • Paint: the tooltip says "Right-click to clear the brush" once a tile is picked; while it's empty there's nothing to clear, so it only says "Select brush tile".
  • docs/GUI.md now says what you said: no tool_button straight on an inner frame (slot styles or frame_button there), a green_button for the button players look for first, the question and announcements keep a style that stands out, and signed numbers keep their green and red.

Settings as a panel that docks and floats like the others: would you like that in this PR, or in the next one?

@lex
lex marked this pull request as ready for review November 1, 2026 14:44
@RedRafe

RedRafe commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Settings as a panel that docks and floats like the others: would you like that in this PR, or in the next one?

Next PR.

About polls, what happens if polls options have different lengths? Does it resize each time player changes poll tab? IIRC, previous version had fixed max width, so it didn't resize at each poll change?
Also, bloom map could use shorted description imo, not necessarily in this PR

@RedRafe

RedRafe commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Previous poll frame had width = 400 to prevent these issues, maybe it was removed when moving this to panel PR

lex and others added 14 commits November 2, 2026 16:43
Polls and Tasks drop their own STYLES buttons for vanilla tool_button and tool_button_red, page
with arrow icons, and show the player's own vote or volunteering as a lit button rather than an
orange number. The production HUD's header buttons are frame_action_buttons like every other
panel's. docs/GUI.md says where a GUI goes, how it closes and which element does each job, and
AGENTS.md points to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The narrow width left an empty strip on the right of its inner frame, since nothing in it stretches. The instructions label gets its own width instead, as a wrapping label needs one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shortcuts drops the inner frame and puts its buttons on the game's shortcut bar slots, through a new frameless option for Gui.add_panel. Choose your tag's list fills its inner frame without a border of its own, with the notify checkbox in a footer under it. Autofill's rows go in a spaced table, so the ammo slots' border no longer covers the ammo count field. Paint's brush is a plain slot-sized button, without the extra flow and sunken frame around it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It opens through Gui.add_window, so it has an X and remembers where it was left, and its Cancel and Save changes buttons go in Gui.add_dialog_buttons' row with space to drag it by between them. Fraction settings such as the toast volume show their percentage next to the slider.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Player list headings are caption_labels, Poke and Report tool_buttons. The production HUD picks its time span from a drop-down, shows production and consumption as plain numbers with the game's own tooltips, and adds items and fluids through filtered pickers instead of a signal picker. Shortcuts and Experience drop their font colours and fake slot buttons, Paint keeps its instructions in the brush's tooltip, the tag list's buttons are tool_buttons, and Gui.make_close_button is a plain back_button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The brush's tooltip already says a right click clears it, so the panel drops its trash button and is just the brush.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like the other top buttons, Paint shows refined hazard concrete and Shortcuts a selector combinator instead of the game's flat interface icons, here and in the info window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From Refactorio#1668's review: every panel and window has its own X and no Close or
Cancel button, so Settings drops Cancel. docs/GUI.md says so, describes
panel footers and the dialog buttons' defaults, and asks for styles to be
set with Gui.set_style.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The brush is a sunken slot like the game's own, named beside it ("Select
brush tile" while empty), with the instructions back under it, reworded
in every language. Its tooltip keeps only the tile and the right click.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The selector combinator meant nothing for Shortcuts: the full-color hand
is the one the button had before, in color. Tag group's dark bookmark
becomes the map's tag marker, while the player has no tag of their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sks' edit button, the HUD's time span and colours, Players' and Tag group's buttons

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng at it

A map poll's names wrapped onto three lines in a panel as wide as its contents. The list shows
400 pixels before it scrolls rather than 250, about a dozen maps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…under the answers

A wrapping label that stretches is laid out as if it wrapped narrower, so long answers left an empty space below them. The width stays the panel's whichever poll is shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lex

lex commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Next PR it is, for Settings.

Polls: the width stays the same whichever poll is shown. Since 7b9c8dc the panel has the wide width (470; the old frame's width = 400 went in #1668, and on develop the panel takes its width from what's in it). Switching between polls of very different lengths showed one more thing: a long answer left an empty space under the answers, because a wrapping label that stretches gets its height as if it wrapped narrower. f187737 gives the labels the panel's width instead, so they wrap at its edge with no gap. The height still follows the poll, up to 400 and then a scroll bar, as before.

1_polls_switching

Top: develop. Bottom: this PR, three polls with 14 answers, the map names (one long enough to wrap) and Yes / No.

Bloom: agreed, it's "Bloom (Petals and Riches, halfway)" in #1674.

@RedRafe

RedRafe commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Personally I think poll window is now wider than it used to be - but with 43" screens and wide/ultra-wide now being more popular than before, and the window being free to move, if we'll ever need to adjust it then it be a simple value to adjust.

Good to go, thanks! 😊

@RedRafe
RedRafe merged commit 1cc629d into Refactorio:develop Nov 2, 2026
6 checks passed
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.

2 participants