Skip to content

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

Draft
lex wants to merge 12 commits into
Refactorio:developfrom
lex:gui-elements
Draft

lex wants to merge 12 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.

This builds on #1669 (dialog buttons), whose commit is at the start of this branch until that merges.

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 vote buttons, the edit button and the page arrows are vanilla tool_buttons with arrow icons, the question is a bold_label, and the player's own vote shows as a lit button rather than an orange number.
  • Tasks (screenshot 2): the task buttons are tool_buttons (tool_button_red to delete), and the player's own volunteering is a lit button.
  • Production HUD (screenshot 3): its time span is a drop-down, production and consumption are plain numbers with the game's own tooltips, and items and fluids are added through filtered pickers instead of a signal picker. Its header buttons are frame_action_buttons like every other panel's.
  • 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, Poke and Report are tool_buttons, and the names line up with the buttons.
  • Tag group (screenshot 8): the tag list's buttons are tool_buttons.
  • Settings (screenshot 9): 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 10): 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: 28 passed, 0 failed.
  • Every panel above and the Settings window, on Lay out dialogs the way Factorio's own are #1669 and on this branch, in a 2.1.24 client.
  • pwsh .github/scripts/run-all.ps1 <factorio> crashsite danger-ore diggy frontier: all pass. luacheck .: 0 warnings / 0 errors.

Screenshots

1_polls 2_tasks 3_production_hud 4_paint 5_shortcuts 6_autofill 7_players 8_tag_group 9_settings 10_top_buttons

🤖 Generated with Claude Code

lex and others added 12 commits October 30, 2026 12:34
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>
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>
@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

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